MediaWiki REL1_37
|
The Registry loads JSON files, and uses a Processor to extract information from them. More...
Public Member Functions | |
clearQueue () | |
Clear the current load queue. | |
finish () | |
After this is called, no more extensions can be loaded. | |
getAllThings () | |
Get credits information about all installed extensions and skins. | |
getAttribute ( $name) | |
getQueue () | |
Get the current load queue. | |
isLoaded ( $name, $constraint=' *') | |
Whether a thing has been loaded. | |
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) | |
setLoadTestClassesAndNamespaces ( $load) | |
Controls if classes and namespaces defined under the keys TestAutoloadClasses and TestAutoloadNamespaces should be added to the autoloader. | |
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 | exportTestAutoloadClassesAndNamespaces ( $dir, $info, &$autoloadClasses=[], &$autoloadNamespaces=[]) |
Export test autoload classes and namespaces for a given directory and parsed JSON info file. | |
static | getInstance () |
Public Attributes | |
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 | |
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) | |
getLazyLoadedAttribute ( $name) | |
Get an attribute value that isn't cached by reading each extension.json file again. | |
saveToCache (BagOStuff $cache, array $data) | |
Save data in the cache. | |
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 | $lazyAttributes = [] |
Lazy-loaded attributes. | |
bool | $loadTestClassesAndNamespaces = false |
Whether test classes and namespaces should be added to the auto loader. | |
int[] | $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. | |
getCache () | |
getVaryHash () | |
Get the cache varying hash. | |
invalidateProcessCache () | |
Invalidate the cache of the vary hash and the lazy options. | |
makeCacheKey (BagOStuff $cache, $component,... $extra) | |
Private Attributes | |
bool | $finished = false |
Whether we are done loading things. | |
array[] | $loaded = [] |
Array of loaded things, keyed by name, values are credits information. | |
string null | $varyHash |
The hash of cache-varying options, lazy-initialised. | |
const | CACHE_EXPIRY = 60 * 60 * 24 |
const | CACHE_VERSION = 7 |
Bump whenever the registration cache needs resetting. | |
const | LAZY_LOADED_ATTRIBUTES |
Attributes that should be lazy-loaded. | |
Static Private Attributes | |
static ExtensionRegistry | $instance |
The Registry loads JSON files, and uses a Processor to extract information from them.
It also registers classes with the autoloader.
Definition at line 15 of file ExtensionRegistry.php.
|
private |
Queries information about the software environment and constructs an appropiate version checker.
Definition at line 335 of file ExtensionRegistry.php.
References MW_VERSION.
ExtensionRegistry::clearQueue | ( | ) |
Clear the current load queue.
Not intended to be used outside of the installer.
Definition at line 306 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 450 of file ExtensionRegistry.php.
References AutoLoader\$psr4Namespaces.
|
protected |
Definition at line 487 of file ExtensionRegistry.php.
References $path, AutoLoader\$psr4Namespaces, and wfArrayPlus2d().
|
static |
Export test autoload classes and namespaces for a given directory and parsed JSON info file.
string | $dir | |
array | $info | |
array | &$autoloadClasses | |
array | &$autoloadNamespaces |
Definition at line 473 of file ExtensionRegistry.php.
References AutoLoader\$psr4Namespaces.
ExtensionRegistry::finish | ( | ) |
After this is called, no more extensions can be loaded.
Definition at line 316 of file ExtensionRegistry.php.
|
private |
Get the list of abilities and their values.
Definition at line 324 of file ExtensionRegistry.php.
ExtensionRegistry::getAllThings | ( | ) |
Get credits information about all installed extensions and skins.
Definition at line 683 of file ExtensionRegistry.php.
ExtensionRegistry::getAttribute | ( | $name | ) |
|
private |
Definition at line 190 of file ExtensionRegistry.php.
|
static |
Definition at line 141 of file ExtensionRegistry.php.
|
protected |
Get an attribute value that isn't cached by reading each extension.json file again.
string | $name |
Definition at line 623 of file ExtensionRegistry.php.
References $cache.
ExtensionRegistry::getQueue | ( | ) |
Get the current load queue.
Not intended to be used outside of the installer.
Definition at line 298 of file ExtensionRegistry.php.
|
private |
Get the cache varying hash.
Definition at line 210 of file ExtensionRegistry.php.
References MW_VERSION.
|
private |
Invalidate the cache of the vary hash and the lazy options.
Definition at line 229 of file ExtensionRegistry.php.
Referenced by queue(), and setCheckDevRequires().
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 586 of file ExtensionRegistry.php.
ExtensionRegistry::loadFromQueue | ( | ) |
MWException | If the queue is already marked as finished (no further things should be loaded then). |
Definition at line 238 of file ExtensionRegistry.php.
References $cache.
|
private |
Definition at line 196 of file ExtensionRegistry.php.
References $cache.
|
staticprotected |
Fully expand autoloader paths.
string | $dir | |
string[] | $files |
Definition at line 694 of file ExtensionRegistry.php.
References $file.
ExtensionRegistry::queue | ( | $path | ) |
string | $path | Absolute path to the JSON file |
Definition at line 172 of file ExtensionRegistry.php.
References $path, $wgExtensionInfoMTime, and invalidateProcessCache().
ExtensionRegistry::readFromQueue | ( | array | $queue | ) |
Process a queue of extensions and return their extracted data.
int[] | $queue | keys are filenames, values are ignored |
Exception | |
ExtensionDependencyError |
Definition at line 359 of file ExtensionRegistry.php.
References $path, $queue, and wfDeprecatedMsg().
|
protected |
Save data in the cache.
BagOStuff | $cache | |
array | $data |
Definition at line 267 of file ExtensionRegistry.php.
References $cache, and $wgDevelopmentWarnings.
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 663 of file ExtensionRegistry.php.
ExtensionRegistry::setCheckDevRequires | ( | $check | ) |
bool | $check |
Definition at line 153 of file ExtensionRegistry.php.
References invalidateProcessCache().
ExtensionRegistry::setLoadTestClassesAndNamespaces | ( | $load | ) |
Controls if classes and namespaces defined under the keys TestAutoloadClasses and TestAutoloadNamespaces should be added to the autoloader.
bool | $load |
Definition at line 165 of file ExtensionRegistry.php.
|
protected |
Items in the JSON file that aren't being set as globals.
Definition at line 95 of file ExtensionRegistry.php.
|
protected |
Whether to check dev-requires.
Definition at line 123 of file ExtensionRegistry.php.
|
private |
Whether we are done loading things.
Definition at line 87 of file ExtensionRegistry.php.
|
staticprivate |
Definition at line 135 of file ExtensionRegistry.php.
|
protected |
Lazy-loaded attributes.
Definition at line 109 of file ExtensionRegistry.php.
|
private |
Array of loaded things, keyed by name, values are credits information.
The keys that the credit info arrays may have is defined by ExtensionProcessor::CREDIT_ATTRIBS (plus a 'path' key that points to the skin or extension JSON file).
This info may be accessed via ExtensionRegistry::getAllThings.
Definition at line 73 of file ExtensionRegistry.php.
|
protected |
Whether test classes and namespaces should be added to the auto loader.
Definition at line 130 of file ExtensionRegistry.php.
|
protected |
List of paths that should be loaded.
Definition at line 80 of file ExtensionRegistry.php.
|
protected |
Attributes for testing.
Definition at line 102 of file ExtensionRegistry.php.
|
private |
The hash of cache-varying options, lazy-initialised.
Definition at line 116 of file ExtensionRegistry.php.
|
private |
Definition at line 44 of file ExtensionRegistry.php.
|
private |
Bump whenever the registration cache needs resetting.
Definition at line 42 of file ExtensionRegistry.php.
|
private |
Attributes that should be lazy-loaded.
Definition at line 56 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 26 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 32 of file ExtensionRegistry.php.
const ExtensionRegistry::MEDIAWIKI_CORE = 'MediaWiki' |
"requires" key that applies to MediaWiki core
Definition at line 20 of file ExtensionRegistry.php.
const ExtensionRegistry::MERGE_STRATEGY = '_merge_strategy' |
Special key that defines the merge strategy.
Definition at line 51 of file ExtensionRegistry.php.
const ExtensionRegistry::OLDEST_MANIFEST_VERSION = 1 |
Version of the oldest supported manifest version.
Definition at line 37 of file ExtensionRegistry.php.