erebot/skeleton-module

Skeleton for a new module designed for Erebot

0.3.0 2018-05-12 13:04 UTC

This package is not auto-updated.

Last update: 2024-11-16 19:48:08 UTC


README

README for Erebot_Module_Skeleton

This file contains a few instructions on how to create a new module for Erebot.

First, let me make it clear that the content of this pseudo-module is released
under the version 3 or later of the GNU General Public License.

Now, let's see how this pseudo-module is organized.
Folders are indicated using a trailing "/" following their name (eg. "src/").
Each file/folder is followed by a short description on its role.
```
 /
 |- build.xml           A description of the tasks usable with Phing
 |                      (overrides vendor/erebot/buildenv/build.xml).
 |- composer.json       Package description for Composer.
 |- data/               Static files used by the module.
 |  `- i18n/            Translation catalogs for the module
 |                      (updated automatically by a call to "phing").
 |- docs/               Everything that relates to the documentation
 |  |                   (sub-folders are automatically created by Phing, Doxygen, ...).
 |  `- src/             Sources for the end-user documentation.
 |- Doxyfile            Doxygen configuration
 |                      (overrides vendor/erebot/buildenv/Doxyfile).
 |- LICENSE             License for the module.
 |- README              README information for the module (this file)
 |- src/                Source code for the module.
 |- tests/              (Unit) Tests for the module (compatible with PHPUnit).
 `- vendor/             Dependencies for the module, managed by Composer.
```

At a minimum, you will probably need to edit build.xml, composer.json and README.
In most cases, you only need to replace occurrences of "Erebot_Module_Skeleton"
with the name of your new module.

In addition, you may need to replace the content of the LICENSE file to reflect
the actual license used by your module.

Once this is done, you may start adding code under the src/ folder.
Well, actually, you'll need to create a folder structure under src/ matching
the names of the classes in your code.
For example, the class ``Erebot_Module_Skeleton`` really belongs to
``src/Erebot/Module/Skeleton.php``.

Now, to test your module, add the module to Erebot's composer.json and update
your Erebot installation with::

    $ php /path/to/composer.phar update

Then, add the configuration for your module in Erebot's configuration file and
start Erebot normally. It should detect your module and configure it with the
correct settings.

VoilĂ !