MediaWiki REL1_34
|
ExtensionRegistry class. More...
Public Member Functions | |
clearQueue () | |
Clear the current load queue. | |
finish () | |
After this is called, no more extensions can be loaded. | |
getAllThings () | |
Get information about all things. | |
getAttribute ( $name) | |
getQueue () | |
Get the current load queue. | |
isLoaded ( $name, $constraint=' *') | |
Whether a thing has been loaded. | |
load ( $path) | |
Loads and processes the given JSON file without delay. | |
loadFromQueue () | |
queue ( $path) | |
readFromQueue (array $queue) | |
Process a queue of extensions and return their extracted data. | |
setAttributeForTest ( $name, array $value) | |
Force override the value of an attribute during tests. | |
setCheckDevRequires ( $check) | |
Static Public Member Functions | |
static | exportAutoloadClassesAndNamespaces ( $dir, $info, &$autoloadClasses=[], &$autoloadNamespaces=[]) |
Export autoload classes and namespaces for a given directory and parsed JSON info file. | |
static | getInstance () |
Public Attributes | |
const | CACHE_VERSION = 7 |
Bump whenever the registration cache needs resetting. | |
const | MANIFEST_VERSION = 2 |
Version of the highest supported manifest version Note: Update MANIFEST_VERSION_MW_VERSION when changing this. | |
const | MANIFEST_VERSION_MW_VERSION = '>= 1.29.0' |
MediaWiki version constraint representing what the current highest MANIFEST_VERSION is supported in. | |
const | MEDIAWIKI_CORE = 'MediaWiki' |
"requires" key that applies to MediaWiki core/$wgVersion | |
const | MERGE_STRATEGY = '_merge_strategy' |
Special key that defines the merge strategy. | |
const | OLDEST_MANIFEST_VERSION = 1 |
Version of the oldest supported manifest version. | |
Protected Member Functions | |
exportExtractedData (array $info) | |
Static Protected Member Functions | |
static | processAutoLoader ( $dir, array $files) |
Fully expand autoloader paths. | |
Protected Attributes | |
array | $attributes = [] |
Items in the JSON file that aren't being set as globals. | |
bool | $checkDev = false |
Whether to check dev-requires. | |
array | $queued = [] |
List of paths that should be loaded. | |
array | $testAttributes = [] |
Attributes for testing. | |
Private Member Functions | |
buildVersionChecker () | |
Queries information about the software environment and constructs an appropiate version checker. | |
getAbilities () | |
Get the list of abilities and their values. | |
Private Attributes | |
bool | $finished = false |
Whether we are done loading things. | |
array | $loaded = [] |
Array of loaded things, keyed by name, values are credits information. | |
Static Private Attributes | |
static ExtensionRegistry | $instance |
ExtensionRegistry class.
The Registry loads JSON files, and uses a Processor to extract information from them. It also registers classes with the autoloader.
Definition at line 18 of file ExtensionRegistry.php.
|
private |
Queries information about the software environment and constructs an appropiate version checker.
Definition at line 242 of file ExtensionRegistry.php.
References $wgVersion, and getAbilities().
Referenced by readFromQueue().
ExtensionRegistry::clearQueue | ( | ) |
Clear the current load queue.
Not intended to be used outside of the installer.
Definition at line 214 of file ExtensionRegistry.php.
|
static |
Export autoload classes and namespaces for a given directory and parsed JSON info file.
string | $dir | |
array | $info | |
array | &$autoloadClasses | |
array | &$autoloadNamespaces |
Definition at line 353 of file ExtensionRegistry.php.
References $GLOBALS, and AutoLoader\$psr4Namespaces.
|
protected |
Definition at line 367 of file ExtensionRegistry.php.
References $GLOBALS, $path, AutoLoader\$psr4Namespaces, and wfArrayPlus2d().
Referenced by loadFromQueue().
ExtensionRegistry::finish | ( | ) |
After this is called, no more extensions can be loaded.
Definition at line 223 of file ExtensionRegistry.php.
|
private |
Get the list of abilities and their values.
Definition at line 231 of file ExtensionRegistry.php.
Referenced by buildVersionChecker(), and loadFromQueue().
ExtensionRegistry::getAllThings | ( | ) |
Get information about all things.
Definition at line 520 of file ExtensionRegistry.php.
ExtensionRegistry::getAttribute | ( | $name | ) |
|
static |
Definition at line 106 of file ExtensionRegistry.php.
Referenced by MediaWiki\Rest\EntryPoint\main().
ExtensionRegistry::getQueue | ( | ) |
Get the current load queue.
Not intended to be used outside of the installer.
Definition at line 206 of file ExtensionRegistry.php.
ExtensionRegistry::isLoaded | ( | $name, | |
$constraint = '*' |
|||
) |
Whether a thing has been loaded.
string | $name | |
string | $constraint | The required version constraint for this dependency |
LogicException | if a specific contraint is asked for, but the extension isn't versioned |
Definition at line 468 of file ExtensionRegistry.php.
ExtensionRegistry::load | ( | $path | ) |
Loads and processes the given JSON file without delay.
If some extensions are already queued, this will load those as well. TODO: Remove in MediaWiki 1.35
string | $path | Absolute path to the JSON file |
Definition at line 453 of file ExtensionRegistry.php.
References $path, loadFromQueue(), queue(), and wfDeprecated().
ExtensionRegistry::loadFromQueue | ( | ) |
MWException | If the queue is already marked as finished (no further things should be loaded then). |
Definition at line 147 of file ExtensionRegistry.php.
References $cache, $wgDevelopmentWarnings, $wgObjectCaches, $wgVersion, exportExtractedData(), getAbilities(), and readFromQueue().
Referenced by load().
|
staticprotected |
Fully expand autoloader paths.
string | $dir | |
array | $files |
Definition at line 531 of file ExtensionRegistry.php.
References $file.
ExtensionRegistry::queue | ( | $path | ) |
string | $path | Absolute path to the JSON file |
Definition at line 125 of file ExtensionRegistry.php.
References $path, and $wgExtensionInfoMTime.
Referenced by load().
ExtensionRegistry::readFromQueue | ( | array | $queue | ) |
Process a queue of extensions and return their extracted data.
array | $queue | keys are filenames, values are ignored |
Exception | |
ExtensionDependencyError |
Definition at line 267 of file ExtensionRegistry.php.
References $path, $queue, buildVersionChecker(), and wfDeprecated().
Referenced by loadFromQueue().
ExtensionRegistry::setAttributeForTest | ( | $name, | |
array | $value | ||
) |
Force override the value of an attribute during tests.
string | $name | Name of attribute to override |
array | $value | Value to set |
Definition at line 500 of file ExtensionRegistry.php.
ExtensionRegistry::setCheckDevRequires | ( | $check | ) |
|
protected |
Items in the JSON file that aren't being set as globals.
Definition at line 81 of file ExtensionRegistry.php.
|
protected |
Whether to check dev-requires.
Definition at line 95 of file ExtensionRegistry.php.
|
private |
Whether we are done loading things.
Definition at line 73 of file ExtensionRegistry.php.
|
staticprivate |
Definition at line 100 of file ExtensionRegistry.php.
|
private |
Array of loaded things, keyed by name, values are credits information.
Definition at line 59 of file ExtensionRegistry.php.
|
protected |
List of paths that should be loaded.
Definition at line 66 of file ExtensionRegistry.php.
|
protected |
Attributes for testing.
Definition at line 88 of file ExtensionRegistry.php.
const ExtensionRegistry::CACHE_VERSION = 7 |
Bump whenever the registration cache needs resetting.
Definition at line 45 of file ExtensionRegistry.php.
const ExtensionRegistry::MANIFEST_VERSION = 2 |
Version of the highest supported manifest version Note: Update MANIFEST_VERSION_MW_VERSION when changing this.
Definition at line 29 of file ExtensionRegistry.php.
const ExtensionRegistry::MANIFEST_VERSION_MW_VERSION = '>= 1.29.0' |
MediaWiki version constraint representing what the current highest MANIFEST_VERSION is supported in.
Definition at line 35 of file ExtensionRegistry.php.
const ExtensionRegistry::MEDIAWIKI_CORE = 'MediaWiki' |
"requires" key that applies to MediaWiki core/$wgVersion
Definition at line 23 of file ExtensionRegistry.php.
const ExtensionRegistry::MERGE_STRATEGY = '_merge_strategy' |
Special key that defines the merge strategy.
Definition at line 52 of file ExtensionRegistry.php.
const ExtensionRegistry::OLDEST_MANIFEST_VERSION = 1 |
Version of the oldest supported manifest version.
Definition at line 40 of file ExtensionRegistry.php.