Skip to content
Permalink
Browse files

Fixing typo on variable name.

  • Loading branch information...
renan committed Oct 30, 2009
1 parent 2e3bbe3 commit 84a10904fb158a2f5ebbdc8e04ab06ad117138c5
Showing with 14 additions and 17 deletions.
  1. +1 −1 cake/libs/configure.php
  2. +13 −16 cake/libs/view/helpers/cache.php
@@ -254,7 +254,7 @@ function __list($path, $suffix = false, $extension = false) {
* 'key1' => 'value of the Configure::One[key1]',
* 'key2' => 'value of the Configure::One[key2]'
* );
*
*
* Configure::write(array(
* 'One.key1' => 'value of the Configure::One[key1]',
* 'One.key2' => 'value of the Configure::One[key2]'
@@ -74,15 +74,15 @@ function cache($file, $out, $cache = false) {
$cacheTime = 0;
$useCallbacks = false;
if (is_array($this->cacheAction)) {
$contoller = Inflector::underscore($this->controllerName);
$controller = Inflector::underscore($this->controllerName);
$check = str_replace('/', '_', $this->here);
$replace = str_replace('/', '_', $this->base);
$match = str_replace($this->base, '', $this->here);
$match = str_replace('//', '/', $match);
$match = str_replace('/' . $contoller . '/', '', $match);
$match = str_replace('/' . $controller . '/', '', $match);
$match = str_replace('/' . $this->controllerName . '/', '', $match);
$check = str_replace($replace, '', $check);
$check = str_replace('_' . $contoller . '_', '', $check);
$check = str_replace('_' . $controller . '_', '', $check);
$check = str_replace('_' . $this->controllerName . '_', '', $check);
$check = Inflector::slug($check);
$check = preg_replace('/^_+/', '', $check);
@@ -171,7 +171,6 @@ function __parseFile($file, $cache) {
$outputResult = array_values($outputResult);
}
if (!empty($fileResult)) {
$i = 0;
foreach ($fileResult as $cacheBlock) {
@@ -193,24 +192,23 @@ function __parseFile($file, $cache) {
function __parseOutput($cache) {
$count = 0;
if (!empty($this->__match)) {
foreach ($this->__match as $found) {
$original = $cache;
$length = strlen($found);
$position = 0;
for ($i = 1; $i <= 1; $i++) {
$position = strpos($cache, $found, $position);
for ($i = 1; $i <= 1; $i++) {
$position = strpos($cache, $found, $position);
if ($position !== false) {
$cache = substr($original, 0, $position);
$cache .= $this->__replace[$count];
$cache .= substr($original, $position + $length);
} else {
break;
}
if ($position !== false) {
$cache = substr($original, 0, $position);
$cache .= $this->__replace[$count];
$cache .= substr($original, $position + $length);
} else {
break;
}
$count++;
}
$count++;
}
return $cache;
}
@@ -291,5 +289,4 @@ function __writeFile($content, $timestamp, $useCallbacks = false) {
return cache('views' . DS . $cache, $file, $timestamp);
}
}
?>

0 comments on commit 84a1090

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.