Handles a (possibly encrypted) connection to an IRC server.
More...
|
| __construct (\Erebot\Interfaces\Core $bot,\Erebot\Interfaces\Config\Server $config=null, $events=array()) |
|
| __destruct () |
|
| addEventHandler (\Erebot\Interfaces\EventHandler $handler) |
|
| addNumericHandler (\Erebot\Interfaces\NumericHandler $handler) |
|
| connect () |
|
| disconnect ($quitMessage=null) |
|
| dispatch (\Erebot\Interfaces\Event\Base\Generic $event) |
|
| getBot () |
|
| getCollator () |
|
| getConfig ($chan) |
|
| getEventsProducer () |
|
| getIO () |
|
| getModule ($name, $chan=null, $autoload=true) |
|
| getModules ($chan=null) |
|
| getNumericProfile () |
|
| getSocket () |
|
| getURIFactory () |
|
| handleCapabilities (\Erebot\Interfaces\EventHandler $handler,\Erebot\Event\ServerCapabilities $event) |
|
| handleConnect (\Erebot\Interfaces\EventHandler $handler,\Erebot\Interfaces\Event\Connect $event) |
|
| isChannel ($chan) |
|
| isConnected () |
|
| loadModule ($module, $chan=null) |
|
| process () |
| Processes commands queued in the input buffer.
|
|
| read () |
|
| reload (\Erebot\Interfaces\Config\Server $config) |
|
| removeEventHandler (\Erebot\Interfaces\EventHandler $handler) |
|
| removeNumericHandler (\Erebot\Interfaces\NumericHandler $handler) |
|
| setCollator (\Erebot\Interfaces\IrcCollator $collator) |
|
| setNumericProfile (\Erebot\NumericProfile\Base $profile) |
|
| setURIFactory ($factory) |
|
| write () |
|
Handles a (possibly encrypted) connection to an IRC server.
Definition at line 27 of file IrcConnection.php.
Erebot\IrcConnection::__construct |
( |
\Erebot\Interfaces\Core |
$bot, |
|
|
\Erebot\Interfaces\Config\Server |
$config = null , |
|
|
|
$events = array() |
|
) |
| |
Constructs the object which will hold a connection.
- Parameters
-
Erebot::Interfaces::Core | $bot | A bot instance. |
Erebot::Interfaces::Config::Server | $config | The connfiguration for this connection. |
array | $events | (optional) A mapping of event interface names to the class that must be used to produce such events (factory). |
- Note
- No connection (in the socket sense) is actually created until Erebot::Interfaces::Connection::connect() is called.
Definition at line 90 of file IrcConnection.php.
Erebot\IrcConnection::__destruct |
( |
| ) |
|
Erebot\IrcConnection::dispatchEvent |
( |
\Erebot\Interfaces\Event\Base\Generic |
$event | ) |
|
|
protected |
Dispatches the given event to handlers which have been registered for this type of event.
- Parameters
-
Erebot::Interfaces::Event::Base::Generic | $event | An event to dispatch. |
Definition at line 755 of file IrcConnection.php.
Erebot\IrcConnection::dispatchNumeric |
( |
\Erebot\Interfaces\Event\Numeric |
$numeric | ) |
|
|
protected |
Dispatches the given numeric event to handlers which have been registered for this type of numeric.
- Parameters
-
Erebot::Interfaces::Event::Numeric | $numeric | A numeric message to dispatch. |
Definition at line 782 of file IrcConnection.php.
Erebot\IrcConnection::getCollator |
( |
| ) |
|
Returns the collator associated with this connection.
- Return values
-
Erebot::Interfaces::IrcCollator | The collator for this connection. |
Definition at line 910 of file IrcConnection.php.
Erebot\IrcConnection::getURIFactory |
( |
| ) |
|
Returns the name of the class used to parse Uniform Resource Identifiers.
- Return values
-
string | Name of the class used to parse an URI. |
Definition at line 153 of file IrcConnection.php.
Handles the "ServerCapabilities" event.
- Parameters
-
Erebot::Interfaces::EventHandler | $handler | The event handler responsible for calling this method. |
Erebot::Event::ServerCapabilities | $event | The "ServerCapabilities" event to process. |
Definition at line 856 of file IrcConnection.php.
Erebot\IrcConnection::handleConnect |
( |
\Erebot\Interfaces\EventHandler |
$handler, |
|
|
\Erebot\Interfaces\Event\Connect |
$event |
|
) |
| |
Handles the "Connect" event.
- Parameters
-
Erebot::Interfaces::EventHandler | $handler | The event handler responsible for calling this method. |
Erebot::Interfaces::Event::Connect | $event | The "Connect" event to process. |
Definition at line 885 of file IrcConnection.php.
Erebot\IrcConnection::loadModules |
( |
\Erebot\Interfaces\Config\Server |
$config, |
|
|
|
$flags |
|
) |
| |
|
protected |
(Re)Load the modules for this connection.
- Parameters
-
Erebot::Interfaces::Config::Server | $config | A server configuration that describes the modules to load. |
int | $flags | Flags that will be passed to the reload() method of every module that needs reloading. This is a bitwise-OR of the RELOAD_* constants defined in Erebot::Module::Base. |
Definition at line 214 of file IrcConnection.php.
Erebot\IrcConnection::realLoadModule |
( |
|
$module, |
|
|
|
$chan, |
|
|
|
$flags, |
|
|
& |
$plainModules, |
|
|
& |
$channelModules |
|
) |
| |
|
protected |
Load a single module for this connection.
- Parameters
-
string | $module | Name of the module to load. If the module is already loaded, nothing will happen. |
string | null | $chan | Name of the IRC channel for which this module is being loaded. Pass null to load a module globally (for the whole connection) rather than for a specific IRC channel. |
opaque | $flags | Bitwise-OR combination of flags to pass to the module's initialization method. |
array | $plainModules | An associative array containing the global modules currently loaded. This array will be updated if it needs to be once the module has been successfully loaded. |
array | $channelModules | An associative array containing the modules currently loaded for the given IRC channel. This array will be updated if it needs to be once the module has been successfully loaded. |
- Return values
-
Erebot::Module::Base | An instance of the module with the given name. |
Definition at line 621 of file IrcConnection.php.
Erebot\IrcConnection::reload |
( |
\Erebot\Interfaces\Config\Server |
$config | ) |
|
Reloads/sets the configuration for this connection.
- Parameters
-
Erebot::Interfaces::Config::Server | $config | The new configuration for this connection. |
Definition at line 192 of file IrcConnection.php.
Erebot\IrcConnection::setCollator |
( |
\Erebot\Interfaces\IrcCollator |
$collator | ) |
|
Sets the collector to use for this connection.
- Parameters
-
Erebot::Interfaces::Collator | $collator | The new collator to use for this connection. |
Definition at line 898 of file IrcConnection.php.
Erebot\IrcConnection::setURIFactory |
( |
|
$factory | ) |
|
Sets the class to use as a factory to parse Uniform Resource Identifiers.
- Parameters
-
string | $factory | Name of the class to use to parse an URI. |
Definition at line 165 of file IrcConnection.php.
Erebot\IrcConnection::$config |
|
protected |
A configuration object implementing the Erebot::Interfaces::Config::Server interface.
Definition at line 33 of file IrcConnection.php.
The documentation for this class was generated from the following file: