moved parts of libs loading into AutoLoader
This commit is contained in:
parent
a52f6894c0
commit
96d3f1eaba
@ -27,17 +27,24 @@ abstract class AutoLoader {
|
|||||||
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, $className);
|
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, $className);
|
||||||
|
|
||||||
// Core file
|
// Core file
|
||||||
$classDirectoryPath = preg_replace('/ManiaControl/', 'core', $classPath, 1);
|
$coreClassPath = preg_replace('/ManiaControl/', 'core', $classPath, 1);
|
||||||
$filePath = ManiaControlDir . $classDirectoryPath . '.php';
|
$coreFilePath = ManiaControlDir . $coreClassPath . '.php';
|
||||||
if (file_exists($filePath)) {
|
if (file_exists($coreFilePath)) {
|
||||||
require_once $filePath;
|
include_once $coreFilePath;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plugin file
|
// Plugin file
|
||||||
$filePath = ManiaControlDir . 'plugins' . DIRECTORY_SEPARATOR . $classPath . '.php';
|
$pluginFilePath = ManiaControlDir . 'plugins' . DIRECTORY_SEPARATOR . $classPath . '.php';
|
||||||
if (file_exists($filePath)) {
|
if (file_exists($pluginFilePath)) {
|
||||||
include_once $filePath;
|
include_once $pluginFilePath;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lib file
|
||||||
|
$libFilePath = ManiaControlDir . 'libs' . DIRECTORY_SEPARATOR . $classPath . '.php';
|
||||||
|
if (file_exists($libFilePath)) {
|
||||||
|
include_once $libFilePath;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,6 @@ use Maniaplanet\DedicatedServer\Connection;
|
|||||||
use Maniaplanet\DedicatedServer\Xmlrpc\AuthenticationException;
|
use Maniaplanet\DedicatedServer\Xmlrpc\AuthenticationException;
|
||||||
use Maniaplanet\DedicatedServer\Xmlrpc\TransportException;
|
use Maniaplanet\DedicatedServer\Xmlrpc\TransportException;
|
||||||
|
|
||||||
require_once ManiaControlDir . '/libs/Maniaplanet/DedicatedServer/Connection.php';
|
|
||||||
require_once ManiaControlDir . '/libs/FML/autoload.php';
|
|
||||||
require_once ManiaControlDir . '/libs/Symfony/autoload.php';
|
require_once ManiaControlDir . '/libs/Symfony/autoload.php';
|
||||||
require_once ManiaControlDir . '/libs/curl-easy/autoload.php';
|
require_once ManiaControlDir . '/libs/curl-easy/autoload.php';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user