9 * This source file is subject to the new BSD license that is bundled
10 * with this package in the file LICENSE.
11 * It is also available through the world-wide-web at this URL:
12 * http://phergie.org/license
15 * @package Phergie_Plugin_Caffeine
16 * @author Phergie Development Team <team@phergie.org>
17 * @copyright 2008-2010 Phergie Development Team (http://phergie.org)
18 * @license http://phergie.org/license New BSD License
19 * @link http://pear.phergie.org/package/Phergie_Plugin_Caffeine
23 * Processes requests to serve users caffeinated beverages.
26 * @package Phergie_Plugin_Caffeine
27 * @author Phergie Development Team <team@phergie.org>
28 * @license http://phergie.org/license New BSD License
29 * @link http://pear.phergie.org/package/Phergie_Plugin_Caffeine
30 * @uses Phergie_Plugin_Command pear.phergie.org
31 * @uses Phergie_Plugin_Serve pear.phergie.org
33 class Phergie_Plugin_Caffeine extends Phergie_Plugin_Abstract
36 * Checks for dependencies.
40 public function onLoad()
42 $plugins = $this->plugins;
43 $plugins->getPlugin('Command');
44 $plugins->getPlugin('Serve');
48 * Processes requests to serve a user a caffeinated beverage.
50 * @param string $request Request including the target and an optional
51 * suggestion of what caffeinated beverage to serve
55 public function onCommandCaffeine($request)
57 $format = $this->getConfig(
59 'throws %target% %article% %item%.'
62 $this->plugins->getPlugin('Serve')->serve(
63 dirname(__FILE__) . '/Caffeine/caffeine.db',