MediaWiki REL1_30
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)
 
 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

 handleExtensionDependency ( $dependencyName, $constraint, $checkedExt)
 Handle a dependency to another extension.
 
 handleMediaWikiDependency ( $constraint, $checkedExt)
 Handle a dependency to MediaWiki core.
 
 setCoreVersion ( $coreVersion)
 Set MediaWiki core version.
 

Private Attributes

Constraint bool $coreVersion = false
 representing $wgVersion
 
array $loaded = []
 Loaded extensions.
 
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)
Parameters
string$coreVersionCurrent version of core

Definition at line 51 of file VersionChecker.php.

References setCoreVersion().

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', 'extensions' => { 'FooBaz' => '>= 1.25.0' }, 'skins' => { 'BazBar' => '>= 1.0.0' } } }

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

Definition at line 105 of file VersionChecker.php.

References handleExtensionDependency(), handleMediaWikiDependency(), and ExtensionRegistry\MEDIAWIKI_CORE.

◆ handleExtensionDependency()

VersionChecker::handleExtensionDependency ( $dependencyName,
$constraint,
$checkedExt )
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
Returns
bool|string false for no errors, or a string message

Definition at line 169 of file VersionChecker.php.

References $e, and wfDebug().

Referenced by checkArray().

◆ handleMediaWikiDependency()

VersionChecker::handleMediaWikiDependency ( $constraint,
$checkedExt )
private

Handle a dependency to MediaWiki core.

It will check, if a MediaWiki version constraint was set with self::setCoreVersion before this call (if not, it will return an empty array) and checks the version constraint given against it.

Parameters
string$constraintThe required version constraint for this dependency
string$checkedExtThe Extension, which depends on this dependency
Returns
bool|string false if no error, or a string with the message

Definition at line 144 of file VersionChecker.php.

Referenced by checkArray().

◆ setCoreVersion()

VersionChecker::setCoreVersion ( $coreVersion)
private

Set MediaWiki core version.

Parameters
string$coreVersionCurrent version of core

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

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 41 of file VersionChecker.php.

◆ $versionParser

VersionParser VersionChecker::$versionParser
private

Definition at line 46 of file VersionChecker.php.


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