|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
Interface for connections. More...
Inheritance diagram for Erebot\Interfaces\Connection:Public Member Functions | |
| connect () | |
| disconnect ($quitMessage=null) | |
| getBot () | |
| getConfig ($chan) | |
| getIO () | |
| getSocket () | |
| isConnected () | |
Interface for connections.
Definition at line 27 of file Connection.php.
| Erebot\Interfaces\Connection::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. |
Implemented in Erebot\IrcConnection, Erebot\Prompt, Erebot\Identd\Server, and Erebot\Identd\Worker.
| Erebot\Interfaces\Connection::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. |
Implemented in Erebot\IrcConnection, Erebot\Prompt, Erebot\Identd\Server, and Erebot\Identd\Worker.
| Erebot\Interfaces\Connection::getBot | ( | ) |
Returns the bot instance this connection is associated with.
| Erebot::Interfaces::Core | An instance of the core class (Erebot). |
Implemented in Erebot\IrcConnection, Erebot\Prompt, Erebot\Identd\Worker, and Erebot\Identd\Server.
| Erebot\Interfaces\Connection::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. |
Implemented in Erebot\IrcConnection, Erebot\Prompt, Erebot\Identd\Worker, and Erebot\Identd\Server.
| Erebot\Interfaces\Connection::getIO | ( | ) |
Returns the object used to handle I/O (input/output) with this connection.
Implemented in Erebot\IrcConnection, Erebot\Identd\Worker, Erebot\Prompt, and Erebot\Identd\Server.
| Erebot\Interfaces\Connection::getSocket | ( | ) |
Returns the underlying transport implementation for this connection.
| stream | Returns this connection's socket, as a PHP stream. |
Implemented in Erebot\IrcConnection, Erebot\Prompt, Erebot\Identd\Worker, and Erebot\Identd\Server.
| Erebot\Interfaces\Connection::isConnected | ( | ) |
Returns whether this connection object is currently connected to a server.
| bool | true if the connection is really connected, false otherwise. |
Implemented in Erebot\IrcConnection, Erebot\Prompt, Erebot\Identd\Worker, and Erebot\Identd\Server.