MDL-39554 cache: forced sharing options for static + request

This commit is contained in:
Sam Hemelryk 2013-05-08 10:56:55 +12:00
parent 5df9bc3998
commit bd12f745b7

View file

@ -231,6 +231,13 @@ class cache_config {
// Invalid cache mode used for the definition.
continue;
}
if ($conf['mode'] === cache_store::MODE_SESSION || $conf['mode'] === cache_store::MODE_REQUEST) {
// We force this for session and request caches.
// They are only allowed to use the default as we don't want people changing them.
$conf['sharingoptions'] = cache_definition::SHARING_DEFAULT;
$conf['selectedsharingoption'] = cache_definition::SHARING_DEFAULT;
$conf['userinputsharingkey'] = '';
} else {
// Default the sharing option as it was added for 2.5.
// This can be removed sometime after 2.5 is the minimum version someone can upgrade from.
if (!isset($conf['sharingoptions'])) {
@ -246,6 +253,7 @@ class cache_config {
if (!isset($conf['userinputsharingkey'])) {
$conf['userinputsharingkey'] = '';
}
}
$this->configdefinitions[$id] = $conf;
}