PHP Class Phergie_Plugin_Abstract, phergie

Author: Phergie Development Team ([email protected])
Afficher le fichier Open project: phergie/phergie Class Usage Examples

Protected Properties

Свойство Type Description
$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

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
fail ( string $message ) : Phergie_Plugin_Abstract Indicates that the plugin failed to load due to an unsatisfied runtime requirement, such as a missing dependency.

Method Details

__call() public méthode

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
Résultat mixed

fail() protected méthode

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
Résultat Phergie_Plugin_Abstract Provides a fluent interface

findDataFile() public méthode

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
Résultat string | null File path or NULL if the file cannot be found

getConfig() public méthode

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
Résultat Phergie_Config | mixed Configuration handler or value of the setting specified by $name

getConnection() public méthode

Returns the current event connection.
public getConnection ( ) : Phergie_Connection
Résultat Phergie_Connection

getEvent() public méthode

Returns the current incoming event to be handled.
public getEvent ( ) : Phergie_Event_Request | Phergie_Event_Response
Résultat Phergie_Event_Request | Phergie_Event_Response

getEventHandler() public méthode

Returns the current event handler.
public getEventHandler ( ) : Phergie_Event_Handler
Résultat Phergie_Event_Handler

getName() public méthode

Returns the short name for the plugin based on its class name.
public getName ( ) : string
Résultat string

getPluginHandler() public méthode

Returns the current plugin handler.
public getPluginHandler ( ) : Phergie_Plugin_Handler
Résultat Phergie_Plugin_Handler

onAction() public méthode

Handler for when the bot receives a CTCP ACTION request.
public onAction ( ) : void
Résultat void

onConnect() public méthode

Handler for when the bot initially connects to a server.
public onConnect ( ) : void
Résultat void

onCtcp() public méthode

Handler for when the bot receives a CTCP request of an unknown type.
public onCtcp ( ) : void
Résultat void

onCtcpPing() public méthode

Handler for when the bot receives a CTCP PING request.
public onCtcpPing ( ) : void
Résultat void

onCtcpReply() public méthode

Handler for when a reply received for a CTCP request of an unknown type.
public onCtcpReply ( ) : void
Résultat void

onInvite() public méthode

Handler for when the bot receives an invitation to join a channel.
public onInvite ( ) : void
Résultat void

onJoin() public méthode

Handler for when a user joins a channel.
public onJoin ( ) : void
Résultat void

onKick() public méthode

Handler for when a user is kicked from a channel.
public onKick ( ) : void
Résultat void

onKill() public méthode

Handler for when the bot receives a kill request from a server.
public onKill ( ) : void
Résultat void

onLoad() public méthode

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
Résultat void

onMode() public méthode

Handler for when a user or channel mode is changed.
public onMode ( ) : void
Résultat void

onNick() public méthode

Handler for when the server prompts the client for a nick.
public onNick ( ) : void
Résultat void

onNotice() public méthode

Handler for when a notice is received.
public onNotice ( ) : void
Résultat void

onOper() public méthode

Handler for when a user obtains operator privileges.
public onOper ( ) : void
Résultat void

onPart() public méthode

Handler for when a user leaves a channel.
public onPart ( ) : void
Résultat void

onPing() public méthode

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
Résultat void

onPingReply() public méthode

Handler for when a reply is received for a CTCP PING request sent by the bot.
public onPingReply ( ) : void
Résultat void

onPrivmsg() public méthode

Handler for when a message is received from a channel or user.
public onPrivmsg ( ) : void
Résultat void

onQuit() public méthode

Handler for when the client session is about to be terminated.
public onQuit ( ) : void
Résultat void

onResponse() public méthode

Handler for when a server response is received to a command issued by the bot.
public onResponse ( ) : void
Résultat void

onTick() public méthode

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
Résultat void

onTime() public méthode

Handler for when the bot receives a CTCP TIME request.
public onTime ( ) : void
Résultat void

onTimeReply() public méthode

Handler for when a reply is received for a CTCP TIME request sent by the bot.
public onTimeReply ( ) : void
Résultat void

onTopic() public méthode

Handler for when a channel topic is viewed or changed.
public onTopic ( ) : void
Résultat void

onVersion() public méthode

Handler for when the bot receives a CTCP VERSION request.
public onVersion ( ) : void
Résultat void

onVersionReply() public méthode

Handler for when a reply is received for a CTCP VERSION request sent by the bot.
public onVersionReply ( ) : void
Résultat void

postDispatch() public méthode

Handler for after any events triggered by plugins in response to a received event are sent to the server.
public postDispatch ( ) : void
Résultat void

preDispatch() public méthode

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
Résultat void

preEvent() public méthode

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
Résultat boolean | null | void FALSE to short-circuit further event processing, TRUE or NULL otherwise

setConfig() public méthode

Sets the current configuration handler.
public setConfig ( Phergie_Config $config ) : Phergie_Plugin_Abstract
$config Phergie_Config Configuration handler
Résultat Phergie_Plugin_Abstract Provides a fluent interface

setConnection() public méthode

Sets the current connection.
public setConnection ( Phergie_Connection $connection ) : Phergie_Plugin_Abstract
$connection Phergie_Connection Connection
Résultat Phergie_Plugin_Abstract Provides a fluent interface

setEvent() public méthode

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
Résultat Phergie_Plugin_Abstract Provides a fluent interface

setEventHandler() public méthode

Sets the current event handler.
public setEventHandler ( Phergie_Event_Handler $handler ) : Phergie_Plugin_Abstract
$handler Phergie_Event_Handler Event handler
Résultat Phergie_Plugin_Abstract Provides a fluent interface

setName() public méthode

Sets the short name for the plugin.
public setName ( string $name ) : Phergie_Plugin_Abstract
$name string Plugin short name
Résultat Phergie_Plugin_Abstract Provides a fluent interface

setPluginHandler() public méthode

Sets the current plugin handler.
public setPluginHandler ( Phergie_Plugin_Handler $handler ) : Phergie_Plugin_Abstract
$handler Phergie_Plugin_Handler Plugin handler
Résultat Phergie_Plugin_Abstract Provides a fluent interface

Property Details

$config protected_oe property

Current configuration handler
protected Phergie_Config $config
Résultat Phergie_Config

$connection protected_oe property

Current connection instance
protected Phergie_Connection $connection
Résultat Phergie_Connection

$event protected_oe property

Current incoming event being handled
protected Phergie_Event_Request|Phergie_Event_Response $event
Résultat Phergie_Event_Request | Phergie_Event_Response

$events protected_oe property

Current event handler instance for outgoing events
protected Phergie_Event_Handler $events
Résultat Phergie_Event_Handler

$name protected_oe property

Plugin short name
protected string $name
Résultat string

$plugins protected_oe property

Plugin handler used to provide access to other plugins
protected Phergie_Plugin_Handler $plugins
Résultat Phergie_Plugin_Handler