'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',
'ParserTestFiles',
'AutoloadClasses',
'manifest_version',
+ 'load_composer_autoloader',
);
/**
}
}
+ /**
+ * @param string $path
+ * @param array $info
+ * @throws Exception
+ */
protected function extractCredits( $path, array $info ) {
$credits = array(
'path' => $path,
}
}
- $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;
}
/**
$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;
+ }
}