X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fregistration%2FExtensionProcessor.php;h=6ac25e8414e336b875b3e23113db9380552ca61c;hb=f27f087fa7be8c267e472645812d141892ff5930;hp=84e873dd6cdc107ca90ddd1c049d8acdf468d1a1;hpb=10973705e0429fc6d909c4995f55179381c906b7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index 84e873dd6c..6ac25e8414 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -23,6 +23,7 @@ class ExtensionProcessor implements Processor { 'AvailableRights', 'ContentHandlers', 'ConfigRegistry', + 'CentralIdLookupProviders', 'RateLimits', 'RecentChangesFlags', 'MediaHandlers', @@ -44,6 +45,7 @@ class ExtensionProcessor implements Processor { 'APIPropModules', 'APIListModules', 'ValidSkinNames', + 'FeedClasses', ); /** @@ -57,13 +59,13 @@ class ExtensionProcessor implements Processor { 'wgGroupPermissions' => 'array_plus_2d', 'wgRevokePermissions' => 'array_plus_2d', 'wgHooks' => 'array_merge_recursive', - // credits are handled in the ExtensionRegistry - // 'wgExtensionCredits' => 'array_merge_recursive', + 'wgExtensionCredits' => 'array_merge_recursive', 'wgExtraGenderNamespaces' => 'array_plus', 'wgNamespacesWithSubpages' => 'array_plus', 'wgNamespaceContentModels' => 'array_plus', 'wgNamespaceProtection' => 'array_plus', 'wgCapitalLinkOverrides' => 'array_plus', + 'wgRateLimits' => 'array_plus_2d', ); /** @@ -102,6 +104,7 @@ class ExtensionProcessor implements Processor { 'ParserTestFiles', 'AutoloadClasses', 'manifest_version', + 'load_composer_autoloader', ); /** @@ -293,6 +296,11 @@ class ExtensionProcessor implements Processor { } } + /** + * @param string $path + * @param array $info + * @throws Exception + */ protected function extractCredits( $path, array $info ) { $credits = array( 'path' => $path, @@ -304,7 +312,18 @@ class ExtensionProcessor implements Processor { } } - $this->credits[$credits['name']] = $credits; + $name = $credits['name']; + + // If someone is loading the same thing twice, throw + // a nice error (T121493) + if ( isset( $this->credits[$name] ) ) { + $firstPath = $this->credits[$name]['path']; + $secondPath = $credits['path']; + throw new Exception( "It was attempted to load $name twice, from $firstPath and $secondPath." ); + } + + $this->credits[$name] = $credits; + $this->globals['wgExtensionCredits'][$credits['type']][] = $credits; } /** @@ -353,4 +372,15 @@ class ExtensionProcessor implements Processor { $array[$name] = $value; } } + + public function getExtraAutoloaderPaths( $dir, array $info ) { + $paths = array(); + if ( isset( $info['load_composer_autoloader'] ) && $info['load_composer_autoloader'] === true ) { + $path = "$dir/vendor/autoload.php"; + if ( file_exists( $path ) ) { + $paths[] = $path; + } + } + return $paths; + } }