PHP Класс Phergie_Plugin_Abstract, phergie

Автор: Phergie Development Team ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$config Phergie_Config Current configuration handler
$connection Phergie_Connection Current connection instance
$event Phergie_Event_Request | Phergie_Event_Response Current incoming event being handled
$events Phergie_Event_Handler Current event handler instance for outgoing events
$name string Plugin short name
$plugins Phergie_Plugin_Handler Plugin handler used to provide access to other plugins

Открытые методы

Метод Описание
__call ( string $name, array $args ) : mixed Provides do* methods with signatures identical to those of Phergie_Driver_Abstract but that queue up events to be dispatched later.
findDataFile ( string $filename ) : string | null Locates a given data file used by this plugin and returns the path to it. This is currently used mainly for compatibility with PEAR packaging.
getConfig ( string $name = null, mixed $default = null ) : Phergie_Config | mixed Returns the current configuration handler or the value of a single setting from it.
getConnection ( ) : Phergie_Connection Returns the current event connection.
getEvent ( ) : Phergie_Event_Request | Phergie_Event_Response Returns the current incoming event to be handled.
getEventHandler ( ) : Phergie_Event_Handler Returns the current event handler.
getName ( ) : string Returns the short name for the plugin based on its class name.
getPluginHandler ( ) : Phergie_Plugin_Handler Returns the current plugin handler.
onAction ( ) : void Handler for when the bot receives a CTCP ACTION request.
onConnect ( ) : void Handler for when the bot initially connects to a server.
onCtcp ( ) : void Handler for when the bot receives a CTCP request of an unknown type.
onCtcpPing ( ) : void Handler for when the bot receives a CTCP PING request.
onCtcpReply ( ) : void Handler for when a reply received for a CTCP request of an unknown type.
onInvite ( ) : void Handler for when the bot receives an invitation to join a channel.
onJoin ( ) : void Handler for when a user joins a channel.
onKick ( ) : void Handler for when a user is kicked from a channel.
onKill ( ) : void Handler for when the bot receives a kill request from a server.
onLoad ( ) : void Handler for when the plugin is initially loaded - useful for checking runtime dependencies or performing any setup necessary for the plugin to function properly such as initializing a database.
onMode ( ) : void Handler for when a user or channel mode is changed.
onNick ( ) : void Handler for when the server prompts the client for a nick.
onNotice ( ) : void Handler for when a notice is received.
onOper ( ) : void Handler for when a user obtains operator privileges.
onPart ( ) : void Handler for when a user leaves a channel.
onPing ( ) : void Handler for when the bot receives a ping event from a server, at which point it is expected to respond with a pong request within a short period else the server may terminate its connection.
onPingReply ( ) : void Handler for when a reply is received for a CTCP PING request sent by the bot.
onPrivmsg ( ) : void Handler for when a message is received from a channel or user.
onQuit ( ) : void Handler for when the client session is about to be terminated.
onResponse ( ) : void Handler for when a server response is received to a command issued by the bot.
onTick ( ) : void Handler for each tick, a single iteration of the continuous loop executed by the bot to receive, handle, and send events - useful for repeated execution of tasks on a time interval.
onTime ( ) : void Handler for when the bot receives a CTCP TIME request.
onTimeReply ( ) : void Handler for when a reply is received for a CTCP TIME request sent by the bot.
onTopic ( ) : void Handler for when a channel topic is viewed or changed.
onVersion ( ) : void Handler for when the bot receives a CTCP VERSION request.
onVersionReply ( ) : void Handler for when a reply is received for a CTCP VERSION request sent by the bot.
postDispatch ( ) : void Handler for after any events triggered by plugins in response to a received event are sent to the server.
preDispatch ( ) : void Handler for after plugin processing of an event has concluded but before any events triggered in response by plugins are sent to the server - useful for modifying outgoing events before they are sent.
preEvent ( ) : boolean | null | void Handler for when any event is received but has not yet been dispatched to the plugin handler method specific to its event type.
setConfig ( Phergie_Config $config ) : Phergie_Plugin_Abstract Sets the current configuration handler.
setConnection ( Phergie_Connection $connection ) : Phergie_Plugin_Abstract Sets the current connection.
setEvent ( Phergie_Event_Request | Phergie_Event_Response $event ) : Phergie_Plugin_Abstract Sets the current incoming event to be handled.
setEventHandler ( Phergie_Event_Handler $handler ) : Phergie_Plugin_Abstract Sets the current event handler.
setName ( string $name ) : Phergie_Plugin_Abstract Sets the short name for the plugin.
setPluginHandler ( Phergie_Plugin_Handler $handler ) : Phergie_Plugin_Abstract Sets the current plugin handler.

Защищенные методы

Метод Описание
fail ( string $message ) : Phergie_Plugin_Abstract Indicates that the plugin failed to load due to an unsatisfied runtime requirement, such as a missing dependency.

Описание методов

__call() публичный Метод

Provides do* methods with signatures identical to those of Phergie_Driver_Abstract but that queue up events to be dispatched later.
public __call ( string $name, array $args ) : mixed
$name string Name of the method called
$args array Arguments passed in the call
Результат mixed

fail() защищенный Метод

Indicates that the plugin failed to load due to an unsatisfied runtime requirement, such as a missing dependency.
protected fail ( string $message ) : Phergie_Plugin_Abstract
$message string Error message to provide more information about the reason for the failure
Результат Phergie_Plugin_Abstract Provides a fluent interface

findDataFile() публичный Метод

Locates a given data file used by this plugin and returns the path to it. This is currently used mainly for compatibility with PEAR packaging.
public findDataFile ( string $filename ) : string | null
$filename string Name of the file
Результат string | null File path or NULL if the file cannot be found

getConfig() публичный Метод

Returns the current configuration handler or the value of a single setting from it.
public getConfig ( string $name = null, mixed $default = null ) : Phergie_Config | mixed
$name string Optional name of a setting for which the value should be returned instead of the entire configuration handler
$default mixed Optional default value to return if no value is set for the setting indicated by $name
Результат Phergie_Config | mixed Configuration handler or value of the setting specified by $name

getConnection() публичный Метод

Returns the current event connection.
public getConnection ( ) : Phergie_Connection
Результат Phergie_Connection

getEvent() публичный Метод

Returns the current incoming event to be handled.
public getEvent ( ) : Phergie_Event_Request | Phergie_Event_Response
Результат Phergie_Event_Request | Phergie_Event_Response

getEventHandler() публичный Метод

Returns the current event handler.
public getEventHandler ( ) : Phergie_Event_Handler
Результат Phergie_Event_Handler

getName() публичный Метод

Returns the short name for the plugin based on its class name.
public getName ( ) : string
Результат string

getPluginHandler() публичный Метод

Returns the current plugin handler.
public getPluginHandler ( ) : Phergie_Plugin_Handler
Результат Phergie_Plugin_Handler

onAction() публичный Метод

Handler for when the bot receives a CTCP ACTION request.
public onAction ( ) : void
Результат void

onConnect() публичный Метод

Handler for when the bot initially connects to a server.
public onConnect ( ) : void
Результат void

onCtcp() публичный Метод

Handler for when the bot receives a CTCP request of an unknown type.
public onCtcp ( ) : void
Результат void

onCtcpPing() публичный Метод

Handler for when the bot receives a CTCP PING request.
public onCtcpPing ( ) : void
Результат void

onCtcpReply() публичный Метод

Handler for when a reply received for a CTCP request of an unknown type.
public onCtcpReply ( ) : void
Результат void

onInvite() публичный Метод

Handler for when the bot receives an invitation to join a channel.
public onInvite ( ) : void
Результат void

onJoin() публичный Метод

Handler for when a user joins a channel.
public onJoin ( ) : void
Результат void

onKick() публичный Метод

Handler for when a user is kicked from a channel.
public onKick ( ) : void
Результат void

onKill() публичный Метод

Handler for when the bot receives a kill request from a server.
public onKill ( ) : void
Результат void

onLoad() публичный Метод

Handler for when the plugin is initially loaded - useful for checking runtime dependencies or performing any setup necessary for the plugin to function properly such as initializing a database.
public onLoad ( ) : void
Результат void

onMode() публичный Метод

Handler for when a user or channel mode is changed.
public onMode ( ) : void
Результат void

onNick() публичный Метод

Handler for when the server prompts the client for a nick.
public onNick ( ) : void
Результат void

onNotice() публичный Метод

Handler for when a notice is received.
public onNotice ( ) : void
Результат void

onOper() публичный Метод

Handler for when a user obtains operator privileges.
public onOper ( ) : void
Результат void

onPart() публичный Метод

Handler for when a user leaves a channel.
public onPart ( ) : void
Результат void

onPing() публичный Метод

Handler for when the bot receives a ping event from a server, at which point it is expected to respond with a pong request within a short period else the server may terminate its connection.
public onPing ( ) : void
Результат void

onPingReply() публичный Метод

Handler for when a reply is received for a CTCP PING request sent by the bot.
public onPingReply ( ) : void
Результат void

onPrivmsg() публичный Метод

Handler for when a message is received from a channel or user.
public onPrivmsg ( ) : void
Результат void

onQuit() публичный Метод

Handler for when the client session is about to be terminated.
public onQuit ( ) : void
Результат void

onResponse() публичный Метод

Handler for when a server response is received to a command issued by the bot.
public onResponse ( ) : void
Результат void

onTick() публичный Метод

Handler for each tick, a single iteration of the continuous loop executed by the bot to receive, handle, and send events - useful for repeated execution of tasks on a time interval.
public onTick ( ) : void
Результат void

onTime() публичный Метод

Handler for when the bot receives a CTCP TIME request.
public onTime ( ) : void
Результат void

onTimeReply() публичный Метод

Handler for when a reply is received for a CTCP TIME request sent by the bot.
public onTimeReply ( ) : void
Результат void

onTopic() публичный Метод

Handler for when a channel topic is viewed or changed.
public onTopic ( ) : void
Результат void

onVersion() публичный Метод

Handler for when the bot receives a CTCP VERSION request.
public onVersion ( ) : void
Результат void

onVersionReply() публичный Метод

Handler for when a reply is received for a CTCP VERSION request sent by the bot.
public onVersionReply ( ) : void
Результат void

postDispatch() публичный Метод

Handler for after any events triggered by plugins in response to a received event are sent to the server.
public postDispatch ( ) : void
Результат void

preDispatch() публичный Метод

Handler for after plugin processing of an event has concluded but before any events triggered in response by plugins are sent to the server - useful for modifying outgoing events before they are sent.
public preDispatch ( ) : void
Результат void

preEvent() публичный Метод

Handler for when any event is received but has not yet been dispatched to the plugin handler method specific to its event type.
public preEvent ( ) : boolean | null | void
Результат boolean | null | void FALSE to short-circuit further event processing, TRUE or NULL otherwise

setConfig() публичный Метод

Sets the current configuration handler.
public setConfig ( Phergie_Config $config ) : Phergie_Plugin_Abstract
$config Phergie_Config Configuration handler
Результат Phergie_Plugin_Abstract Provides a fluent interface

setConnection() публичный Метод

Sets the current connection.
public setConnection ( Phergie_Connection $connection ) : Phergie_Plugin_Abstract
$connection Phergie_Connection Connection
Результат Phergie_Plugin_Abstract Provides a fluent interface

setEvent() публичный Метод

Sets the current incoming event to be handled.
public setEvent ( Phergie_Event_Request | Phergie_Event_Response $event ) : Phergie_Plugin_Abstract
$event Phergie_Event_Request | Phergie_Event_Response Event
Результат Phergie_Plugin_Abstract Provides a fluent interface

setEventHandler() публичный Метод

Sets the current event handler.
public setEventHandler ( Phergie_Event_Handler $handler ) : Phergie_Plugin_Abstract
$handler Phergie_Event_Handler Event handler
Результат Phergie_Plugin_Abstract Provides a fluent interface

setName() публичный Метод

Sets the short name for the plugin.
public setName ( string $name ) : Phergie_Plugin_Abstract
$name string Plugin short name
Результат Phergie_Plugin_Abstract Provides a fluent interface

setPluginHandler() публичный Метод

Sets the current plugin handler.
public setPluginHandler ( Phergie_Plugin_Handler $handler ) : Phergie_Plugin_Abstract
$handler Phergie_Plugin_Handler Plugin handler
Результат Phergie_Plugin_Abstract Provides a fluent interface

Описание свойств

$config защищенное свойство

Current configuration handler
protected Phergie_Config $config
Результат Phergie_Config

$connection защищенное свойство

Current connection instance
protected Phergie_Connection $connection
Результат Phergie_Connection

$event защищенное свойство

Current incoming event being handled
protected Phergie_Event_Request|Phergie_Event_Response $event
Результат Phergie_Event_Request | Phergie_Event_Response

$events защищенное свойство

Current event handler instance for outgoing events
protected Phergie_Event_Handler $events
Результат Phergie_Event_Handler

$name защищенное свойство

Plugin short name
protected string $name
Результат string

$plugins защищенное свойство

Plugin handler used to provide access to other plugins
protected Phergie_Plugin_Handler $plugins
Результат Phergie_Plugin_Handler