mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
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:
parent
a12fd86c54
commit
e2c087f34b
1 changed files with 6 additions and 3 deletions
|
@ -433,16 +433,19 @@ class JavascriptHelper extends AppHelper {
|
||||||
$out = '';
|
$out = '';
|
||||||
$rules = array();
|
$rules = array();
|
||||||
|
|
||||||
|
if (!$this->_cacheEvents) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$data = $this->getCache();
|
$data = $this->getCache();
|
||||||
if (!$this->_cacheEvents || empty($data)) {
|
|
||||||
|
if (empty($data)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->_cacheToFile) {
|
if ($this->_cacheToFile) {
|
||||||
$filename = md5($data);
|
$filename = md5($data);
|
||||||
if (!file_exists(JS . $filename . '.js')) {
|
if (!file_exists(JS . $filename . '.js')) {
|
||||||
$filePath = str_replace(WWW_ROOT, '', JS) . $filename . '.js';
|
cache(str_replace(WWW_ROOT, '', JS) . $filename . '.js', $data, '+999 days', 'public');
|
||||||
cache($filePath, $data, '+999 days', 'public');
|
|
||||||
}
|
}
|
||||||
$out = $this->link($filename);
|
$out = $this->link($filename);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue