MediaWiki REL1_32
VersionChecker Class Reference

Provides functions to check a set of extensions with dependencies against a set of loaded extensions and given version information. More...

Collaboration diagram for VersionChecker:

Public Member Functions

 __construct ( $coreVersion, $phpVersion, array $phpExtensions)
 
 checkArray (array $extDependencies)
 Check all given dependencies if they are compatible with the named installed extensions in the $credits array.
 
 setLoadedExtensionsAndSkins (array $credits)
 Set an array with credits of all loaded extensions and skins.
 

Private Member Functions

 handleDependency ( $version, $constraint, $checkedExt)
 Handle a simple dependency to MediaWiki core or PHP.
 
 handleExtensionDependency ( $dependencyName, $constraint, $checkedExt, $type)
 Handle a dependency to another extension.
 
 setCoreVersion ( $coreVersion)
 Set MediaWiki core version.
 
 setPhpVersion ( $phpVersion)
 Set PHP version.
 

Private Attributes

Constraint bool $coreVersion = false
 representing $wgVersion
 
array $loaded = []
 Loaded extensions.
 
string[] $phpExtensions = []
 List of installed PHP extensions.
 
Constraint bool $phpVersion = false
 representing PHP version
 
VersionParser $versionParser
 

Detailed Description

Provides functions to check a set of extensions with dependencies against a set of loaded extensions and given version information.

Since
1.29

Definition at line 32 of file VersionChecker.php.

Constructor & Destructor Documentation

◆ __construct()

VersionChecker::__construct (   $coreVersion,
  $phpVersion,
array  $phpExtensions 
)
Parameters
string$coreVersionCurrent version of core
string$phpVersionCurrent PHP version
string[]$phpExtensionsList of installed PHP extensions

Definition at line 63 of file VersionChecker.php.

References $phpExtensions, setCoreVersion(), and setPhpVersion().

Member Function Documentation

◆ checkArray()

VersionChecker::checkArray ( array  $extDependencies)

Check all given dependencies if they are compatible with the named installed extensions in the $credits array.

Example $extDependencies: { 'FooBar' => { 'MediaWiki' => '>= 1.25.0', 'platform': { 'php': '>= 7.0.0', 'ext-foo': '*' }, 'extensions' => { 'FooBaz' => '>= 1.25.0' }, 'skins' => { 'BazBar' => '>= 1.0.0' } } }

Parameters
array$extDependenciesAll extensions that depend on other ones
Returns
array

Definition at line 138 of file VersionChecker.php.

References as, handleDependency(), handleExtensionDependency(), and ExtensionRegistry\MEDIAWIKI_CORE.

◆ handleDependency()

VersionChecker::handleDependency (   $version,
  $constraint,
  $checkedExt 
)
private

Handle a simple dependency to MediaWiki core or PHP.

See handleMediaWikiDependency and handlePhpDependency for details.

Parameters
Constraint | bool$versionThe version installed
string$constraintThe required version constraint for this dependency
string$checkedExtThe Extension, which depends on this dependency
Returns
bool false if no error, true else

Definition at line 233 of file VersionChecker.php.

Referenced by checkArray().

◆ handleExtensionDependency()

VersionChecker::handleExtensionDependency (   $dependencyName,
  $constraint,
  $checkedExt,
  $type 
)
private

Handle a dependency to another extension.

Parameters
string$dependencyNameThe name of the dependency
string$constraintThe required version constraint for this dependency
string$checkedExtThe Extension, which depends on this dependency
string$typeEither 'extensions' or 'skins'
Returns
bool|array false for no errors, or an array of info

Definition at line 257 of file VersionChecker.php.

References $e.

Referenced by checkArray().

◆ setCoreVersion()

VersionChecker::setCoreVersion (   $coreVersion)
private

Set MediaWiki core version.

Parameters
string$coreVersionCurrent version of core

Definition at line 87 of file VersionChecker.php.

References $coreVersion, and $e.

Referenced by __construct().

◆ setLoadedExtensionsAndSkins()

VersionChecker::setLoadedExtensionsAndSkins ( array  $credits)

Set an array with credits of all loaded extensions and skins.

Parameters
array$creditsAn array of installed extensions with credits of them
Returns
VersionChecker $this

Definition at line 76 of file VersionChecker.php.

◆ setPhpVersion()

VersionChecker::setPhpVersion (   $phpVersion)
private

Set PHP version.

Parameters
string$phpVersionCurrent PHP version. Must be well-formed.
Exceptions
UnexpectedValueException

Definition at line 105 of file VersionChecker.php.

References $phpVersion.

Referenced by __construct().

Member Data Documentation

◆ $coreVersion

Constraint bool VersionChecker::$coreVersion = false
private

representing $wgVersion

Definition at line 36 of file VersionChecker.php.

Referenced by setCoreVersion().

◆ $loaded

array VersionChecker::$loaded = []
private

Loaded extensions.

Definition at line 51 of file VersionChecker.php.

◆ $phpExtensions

string [] VersionChecker::$phpExtensions = []
private

List of installed PHP extensions.

Definition at line 46 of file VersionChecker.php.

Referenced by __construct().

◆ $phpVersion

Constraint bool VersionChecker::$phpVersion = false
private

representing PHP version

Definition at line 41 of file VersionChecker.php.

Referenced by setPhpVersion().

◆ $versionParser

VersionParser VersionChecker::$versionParser
private

Definition at line 56 of file VersionChecker.php.


The documentation for this class was generated from the following file: