|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
A server compatible with the Identification Protocol (RFC 1413). More...
Inheritance diagram for Erebot\Identd\Server:Public Member Functions | |
| __construct (\Erebot\Interfaces\Core $bot, $connector= '0.0.0.0:113', $workerCls= '\\Erebot\\Identd\\Worker') | |
| __destruct () | |
| Destructor. | |
| connect () | |
| disconnect ($quitMessage=null) | |
| emptyReadQueue () | |
| getBot () | |
| getConfig ($chan) | |
| getIO () | |
| getSocket () | |
| isConnected () | |
| process () | |
| Processes commands queued in the input buffer. | |
| read () | |
Protected Attributes | |
| $bot | |
| A bot object implementing the Erebot::Interfaces::Core interface. | |
| $socket | |
| The underlying socket, represented as a stream. | |
| $workerCls | |
| Class to use to process IdentD requests. | |
A server compatible with the Identification Protocol (RFC 1413).
Definition at line 30 of file Server.php.
| Erebot\Identd\Server::__construct | ( | \Erebot\Interfaces\Core | $bot, |
$connector = '0.0.0.0:113', |
|||
$workerCls = '\\Erebot\\Identd\\Worker' |
|||
| ) |
Create a new instance of the IdentD server.
| Erebot::Interfaces::Core | $bot | Instance of the bot to operate on. |
| string | $connector | (optional) A string of the form "address:port" describing the IP address and port the server should listen on. The default is to listen on port 113 (as per RFC 1413) on all available interfaces (ie. "0.0.0.0:113"). |
| string | $workerCls | (optional) Instances of this class will be created to handle identification requests. The default is "Erebot::Identd::Worker". |
Definition at line 63 of file Server.php.
References Erebot\Identd\Server\$bot, and Erebot\Identd\Server\$workerCls.
| Erebot\Identd\Server::connect | ( | ) |
Makes the actual connection to an IRC server, using the configuration data passed to the constructor.
| Erebot::ConnectionFailureException | Thrown whenever the bot fails to establish a connection to the given server. |
Implements Erebot\Interfaces\Connection.
Definition at line 84 of file Server.php.
| Erebot\Identd\Server::disconnect | ( | $quitMessage = null | ) |
Disconnects the bot from that particular IRC server.
| string | $quitMessage | (optional) A message which will be visible by other users when the bot gets disconnected. If no message is given, the IrcConnector module is probed for its "quit_message" parameter. If no message is available, the bot quits with an empty string as its quit message. |
Implements Erebot\Interfaces\Connection.
Definition at line 89 of file Server.php.
Referenced by Erebot\Identd\Server\__destruct().
| Erebot\Identd\Server::getBot | ( | ) |
Returns the bot instance this connection is associated with.
| Erebot::Interfaces::Core | An instance of the core class (Erebot). |
Implements Erebot\Interfaces\Connection.
Definition at line 128 of file Server.php.
References Erebot\Identd\Server\$bot.
| Erebot\Identd\Server::getConfig | ( | $chan | ) |
Retrieves the configuration for a given channel.
| null | string | $chan | The name of the IRC channel for which a configuration must be retrieved. If $chan is null, the configuration associated with this object is returned instead (an instance of the Erebot::Interfaces::Config::Server). |
| Erebot::Interfaces::Config::Channel | The configuration for the given channel, if there is one. |
| Erebot::Interfaces::Config::Server | Otherwise, the configuration for the associated IRC server. |
| Erebot::NotFoundException | No Erebot::Interfaces::Config::Channel object exists for the given channel. |
Implements Erebot\Interfaces\Connection.
Definition at line 133 of file Server.php.
| Erebot\Identd\Server::getIO | ( | ) |
Returns the object used to handle I/O (input/output) with this connection.
Implements Erebot\Interfaces\Connection.
Definition at line 138 of file Server.php.
| Erebot\Identd\Server::getSocket | ( | ) |
Returns the underlying transport implementation for this connection.
| stream | Returns this connection's socket, as a PHP stream. |
Implements Erebot\Interfaces\Connection.
Definition at line 103 of file Server.php.
References Erebot\Identd\Server\$socket.
| Erebot\Identd\Server::isConnected | ( | ) |
Returns whether this connection object is currently connected to a server.
| bool | true if the connection is really connected, false otherwise. |
Implements Erebot\Interfaces\Connection.
Definition at line 98 of file Server.php.
| Erebot\Identd\Server::read | ( | ) |
Processes data from the incoming buffer.
Once this method has been called, all lines awaiting processing in the incoming buffer have been transferred to the incoming FIFO. You must call Erebot::Connection::processQueuedData() after that in order to process the lines in the FIFO. This is done so that a throttling policy may be put in place if needed (eg. for an anti-flood system).
Implements Erebot\Interfaces\ReceivingConnection.
Definition at line 113 of file Server.php.
References Erebot\Identd\Server\$socket.