]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Irc/extlib/phergie/Phergie/ExtendedBot.php
Extended Phergie_Bot to allow Statusnet to be the driver
[quix0rs-gnu-social.git] / plugins / Irc / extlib / phergie / Phergie / ExtendedBot.php
1 <?php\r
2 /**\r
3  * StatusNet - the distributed open-source microblogging tool\r
4  *\r
5  * This program is free software: you can redistribute it and/or modify\r
6  * it under the terms of the GNU Affero General Public License as published by\r
7  * the Free Software Foundation, either version 3 of the License, or\r
8  * (at your option) any later version.\r
9  *\r
10  * This program is distributed in the hope that it will be useful,\r
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13  * GNU Affero General Public License for more details.\r
14  *\r
15  * You should have received a copy of the GNU Affero General Public License\r
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
17  *\r
18  * Extends the bot class (Phergie_Bot) to allow connection and access to\r
19  * sockets and to allow StatusNet to 'drive' the bot\r
20  *\r
21  * @category  Phergie\r
22  * @package   Phergie_Extended_Bot\r
23  * @author    Luke Fitzgerald <lw.fitzgerald@googlemail.com\r
24  * @copyright 2010 StatusNet, Inc.\r
25  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0\r
26  * @link      http://status.net/\r
27  */\r
28 class Phergie_Extended_Bot extends Phergie_Bot {\r
29     /**\r
30     * Set up bot and connect to servers\r
31     *\r
32     * @return void\r
33     */\r
34     public function connect() {\r
35         $ui = $this->getUi();\r
36         $ui->setEnabled($this->getConfig('ui.enabled'));\r
37 \r
38         $this->loadPlugins();\r
39         $this->loadConnections();\r
40     }\r
41 \r
42     /**\r
43     * Get the sockets used by the bot\r
44     *\r
45     * @return array Array of socket resources\r
46     */\r
47     public function getSockets() {\r
48         return $this->getDriver()->getSockets();\r
49     }\r
50 }