From 525efcb8087ca46c24d9bdba2a1043d676ca2bc6 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 29 Oct 2013 17:48:37 -0400 Subject: [PATCH] Remove use of deprecated constants. Fixes #2232 --- lib/Cake/Test/Case/View/Helper/JsHelperTest.php | 2 +- lib/Cake/View/Helper/JsHelper.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Test/Case/View/Helper/JsHelperTest.php b/lib/Cake/Test/Case/View/Helper/JsHelperTest.php index 95279c903a5..dc5e0bc15ae 100644 --- a/lib/Cake/Test/Case/View/Helper/JsHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/JsHelperTest.php @@ -367,7 +367,7 @@ public function testWriteBufferAndXhr() { * @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 = '/'; diff --git a/lib/Cake/View/Helper/JsHelper.php b/lib/Cake/View/Helper/JsHelper.php index 62e6a03e519..118ff9c34e7 100644 --- a/lib/Cake/View/Helper/JsHelper.php +++ b/lib/Cake/View/Helper/JsHelper.php @@ -211,8 +211,9 @@ public function writeBuffer($options = array()) { 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); }