13 private static function startAutoloader() {
14 $GLOBALS[
'IP'] = __DIR__ .
'/../../';
15 require_once __DIR__ .
'/../AutoLoader.php';
19 self::checkMergePluginActive( $event );
20 self::startAutoloader();
21 self::handleChangeEvent( $event );
32 private static function checkMergePluginActive( Event $event ) {
33 if ( version_compare( PluginInterface::PLUGIN_API_VERSION,
'2.0.0',
'>=' ) ) {
34 foreach ( $event->getComposer()->getPluginManager()->getPlugins() as $plugin ) {
35 if ( $plugin instanceof \
Wikimedia\Composer\Merge\V2\MergePlugin ) {
42 if ( $plugin instanceof \
Wikimedia\Composer\MergePlugin ) {
43 throw new \Exception(
"wikimedia/composer-merge-plugin 2.x is not activated. " .
44 "Use Composer 1.x to update wikimedia/composer-merge-plugin to version " .
45 "2.x before running Composer 2.x." );
52 self::startAutoloader();
53 self::handleChangeEvent( $event );
56 private static function handleChangeEvent( Event $event ) {
57 $package = $event->getComposer()->getPackage();
59 if ( $package instanceof Package ) {
66 $packageModifier->setProvidesMediaWiki();