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