2 /******************************* PHP-P10 v2 *****************************
3 * Copyright (C) 2011-2012 Philipp Kreil (pk910) *
5 * This program is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 3 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 ************************************************************************
26 error_reporting(E_ALL & ~E_STRICT);
28 require_once("Uplink/Uplink.class.php");
29 require_once("ModCMD/ModCMD.class.php");
30 require_once("BotLoader/BotLoader.class.php");
31 require_once("Tools/timer.inc.php");
32 require_once("Tools/Table.class.php");
34 if(function_exists("pcntl_signal")) {
35 pcntl_signal(SIGINT, 'shutdown');
36 pcntl_signal(SIGTERM, 'shutdown');
39 function myErrorHandler($errorcode, $errortext, $errorfile, $errorline)
43 echo $errorcode.': '.$errortext.' in '.$errorfile.' Line '.$errorline;
47 echo $errorcode.': '.$errortext.' in '.$errorfile.' Line '.$errorline;
51 echo $errorcode.': '.$errortext.' in '.$errorfile.' Line '.$errorline;
55 echo $errorcode.': '.$errortext.' in '.$errorfile.' Line '.$errorline;
62 $error_handler = set_error_handler("myErrorHandler");
64 //basicly here is nothing, yet :D
65 $uplink = new Uplink();
66 require_once("config.inc.php");
68 $uplink->setEventHandler(ModCMD::getEventHandler());
70 $uplink->initialize();
72 $botloader = new BotLoader($uplink);
73 $botloader->loadBots();
74 BotLoader::load("ModManager", "ModManager.class.php");
76 function shutdown($signal = 0) {
79 echo "\n\nrecived shutdown instruction...\n";
80 $botloader->unloadBots();
90 if(function_exists("pcntl_signal_dispatch"))
91 pcntl_signal_dispatch();