From 2b95df3abf39f4da2536b5c5139d9c421e05985c Mon Sep 17 00:00:00 2001 From: phpnut Date: Sat, 13 Sep 2008 18:59:30 +0000 Subject: [PATCH] Additional optimization refactoring git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7597 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/bootstrap.php | 1 - cake/libs/cache.php | 2 +- cake/libs/cache/file.php | 2 +- cake/libs/cake_log.php | 2 +- cake/libs/configure.php | 8 ++++---- cake/libs/controller/components/session.php | 2 +- cake/libs/inflector.php | 2 +- cake/libs/session.php | 2 +- 8 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cake/bootstrap.php b/cake/bootstrap.php index 7604a7a2d..dcc8fa213 100644 --- a/cake/bootstrap.php +++ b/cake/bootstrap.php @@ -40,7 +40,6 @@ if (!defined('PHP5')) { require LIBS . 'inflector.php'; require LIBS . 'configure.php'; } - require LIBS . 'file.php'; require LIBS . 'cache.php'; Configure::getInstance(); diff --git a/cake/libs/cache.php b/cake/libs/cache.php index ac9f0a0d2..251c24ae4 100644 --- a/cake/libs/cache.php +++ b/cake/libs/cache.php @@ -504,7 +504,7 @@ class CacheEngine extends Object { if (empty($key)) { return false; } - $key = Inflector::slug(str_replace(array(DS, '/', '.'), '_', strval($key))); + $key = Inflector::underscore(str_replace(array(DS, '/', '.'), '_', strval($key))); return $key; } } diff --git a/cake/libs/cache/file.php b/cake/libs/cache/file.php index cc662fa58..6285765d5 100644 --- a/cake/libs/cache/file.php +++ b/cake/libs/cache/file.php @@ -86,7 +86,7 @@ class FileEngine extends CacheEngine { )); if(!isset($this->__File)) { if (!class_exists('File')) { - uses('file'); + require LIBS . 'file.php'; } $this->__File =& new File($this->settings['path'] . DS . 'cake'); } diff --git a/cake/libs/cake_log.php b/cake/libs/cake_log.php index 7ef00ef4b..509789067 100644 --- a/cake/libs/cake_log.php +++ b/cake/libs/cake_log.php @@ -31,7 +31,7 @@ * */ if (!class_exists('File')) { - uses('file'); + require LIBS . 'file.php'; } /** * Set up error level constants to be used within the framework if they are not defined within the diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 5c4915b24..6624ecc0c 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -208,7 +208,7 @@ class Configure extends Object { */ function __list($path, $suffix = false, $extension = false) { if (!class_exists('Folder')) { - uses('folder'); + require LIBS . 'folder.php'; } $items = array(); $Folder =& new Folder($path); @@ -276,10 +276,10 @@ class Configure extends Object { } if (!class_exists('Debugger')) { - uses('debugger'); + require LIBS . 'debugger.php'; } if (!class_exists('CakeLog')) { - uses('cake_log'); + require LIBS . 'cake_log.php'; } Configure::write('log', LOG_NOTICE); } else { @@ -521,7 +521,7 @@ class Configure extends Object { if ($write === true) { if (!class_exists('File')) { - uses('file'); + require LIBS . 'file.php'; } $fileClass = new File($file); diff --git a/cake/libs/controller/components/session.php b/cake/libs/controller/components/session.php index 5bc3300d8..6da83dfb3 100644 --- a/cake/libs/controller/components/session.php +++ b/cake/libs/controller/components/session.php @@ -27,7 +27,7 @@ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ if (!class_exists('cakesession')) { - uses('session'); + require LIBS . 'session.php'; } /** * Session Component. diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php index cabd761c1..b8dcca2ce 100644 --- a/cake/libs/inflector.php +++ b/cake/libs/inflector.php @@ -491,7 +491,7 @@ class Inflector extends Object { */ function slug($string, $replacement = '_') { if (!class_exists('String')) { - require_once LIBS . 'string.php'; + require LIBS . 'string.php'; } $map = array( '/à|á|å|â/' => 'a', diff --git a/cake/libs/session.php b/cake/libs/session.php index 02c98c818..532990a90 100644 --- a/cake/libs/session.php +++ b/cake/libs/session.php @@ -34,7 +34,7 @@ * */ if (!class_exists('Set')) { - uses('set'); + require LIBS . 'set.php'; } /** * Session class for Cake.