moved last remaining manual lib include into autoloader

This commit is contained in:
Steffen Schröder 2014-09-01 03:52:14 +02:00
parent b6f061510f
commit 0240c92d58
2 changed files with 8 additions and 15 deletions

View File

@ -29,9 +29,6 @@ require_once MANIACONTROL_PATH . 'core' . DIRECTORY_SEPARATOR . 'AutoLoader.php'
// Setup Logger
\ManiaControl\Logger::setup();
// Load libs
require_once MANIACONTROL_PATH . '/libs/curl-easy/autoload.php';
/**
* @deprecated
* @see \ManiaControl\Logger::log()

View File

@ -34,18 +34,14 @@ abstract class AutoLoader {
return;
}
// Plugin file
$pluginFilePath = MANIACONTROL_PATH . 'plugins' . DIRECTORY_SEPARATOR . $classPath . '.php';
if (file_exists($pluginFilePath)) {
include_once $pluginFilePath;
return;
}
// Lib file
$libFilePath = MANIACONTROL_PATH . 'libs' . DIRECTORY_SEPARATOR . $classPath . '.php';
if (file_exists($libFilePath)) {
include_once $libFilePath;
return;
// Other file
$paths = array('plugins', 'libs', 'libs' . DIRECTORY_SEPARATOR . 'curl-easy');
foreach ($paths as $path) {
$filePath = MANIACONTROL_PATH . $path . DIRECTORY_SEPARATOR . $classPath . '.php';
if (file_exists($filePath)) {
include_once $filePath;
return;
}
}
}
}