MediaWiki REL1_31
|
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) | |
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. | |
Static Public Member Functions | |
static | getInstance () |
Public Attributes | |
const | CACHE_VERSION = 6 |
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) | |
processAutoLoader ( $dir, array $files) | |
Fully expand autoloader paths. | |
Protected Attributes | |
array | $attributes = [] |
Items in the JSON file that aren't being set as globals. | |
array | $queued = [] |
List of paths that should be loaded. | |
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 14 of file ExtensionRegistry.php.
ExtensionRegistry::clearQueue | ( | ) |
Clear the current load queue.
Not intended to be used outside of the installer.
Definition at line 186 of file ExtensionRegistry.php.
|
protected |
Definition at line 289 of file ExtensionRegistry.php.
References $GLOBALS, $path, AutoLoader\$psr4Namespaces, MERGE_STRATEGY, and wfArrayPlus2d().
Referenced by loadFromQueue().
ExtensionRegistry::finish | ( | ) |
After this is called, no more extensions can be loaded.
Definition at line 195 of file ExtensionRegistry.php.
ExtensionRegistry::getAllThings | ( | ) |
Get information about all things.
Definition at line 406 of file ExtensionRegistry.php.
References $loaded.
ExtensionRegistry::getAttribute | ( | $name | ) |
string | $name |
Definition at line 393 of file ExtensionRegistry.php.
References $name.
|
static |
Definition at line 88 of file ExtensionRegistry.php.
References $instance.
Referenced by ExtensionsTestSuite\__construct(), Maintenance\checkRequiredExtensions(), CodeEditorHooks\editPageShowEditFormInitial(), MWNamespace\getCanonicalNamespaces(), ApiBase\getModuleSourceInfo(), ParserTestRunner\getParserTestFiles(), getSkinThemeMap(), TrackingCategories\getTrackingCategories(), DatabaseUpdater\loadExtensions(), SpamBlacklist\logFilterHit(), onContentGetParserOutput(), onResourceLoaderRegisterModules(), ExtensionJsonValidationTest\providePassesValidation(), ExtensionJsonValidationTest\setUp(), InputBox\shouldUseVE(), 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 178 of file ExtensionRegistry.php.
References $queued.
ExtensionRegistry::isLoaded | ( | $name | ) |
Whether a thing has been loaded.
string | $name |
Definition at line 385 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.
string | $path | Absolute path to the JSON file |
Definition at line 374 of file ExtensionRegistry.php.
References loadFromQueue(), and queue().
ExtensionRegistry::loadFromQueue | ( | ) |
MWException | If the queue is already marked as finished (no further things should be loaded then). |
Definition at line 123 of file ExtensionRegistry.php.
References $cache, $e, $wgDevelopmentWarnings, $wgVersion, CACHE_VERSION, exportExtractedData(), and readFromQueue().
Referenced by load().
|
protected |
Fully expand autoloader paths.
string | $dir | |
array | $files |
Definition at line 417 of file ExtensionRegistry.php.
Referenced by readFromQueue().
ExtensionRegistry::queue | ( | $path | ) |
string | $path | Absolute path to the JSON file |
Definition at line 99 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 207 of file ExtensionRegistry.php.
References $GLOBALS, AutoLoader\$psr4Namespaces, $queue, $wgVersion, processAutoLoader(), and wfDeprecated().
Referenced by loadFromQueue().
|
protected |
Items in the JSON file that aren't being set as globals.
Definition at line 77 of file ExtensionRegistry.php.
|
private |
Whether we are done loading things.
Definition at line 69 of file ExtensionRegistry.php.
|
staticprivate |
Definition at line 82 of file ExtensionRegistry.php.
Referenced by getInstance().
|
private |
Array of loaded things, keyed by name, values are credits information.
Definition at line 55 of file ExtensionRegistry.php.
Referenced by getAllThings().
|
protected |
List of paths that should be loaded.
Definition at line 62 of file ExtensionRegistry.php.
Referenced by getQueue().
const ExtensionRegistry::CACHE_VERSION = 6 |
Bump whenever the registration cache needs resetting.
Definition at line 41 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 25 of file ExtensionRegistry.php.
Referenced by ConvertExtensionToRegistration\execute(), UpdateExtensionJsonSchema\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 31 of file ExtensionRegistry.php.
Referenced by ConvertExtensionToRegistration\execute().
const ExtensionRegistry::MEDIAWIKI_CORE = 'MediaWiki' |
"requires" key that applies to MediaWiki core/$wgVersion
Definition at line 19 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 48 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 36 of file ExtensionRegistry.php.
Referenced by ExtensionJsonValidator\validate().