From 9ced2d5c609d94245ba0522324d251c9ba529821 Mon Sep 17 00:00:00 2001 From: Platonides Date: Sun, 6 Mar 2011 23:07:36 +0000 Subject: [PATCH] Follow up r83140. Add a clear() method to ObjectCache so that it can be used by ForkController. --- includes/ForkController.php | 4 ++-- includes/objectcache/ObjectCache.php | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/includes/ForkController.php b/includes/ForkController.php index e5b44c2b50..1cd49e76b5 100644 --- a/includes/ForkController.php +++ b/includes/ForkController.php @@ -115,10 +115,10 @@ class ForkController { } protected function prepareEnvironment() { - global $wgCaches, $wgMemc; + global $wgMemc; // Don't share DB or memcached connections wfGetLBFactory()->destroyInstance(); - $wgCaches = array(); + ObjectCache::clear(); unset( $wgMemc ); } diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index 5155c0da9a..118aadfe27 100644 --- a/includes/objectcache/ObjectCache.php +++ b/includes/objectcache/ObjectCache.php @@ -21,6 +21,13 @@ class ObjectCache { return $object; } + /** + * Clear all the cached instances. + */ + static function clear() { + self::$instances = array(); + } + /** * Create a new cache object of the specified type. */ -- 2.20.1