Erebot
latest
A modular IRC bot for PHP 7.0+
|
Provides core functionalities for Erebot. More...
Public Member Functions | |
__clone () | |
__construct (\Erebot\Interfaces\Config\Main $config,\Erebot\Intl\TranslatorInterface $translator) | |
__destruct () | |
addConnection (\Erebot\Interfaces\Connection $connection) | |
addTimer (\Erebot\TimerInterface $timer) | |
getConnections () | |
getRunningTime () | |
gettext ($message) | |
getTimers () | |
handleSIGHUP ($signum) | |
handleSignal ($signum) | |
reload (\Erebot\Interfaces\Config\Main $config=null) | |
removeConnection (\Erebot\Interfaces\Connection $connection) | |
removeTimer (\Erebot\TimerInterface $timer) | |
start (\Erebot\Interfaces\ConnectionFactory $factory) | |
stop () | |
Protected Member Functions | |
createConnections (\Erebot\Interfaces\ConnectionFactory $factory,\Erebot\Interfaces\Config\Main $config) | |
realStart (\Erebot\Interfaces\ConnectionFactory $factory) | |
Protected Attributes | |
$connections | |
Connections to handle. | |
$mainCfg | |
Main configuration for the bot. | |
$running | |
Indicates whether the bot is currently running or not. | |
$timers | |
Timers to trigger. | |
$translator | |
Translator object for messages the bot may display. | |
Provides core functionalities for Erebot.
This class is responsible for controlling the bot, from its start to its shutdown. This is the class that will create new connections, handle timers, apply multiplexing, etc.
The main method you will be interested in is Erebot::start() which starts the bot.
Erebot\Core::__construct | ( | \Erebot\Interfaces\Config\Main | $config, |
\Erebot\Intl\TranslatorInterface | $translator | ||
) |
|
protected |
Erebot\Core::handleSIGHUP | ( | $signum | ) |
Erebot\Core::handleSignal | ( | $signum | ) |
|
protected |
Really starts the bot.
Erebot::Interfaces::ConnectionFactory | $factory | Factory to use to create new connections. |
Erebot\Core::reload | ( | \Erebot\Interfaces\Config\Main | $config = null | ) |
Reload this instance of the bot.
This method makes the bot reload most of the data it currently relies on, such as configuration files.
Erebot::Interfaces::Config::MainInterface | $config | (optional) The new configuration to use. If omitted, the configuration file currently in use is reloaded. |