]> git.mjollnir.org Git - moodle.git/commitdiff
lib/setup: restore sanity to rcache handling
authormartinlanghoff <martinlanghoff>
Sun, 6 Jan 2008 22:56:07 +0000 (22:56 +0000)
committermartinlanghoff <martinlanghoff>
Sun, 6 Jan 2008 22:56:07 +0000 (22:56 +0000)
$CFG->rcache is safe to keep, even as we are reading the config table.

This is because whenever we update the config table, all the rcache
plugins either mark the cache as dirty or they update the cache.

The reason we want to be able to preserve this is that rcache settings
in CFG should usually be set in config.php rather than in the config
table.

With this fix, we support both control points.

lib/setup.php

index 65f20e36d08321d731804547b29af5b1a6c4399e..98c5909b0cc710cb545a7ca590d3ed76775bbc00 100644 (file)
@@ -211,7 +211,6 @@ global $HTTPSPAGEREQUIRED;
     configure_dbconnection();
 
 /// Load up any configuration from the config table
-    unset($CFG->rcache);
     $CFG = get_config();
 
 /// Turn on SQL logging if required
@@ -286,9 +285,7 @@ global $HTTPSPAGEREQUIRED;
 /// Ensure we define rcache - so we can later check for it
 /// with a really fast and unambiguous $CFG->rcache === false
     if (!empty($CFG->cachetype)) {
-        if (array_key_exists('rcache', $CFG->config_php_settings)) {
-            $CFG->rcache = (bool)$CFG->config_php_settings['rcache']; // always use config.php setting if present
-        } else if (empty($CFG->rcache)) {
+        if (empty($CFG->rcache)) {
             $CFG->rcache = false;
         } else {
             $CFG->rcache = true;