X-Git-Url: http://git.cyclocoop.org/%28?a=blobdiff_plain;f=includes%2Fregistration%2FExtensionRegistry.php;h=c91d6d6e859db165f62a184f765cdb89759a4169;hb=e3e6be734f8cac8bce7cff7cde86a920b7ca0fb1;hp=18766453999873194985d2f44835ce73f87c8c15;hpb=ee56f00ddf0609082f8ae9a4dc3e6e1b6f54ddfd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index 1876645399..c91d6d6e85 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -1,7 +1,5 @@ getLocalServerObjectCache(); + // Don't use MediaWikiServices here to prevent instantiating it before extensions have + // been loaded + $cacheId = ObjectCache::detectLocalServerCache(); + $cache = ObjectCache::newFromId( $cacheId ); } catch ( MWException $e ) { $cache = new EmptyBagOStuff(); } @@ -202,6 +203,7 @@ class ExtensionRegistry { * @param array $queue keys are filenames, values are ignored * @return array extracted info * @throws Exception + * @throws ExtensionDependencyError */ public function readFromQueue( array $queue ) { global $wgVersion; @@ -245,6 +247,7 @@ class ExtensionRegistry { } if ( isset( $info['AutoloadNamespaces'] ) ) { $autoloadNamespaces += $this->processAutoLoader( $dir, $info['AutoloadNamespaces'] ); + AutoLoader::$psr4Namespaces += $autoloadNamespaces; } // get all requirements/dependencies for this extension @@ -273,11 +276,7 @@ class ExtensionRegistry { ); if ( $incompatible ) { - if ( count( $incompatible ) === 1 ) { - throw new Exception( $incompatible[0] ); - } else { - throw new Exception( implode( "\n", $incompatible ) ); - } + throw new ExtensionDependencyError( $incompatible ); } // Need to set this so we can += to it later