4 * This file is part of IrBot, irc robot.
5 * Copyright (C) 2007 Bellière Ludovic
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 // This page need to be rewrited
24 error_reporting(E_ALL
);
26 date_default_timezone_set('Europe/Brussels');
28 require_once('./sources/functions.inc.php');
31 //set_error_handler('myErrorHandler');
33 // Arguments passés à la ligne de commande
34 if ( isset($argv[1], $argv[2], $argv[3], $argv[4]) ) {
36 $port = (int) $argv[2] ;
37 $chan = '#' . $argv[3] ;
40 $server = 'irc.tty2.org';
42 $chan = '#sharesource';
46 require_once('./sources/main-class.inc.php');
47 require_once('./sources/irc-class.inc.php');
48 require_once('./sources/plugin-class.inc.php');
49 require_once('./sources/TextFormat-class.inc.php');
51 // Nouvelle instance de la classe IRCMain
52 bot
::$server = $server;
54 bot
::$channel = $chan;
55 bot
::$myBotName = $name;
56 bot
::$ip = '127.0.0.1';
57 bot
::$domain = 'localhost';
58 bot
::$connection_password = false;
62 IrBot Copyright (C) 2007 Bellière Ludovic
63 This program comes with ABSOLUTELY NO WARRANTY;
64 This is free software, and you are welcome to redistribute it
65 under certain conditions; for details see <http://www.gnu.org/licenses/>.
69 $MainProc = bot
::GetInstance();
72 // On charge les plugins que l'on souhaite
73 $MainProc->plugins
->load_plugin('sample');
74 $MainProc->plugins
->load_plugin('jet');
78 $MainProc -> launch();
79 } catch (Exception
$e) {
80 switch($e->getCode()) {
82 echo $e->getMessage()."\n";
83 echo "Process terminating...\n";
84 die("EOL from client\n");
86 case 1: // SIGHUP restart
87 echo $e->getMessage()."\n";
88 echo "Process restarting ...\n\n";
91 die("EOL from user...\n");