mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
parent
a098ff28b8
commit
525efcb808
2 changed files with 4 additions and 3 deletions
|
@ -367,7 +367,7 @@ class JsHelperTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testWriteScriptsInFile() {
|
||||
$this->skipIf(!is_writable(JS), 'webroot/js is not Writable, script caching test has been skipped.');
|
||||
$this->skipIf(!is_writable(WWW_ROOT . 'js'), 'webroot/js is not Writable, script caching test has been skipped.');
|
||||
|
||||
Configure::write('Cache.disable', false);
|
||||
$this->Js->request->webroot = '/';
|
||||
|
|
|
@ -211,8 +211,9 @@ class JsHelper extends AppHelper {
|
|||
|
||||
if ($options['cache'] && $options['inline']) {
|
||||
$filename = md5($script);
|
||||
if (file_exists(JS . $filename . '.js')
|
||||
|| cache(str_replace(WWW_ROOT, '', JS) . $filename . '.js', $script, '+999 days', 'public')
|
||||
$path = WWW_ROOT . Configure::read('App.jsBaseUrl');
|
||||
if (file_exists($path . $filename . '.js')
|
||||
|| cache(str_replace(WWW_ROOT, '', $path) . $filename . '.js', $script, '+999 days', 'public')
|
||||
) {
|
||||
return $this->Html->script($filename);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue