Remove use of deprecated constants.

Fixes #2232
This commit is contained in:
mark_story 2013-10-29 17:48:37 -04:00
parent a098ff28b8
commit 525efcb808
2 changed files with 4 additions and 3 deletions

View file

@ -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 = '/';

View file

@ -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);
}