4 // This page need to be rewrited
8 date_default_timezone_set('Europe/Brussels');
10 require_once('./sources/functions.inc.php');
13 set_error_handler('myErrorHandler');
15 // Arguments passés à la ligne de commande
16 if ( isset($argv[1], $argv[2], $argv[3], $argv[4]) ) {
18 $port = (int) $argv[2] ;
19 $chan = '#' . $argv[3] ;
22 $server = 'irc.oh-my-songs.com';
24 $chan = '#oms-network';
28 require_once('./sources/main-class.inc.php');
29 require_once('./sources/irc-class.inc.php');
30 require_once('./sources/plugin-class.inc.php');
31 require_once('./sources/TextFormat-class.inc.php');
33 // Nouvelle instance de la classe IRCMain
34 bot
::$server = $server;
36 bot
::$channel = $chan;
37 bot
::$myBotName = $name;
38 bot
::$ip = '127.0.0.1';
39 bot
::$domain = 'localhost';
40 bot
::$connection_password = false;
43 $MainProc = bot
::GetInstance();
45 // On charge les plugins que l'on souhaite
46 $MainProc->plugins
->load_plugin('sample');
47 $MainProc->plugins
->load_plugin('jet');
51 $MainProc -> launch();
52 } catch (Exception
$e) {
53 switch($e->getCode()) {
55 echo $e->getMessage()."\n";
56 echo "Process terminating...\n";
57 die("EOL from client\n");
59 case 1: // SIGHUP restart
60 echo $e->getMessage()."\n";
61 echo "Process restarting ...\n\n";
64 die("EOL from user...\n");