PHP Class Phergie_Plugin_Remind, phergie

Inheritance: extends Phergie_Plugin_Abstract
Show file Open project: phergie/phergie

Protected Properties

Property Type Description
$db resource PDO resource for a SQLite database containing the reminders.
$keepListInMemory boolean Flag that indicates whether or not to use an in-memory reminder list.
$msgStorage In-memory store for pending reminders.
$onlyTargetedReminders boolean Respond *only* to targeted reminders or not.
$publicReminders Number of reminders to show in public.
$remindOnJoin boolean Send reminders when a user joins the channel or not.

Public Methods

Method Description
onCommandAsk ( string $recipient, string $message ) : void Handle reminder requests
onCommandRemind ( string $recipient, string $message ) : void Handle reminder requests
onCommandTell ( string $recipient, string $message ) : void Handle reminder requests
onJoin ( ) : void Handler for when a user joins a channel.
onLoad ( ) : void Check for dependencies.
onPrivmsg ( ) : void Intercepts a message and processes any contained recognized commands.

Protected Methods

Method Description
createTables ( ) : void Creates the database table(s) (if they don't exist)
deleteMessage ( integer $rowid, string $channel, string $nick ) : void Deletes a delivered message
deliverReminders ( string $channel, string $nick ) : void Determines if the user has pending reminders, and if so, delivers them.
fetchMessages ( string $channel = null, string $recipient = null ) : array Get pending messages (for a specific channel/recipient)
handleDelivery ( ) : void Deliver reminders to a user.
handleRemind ( string $recipient, string $message ) : void Handles the tell/remind command (stores the message)
haveTable ( string $name ) : boolean Determines if a table exists
populateMemory ( ) : void Populates the in-memory cache of pending reminders

Method Details

createTables() protected method

Creates the database table(s) (if they don't exist)
protected createTables ( ) : void
return void

deleteMessage() protected method

Deletes a delivered message
protected deleteMessage ( integer $rowid, string $channel, string $nick ) : void
$rowid integer ID of the message to delete
$channel string message's channel
$nick string message's recipient
return void

deliverReminders() protected method

Determines if the user has pending reminders, and if so, delivers them.
protected deliverReminders ( string $channel, string $nick ) : void
$channel string channel to check
$nick string nick to check
return void

fetchMessages() protected method

Get pending messages (for a specific channel/recipient)
protected fetchMessages ( string $channel = null, string $recipient = null ) : array
$channel string channel on which to check for pending messages
$recipient string user for which to check pending messages
return array of records

handleDelivery() protected method

Deliver reminders to a user.
protected handleDelivery ( ) : void
return void

handleRemind() protected method

Handles the tell/remind command (stores the message)
protected handleRemind ( string $recipient, string $message ) : void
$recipient string name of the recipient
$message string message to store
return void

haveTable() protected method

Determines if a table exists
protected haveTable ( string $name ) : boolean
$name string Table name
return boolean

onCommandAsk() public method

Handle reminder requests
See also: handleRemind()
public onCommandAsk ( string $recipient, string $message ) : void
$recipient string recipient of the message
$message string message to tell the recipient
return void

onCommandRemind() public method

Handle reminder requests
See also: handleRemind()
public onCommandRemind ( string $recipient, string $message ) : void
$recipient string recipient of the message
$message string message to tell the recipient
return void

onCommandTell() public method

Handle reminder requests
See also: handleRemind()
public onCommandTell ( string $recipient, string $message ) : void
$recipient string recipient of the message
$message string message to tell the recipient
return void

onJoin() public method

Handler for when a user joins a channel.
public onJoin ( ) : void
return void

onLoad() public method

Check for dependencies.
public onLoad ( ) : void
return void

onPrivmsg() public method

Intercepts a message and processes any contained recognized commands.
public onPrivmsg ( ) : void
return void

populateMemory() protected method

Populates the in-memory cache of pending reminders
protected populateMemory ( ) : void
return void

Property Details

$db protected property

PDO resource for a SQLite database containing the reminders.
protected resource $db
return resource

$keepListInMemory protected property

Flag that indicates whether or not to use an in-memory reminder list.
protected bool $keepListInMemory
return boolean

$msgStorage protected property

In-memory store for pending reminders.
protected $msgStorage

$onlyTargetedReminders protected property

Respond *only* to targeted reminders or not.
protected bool $onlyTargetedReminders
return boolean

$publicReminders protected property

Number of reminders to show in public.
protected $publicReminders

$remindOnJoin protected property

Send reminders when a user joins the channel or not.
protected bool $remindOnJoin
return boolean