MediaWiki
1.33.0
|
ExtensionRegistry class. More...
Public Member Functions | |
clearQueue () | |
Clear the current load queue. More... | |
finish () | |
After this is called, no more extensions can be loaded. More... | |
getAllThings () | |
Get information about all things. More... | |
getAttribute ( $name) | |
getQueue () | |
Get the current load queue. More... | |
isLoaded ( $name, $constraint=' *') | |
Whether a thing has been loaded. More... | |
load ( $path) | |
Loads and processes the given JSON file without delay. More... | |
loadFromQueue () | |
queue ( $path) | |
readFromQueue (array $queue) | |
Process a queue of extensions and return their extracted data. More... | |
setAttributeForTest ( $name, array $value) | |
Force override the value of an attribute during tests. More... | |
Static Public Member Functions | |
static | getInstance () |
Public Attributes | |
const | CACHE_VERSION = 7 |
Bump whenever the registration cache needs resetting. More... | |
const | MANIFEST_VERSION = 2 |
Version of the highest supported manifest version Note: Update MANIFEST_VERSION_MW_VERSION when changing this. More... | |
const | MANIFEST_VERSION_MW_VERSION = '>= 1.29.0' |
MediaWiki version constraint representing what the current highest MANIFEST_VERSION is supported in. More... | |
const | MEDIAWIKI_CORE = 'MediaWiki' |
"requires" key that applies to MediaWiki core/$wgVersion More... | |
const | MERGE_STRATEGY = '_merge_strategy' |
Special key that defines the merge strategy. More... | |
const | OLDEST_MANIFEST_VERSION = 1 |
Version of the oldest supported manifest version. More... | |
Protected Member Functions | |
exportExtractedData (array $info) | |
processAutoLoader ( $dir, array $files) | |
Fully expand autoloader paths. More... | |
Protected Attributes | |
array | $attributes = [] |
Items in the JSON file that aren't being set as globals. More... | |
array | $queued = [] |
List of paths that should be loaded. More... | |
array | $testAttributes = [] |
Attributes for testing. More... | |
Private Member Functions | |
buildVersionChecker () | |
Queries information about the software environment and constructs an appropiate version checker. More... | |
getAbilities () | |
Get the list of abilities and their values. More... | |
Private Attributes | |
bool | $finished = false |
Whether we are done loading things. More... | |
array | $loaded = [] |
Array of loaded things, keyed by name, values are credits information. More... | |
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 17 of file ExtensionRegistry.php.
|
private |
Queries information about the software environment and constructs an appropiate version checker.
Definition at line 228 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 200 of file ExtensionRegistry.php.
|
protected |
Definition at line 334 of file ExtensionRegistry.php.
References $GLOBALS, $name, $path, AutoLoader\$psr4Namespaces, as, MERGE_STRATEGY, and wfArrayPlus2d().
Referenced by loadFromQueue().
ExtensionRegistry::finish | ( | ) |
After this is called, no more extensions can be loaded.
Definition at line 209 of file ExtensionRegistry.php.
|
private |
Get the list of abilities and their values.
Definition at line 217 of file ExtensionRegistry.php.
Referenced by buildVersionChecker(), and loadFromQueue().
ExtensionRegistry::getAllThings | ( | ) |
Get information about all things.
Definition at line 485 of file ExtensionRegistry.php.
References $loaded.
ExtensionRegistry::getAttribute | ( | $name | ) |
string | $name |
Definition at line 452 of file ExtensionRegistry.php.
References $name.
|
static |
Definition at line 98 of file ExtensionRegistry.php.
References $instance.
Referenced by ExtensionsTestSuite\__construct(), Maintenance\checkRequiredExtensions(), WikiEditorHooks\doEventLogging(), CodeEditorHooks\editPageShowEditFormInitial(), WikiEditorHooks\editPageShowEditFormInitial(), MWNamespace\getCanonicalNamespaces(), MultimediaViewerHooks\getModulesForArticle(), ApiBase\getModuleSourceInfo(), getSkinThemeMap(), TrackingCategories\getTrackingCategories(), SpamBlacklist\isLoggingEnabled(), DatabaseUpdater\loadExtensions(), SpamBlacklist\logFilterHit(), onContentGetParserOutput(), CiteHooks\onResourceLoaderRegisterModules(), onResourceLoaderRegisterModules(), ExtensionJsonValidationTest\providePassesValidation(), SkinMonoBook\registerMobileExtensionStyles(), CaptchaTest\setCaptchaTriggersAttribute(), ExtensionJsonValidationTest\setUp(), SkinMonoBook\setupSkinUserCss(), MultimediaViewerHooks\shouldHandleClicks(), InputBox\shouldUseVE(), ApiQueryTitleBlacklistTest\testAntiSpoofIntegration(), ResourceLoaderOOUIImageModuleTest\testNonDefaultSkin(), SimpleCaptcha\triggersCaptcha(), wfLoadExtension(), wfLoadExtensions(), wfLoadSkin(), and wfLoadSkins().
ExtensionRegistry::getQueue | ( | ) |
Get the current load queue.
Not intended to be used outside of the installer.
Definition at line 192 of file ExtensionRegistry.php.
References $queued.
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 433 of file ExtensionRegistry.php.
References $name.
ExtensionRegistry::load | ( | $path | ) |
Loads and processes the given JSON file without delay.
If some extensions are already queued, this will load those as well.
string | $path | Absolute path to the JSON file |
Definition at line 419 of file ExtensionRegistry.php.
References $path, loadFromQueue(), and queue().
ExtensionRegistry::loadFromQueue | ( | ) |
MWException | If the queue is already marked as finished (no further things should be loaded then). |
Definition at line 133 of file ExtensionRegistry.php.
References $cache, $data, $e, $wgDevelopmentWarnings, $wgVersion, CACHE_VERSION, ObjectCache\detectLocalServerCache(), exportExtractedData(), getAbilities(), ObjectCache\newFromId(), and readFromQueue().
Referenced by load().
|
protected |
Fully expand autoloader paths.
string | $dir | |
array | $files |
Definition at line 496 of file ExtensionRegistry.php.
Referenced by readFromQueue().
ExtensionRegistry::queue | ( | $path | ) |
string | $path | Absolute path to the JSON file |
Definition at line 109 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 253 of file ExtensionRegistry.php.
References $data, $GLOBALS, $path, AutoLoader\$psr4Namespaces, $queue, as, buildVersionChecker(), processAutoLoader(), 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 465 of file ExtensionRegistry.php.
|
protected |
Items in the JSON file that aren't being set as globals.
Definition at line 80 of file ExtensionRegistry.php.
|
private |
Whether we are done loading things.
Definition at line 72 of file ExtensionRegistry.php.
|
staticprivate |
Definition at line 92 of file ExtensionRegistry.php.
Referenced by getInstance().
|
private |
Array of loaded things, keyed by name, values are credits information.
Definition at line 58 of file ExtensionRegistry.php.
Referenced by getAllThings().
|
protected |
List of paths that should be loaded.
Definition at line 65 of file ExtensionRegistry.php.
Referenced by getQueue().
|
protected |
Attributes for testing.
Definition at line 87 of file ExtensionRegistry.php.
const ExtensionRegistry::CACHE_VERSION = 7 |
Bump whenever the registration cache needs resetting.
Definition at line 44 of file ExtensionRegistry.php.
Referenced by loadFromQueue().
const ExtensionRegistry::MANIFEST_VERSION = 2 |
Version of the highest supported manifest version Note: Update MANIFEST_VERSION_MW_VERSION when changing this.
Definition at line 28 of file ExtensionRegistry.php.
Referenced by UpdateExtensionJsonSchema\execute(), ConvertExtensionToRegistration\execute(), ExtensionProcessorTest\testGlobalSettingsDocumentedInSchema(), and ExtensionJsonValidator\validate().
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 34 of file ExtensionRegistry.php.
Referenced by ConvertExtensionToRegistration\execute().
const ExtensionRegistry::MEDIAWIKI_CORE = 'MediaWiki' |
"requires" key that applies to MediaWiki core/$wgVersion
Definition at line 22 of file ExtensionRegistry.php.
Referenced by VersionChecker\checkArray(), and ConvertExtensionToRegistration\execute().
const ExtensionRegistry::MERGE_STRATEGY = '_merge_strategy' |
Special key that defines the merge strategy.
Definition at line 51 of file ExtensionRegistry.php.
Referenced by exportExtractedData(), ExtensionProcessor\extractConfig2(), ExtensionProcessor\getExtractedInfo(), ExtensionRegistryTest\provideExportExtractedDataGlobals(), ExtensionProcessorTest\provideRegisterHooks(), ExtensionProcessorTest\testExtractConfig2(), and UpdateExtensionJsonSchema\updateTo2().
const ExtensionRegistry::OLDEST_MANIFEST_VERSION = 1 |
Version of the oldest supported manifest version.
Definition at line 39 of file ExtensionRegistry.php.
Referenced by ExtensionJsonValidator\validate().