mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
"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:
parent
e110032089
commit
2c28dcf841
2 changed files with 10 additions and 21 deletions
|
@ -502,22 +502,15 @@ class Configure extends Object {
|
||||||
*/
|
*/
|
||||||
function __buildPaths($paths) {
|
function __buildPaths($paths) {
|
||||||
$_this =& Configure::getInstance();
|
$_this =& Configure::getInstance();
|
||||||
$cache = false;
|
$core = $_this->corePaths();
|
||||||
$basePaths = Cache::read('base_paths', '_cake_core_');
|
$basePaths = array(
|
||||||
|
'plugin' => APP . 'plugins' . DS,
|
||||||
if (!$basePaths) {
|
'behavior' => array(BEHAVIORS),
|
||||||
$cache = true;
|
'component' => array(COMPONENTS),
|
||||||
$core = $_this->corePaths();
|
'helper' => array(HELPERS),
|
||||||
|
'controller' => array(CONTROLLERS),
|
||||||
$basePaths = array(
|
'view' => array(VIEWS),
|
||||||
'plugin' => APP . 'plugins' . DS,
|
'model' => array(MODELS));
|
||||||
'behavior' => array(BEHAVIORS),
|
|
||||||
'component' => array(COMPONENTS),
|
|
||||||
'helper' => array(HELPERS),
|
|
||||||
'controller' => array(CONTROLLERS),
|
|
||||||
'view' => array(VIEWS),
|
|
||||||
'model' => array(MODELS));
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($basePaths as $type => $default) {
|
foreach ($basePaths as $type => $default) {
|
||||||
$pathsVar = $type . 'Paths';
|
$pathsVar = $type . 'Paths';
|
||||||
|
@ -541,9 +534,6 @@ class Configure extends Object {
|
||||||
$_this->{$pathsVar} = array_merge($_this->{$pathsVar}, $merge);
|
$_this->{$pathsVar} = array_merge($_this->{$pathsVar}, $merge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($cache) {
|
|
||||||
Cache::write('base_paths', array_filter($basePaths), '_cake_core_');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Loads the app/config/bootstrap.php
|
* Loads the app/config/bootstrap.php
|
||||||
|
|
|
@ -27,8 +27,7 @@
|
||||||
/**
|
/**
|
||||||
* Include files
|
* Include files
|
||||||
*/
|
*/
|
||||||
App::import('Core', 'Component');
|
App::import('Core', array('Component', 'View'));
|
||||||
App::import('Core', 'View');;
|
|
||||||
/**
|
/**
|
||||||
* Controller
|
* Controller
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue