Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor optimization in cache views.

  • Loading branch information...
commit 5d2b4c758dd2de4ac470e25416f35bcb9a3c16cb 1 parent a7c7436
Juan Basso jrbasso authored
10 cake/libs/view/helpers/cache.php
View
@@ -225,15 +225,15 @@ function __writeFile($content, $timestamp, $useCallbacks = false) {
$file .= '$controller =& new ' . $this->controllerName . 'Controller();
$controller->plugin = $this->plugin = \''.$this->plugin.'\';
- $controller->helpers = $this->helpers = unserialize(\'' . serialize($this->helpers) . '\');
+ $controller->helpers = $this->helpers = ' . var_export($this->helpers, true) . ';
$controller->base = $this->base = \'' . $this->base . '\';
$controller->layout = $this->layout = \'' . $this->layout. '\';
$controller->webroot = $this->webroot = \'' . $this->webroot . '\';
$controller->here = $this->here = \'' . $this->here . '\';
- $controller->params = $this->params = unserialize(stripslashes(\'' . addslashes(serialize($this->params)) . '\'));
- $controller->action = $this->action = unserialize(\'' . serialize($this->action) . '\');
- $controller->data = $this->data = unserialize(stripslashes(\'' . addslashes(serialize($this->data)) . '\'));
- $controller->viewVars = $this->viewVars = unserialize(stripslashes(\'' . addslashes(serialize($this->viewVars)) . '\'));
+ $controller->params = $this->params = ' . var_export($this->params, true) . ';
+ $controller->action = $this->action = ' . var_export($this->action, true) . ';
+ $controller->data = $this->data = ' . var_export($this->data, true) . ';
+ $controller->viewVars = $this->viewVars = ' . var_export($this->viewVars, true) . ';
$controller->theme = $this->theme = \'' . $this->theme . '\';
Router::setRequestInfo(array($this->params, array(\'base\' => $this->base, \'webroot\' => $this->webroot)));';
2  cake/tests/cases/libs/view/helpers/cache.test.php
View
@@ -336,7 +336,7 @@ function testCacheViewVars() {
$this->assertTrue(file_exists($filename));
$contents = file_get_contents($filename);
- $this->assertPattern('/\$this\-\>viewVars.*variable/', $contents);
+ $this->assertPattern('/\$this\-\>viewVars/', $contents);
$this->assertPattern('/extract\(\$this\-\>viewVars, EXTR_SKIP\);/', $contents);
$this->assertPattern('/php echo \$variable/', $contents);
$this->assertPattern('/variableValue/', $contents);
Please sign in to comment.
Something went wrong with that request. Please try again.