MediaWiki  master
ComposerHookHandler.php
Go to the documentation of this file.
1 <?php
2 
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 }
static handleChangeEvent(Event $event)
Provides access to MediaWiki&#39;s version without requiring MediaWiki (or anything else) being loaded fi...
$GLOBALS['IP']
static onPreInstall(Event $event)
static onPreUpdate(Event $event)