X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fregistration%2FExtensionProcessor.php;h=1212f9972cba8ce42424f2bd385ce7d71ed7d76c;hb=39fb8a4f531256e122fa4c01d4417d23d168f299;hp=207f88423e0f396a5fcdddc9a800281e8b7eff3c;hpb=2c0db8f5e8593a51ae0acc8285fd40b7743b0fce;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index 207f88423e..1212f9972c 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -141,6 +141,7 @@ class ExtensionProcessor implements Processor { /** * Things to be called once registration of these extensions are done + * keyed by the name of the extension that it belongs to * * @var callable[] */ @@ -180,11 +181,11 @@ class ExtensionProcessor implements Processor { $this->extractResourceLoaderModules( $dir, $info ); $this->extractServiceWiringFiles( $dir, $info ); $this->extractParserTestFiles( $dir, $info ); + $name = $this->extractCredits( $path, $info ); if ( isset( $info['callback'] ) ) { - $this->callbacks[] = $info['callback']; + $this->callbacks[$name] = $info['callback']; } - $this->extractCredits( $path, $info ); foreach ( $info as $key => $val ) { if ( in_array( $key, self::$globalSettings ) ) { $this->storeToArray( $path, "wg$key", $val, $this->globals ); @@ -215,13 +216,7 @@ class ExtensionProcessor implements Processor { } public function getRequirements( array $info ) { - $requirements = []; - $key = ExtensionRegistry::MEDIAWIKI_CORE; - if ( isset( $info['requires'][$key] ) ) { - $requirements[$key] = $info['requires'][$key]; - } - - return $requirements; + return isset( $info['requires'] ) ? $info['requires'] : []; } protected function extractHooks( array $info ) { @@ -335,6 +330,7 @@ class ExtensionProcessor implements Processor { /** * @param string $path * @param array $info + * @return string Name of thing * @throws Exception */ protected function extractCredits( $path, array $info ) { @@ -360,6 +356,8 @@ class ExtensionProcessor implements Processor { $this->credits[$name] = $credits; $this->globals['wgExtensionCredits'][$credits['type']][] = $credits; + + return $name; } /**