PHP Class Phergie_Ui_Console, phergie

Author: Phergie Development Team ([email protected])
Inheritance: extends Phergie_Ui_Abstract
Afficher le fichier Open project: phergie/phergie

Protected Properties

Свойство Type Description
$enabled boolean Flag that toggles all console output
$format string Format for timestamps included in console output

Méthodes publiques

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

Méthodes protégées

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

Method Details

__construct() public méthode

Constructor to initialize object properties.
public __construct ( ) : void
Résultat void

console() protected méthode

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

getFormat() public méthode

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

isEnabled() public méthode

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

onCommand() public méthode

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

onConnect() public méthode

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

onEvent() public méthode

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

onPluginFailure() public méthode

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

onPluginLoad() public méthode

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

onQuit() public méthode

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

onShutdown() public méthode

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

setEnabled() public méthode

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

setFormat() public méthode

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

Property Details

$enabled protected_oe property

Flag that toggles all console output
protected bool $enabled
Résultat boolean

$format protected_oe property

Format for timestamps included in console output
protected string $format
Résultat string