MediaWiki REL1_33
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, array $abilities=[], array $abilityErrors=[])
 
 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

bool[] $abilities = []
 List of provided abilities.
 
string[] $abilityErrors = []
 List of provided ability errors.
 
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,
array $abilities = [],
array $abilityErrors = [] )
Parameters
string$coreVersionCurrent version of core
string$phpVersionCurrent PHP version
string[]$phpExtensionsList of installed PHP extensions
bool[]$abilitiesList of provided abilities
string[]$abilityErrorsError messages for the abilities

Definition at line 75 of file VersionChecker.php.

References $abilities, $abilityErrors, $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': '*', 'ability-bar': true }, 'extensions' => { 'FooBaz' => '>= 1.25.0' }, 'skins' => { 'BazBar' => '>= 1.0.0' } } }

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

Definition at line 156 of file VersionChecker.php.

References and(), 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 282 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 306 of file VersionChecker.php.

References $e, and and().

Referenced by checkArray().

◆ setCoreVersion()

VersionChecker::setCoreVersion ( $coreVersion)
private

Set MediaWiki core version.

Parameters
string$coreVersionCurrent version of core

Definition at line 104 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 93 of file VersionChecker.php.

References and().

◆ setPhpVersion()

VersionChecker::setPhpVersion ( $phpVersion)
private

Set PHP version.

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

Definition at line 122 of file VersionChecker.php.

References $phpVersion.

Referenced by __construct().

Member Data Documentation

◆ $abilities

bool [] VersionChecker::$abilities = []
private

List of provided abilities.

Definition at line 51 of file VersionChecker.php.

Referenced by __construct().

◆ $abilityErrors

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

List of provided ability errors.

Definition at line 56 of file VersionChecker.php.

Referenced by __construct().

◆ $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 61 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 66 of file VersionChecker.php.


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