commit | author | age
|
8bd4d9
|
1 |
<?php |
JK |
2 |
function botAutoload($class) { |
|
3 |
if($class == 'BotModuleInit') { |
|
4 |
$class = 'BotModule'; |
|
5 |
} |
|
6 |
elseif($class == 'BotLegacyEnd') { |
|
7 |
$class = 'funcs'; |
|
8 |
} |
|
9 |
elseif(substr($class, -9) == 'Exception') { |
|
10 |
$class = substr($class, 0, -9); |
|
11 |
} |
|
12 |
elseif(substr($class, -9) == 'Interface') { |
|
13 |
$class = substr($class, 0, -9); |
|
14 |
} |
|
15 |
|
|
16 |
if(is_file(BOT_TOPDIR.'/class/legacy/'.$class.'.php')) { |
|
17 |
require_once(BOT_TOPDIR.'/class/legacy/'.$class.'.php'); |
|
18 |
} |
|
19 |
else |
|
20 |
{ |
|
21 |
require_once(BOT_TOPDIR.'/class/'.$class.'.php'); |
|
22 |
} |
|
23 |
} |
|
24 |
|
8a5d94
|
25 |
if(!defined('BOT_TOPDIR')) { |
JK |
26 |
define('BOT_TOPDIR', dirname(__FILE__).'/../'); |
|
27 |
} |
|
28 |
|
8bd4d9
|
29 |
function errorToException($errno, $errstr, $errfile, $errline) { |
JK |
30 |
throw new ErrorException($errstr, 0, $errno, $errfile, $errline); |
|
31 |
} |
|
32 |
|
0868e0
|
33 |
if(!defined('PHPUNIT')) { |
JK |
34 |
error_reporting(E_COMPILE_ERROR|E_PARSE); |
|
35 |
set_error_handler('errorToException', E_ALL & ~E_NOTICE); |
|
36 |
} |
8bd4d9
|
37 |
|
JK |
38 |
setlocale(LC_CTYPE, 'pl_PL.utf8', 'pl_PL', 'polish', 'plk'); |
|
39 |
mb_internal_encoding('UTF-8'); |
1a5b21
|
40 |
libxml_use_internal_errors(); |
8bd4d9
|
41 |
spl_autoload_register('botAutoload'); |
JK |
42 |
?> |