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