diff --git a/lib/javascript.php b/lib/javascript.php index 7a97dfc7ea8..998b8960544 100644 --- a/lib/javascript.php +++ b/lib/javascript.php @@ -79,7 +79,7 @@ $etag = sha1($rev.implode(',', $jsfiles)); // Use the caching only for meaningful revision numbers which prevents future cache poisoning. if ($rev > 0 and $rev < (time() + 60*60)) { - $candidate = $CFG->cachedir.'/js/'.$etag; + $candidate = $CFG->localcachedir.'/js/'.$etag; if (file_exists($candidate)) { if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) || !empty($_SERVER['HTTP_IF_MODIFIED_SINCE'])) { diff --git a/lib/outputlib.php b/lib/outputlib.php index 0aed961612e..08da9d89ea3 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -44,7 +44,6 @@ require_once($CFG->libdir.'/outputrequirementslib.php'); */ function theme_reset_all_caches() { global $CFG, $PAGE; - require_once("$CFG->libdir/filelib.php"); $next = time(); if (isset($CFG->themerev) and $next <= $CFG->themerev and $CFG->themerev - $next < 60*60) { @@ -55,7 +54,6 @@ function theme_reset_all_caches() { } set_config('themerev', $next); // time is unique even when you reset/switch database - fulldelete("$CFG->cachedir/theme"); if ($PAGE) { $PAGE->reload_theme(); diff --git a/lib/outputrequirementslib.php b/lib/outputrequirementslib.php index bce03a5001b..49551c09d45 100644 --- a/lib/outputrequirementslib.php +++ b/lib/outputrequirementslib.php @@ -1744,7 +1744,6 @@ class YUI_config { */ function js_reset_all_caches() { global $CFG; - require_once("$CFG->libdir/filelib.php"); $next = time(); if (isset($CFG->jsrev) and $next <= $CFG->jsrev and $CFG->jsrev - $next < 60*60) { @@ -1755,5 +1754,4 @@ function js_reset_all_caches() { } set_config('jsrev', $next); - fulldelete("$CFG->cachedir/js"); } diff --git a/theme/image.php b/theme/image.php index 9e4ba1bffa8..e3839b28b21 100644 --- a/theme/image.php +++ b/theme/image.php @@ -74,7 +74,7 @@ if (file_exists("$CFG->dirroot/theme/$themename/config.php")) { image_not_found(); } -$candidatelocation = "$CFG->cachedir/theme/$rev/$themename/pix/$component"; +$candidatelocation = "$CFG->localcachedir/theme/$rev/$themename/pix/$component"; $etag = sha1("$rev/$themename/$component/$image"); if ($rev > 0) { @@ -142,7 +142,7 @@ if ($themerev <= 0 or $rev != $themerev) { send_uncached_image($imagefile); } -make_cache_directory('theme', false); +make_localcache_directory('theme', false); // We're not using SVG and there is no cached version of this file (in any format). // As we're going to be caching a format other than svg, and because svg use is conditional we need to ensure that at the same diff --git a/theme/javascript.php b/theme/javascript.php index a5142374cfd..8c3457308a7 100644 --- a/theme/javascript.php +++ b/theme/javascript.php @@ -63,7 +63,7 @@ if (file_exists("$CFG->dirroot/theme/$themename/config.php")) { die('Theme was not found, sorry.'); } -$candidate = "$CFG->cachedir/theme/$rev/$themename/javascript_$type.js"; +$candidate = "$CFG->localcachedir/theme/$rev/$themename/javascript_$type.js"; $etag = sha1("$rev/$themename/$type"); if ($rev > 0 and file_exists($candidate)) { @@ -93,7 +93,7 @@ if ($themerev <= 0 or $rev != $themerev) { js_send_uncached($theme->javascript_content($type)); } -make_cache_directory('theme', false); +make_localcache_directory('theme', false); js_write_cache_file_content($candidate, js_minify($theme->javascript_files($type))); // Verify nothing failed in cache file creation. diff --git a/theme/styles.php b/theme/styles.php index f0129c3895b..0279b5177ea 100644 --- a/theme/styles.php +++ b/theme/styles.php @@ -87,7 +87,7 @@ if (file_exists("$CFG->dirroot/theme/$themename/config.php")) { die('Theme was not found, sorry.'); } -$candidatedir = "$CFG->cachedir/theme/$rev/$themename/css"; +$candidatedir = "$CFG->localcachedir/theme/$rev/$themename/css"; $etag = "$rev/$themename/$type"; $candidatename = $type; if (!$usesvg) { @@ -148,7 +148,7 @@ if ($themerev <= 0 or $themerev != $rev) { $etag = sha1($etag); } -make_cache_directory('theme', false); +make_localcache_directory('theme', false); if ($type === 'editor') { $cssfiles = $theme->editor_css_files();