"Refactoring Configure::_ _buildPaths();"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6028 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-11-20 00:39:37 +00:00
parent e110032089
commit 2c28dcf841
2 changed files with 10 additions and 21 deletions

View file

@ -502,22 +502,15 @@ class Configure extends Object {
*/
function __buildPaths($paths) {
$_this =& Configure::getInstance();
$cache = false;
$basePaths = Cache::read('base_paths', '_cake_core_');
if (!$basePaths) {
$cache = true;
$core = $_this->corePaths();
$basePaths = array(
'plugin' => APP . 'plugins' . DS,
'behavior' => array(BEHAVIORS),
'component' => array(COMPONENTS),
'helper' => array(HELPERS),
'controller' => array(CONTROLLERS),
'view' => array(VIEWS),
'model' => array(MODELS));
}
$core = $_this->corePaths();
$basePaths = array(
'plugin' => APP . 'plugins' . DS,
'behavior' => array(BEHAVIORS),
'component' => array(COMPONENTS),
'helper' => array(HELPERS),
'controller' => array(CONTROLLERS),
'view' => array(VIEWS),
'model' => array(MODELS));
foreach ($basePaths as $type => $default) {
$pathsVar = $type . 'Paths';
@ -541,9 +534,6 @@ class Configure extends Object {
$_this->{$pathsVar} = array_merge($_this->{$pathsVar}, $merge);
}
}
if ($cache) {
Cache::write('base_paths', array_filter($basePaths), '_cake_core_');
}
}
/**
* Loads the app/config/bootstrap.php

View file

@ -27,8 +27,7 @@
/**
* Include files
*/
App::import('Core', 'Component');
App::import('Core', 'View');;
App::import('Core', array('Component', 'View'));
/**
* Controller
*