PHP Class Phergie_Ui_Console, phergie

Author: Phergie Development Team ([email protected])
Inheritance: extends Phergie_Ui_Abstract
Show file Open project: phergie/phergie

Protected Properties

Property Type Description
$enabled boolean Flag that toggles all console output
$format string Format for timestamps included in console output

Public Methods

Method Description
__construct ( ) : void Constructor to initialize object properties.
getFormat ( ) : string Returns the format used for timestamps in console output.
isEnabled ( ) : boolean Returns whether console output is enabled.
onCommand ( Phergie_Event_Command $event, Phergie_Connection $connection ) : void Outputs a prompt when the bot sends a command to a server.
onConnect ( string $host ) : void Outputs a prompt when a server connection is attempted.
onEvent ( Phergie_Event_Abstract $event, Phergie_Connection $connection ) : void Outputs a prompt when the bot receives an IRC event.
onPluginFailure ( string $plugin, string $message ) : void Outputs a prompt when a plugin fails to load.
onPluginLoad ( string $plugin ) : void Outputs a prompt when a plugin is loaded successfully.
onQuit ( Phergie_Connection $connection ) : void Outputs a prompt when the bot terminates a connection to a server.
onShutdown ( ) : void Outputs a prompt when the bot shuts down after terminating all server connections.
setEnabled ( boolean $enabled = true ) : Phergie_Ui_Console Sets whether console output is enabled.
setFormat ( string $format ) : Phergie_Ui_Console Sets the format used for timestamps in console output, overwriting any previous format used.

Protected Methods

Method Description
console ( string $line ) : void Outputs a timestamped line to the console if console output is enabled.

Method Details

__construct() public method

Constructor to initialize object properties.
public __construct ( ) : void
return void

console() protected method

Outputs a timestamped line to the console if console output is enabled.
protected console ( string $line ) : void
$line string Line to output
return void

getFormat() public method

Returns the format used for timestamps in console output.
public getFormat ( ) : string
return string

isEnabled() public method

Returns whether console output is enabled.
public isEnabled ( ) : boolean
return boolean TRUE if console output is enabled, FALSE otherwise

onCommand() public method

Outputs a prompt when the bot sends a command to a server.
public onCommand ( Phergie_Event_Command $event, Phergie_Connection $connection ) : void
$event Phergie_Event_Command Event representing the command being sent
$connection Phergie_Connection Connection on which the command is being sent
return void

onConnect() public method

Outputs a prompt when a server connection is attempted.
public onConnect ( string $host ) : void
$host string Server hostname
return void

onEvent() public method

Outputs a prompt when the bot receives an IRC event.
public onEvent ( Phergie_Event_Abstract $event, Phergie_Connection $connection ) : void
$event Phergie_Event_Abstract Received event
$connection Phergie_Connection Connection on which the event was received
return void

onPluginFailure() public method

Outputs a prompt when a plugin fails to load.
public onPluginFailure ( string $plugin, string $message ) : void
$plugin string Short name of the plugin
$message string Message describing the reason for the failure
return void

onPluginLoad() public method

Outputs a prompt when a plugin is loaded successfully.
public onPluginLoad ( string $plugin ) : void
$plugin string Short name of the plugin
return void

onQuit() public method

Outputs a prompt when the bot terminates a connection to a server.
public onQuit ( Phergie_Connection $connection ) : void
$connection Phergie_Connection Terminated connection
return void

onShutdown() public method

Outputs a prompt when the bot shuts down after terminating all server connections.
public onShutdown ( ) : void
return void

setEnabled() public method

Sets whether console output is enabled.
public setEnabled ( boolean $enabled = true ) : Phergie_Ui_Console
$enabled boolean TRUE to enable console output, FALSE otherwise, defaults to TRUE
return Phergie_Ui_Console Provides a fluent interface

setFormat() public method

Sets the format used for timestamps in console output, overwriting any previous format used.
public setFormat ( string $format ) : Phergie_Ui_Console
$format string Timestamp format
return Phergie_Ui_Console Provides a fluent interface

Property Details

$enabled protected property

Flag that toggles all console output
protected bool $enabled
return boolean

$format protected property

Format for timestamps included in console output
protected string $format
return string