PHP Class Phergie_Plugin_Serve, phergie

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

Public Methods

Method Description
onLoad ( ) : void Checks for dependencies.
serve ( string $database, string $table, string $format, string $request, boolean $censor = false ) : boolean Processes a request to serve a user something.

Protected Methods

Method Description
getItem ( string $database, string $table, array $request ) : object Retrieves a random item from the database table.

Method Details

getItem() protected method

Retrieves a random item from the database table.
protected getItem ( string $database, string $table, array $request ) : object
$database string Path to the SQLite database file
$table string Name of the database table
$request array Parsed request
return object Retrieved item

onLoad() public method

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

serve() public method

Processes a request to serve a user something.
public serve ( string $database, string $table, string $format, string $request, boolean $censor = false ) : boolean
$database string Path to the SQLite database file
$table string Name of the database table
$format string Format of the response where %target%, %item%, %article%', and %link will be replaced with their respective data
$request string Request string including the target and an optional suggestion of the item to fetch
$censor boolean TRUE to integrate with the Censor plugin, defaults to FALSE
return boolean TRUE if the request was processed successfully, FALSE otherwise