From: Platonides Date: Sun, 6 Mar 2011 23:07:36 +0000 (+0000) Subject: Follow up r83140. Add a clear() method to ObjectCache so that it can be used by ForkC... X-Git-Tag: 1.31.0-rc.0~31586 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=9ced2d5c609d94245ba0522324d251c9ba529821;p=lhc%2Fweb%2Fwiklou.git Follow up r83140. Add a clear() method to ObjectCache so that it can be used by ForkController. --- 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. */