X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fregistration%2FExtensionRegistry.php;h=aae5fc28241549f822533e4cad5aa00ba6416ba7;hb=387bfb4f8e82fd94d1e43016ea2c6e54062dd169;hp=d14a5eeeb1f4cc3453e753f1bd8a4718ac1fe780;hpb=77d37c2487bc4eee88038acb0f6b2bd8810f9786;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index d14a5eeeb1..aae5fc2824 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -82,6 +82,7 @@ class ExtensionRegistry { private static $instance; /** + * @codeCoverageIgnore * @return ExtensionRegistry */ public static function getInstance() { @@ -105,9 +106,11 @@ class ExtensionRegistry { } else { throw new Exception( "$path does not exist!" ); } - if ( !$mtime ) { + // @codeCoverageIgnoreStart + if ( $mtime === false ) { $err = error_get_last(); throw new Exception( "Couldn't stat $path: {$err['message']}" ); + // @codeCoverageIgnoreEnd } } $this->queued[$path] = $mtime; @@ -199,6 +202,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; @@ -242,6 +246,7 @@ class ExtensionRegistry { } if ( isset( $info['AutoloadNamespaces'] ) ) { $autoloadNamespaces += $this->processAutoLoader( $dir, $info['AutoloadNamespaces'] ); + AutoLoader::$psr4Namespaces += $autoloadNamespaces; } // get all requirements/dependencies for this extension @@ -270,11 +275,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