Skip to content

Commit

Permalink
MDL-39602 cache: Move the includes for default stores
Browse files Browse the repository at this point in the history
Putting them inside the function get_default_stores ensures
that they will be included from anywhere that calls get_default_stores.
  • Loading branch information
Damyon Wiese committed May 10, 2013
1 parent 1922147 commit 969eaa3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cache/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,15 +393,9 @@ public function delete_store_instance($name) {
* 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();
Expand Down Expand Up @@ -448,6 +442,12 @@ public static function create_default_configuration($forcesave = false) {
* @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',
Expand Down

0 comments on commit 969eaa3

Please sign in to comment.