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/tick-class.inc.php');
50 require_once('./sources/TextFormat-class.inc.php');
52 // Nouvelle instance de la classe IRCMain
53 bot
::$server = $server;
55 bot
::$channel = $chan;
56 bot
::$myBotName = $name;
59 bot
::$connection_password = false;
63 IrBot Copyright (C) 2007 Bellière Ludovic
64 This program comes with ABSOLUTELY NO WARRANTY;
65 This is free software, and you are welcome to redistribute it
66 under certain conditions; for details see <http://www.gnu.org/licenses/>.
71 $MainProc = bot
::GetInstance();
74 // On charge les plugins que l'on souhaite
75 $MainProc->plugins
->load_plugin('sample');
76 $MainProc->plugins
->load_plugin('jet');
80 $MainProc -> launch();
81 } catch (Exception
$e) {
82 switch($e->getCode()) {
84 echo $e->getMessage()."\n";
85 echo "Process terminating...\n";
86 die("EOL from client\n");
88 case 1: // SIGHUP restart
89 echo $e->getMessage()."\n";
90 echo "Process restarting ...\n\n";
93 die("EOL from user...\n");