MediaWiki  1.23.2
ComposerPackageModifier.php
Go to the documentation of this file.
1 <?php
2 
3 use Composer\Package\Link;
4 use Composer\Package\LinkConstraint\VersionConstraint;
5 use Composer\Package\Package;
6 
12 
13  const MEDIAWIKI_PACKAGE_NAME = 'mediawiki/mediawiki';
14 
15  protected $package;
16  protected $versionNormalizer;
17  protected $versionFetcher;
18 
20  $this->package = $package;
21  $this->versionNormalizer = $versionNormalizer;
22  $this->versionFetcher = $versionFetcher;
23  }
24 
25  public function setProvidesMediaWiki() {
26  $this->setLinkAsProvides( $this->newMediaWikiLink() );
27  }
28 
29  private function setLinkAsProvides( Link $link ) {
30  $this->package->setProvides( array( $link ) );
31  }
32 
33  private function newMediaWikiLink() {
35 
36  $link = new Link(
37  '__root__',
38  self::MEDIAWIKI_PACKAGE_NAME,
39  $version,
40  'provides',
41  $version->getPrettyString()
42  );
43 
44  return $link;
45  }
46 
47  private function getMediaWikiVersionConstraint() {
48  $mvVersion = $this->versionFetcher->fetchVersion();
49  $mvVersion = $this->versionNormalizer->normalizeSuffix( $mvVersion );
50 
51  $version = new VersionConstraint( '==', $this->versionNormalizer->normalizeLevelCount( $mvVersion ) );
52  $version->setPrettyString( $mvVersion );
53 
54  return $version;
55  }
56 
57 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
ComposerPackageModifier\setProvidesMediaWiki
setProvidesMediaWiki()
Definition: ComposerPackageModifier.php:25
ComposerPackageModifier\setLinkAsProvides
setLinkAsProvides(Link $link)
Definition: ComposerPackageModifier.php:29
$link
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
Definition: hooks.txt:2149
ComposerPackageModifier\$versionFetcher
$versionFetcher
Definition: ComposerPackageModifier.php:17
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
ComposerPackageModifier
@licence GNU GPL v2+
Definition: ComposerPackageModifier.php:11
ComposerPackageModifier\$package
$package
Definition: ComposerPackageModifier.php:15
ComposerPackageModifier\MEDIAWIKI_PACKAGE_NAME
const MEDIAWIKI_PACKAGE_NAME
Definition: ComposerPackageModifier.php:13
$version
$version
Definition: parserTests.php:86
ComposerPackageModifier\__construct
__construct(Package $package, ComposerVersionNormalizer $versionNormalizer, MediaWikiVersionFetcher $versionFetcher)
Definition: ComposerPackageModifier.php:19
MediaWikiVersionFetcher
Provides access to MediaWiki's version without requiring MediaWiki (or anything else) being loaded fi...
Definition: MediaWikiVersionFetcher.php:10
ComposerPackageModifier\getMediaWikiVersionConstraint
getMediaWikiVersionConstraint()
Definition: ComposerPackageModifier.php:47
ComposerPackageModifier\$versionNormalizer
$versionNormalizer
Definition: ComposerPackageModifier.php:16
ComposerVersionNormalizer
@licence GNU GPL v2+
Definition: ComposerVersionNormalizer.php:7
ComposerPackageModifier\newMediaWikiLink
newMediaWikiLink()
Definition: ComposerPackageModifier.php:33