MediaWiki REL1_27
|
ExtensionRegistry class. More...
Public Member Functions | |
clearQueue () | |
Clear the current load queue. | |
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 = 4 |
Bump whenever the registration cache needs resetting. | |
const | MANIFEST_VERSION = 1 |
Version of the highest supported manifest version. | |
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) | |
markLoaded ( $name, array $credits) | |
Mark a thing as loaded. | |
processAutoLoader ( $dir, array $info) | |
Register classes with the autoloader. | |
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 | |
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 12 of file ExtensionRegistry.php.
ExtensionRegistry::clearQueue | ( | ) |
Clear the current load queue.
Not intended to be used outside of the installer.
Definition at line 154 of file ExtensionRegistry.php.
|
protected |
Definition at line 225 of file ExtensionRegistry.php.
References $GLOBALS, $name, $path, as, attributes, MERGE_STRATEGY, and wfArrayPlus2d().
Referenced by loadFromQueue().
ExtensionRegistry::getAllThings | ( | ) |
Get information about all things.
Definition at line 327 of file ExtensionRegistry.php.
References $loaded.
ExtensionRegistry::getAttribute | ( | $name | ) |
string | $name |
Definition at line 314 of file ExtensionRegistry.php.
References $name, and attributes.
|
static |
Definition at line 71 of file ExtensionRegistry.php.
References $instance.
Referenced by ExtensionsTestSuite\__construct(), MWNamespace\getCanonicalNamespaces(), ApiBase\getModuleSourceInfo(), DatabaseUpdater\loadExtensions(), ResourceLoaderOOUIImageModule\loadFromDefinition(), SpecialTrackingCategories\prepareTrackingCategoriesData(), ExtensionJsonValidationTest\providePassesValidation(), ExtensionJsonValidationTest\setUp(), OutputPage\setupOOUI(), wfLoadExtension(), wfLoadExtensions(), wfLoadSkin(), and wfLoadSkins().
ExtensionRegistry::getQueue | ( | ) |
Get the current load queue.
Not intended to be used outside of the installer.
Definition at line 146 of file ExtensionRegistry.php.
References $queued.
ExtensionRegistry::isLoaded | ( | $name | ) |
Whether a thing has been loaded.
string | $name |
Definition at line 306 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 295 of file ExtensionRegistry.php.
References $path, loadFromQueue(), and queue().
ExtensionRegistry::loadFromQueue | ( | ) |
Definition at line 101 of file ExtensionRegistry.php.
References $cache, $e, $wgVersion, CACHE_VERSION, exportExtractedData(), ObjectCache\getLocalServerInstance(), global, readFromQueue(), and wfMemcKey().
Referenced by load().
|
protected |
Mark a thing as loaded.
string | $name | |
array | $credits |
Definition at line 337 of file ExtensionRegistry.php.
References $name.
|
protected |
Register classes with the autoloader.
string | $dir | |
array | $info |
Definition at line 348 of file ExtensionRegistry.php.
Referenced by readFromQueue().
ExtensionRegistry::queue | ( | $path | ) |
string | $path | Absolute path to the JSON file |
Definition at line 82 of file ExtensionRegistry.php.
References $path, $wgExtensionInfoMTime, and global.
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 |
Definition at line 165 of file ExtensionRegistry.php.
References $GLOBALS, $path, $queue, $version, $wgVersion, as, global, MEDIAWIKI_CORE, and processAutoLoader().
Referenced by loadFromQueue().
|
protected |
Items in the JSON file that aren't being set as globals.
Definition at line 61 of file ExtensionRegistry.php.
|
staticprivate |
Definition at line 66 of file ExtensionRegistry.php.
Referenced by getInstance().
|
private |
Array of loaded things, keyed by name, values are credits information.
Definition at line 46 of file ExtensionRegistry.php.
Referenced by getAllThings().
|
protected |
List of paths that should be loaded.
Definition at line 53 of file ExtensionRegistry.php.
Referenced by getQueue().
const ExtensionRegistry::CACHE_VERSION = 4 |
Bump whenever the registration cache needs resetting.
Definition at line 32 of file ExtensionRegistry.php.
Referenced by loadFromQueue().
const ExtensionRegistry::MANIFEST_VERSION = 1 |
Version of the highest supported manifest version.
Definition at line 22 of file ExtensionRegistry.php.
Referenced by ConvertExtensionToRegistration\execute(), ValidateRegistrationFile\execute(), and ExtensionJsonValidationTest\testPassesValidation().
const ExtensionRegistry::MEDIAWIKI_CORE = 'MediaWiki' |
"requires" key that applies to MediaWiki core/$wgVersion
Definition at line 17 of file ExtensionRegistry.php.
Referenced by ExtensionProcessor\getRequirements(), and readFromQueue().
const ExtensionRegistry::MERGE_STRATEGY = '_merge_strategy' |
Special key that defines the merge strategy.
Definition at line 39 of file ExtensionRegistry.php.
Referenced by exportExtractedData(), ExtensionProcessor\getExtractedInfo(), ExtensionRegistryTest\provideExportExtractedDataGlobals(), and ExtensionProcessorTest\provideRegisterHooks().
const ExtensionRegistry::OLDEST_MANIFEST_VERSION = 1 |
Version of the oldest supported manifest version.
Definition at line 27 of file ExtensionRegistry.php.
Referenced by ValidateRegistrationFile\execute(), and ExtensionJsonValidationTest\testPassesValidation().