mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-21435 sending JS cache to cache/js instead of temp; adding purging of JS caches
This commit is contained in:
parent
6b2ad29acb
commit
09c48cea8b
2 changed files with 8 additions and 2 deletions
|
@ -64,10 +64,16 @@ minify($jsfiles);
|
||||||
function minify($files) {
|
function minify($files) {
|
||||||
global $CFG;
|
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')) {
|
if (0 === stripos(PHP_OS, 'win')) {
|
||||||
Minify::setDocRoot(); // IIS may need help
|
Minify::setDocRoot(); // IIS may need help
|
||||||
}
|
}
|
||||||
Minify::setCache($CFG->dataroot.'/temp', true);
|
Minify::setCache($cachedir, true);
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
// Maximum age to cache
|
// Maximum age to cache
|
||||||
|
|
|
@ -1004,6 +1004,6 @@ function js_reset_all_caches() {
|
||||||
require_once("$CFG->libdir/filelib.php");
|
require_once("$CFG->libdir/filelib.php");
|
||||||
|
|
||||||
set_config('jsrev', empty($CFG->jsrev) ? 1 : $CFG->jsrev+1);
|
set_config('jsrev', empty($CFG->jsrev) ? 1 : $CFG->jsrev+1);
|
||||||
//fulldelete("$CFG->dataroot/cache/js");
|
fulldelete("$CFG->dataroot/cache/js");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue