]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Irc/extlib/phergie/Phergie/Plugin/Quit.php
Revert "Merged in Phergie changes"
[quix0rs-gnu-social.git] / plugins / Irc / extlib / phergie / Phergie / Plugin / Quit.php
1 <?php
2 /**
3  * Phergie 
4  *
5  * PHP version 5
6  *
7  * LICENSE
8  *
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
13  *
14  * @category  Phergie 
15  * @package   Phergie_Plugin_Quit
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_Quit
20  */
21
22 /**
23  * Terminates the current connection upon command.
24  *
25  * @category Phergie 
26  * @package  Phergie_Plugin_Quit
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_Quit
30  * @uses     Phergie_Plugin_Command pear.phergie.org
31  *
32  * @pluginDesc Terminates the current connection upon command.
33  */
34 class Phergie_Plugin_Quit extends Phergie_Plugin_Abstract
35 {
36     /**
37      * Checks for dependencies.
38      *
39      * @return void
40      */
41     public function onLoad()
42     {
43         $this->getPluginHandler()->getPlugin('Command');
44         $help = $this->getPluginHandler()->getPlugin('Help');
45         $help->register($this);
46     }
47
48     /**
49      * Issues a quit command when a message is received requesting that the 
50      * bot terminate the current connection.
51      *
52      * @return void
53      *
54      * @pluginCmd terminates the connection
55      */
56     public function onCommandQuit()
57     {
58         $this->doQuit('Requested by ' . $this->getEvent()->getNick());
59     }
60 }