dev-moderation #66
@ -9,13 +9,14 @@ const GAME_VERSION = 'alpha-7.4';
|
||||
require_once 'mysql_override.php';
|
||||
|
||||
spl_autoload_register(function (string $className) {
|
||||
$rootdir = $_SERVER['DOCUMENT_ROOT'] . '/_incl_data';
|
||||
$rootdir = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . '_incl_data' . DIRECTORY_SEPARATOR;
|
||||
# 1 with namespaces
|
||||
# 2 without
|
||||
$fileName = [
|
||||
$rootdir . '/class/' . str_replace('\\', DIRECTORY_SEPARATOR, $className . '.php'),
|
||||
$rootdir . '/class/' . $className . '.php',
|
||||
$rootdir . '/vendor/' . $className . '.php',
|
||||
$rootdir . 'class' . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $className . '.php'),
|
||||
$rootdir . 'class' . DIRECTORY_SEPARATOR . $className . '.php',
|
||||
$rootdir . 'function' . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $className . '.php'),
|
||||
$rootdir . 'vendor' . DIRECTORY_SEPARATOR . $className . '.php',
|
||||
];
|
||||
foreach ($fileName as $file) {
|
||||
if (file_exists($file)) {
|
||||
@ -26,7 +27,7 @@ spl_autoload_register(function (string $className) {
|
||||
});
|
||||
|
||||
spl_autoload_register(function (string $classname) {
|
||||
$rootdir = $_SERVER['DOCUMENT_ROOT'] . '/_incl_data';
|
||||
$rootdir = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . '_incl_data';
|
||||
$classMap = [
|
||||
'NewCombats' => $rootdir . '/class/',
|
||||
'Insallah' => $rootdir . '/class/Insallah/',
|
||||
|
Loading…
Reference in New Issue
Block a user