Skip to content

Commit

Permalink
Fixing typo on variable name.
Browse files Browse the repository at this point in the history
  • Loading branch information
renan committed Oct 30, 2009
1 parent 2e3bbe3 commit 84a1090
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cake/libs/configure.php
Expand Up @@ -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]'
Expand Down
29 changes: 13 additions & 16 deletions cake/libs/view/helpers/cache.php
Expand Up @@ -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);
Expand Down Expand Up @@ -171,7 +171,6 @@ function __parseFile($file, $cache) {
$outputResult = array_values($outputResult);
}


if (!empty($fileResult)) {
$i = 0;
foreach ($fileResult as $cacheBlock) {
Expand All @@ -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;
}
Expand Down Expand Up @@ -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.