mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
updating cache
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5793 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
28a36282c5
commit
9fdd1c3630
2 changed files with 11 additions and 11 deletions
|
@ -45,7 +45,6 @@ class Cache extends Object {
|
|||
* @access protected
|
||||
*/
|
||||
var $_Engine = null;
|
||||
|
||||
/**
|
||||
* Cache configuration stack
|
||||
*
|
||||
|
@ -98,7 +97,7 @@ class Cache extends Object {
|
|||
* @return array(engine, settings) on success, false on failure
|
||||
* @access public
|
||||
*/
|
||||
function config($name = 'default', $settings = array('engine' => 'File')) {
|
||||
function config($name = 'default', $settings = array()) {
|
||||
$_this =& Cache::getInstance();
|
||||
if(is_array($name)) {
|
||||
extract($name);
|
||||
|
@ -106,26 +105,27 @@ class Cache extends Object {
|
|||
|
||||
if(isset($_this->__config[$name])) {
|
||||
$settings = array_merge($_this->__config[$name], $settings);
|
||||
} elseif (!empty($name) && !empty($settings)) {
|
||||
$settings = $_this->__config[$name] = array_merge(array('engine' => 'File'), $settings);
|
||||
} elseif (is_string($name) && !empty($settings)) {
|
||||
$_this->__config[$name] = $settings;
|
||||
} else {
|
||||
$name = 'default';
|
||||
$settings = $_this->__config['default'];
|
||||
}
|
||||
|
||||
$engine = 'File';
|
||||
if(!empty($settings['engine'])) {
|
||||
$engine = $settings['engine'];
|
||||
}
|
||||
|
||||
if($name !== $_this->__currentConfig) {
|
||||
if($_this->engine($engine, $settings)) {
|
||||
$_this->__currentConfig = $name;
|
||||
$settings = $_this->settings($engine);
|
||||
$_this->__config[$name] = array_merge(array('engine' => $engine), $settings);
|
||||
return compact('engine', 'settings');
|
||||
if($_this->engine($engine, $settings) === false) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
$_this->__currentConfig = $name;
|
||||
$_this->__config[$name] = array_merge(array('engine' => $engine), $_this->settings($engine));
|
||||
}
|
||||
|
||||
$settings = $_this->__config[$name];
|
||||
return compact('engine', 'settings');
|
||||
}
|
||||
/**
|
||||
|
@ -156,7 +156,6 @@ class Cache extends Object {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
$_this->_Engine[$name] = null;
|
||||
return false;
|
||||
}
|
||||
|
|
1
cake/libs/cache/file.php
vendored
1
cake/libs/cache/file.php
vendored
|
@ -78,6 +78,7 @@ class FileEngine extends CacheEngine {
|
|||
}
|
||||
$this->settings['path'] = $this->__File->Folder->cd($this->settings['path']);
|
||||
if (!is_writable($this->settings['path'])) {
|
||||
trigger_error(__(sprintf('%s is not writable', $this->settings['path']), true), E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue