MediaWiki  master
ComposerHookHandler.php
Go to the documentation of this file.
1 <?php
2 
3 use Composer\Package\Package;
4 use Composer\Script\Event;
5 
11 
12  private static function startAutoloader() {
13  $GLOBALS['IP'] = __DIR__ . '/../../';
14  require_once __DIR__ . '/../AutoLoader.php';
15  }
16 
17  public static function onPreUpdate( Event $event ) {
19  self::handleChangeEvent( $event );
20  }
21 
22  public static function onPreInstall( Event $event ) {
24  self::handleChangeEvent( $event );
25  }
26 
27  private static function handleChangeEvent( Event $event ) {
28  $package = $event->getComposer()->getPackage();
29 
30  if ( $package instanceof Package ) {
31  $packageModifier = new ComposerPackageModifier(
32  $package,
35  );
36 
37  $packageModifier->setProvidesMediaWiki();
38  }
39  }
40 
41 }
ComposerPackageModifier
Definition: ComposerPackageModifier.php:11
ComposerHookHandler\handleChangeEvent
static handleChangeEvent(Event $event)
Definition: ComposerHookHandler.php:27
ComposerHookHandler\onPreUpdate
static onPreUpdate(Event $event)
Definition: ComposerHookHandler.php:17
MediaWikiVersionFetcher
Provides access to MediaWiki's version without requiring MediaWiki (or anything else) being loaded fi...
Definition: MediaWikiVersionFetcher.php:9
ComposerHookHandler\startAutoloader
static startAutoloader()
Definition: ComposerHookHandler.php:12
ComposerVersionNormalizer
Definition: ComposerVersionNormalizer.php:7
ComposerHookHandler\onPreInstall
static onPreInstall(Event $event)
Definition: ComposerHookHandler.php:22
ComposerHookHandler
Definition: ComposerHookHandler.php:10