Fixing failing tests in JavascriptHelper.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7944 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2008-12-19 01:30:02 +00:00
parent a12fd86c54
commit e2c087f34b

View file

@ -433,16 +433,19 @@ class JavascriptHelper extends AppHelper {
$out = '';
$rules = array();
if (!$this->_cacheEvents) {
return;
}
$data = $this->getCache();
if (!$this->_cacheEvents || empty($data)) {
if (empty($data)) {
return;
}
if ($this->_cacheToFile) {
$filename = md5($data);
if (!file_exists(JS . $filename . '.js')) {
$filePath = str_replace(WWW_ROOT, '', JS) . $filename . '.js';
cache($filePath, $data, '+999 days', 'public');
cache(str_replace(WWW_ROOT, '', JS) . $filename . '.js', $data, '+999 days', 'public');
}
$out = $this->link($filename);
} else {