Skip to content

Commit

Permalink
fix FileEngine, divergent behavior when debug is off or on
Browse files Browse the repository at this point in the history
  • Loading branch information
darxmac committed Sep 30, 2014
1 parent 11b0b27 commit c4b8453
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Cache/Engine/FileEngine.php
Expand Up @@ -401,12 +401,11 @@ protected function _setKey($key, $createKey = false) {
*/
protected function _active() {
$dir = new \SplFileInfo($this->_config['path']);
if (Configure::read('debug')) {
$path = $dir->getPathname();
if (!is_dir($path)) {
mkdir($path, 0775, true);
}
$path = $dir->getPathname();
if (!is_dir($path)) {
mkdir($path, 0775, true);
}

if ($this->_init && !($dir->isDir() && $dir->isWritable())) {
$this->_init = false;
trigger_error(sprintf(
Expand Down

0 comments on commit c4b8453

Please sign in to comment.