Skip to content

Commit

Permalink
MDL-36047 cache: Fixed up issues with PHP 5.3.2 and 5.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Oct 15, 2012
1 parent 61bfc2c commit d479717
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cache/classes/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion cache/classes/loaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions cache/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d479717

Please sign in to comment.