]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Irc/extlib/phergie/phergie.php
f0b9f6ced5e997b760d0910e74e0bc6c67598e98
[quix0rs-gnu-social.git] / plugins / Irc / extlib / phergie / phergie.php
1 #!/usr/bin/env php
2 <?php
3 /**
4  * Phergie 
5  *
6  * PHP version 5
7  *
8  * LICENSE
9  *
10  * This source file is subject to the new BSD license that is bundled
11  * with this package in the file LICENSE.
12  * It is also available through the world-wide-web at this URL:
13  * http://phergie.org/license
14  *
15  * @category  Phergie
16  * @package   Phergie
17  * @author    Phergie Development Team <team@phergie.org>
18  * @copyright 2008-2010 Phergie Development Team (http://phergie.org)
19  * @license   http://phergie.org/license New BSD License
20  * @link      http://pear.phergie.org/package/Phergie
21  */
22
23 /**
24  * @see Phergie_Autoload
25  */
26 require 'Phergie/Autoload.php';
27 Phergie_Autoload::registerAutoloader();
28
29 $bot = new Phergie_Bot;
30
31 if (!isset($argc)) {
32     echo
33         'The PHP setting register_argc_argv must be enabled for Phergie ', 
34         'configuration files to be specified using command line arguments; ',
35         'defaulting to Settings.php in the current working directory',
36         PHP_EOL;
37 } else if ($argc > 0) {
38     // Skip the current file for manual installations
39     // ex: php phergie.php Settings.php
40     if (realpath($argv[0]) == __FILE__) {
41         array_shift($argv);
42     }
43
44     // If configuration files were specified, override default behavior
45     if (count($argv) > 0) {
46         $config = new Phergie_Config;
47         foreach ($argv as $file) {
48             $config->read($file);
49         }
50         $bot->setConfig($config);
51     }
52 }
53
54 $bot->run();