MDL-56602 themes: Use version number as base themerev

This commit is contained in:
Andrew Nicols
2016-11-10 08:02:31 +08:00
parent 7eb34671c1
commit 9d75a519f3
3 changed files with 58 additions and 1 deletions
+7 -1
View File
@@ -86,7 +86,13 @@ function theme_get_revision() {
if (empty($CFG->themedesignermode)) {
if (empty($CFG->themerev)) {
return -1;
// If theme designer mode is not set, and there is no themerev, this is almost certainly part of the installation.
// We attempt to set a themerev based on the Moodle version number to avoid costly rebuilds of the dynamic
// theme files between each page load.
$version = null;
require("{$CFG->dirroot}/version.php");
return version_to_timestamp($version);
} else {
return $CFG->themerev;
}