diff --git a/lib/Cake/Cache/Cache.php b/lib/Cake/Cache/Cache.php index 259bdc490..4dd4e019f 100644 --- a/lib/Cake/Cache/Cache.php +++ b/lib/Cake/Cache/Cache.php @@ -19,6 +19,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('Inflector', 'Utility'); + /** * Caching for CakePHP. * @@ -109,7 +111,8 @@ class Cache { list($plugin, $class) = pluginSplit($config['engine']); $cacheClass = $class . 'Engine'; - if (!class_exists($cacheClass) && self::_loadEngine($class, $plugin) === false) { + App::uses($cacheClass, 'Cache/Engine'); + if (!class_exists($cacheClass)) { return false; } $cacheClass = $class . 'Engine'; @@ -151,26 +154,6 @@ class Cache { return true; } -/** - * Tries to find and include a file for a cache engine and returns object instance - * - * @param $name Name of the engine (without 'Engine') - * @return mixed $engine object or null - */ - protected static function _loadEngine($name, $plugin = null) { - if ($plugin) { - return App::import('Lib', $plugin . '.cache' . DS . $name, false); - } else { - $core = App::core(); - $path = $core['libs'][0] . 'cache' . DS . strtolower($name) . '.php'; - if (file_exists($path)) { - require $path; - return true; - } - return App::import('Lib', 'cache' . DS . $name, false); - } - } - /** * Temporarily change the settings on a cache config. The settings will persist for the next write * operation (write, decrement, increment, clear). Any reads that are done before the write, will diff --git a/cake/libs/cache/apc.php b/lib/Cake/Cache/Engine/ApcEngine.php similarity index 100% rename from cake/libs/cache/apc.php rename to lib/Cake/Cache/Engine/ApcEngine.php diff --git a/cake/libs/cache/file.php b/lib/Cake/Cache/Engine/FileEngine.php similarity index 100% rename from cake/libs/cache/file.php rename to lib/Cake/Cache/Engine/FileEngine.php diff --git a/cake/libs/cache/memcache.php b/lib/Cake/Cache/Engine/MemcacheEngine.php similarity index 100% rename from cake/libs/cache/memcache.php rename to lib/Cake/Cache/Engine/MemcacheEngine.php diff --git a/cake/libs/cache/xcache.php b/lib/Cake/Cache/Engine/XcacheEngine.php similarity index 100% rename from cake/libs/cache/xcache.php rename to lib/Cake/Cache/Engine/XcacheEngine.php diff --git a/cake/libs/error/error_handler.php b/lib/Cake/Error/ErrorHandler.php similarity index 100% rename from cake/libs/error/error_handler.php rename to lib/Cake/Error/ErrorHandler.php diff --git a/cake/libs/error/exceptions.php b/lib/Cake/Error/exceptions.php similarity index 100% rename from cake/libs/error/exceptions.php rename to lib/Cake/Error/exceptions.php diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php index 5a6a2e697..93532e608 100644 --- a/lib/Cake/bootstrap.php +++ b/lib/Cake/bootstrap.php @@ -219,14 +219,15 @@ if (!defined('JS_URL')) { require LIBS . 'basics.php'; -require LIBS . 'Utility' . DS . 'Inflector.php'; -require LIBS . 'Utility' . DS . 'Folder.php'; require LIBS . 'Core' . DS .'App.php'; +require LIBS . 'Error' . DS . 'exceptions.php'; +App::uses('ErrorHandler', 'Error'); App::uses('Configure', 'Core'); App::uses('Cache', 'Cache'); -//require LIBS . 'error' . DS . 'exceptions.php'; + + //require LIBS . 'object.php'; //require LIBS . 'configure.php'; //require LIBS . 'set.php';