Skip to content

Commit

Permalink
Hackity hack imports on CacheHelper pages.
Browse files Browse the repository at this point in the history
I doubt this is the *correct* solution, but it stops
all the dispatcher tests from failing.
  • Loading branch information
markstory committed Jul 4, 2012
1 parent b17a5e3 commit ff49ef3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/Cake/View/Helper/CacheHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
";
}

Expand Down

0 comments on commit ff49ef3

Please sign in to comment.