Skip to content

Commit

Permalink
Remove use of deprecated constants.
Browse files Browse the repository at this point in the history
Fixes #2232
  • Loading branch information
markstory committed Oct 29, 2013
1 parent a098ff2 commit 525efcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/View/Helper/JsHelperTest.php
Expand Up @@ -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 = '/';
Expand Down
5 changes: 3 additions & 2 deletions lib/Cake/View/Helper/JsHelper.php
Expand Up @@ -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);
}
Expand Down

0 comments on commit 525efcb

Please sign in to comment.