Phergie
[ class tree: Phergie ] [ index: Phergie ] [ all elements ]

Class: Phergie_Ui_Console

Source Location: /Phergie/Ui/Console.php

Class Overview

Phergie_Ui_Abstract
   |
   --Phergie_Ui_Console

End-user interface that produces console output when running the bot from a shell.


Author(s):

Variables

Methods


Inherited Methods

Class: Phergie_Ui_Abstract

Phergie_Ui_Abstract::onCommand()
Handler for when the bot sends a command to a server.
Phergie_Ui_Abstract::onConnect()
Handler for when a server connection is attempted.
Phergie_Ui_Abstract::onEvent()
Handler for when the bot receives an IRC event.
Phergie_Ui_Abstract::onPluginFailure()
Handler for when a plugin fails to load.
Phergie_Ui_Abstract::onPluginLoad()
Handler for when an attempt is made to load a plugin.
Phergie_Ui_Abstract::onQuit()
Handler for when the bot terminates a connection to a server.
Phergie_Ui_Abstract::onShutdown()
Handler for when the bot shuts down after terminating all server connections.

Class Details

[line 32]
End-user interface that produces console output when running the bot from a shell.



Tags:

author:  Phergie Development Team <team@phergie.org>
link:  http://pear.phergie.org/package/Phergie
license:  New BSD License


[ Top ]


Class Variables

$enabled =

[line 39]

Flag that toggles all console output



Tags:

access:  protected

Type:   bool


[ Top ]

$format =

[line 47]

Format for timestamps included in console output



Tags:

link:  http://php.net/date
access:  protected

Type:   string


[ Top ]



Class Methods


constructor __construct [line 54]

void __construct( )

Constructor to initialize object properties.



Tags:

access:  public


[ Top ]

method console [line 67]

void console( string $line)

Outputs a timestamped line to the console if console output is enabled.



Tags:

access:  protected


Parameters:

string   $line   Line to output

[ Top ]

method getFormat [line 104]

string getFormat( )

Returns the format used for timestamps in console output.



Tags:

link:  http://php.net/date
access:  public


[ Top ]

method isEnabled [line 79]

bool isEnabled( )

Returns whether console output is enabled.



Tags:

return:  TRUE if console output is enabled, FALSE otherwise
access:  public


[ Top ]

method onCommand [line 187]

void onCommand( Phergie_Event_Command $event, Phergie_Connection $connection)

Outputs a prompt when the bot sends a command to a server.



Tags:

access:  public


Overrides Phergie_Ui_Abstract::onCommand() (Handler for when the bot sends a command to a server.)

Parameters:

Phergie_Event_Command   $event   Event representing the command being sent
Phergie_Connection   $connection   Connection on which the command is being sent

[ Top ]

method onConnect [line 131]

void onConnect( string $host)

Outputs a prompt when a server connection is attempted.



Tags:

access:  public


Overrides Phergie_Ui_Abstract::onConnect() (Handler for when a server connection is attempted.)

Parameters:

string   $host   Server hostname

[ Top ]

method onEvent [line 170]

void onEvent( Phergie_Event_Abstract $event, Phergie_Connection $connection)

Outputs a prompt when the bot receives an IRC event.



Tags:

access:  public


Overrides Phergie_Ui_Abstract::onEvent() (Handler for when the bot receives an IRC event.)

Parameters:

Phergie_Event_Abstract   $event   Received event
Phergie_Connection   $connection   Connection on which the event was received

[ Top ]

method onPluginFailure [line 156]

void onPluginFailure( string $plugin, string $message)

Outputs a prompt when a plugin fails to load.



Tags:

access:  public


Overrides Phergie_Ui_Abstract::onPluginFailure() (Handler for when a plugin fails to load.)

Parameters:

string   $plugin   Short name of the plugin
string   $message   Message describing the reason for the failure

[ Top ]

method onPluginLoad [line 143]

void onPluginLoad( string $plugin)

Outputs a prompt when a plugin is loaded successfully.



Tags:

access:  public


Overrides Phergie_Ui_Abstract::onPluginLoad() (Handler for when an attempt is made to load a plugin.)

Parameters:

string   $plugin   Short name of the plugin

[ Top ]

method onQuit [line 207]

void onQuit( Phergie_Connection $connection)

Outputs a prompt when the bot terminates a connection to a server.



Tags:

access:  public


Overrides Phergie_Ui_Abstract::onQuit() (Handler for when the bot terminates a connection to a server.)

Parameters:

Phergie_Connection   $connection   Terminated connection

[ Top ]

method onShutdown [line 219]

void onShutdown( )

Outputs a prompt when the bot shuts down after terminating all server connections.



Tags:

access:  public


Overrides Phergie_Ui_Abstract::onShutdown() (Handler for when the bot shuts down after terminating all server connections.)

[ Top ]

method setEnabled [line 92]

Phergie_Ui_Console setEnabled( [bool $enabled = true])

Sets whether console output is enabled.



Tags:

return:  Provides a fluent interface
access:  public


Parameters:

bool   $enabled   TRUE to enable console output, FALSE otherwise, defaults to TRUE

[ Top ]

method setFormat [line 118]

Phergie_Ui_Console setFormat( string $format)

Sets the format used for timestamps in console output, overwriting any previous format used.



Tags:

return:  Provides a fluent interface
link:  http://php.net/date
access:  public


Parameters:

string   $format   Timestamp format

[ Top ]


Documentation generated on Mon, 27 Sep 2010 23:03:47 -0500 by phpDocumentor 1.4.3