Follow up r83140. Add a clear() method to ObjectCache so that it can be used by ForkC...
authorPlatonides <platonides@users.mediawiki.org>
Sun, 6 Mar 2011 23:07:36 +0000 (23:07 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sun, 6 Mar 2011 23:07:36 +0000 (23:07 +0000)
includes/ForkController.php
includes/objectcache/ObjectCache.php

index e5b44c2..1cd49e7 100644 (file)
@@ -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 );
        }
 
index 5155c0d..118aadf 100644 (file)
@@ -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.
         */