PHP Class Phergie_Bot, phergie

Author: Phergie Development Team ([email protected])
Datei anzeigen Open project: phergie/phergie Class Usage Examples

Protected Properties

Property Type Description
$config Phergie_Config Current configuration instance
$connections Phergie_Connection_Handler Current connection handler instance
$driver Phergie_Driver_Abstract Current driver instance
$events Phergie_Event_Handler Current event handler instance
$plugins Phergie_Plugin_Handler Current plugin handler instance
$processor Phergie_Process_Abstract Current processor instance
$ui Phergie_Ui_Abstract Current end-user interface instance

Public Methods

Method Description
getConfig ( string $index = null, mixed $default = null ) : mixed Returns the entire configuration in use or the value of a specific configuration setting.
getConnectionHandler ( ) : Phergie_Connection_Handler Returns a connection handler instance, creating it if it does not already exist and using a default class if none has been set.
getDefaultConfiguration ( ) : string | boolean Tries to locate the default configuration file
getDriver ( ) : Phergie_Driver_Abstract Returns a driver instance, creating one of the default class if none has been set.
getEventHandler ( ) : Phergie_Event_Handler Returns an event handler instance, creating it if it does not already exist and using a default class if none has been set.
getPluginHandler ( ) : Phergie_Plugin_Handler Returns a plugin handler instance, creating it if it does not already exist and using a default class if none has been set.
getProcessor ( ) : Phergie_Process_Abstract Returns a processer instance, creating one if none exists.
getUi ( ) : Phergie_Ui_Abstract Returns an end-user interface instance, creating it if it does not already exist and using a default class if none has been set.
run ( ) : Phergie_Bot Establishes server connections and initiates an execution loop to continuously receive and process events.
setConfig ( Phergie_Config $config ) : Phergie_Runner_Abstract Sets the configuration to use.
setConnectionHandler ( Phergie_Connection_Handler $handler ) : Phergie_Bot Sets the connection handler instance to use.
setDriver ( Phergie_Driver_Abstract $driver ) : Phergie_Bot Sets the driver instance to use.
setEventHandler ( Phergie_Event_Handler $handler ) : Phergie_Bot Sets the event handler instance to use.
setPluginHandler ( Phergie_Plugin_Handler $handler ) : Phergie_Bot Sets the plugin handler instance to use.
setProcessor ( Phergie_Process_Abstract $processor ) : Phergie_Bot Sets the processer instance to use.
setUi ( Phergie_Ui_Abstract $ui ) : Phergie_Bot Sets the end-user interface instance to use.

Protected Methods

Method Description
loadConnections ( ) : void Configures and establishes connections to IRC servers.
loadPlugins ( ) : void Loads plugins into the plugin handler.

Method Details

getConfig() public method

Returns the entire configuration in use or the value of a specific configuration setting.
public getConfig ( string $index = null, mixed $default = null ) : mixed
$index string Optional index of a specific configuration setting for which the corresponding value should be returned
$default mixed Value to return if no match is found for $index
return mixed Value corresponding to $index or the entire configuration if $index is not specified

getConnectionHandler() public method

Returns a connection handler instance, creating it if it does not already exist and using a default class if none has been set.
public getConnectionHandler ( ) : Phergie_Connection_Handler
return Phergie_Connection_Handler

getDefaultConfiguration() public method

Tries to locate the default configuration file
public getDefaultConfiguration ( ) : string | boolean
return string | boolean Returns false when no file was found

getDriver() public method

Returns a driver instance, creating one of the default class if none has been set.
public getDriver ( ) : Phergie_Driver_Abstract
return Phergie_Driver_Abstract

getEventHandler() public method

Returns an event handler instance, creating it if it does not already exist and using a default class if none has been set.
public getEventHandler ( ) : Phergie_Event_Handler
return Phergie_Event_Handler

getPluginHandler() public method

Returns a plugin handler instance, creating it if it does not already exist and using a default class if none has been set.
public getPluginHandler ( ) : Phergie_Plugin_Handler
return Phergie_Plugin_Handler

getProcessor() public method

Returns a processer instance, creating one if none exists.
public getProcessor ( ) : Phergie_Process_Abstract
return Phergie_Process_Abstract

getUi() public method

Returns an end-user interface instance, creating it if it does not already exist and using a default class if none has been set.
public getUi ( ) : Phergie_Ui_Abstract
return Phergie_Ui_Abstract

loadConnections() protected method

Configures and establishes connections to IRC servers.
protected loadConnections ( ) : void
return void

loadPlugins() protected method

Loads plugins into the plugin handler.
protected loadPlugins ( ) : void
return void

run() public method

Establishes server connections and initiates an execution loop to continuously receive and process events.
public run ( ) : Phergie_Bot
return Phergie_Bot Provides a fluent interface

setConfig() public method

Sets the configuration to use.
public setConfig ( Phergie_Config $config ) : Phergie_Runner_Abstract
$config Phergie_Config Configuration instance
return Phergie_Runner_Abstract Provides a fluent interface

setConnectionHandler() public method

Sets the connection handler instance to use.
public setConnectionHandler ( Phergie_Connection_Handler $handler ) : Phergie_Bot
$handler Phergie_Connection_Handler Connection handler instance
return Phergie_Bot Provides a fluent interface

setDriver() public method

Sets the driver instance to use.
public setDriver ( Phergie_Driver_Abstract $driver ) : Phergie_Bot
$driver Phergie_Driver_Abstract Driver instance
return Phergie_Bot Provides a fluent interface

setEventHandler() public method

Sets the event handler instance to use.
public setEventHandler ( Phergie_Event_Handler $handler ) : Phergie_Bot
$handler Phergie_Event_Handler Event handler instance
return Phergie_Bot Provides a fluent interface

setPluginHandler() public method

Sets the plugin handler instance to use.
public setPluginHandler ( Phergie_Plugin_Handler $handler ) : Phergie_Bot
$handler Phergie_Plugin_Handler Plugin handler instance
return Phergie_Bot Provides a fluent interface

setProcessor() public method

Sets the processer instance to use.
public setProcessor ( Phergie_Process_Abstract $processor ) : Phergie_Bot
$processor Phergie_Process_Abstract Processer instance
return Phergie_Bot Provides a fluent interface

setUi() public method

Sets the end-user interface instance to use.
public setUi ( Phergie_Ui_Abstract $ui ) : Phergie_Bot
$ui Phergie_Ui_Abstract End-user interface instance
return Phergie_Bot Provides a fluent interface

Property Details

$config protected_oe property

Current configuration instance
protected Phergie_Config $config
return Phergie_Config

$connections protected_oe property

Current connection handler instance
protected Phergie_Connection_Handler $connections
return Phergie_Connection_Handler

$driver protected_oe property

Current driver instance
protected Phergie_Driver_Abstract $driver
return Phergie_Driver_Abstract

$events protected_oe property

Current event handler instance
protected Phergie_Event_Handler $events
return Phergie_Event_Handler

$plugins protected_oe property

Current plugin handler instance
protected Phergie_Plugin_Handler $plugins
return Phergie_Plugin_Handler

$processor protected_oe property

Current processor instance
protected Phergie_Process_Abstract $processor
return Phergie_Process_Abstract

$ui protected_oe property

Current end-user interface instance
protected Phergie_Ui_Abstract $ui
return Phergie_Ui_Abstract