An interface for an object capable of managing modules.
More...
An interface for an object capable of managing modules.
Definition at line 28 of file ModuleContainer.php.
| Erebot\Interfaces\ModuleContainer::getModule |
( |
|
$name, |
|
|
|
$chan = null, |
|
|
|
$autoload = true |
|
) |
| |
Returns an instance of a given module on a given channel.
- Parameters
-
| string | $name | The name of the module (ie. the name of the class implementing the feature we're interested in). |
| string | $chan | (optional) An IRC channel name. If given, the bot will try to return an instance which is specific to that particular channel, before falling back to a shared instance. Otherwise, this method only looks for a shared instance. |
| bool | $autoload | (optional) Whether the module should be autoloaded if it could not be found first time around (true) or not (false). The default is to autoload missing modules. |
- Return values
-
- Exceptions
-
Implemented in Erebot\IrcConnection.
| Erebot\Interfaces\ModuleContainer::getModules |
( |
|
$chan = null | ) |
|
Returns the modules loaded for a given channel or for the whole connection.
- Parameters
-
| string | $chan | (optional) An IRC channel name. If given, both the modules which were specifically loaded for that channel and the shared modules are returned. Otherwise, only the shared modules are returned. |
- Return values
-
Implemented in Erebot\IrcConnection.
| Erebot\Interfaces\ModuleContainer::loadModule |
( |
|
$module, |
|
|
|
$chan = null |
|
) |
| |
Loads a module for a specific channel or for the whole connection.
- Parameters
-
| string | $module | The name of the module to load. |
| NULL | string | $chan | (optional) An IRC channel name. If given, the module will be loaded and a specific instance will be created for that $chan. Otherwise, an instance will be created that will be shared across channels on the same connection. |
- Return values
-
- Note
- Only one instance of a module is ever created for a channel or the pool of shared modules. Therefore, it is safe to call this method multiple times with the same parameters.
- Exceptions
-
Implemented in Erebot\IrcConnection.
The documentation for this interface was generated from the following file: