dev-moderation #66

Merged
lopar merged 29 commits from dev-moderation into dev 2023-12-09 14:14:38 +00:00
Showing only changes of commit 38c0e292ac - Show all commits

View File

@ -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/',