Erebot  latest
A modular IRC bot for PHP 7.0+
Erebot\Config\Main Class Reference

Contains the main (general) configuration for Erebot. More...

+ Inheritance diagram for Erebot\Config\Main:

Public Member Functions

 __clone ()
 
 __construct ($configData, $source,\Erebot\Intl\TranslatorInterface $translator)
 
 __destruct ()
 
 getCommandsPrefix ()
 
 getConfigFile ()
 
 getGroupIdentity ()
 
 getNetworkCfg ($network)
 
 getNetworks ()
 
 getPidfile ()
 
 getTimezone ()
 
 getTranslator ($component)
 
 getUserIdentity ()
 
 getVersion ()
 
 load ($configData, $source)
 
 mustDaemonize ()
 
- Public Member Functions inherited from Erebot\Config\Proxy
 __clone ()
 
 __destruct ()
 
 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)
 

Protected Attributes

 $commandsPrefix
 The prefix used to recognize commands.
 
 $configFile
 The (relative or absolute) path to the configuration, if available.
 
 $coreTranslator
 Translator used by core files.
 
 $daemonize
 Whether to daemonize the bot or not.
 
 $groupIdentity
 Group identity to switch to.
 
 $networks
 A list of Erebot::Config::Network objects.
 
 $pidfile
 File where the bot's PID will be written.
 
 $timezone
 The bot's current timezone.
 
 $userIdentity
 User identity to switch to.
 
 $version
 The configuration file's version string.
 
- Protected Attributes inherited from Erebot\Config\Proxy
 $locale
 The current locale.
 
 $modules
 Array of modules loaded at this particular configuration level.
 
 $proxified
 Reference to a proxified object.
 

Private Member Functions

 stripXGlobWrappers (&$domxml)
 

Additional Inherited Members

- Static Public Member Functions inherited from Erebot\Config\Proxy
static parseBoolHelper ($value)
 
static parseIntHelper ($value)
 
static parseRealHelper ($value)
 
- Protected Member Functions inherited from Erebot\Config\Proxy
 __construct (\Erebot\Interfaces\Config\Proxy $proxified,\SimpleXMLElement $xml)
 
 parseSomething ($module, $param, $default, callable $parser, $origin, callable $checker)
 
- Static Protected Member Functions inherited from Erebot\Config\Proxy
static getBaseDir ($component)
 

Detailed Description

Contains the main (general) configuration for Erebot.

This class deals with settings which affect the whole bot such as its version string. It also contains references to instances of Erebot::Config::Network.

Definition at line 31 of file Main.php.

Constructor & Destructor Documentation

Erebot\Config\Main::__construct (   $configData,
  $source,
\Erebot\Intl\TranslatorInterface  $translator 
)

Creates a new instance of the Erebot::Config::Main class.

Parameters
string$configDataEither 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$sourceErebot::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::Intl::TranslatorInterface$translatorTranslator to use for messages coming from core files.
Exceptions
Erebot::InvalidValueExceptionThe configuration file did not exist or contained invalid values. This exception is also thrown when the $source parameter contains an invalid value.

Definition at line 86 of file Main.php.

References Erebot\Config\Main\load().

Erebot\Config\Main::__destruct ( )

Destructs Erebot::Config::Main instances.

Definition at line 101 of file Main.php.

Member Function Documentation

Erebot\Config\Main::__clone ( )

Definition at line 110 of file Main.php.

Erebot\Config\Main::getCommandsPrefix ( )

Definition at line 316 of file Main.php.

References Erebot\Config\Main\$commandsPrefix.

Erebot\Config\Main::getConfigFile ( )

Definition at line 322 of file Main.php.

References Erebot\Config\Main\$configFile.

Erebot\Config\Main::getGroupIdentity ( )

Definition at line 334 of file Main.php.

References Erebot\Config\Main\$groupIdentity.

Erebot\Config\Main::getNetworkCfg (   $network)

Definition at line 289 of file Main.php.

Erebot\Config\Main::getNetworks ( )

Definition at line 298 of file Main.php.

References Erebot\Config\Main\$networks.

Erebot\Config\Main::getPidfile ( )

Definition at line 346 of file Main.php.

References Erebot\Config\Main\$pidfile.

Erebot\Config\Main::getTimezone ( )

Definition at line 310 of file Main.php.

References Erebot\Config\Main\$timezone.

Erebot\Config\Main::getTranslator (   $component)

Definition at line 352 of file Main.php.

References Erebot\Config\Main\$coreTranslator.

Erebot\Config\Main::getUserIdentity ( )

Definition at line 340 of file Main.php.

References Erebot\Config\Main\$userIdentity.

Erebot\Config\Main::getVersion ( )

Definition at line 304 of file Main.php.

References Erebot\Config\Main\$version.

Erebot\Config\Main::mustDaemonize ( )

Definition at line 328 of file Main.php.

References Erebot\Config\Main\$daemonize.

Erebot\Config\Main::stripXGlobWrappers ( $domxml)
private

Removes wrapping xglob tags that were automatically added by the Erebot::XGlobStream wrapper.

Parameters
DOMDocument$domxmlA DOM node with the document resulting from the parsing and interpretation of the configuration file.

Definition at line 125 of file Main.php.

References Erebot\XGlobStream\TAG, and Erebot\XGlobStream\XMLNS.

Referenced by Erebot\Config\Main\load().


The documentation for this class was generated from the following file: