MDL-21435 sending JS cache to cache/js instead of temp; adding purging of JS caches

This commit is contained in:
Petr Skoda 2010-05-22 20:04:06 +00:00
parent 6b2ad29acb
commit 09c48cea8b
2 changed files with 8 additions and 2 deletions

View File

@ -64,10 +64,16 @@ minify($jsfiles);
function minify($files) {
global $CFG;
$cachedir = $CFG->dataroot.'/cache/js';
// make sure the cache dir exist
if (!file_exists($cachedir)) {
@mkdir($cachedir, $CFG->directorypermissions, true);
}
if (0 === stripos(PHP_OS, 'win')) {
Minify::setDocRoot(); // IIS may need help
}
Minify::setCache($CFG->dataroot.'/temp', true);
Minify::setCache($cachedir, true);
$options = array(
// Maximum age to cache

View File

@ -1004,6 +1004,6 @@ function js_reset_all_caches() {
require_once("$CFG->libdir/filelib.php");
set_config('jsrev', empty($CFG->jsrev) ? 1 : $CFG->jsrev+1);
//fulldelete("$CFG->dataroot/cache/js");
fulldelete("$CFG->dataroot/cache/js");
}