Permalink
Browse files

MDL-36047 cache: Fixed up issues with PHP 5.3.2 and 5.3.7

  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed Oct 15, 2012
1 parent 61bfc2c commit d4797177b524050fbfab3dfc36d063157cc5890d
Showing with 5 additions and 4 deletions.
  1. +1 −1 cache/classes/config.php
  2. +1 −1 cache/classes/loaders.php
  3. +3 −2 cache/locallib.php
View
@@ -170,7 +170,7 @@ public function load() {
$plugin = $store['plugin'];
$class = 'cachestore_'.$plugin;
$exists = array_key_exists($plugin, $availableplugins);
- if (!$exists && (!class_exists($class) || !is_subclass_of($class, 'cache_store'))) {
+ if (!$exists) {
// Not a valid plugin, or has been uninstalled, just skip it an carry on.
debugging('Invalid cache store in config. Not an available plugin.', DEBUG_DEVELOPER);
continue;
@@ -40,7 +40,7 @@
* @copyright 2012 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class cache implements cache_loader, cache_is_key_aware {
+class cache implements cache_loader {
/**
* We need a timestamp to use within the cache API.
View
@@ -136,7 +136,8 @@ public function add_store_instance($name, $plugin, array $configuration = array(
throw new cache_exception('Invalid cache plugin specified. The plugin does not contain the required class.');
}
}
- if (!is_subclass_of($class, 'cache_store')) {
+ $reflection = new ReflectionClass($class);
+ if (!$reflection->implementsInterface('cache_store')) {
throw new cache_exception('Invalid cache plugin specified. The plugin does not extend the required class.');
}
if (!$class::are_requirements_met()) {
@@ -400,7 +401,7 @@ protected static function locate_definitions() {
$definition['component'] = $component;
$definition['area'] = $area;
if (array_key_exists($id, $definitions)) {
- debugging('Error: duplicate cache definition found with name '.$name, DEBUG_DEVELOPER);
+ debugging('Error: duplicate cache definition found with id: '.$id, DEBUG_DEVELOPER);
continue;
}
$definitions[$id] = $definition;

0 comments on commit d479717

Please sign in to comment.