Skip to content
Permalink
Browse files

Hackity hack imports on CacheHelper pages.

I doubt this is the *correct* solution, but it stops
all the dispatcher tests from failing.
  • Loading branch information...
markstory committed May 16, 2012
1 parent b17a5e3 commit ff49ef3e38f12b92c2671e91390c00c042bcc0c2
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/Cake/View/Helper/CacheHelper.php
@@ -280,15 +280,19 @@ protected function _writeFile($content, $timestamp, $useCallbacks = false) {
}
$cache = $cache . '.php';
$file = '<!--cachetime:' . $cacheTime . '--><?php';
$file .= "
use Cake\\Core\\Configure;
use Cake\\Routing\\Router;
";
$namespace = Configure::read('App.namespace');
if (empty($this->_View->plugin)) {
$file .= "
App::uses('{$this->_View->name}Controller', 'Controller');
use $namespace\\Controller\\{$this->_View->name}Controller;
";
} else {
$file .= "
App::uses('{$this->_View->plugin}AppController', '{$this->_View->plugin}.Controller');
App::uses('{$this->_View->name}Controller', '{$this->_View->plugin}.Controller');
use {$this->_View->plugin}\\Controller\\{$this->_View->name}Controller;
";
}

0 comments on commit ff49ef3

Please sign in to comment.
You can’t perform that action at this time.