From 0240c92d5824688bd23e0293c4927be6c076c8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Mon, 1 Sep 2014 03:52:14 +0200 Subject: [PATCH] moved last remaining manual lib include into autoloader --- application/ManiaControl.php | 3 --- application/core/AutoLoader.php | 20 ++++++++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/application/ManiaControl.php b/application/ManiaControl.php index 32ca11d4..7af3bcf9 100644 --- a/application/ManiaControl.php +++ b/application/ManiaControl.php @@ -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() diff --git a/application/core/AutoLoader.php b/application/core/AutoLoader.php index 32697d99..d385bc3a 100644 --- a/application/core/AutoLoader.php +++ b/application/core/AutoLoader.php @@ -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; + } } } }