MediaWiki
REL1_30
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
13
class
ComposerHookHandler
{
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,
29
new
ComposerVersionNormalizer
(),
30
new
MediaWikiVersionFetcher
()
31
);
32
33
$packageModifier->setProvidesMediaWiki();
34
}
35
}
36
37
}
$GLOBALS
$GLOBALS['IP']
Definition
ComposerHookHandler.php:6
ComposerHookHandler
@licence GNU GPL v2+
Definition
ComposerHookHandler.php:13
ComposerHookHandler\handleChangeEvent
static handleChangeEvent(Event $event)
Definition
ComposerHookHandler.php:23
ComposerHookHandler\onPreInstall
static onPreInstall(Event $event)
Definition
ComposerHookHandler.php:19
ComposerHookHandler\onPreUpdate
static onPreUpdate(Event $event)
Definition
ComposerHookHandler.php:15
ComposerPackageModifier
@licence GNU GPL v2+
Definition
ComposerPackageModifier.php:11
ComposerVersionNormalizer
@licence GNU GPL v2+
Definition
ComposerVersionNormalizer.php:7
MediaWikiVersionFetcher
Provides access to MediaWiki's version without requiring MediaWiki (or anything else) being loaded fi...
Definition
MediaWikiVersionFetcher.php:9
includes
composer
ComposerHookHandler.php
Generated on Mon Nov 25 2024 15:42:12 for MediaWiki by
1.10.0