PHPSessionHandler: Implement SessionHandlerInterface
[mediawiki.git] / includes / composer / ComposerHookHandler.php
blob2587b1d850461d6b636da66b7fe4222841370225
1 <?php
3 use Composer\Package\Package;
4 use Composer\Script\Event;
6 $GLOBALS['IP'] = __DIR__ . '/../../';
7 require_once __DIR__ . '/../AutoLoader.php';
9 /**
10 * @licence GNU GPL v2+
11 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
13 class ComposerHookHandler {
15 public static function onPreUpdate( Event $event ) {
16 self::handleChangeEvent( $event );
19 public static function onPreInstall( Event $event ) {
20 self::handleChangeEvent( $event );
23 private static function handleChangeEvent( Event $event ) {
24 $package = $event->getComposer()->getPackage();
26 if ( $package instanceof Package ) {
27 $packageModifier = new ComposerPackageModifier(
28 $package,
29 new ComposerVersionNormalizer(),
30 new MediaWikiVersionFetcher()
33 $packageModifier->setProvidesMediaWiki();