|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
Interface for the main (general) configuration. More...
Inheritance diagram for Erebot\Interfaces\Config\Main:Public Member Functions | |
| __clone () | |
| getCommandsPrefix () | |
| getConfigFile () | |
| getGroupIdentity () | |
| getNetworkCfg ($network) | |
| getNetworks () | |
| getPidfile () | |
| getTimezone () | |
| getUserIdentity () | |
| getVersion () | |
| load ($configData, $source) | |
| mustDaemonize () | |
Public Member Functions inherited from Erebot\Interfaces\Config\Proxy | |
| getMainCfg () | |
| getModule ($moduleName) | |
| getModules ($recursive) | |
| getTranslator ($component) | |
| parseBool ($module, $param, $default=null) | |
| parseInt ($module, $param, $default=null) | |
| parseReal ($module, $param, $default=null) | |
| parseString ($module, $param, $default=null) | |
Public Attributes | |
| const | LOAD_FROM_FILE = 1 |
| Indicates that the configuration must be loaded from a file. | |
| const | LOAD_FROM_STRING = 2 |
| Indicates that the configuration must be loaded from a string. | |
Interface for the main (general) configuration.
This interface provides the necessary methods to represent the general configuration associated with an instance of the bot.
| Erebot\Interfaces\Config\Main::__clone | ( | ) |
Prevents cloning of this class to avoid escape from the singleton design pattern.
Implemented in Erebot\Config\Main.
| Erebot\Interfaces\Config\Main::getCommandsPrefix | ( | ) |
Returns the prefix used by commands.
| string | The prefix for commands, such as '!'. |
Implemented in Erebot\Config\Main.
| Erebot\Interfaces\Config\Main::getConfigFile | ( | ) |
Returns the name of the currently loaded configuration file.
| string | Currently loaded configuration file. |
| null | No configuration file has been loaded or the configuration was loaded using Erebot::Interfaces::Config::Main::LOAD_FROM_STRING. |
Implemented in Erebot\Config\Main.
| Erebot\Interfaces\Config\Main::getGroupIdentity | ( | ) |
Returns the group identity the bot should switch to upon startup.
| string | The group name or GID the bot must switch to, or null if the bot should keep its current group identity. |
Implemented in Erebot\Config\Main.
| Erebot\Interfaces\Config\Main::getNetworkCfg | ( | $network | ) |
Returns the configuration object for a particular IRC network.
| string | $network | The name of the IRC network whose configuration we're interested in. |
| Erebot::Interfaces::Config::Network | The configuration object for that network. |
| Erebot::NotFoundException | No such network has been configured on the bot. |
Implemented in Erebot\Config\Main.
| Erebot\Interfaces\Config\Main::getNetworks | ( | ) |
Returns all IRC network configurations.
| array | A list of network configurations, as objects implementing Erebot::Interfaces::Config::Network. |
Implemented in Erebot\Config\Main.
| Erebot\Interfaces\Config\Main::getPidfile | ( | ) |
Returns the file where the bot's PID should be written to upon startup.
| string | The file where the bot's PID should be written, or null if its PID should not be written anywhere. |
Implemented in Erebot\Config\Main.
| Erebot\Interfaces\Config\Main::getTimezone | ( | ) |
Returns the bot's timezone.
| string | The bot's current timezone, such as 'Europe/Paris'. |
Implemented in Erebot\Config\Main.
| Erebot\Interfaces\Config\Main::getUserIdentity | ( | ) |
Returns the user identity the bot should switch to upon startup.
| string | The user name or GID the bot must switch to, or null if the bot should keep its current user identity. |
Implemented in Erebot\Config\Main.
| Erebot\Interfaces\Config\Main::getVersion | ( | ) |
Returns the configuration file's version string.
| string | The bot's version, such as '0.20-pre'. |
Implemented in Erebot\Config\Main.
| Erebot\Interfaces\Config\Main::load | ( | $configData, | |
| $source | |||
| ) |
(Re)loads a configuration file.
| string | $configData | Either a (relative or absolute) path to the configuration file to load or a string representation of the configuration, depending on the value of the $source parameter. |
| opaque | $source | Erebot::Interfaces::Config::Main::LOAD_FROM_FILE or Erebot::Interfaces::Config::Main::LOAD_FROM_STRING, depending on whether $configData contains a filename or the string representation of the configuration data, respectively. |
| Erebot::InvalidValueException | The configuration file did not exist or contained invalid values. This exception is also thrown when the $source parameter contains an invalid value. |
Implemented in Erebot\Config\Main.
| Erebot\Interfaces\Config\Main::mustDaemonize | ( | ) |
Indicates whether the bot should "daemonize" itself upon startup.
| bool | true if the bot must turn into a daemon, false otherwise. |
Implemented in Erebot\Config\Main.