diff --git a/cache/locallib.php b/cache/locallib.php index 22fc71316f9..8124fdc76a9 100644 --- a/cache/locallib.php +++ b/cache/locallib.php @@ -393,15 +393,9 @@ class cache_config_writer extends cache_config { * Returns a configuration array if it could not be saved. This is a bad situation. Check your error logs. */ public static function create_default_configuration($forcesave = false) { - global $CFG; - // HACK ALERT. // We probably need to come up with a better way to create the default stores, or at least ensure 100% that the // default store plugins are protected from deletion. - require_once($CFG->dirroot.'/cache/stores/file/lib.php'); - require_once($CFG->dirroot.'/cache/stores/session/lib.php'); - require_once($CFG->dirroot.'/cache/stores/static/lib.php'); - $writer = new self; $writer->configstores = self::get_default_stores(); $writer->configdefinitions = self::locate_definitions(); @@ -448,6 +442,12 @@ class cache_config_writer extends cache_config { * @return array */ protected static function get_default_stores() { + global $CFG; + + require_once($CFG->dirroot.'/cache/stores/file/lib.php'); + require_once($CFG->dirroot.'/cache/stores/session/lib.php'); + require_once($CFG->dirroot.'/cache/stores/static/lib.php'); + return array( 'default_application' => array( 'name' => 'default_application',