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 |
} |
806853
|
19 |
elseif(is_file(BOT_TOPDIR.'/class/'.$class.'.php')) { |
8bd4d9
|
20 |
require_once(BOT_TOPDIR.'/class/'.$class.'.php'); |
JK |
21 |
} |
|
22 |
} |
|
23 |
|
8a5d94
|
24 |
if(!defined('BOT_TOPDIR')) { |
JK |
25 |
define('BOT_TOPDIR', dirname(__FILE__).'/../'); |
|
26 |
} |
|
27 |
|
8bd4d9
|
28 |
function errorToException($errno, $errstr, $errfile, $errline) { |
JK |
29 |
throw new ErrorException($errstr, 0, $errno, $errfile, $errline); |
|
30 |
} |
|
31 |
|
0868e0
|
32 |
if(!defined('PHPUNIT')) { |
JK |
33 |
error_reporting(E_COMPILE_ERROR|E_PARSE); |
|
34 |
set_error_handler('errorToException', E_ALL & ~E_NOTICE); |
|
35 |
} |
8bd4d9
|
36 |
|
JK |
37 |
setlocale(LC_CTYPE, 'pl_PL.utf8', 'pl_PL', 'polish', 'plk'); |
|
38 |
mb_internal_encoding('UTF-8'); |
1a5b21
|
39 |
libxml_use_internal_errors(); |
905c85
|
40 |
libxml_disable_entity_loader(true); |
8bd4d9
|
41 |
spl_autoload_register('botAutoload'); |
eac902
|
42 |
ini_set('default_charset', 'utf-8'); |