MediaWiki
master
|
Load JSON files, and uses a Processor to extract information. 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 credits information about all installed extensions and skins. More... | |
getAttribute ( $name) | |
getQueue () | |
Get the current load queue. More... | |
isLoaded ( $name, $constraint=' *') | |
Whether a thing has been loaded. 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... | |
setCache (BagOStuff $cache) | |
Set the cache to use for extension info. More... | |
setCheckDevRequires ( $check) | |
setLoadTestClassesAndNamespaces ( $load) | |
Controls if classes and namespaces defined under the keys TestAutoloadClasses and TestAutoloadNamespaces should be added to the autoloader. More... | |
setSettingsBuilder (SettingsBuilder $settingsBuilder) | |
Static Public Member Functions | |
static | getInstance () |
Public Attributes | |
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 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) | |
getLazyLoadedAttribute ( $name) | |
Get an attribute value that isn't cached by reading each extension.json file again. More... | |
saveToCache (BagOStuff $cache, array $data) | |
Save data in the cache. More... | |
Static Protected Member Functions | |
static | 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... | |
bool | $checkDev = false |
Whether to check dev-requires. More... | |
array | $lazyAttributes = [] |
Lazy-loaded attributes. More... | |
bool | $loadTestClassesAndNamespaces = false |
Whether test classes and namespaces should be added to the auto loader. More... | |
int[] | $queued = [] |
List of paths that should be loaded. More... | |
array | $testAttributes = [] |
Attributes for testing. More... | |
Load JSON files, and uses a Processor to extract information.
This also adds the extension's classes to the AutoLoader.
Definition at line 23 of file ExtensionRegistry.php.
ExtensionRegistry::clearQueue | ( | ) |
Clear the current load queue.
Not intended to be used outside of the installer.
Definition at line 340 of file ExtensionRegistry.php.
|
protected |
Definition at line 451 of file ExtensionRegistry.php.
References wfArrayPlus2d().
ExtensionRegistry::finish | ( | ) |
After this is called, no more extensions can be loaded.
Definition at line 350 of file ExtensionRegistry.php.
ExtensionRegistry::getAllThings | ( | ) |
Get credits information about all installed extensions and skins.
Definition at line 652 of file ExtensionRegistry.php.
ExtensionRegistry::getAttribute | ( | $name | ) |
|
static |
Definition at line 159 of file ExtensionRegistry.php.
Referenced by MediaWiki\Rest\Handler\ParsoidHandler\__construct(), Parser\Parsoid\Config\SiteConfig\__construct(), ApiQuerySiteinfo\appendExtensions(), Maintenance\checkRequiredExtensions(), MediaWiki\ResourceLoader\FileModule\compileLessString(), SpecialVersion\execute(), CheckDependencies\execute(), ManageForeignResources\execute(), NamespaceInfo\getCanonicalNamespaces(), MediaWiki\Settings\SettingsBuilder\getInstance(), OutputPage\getJSVars(), ApiBase\getModuleSourceInfo(), MediaWiki\ResourceLoader\getSkinThemeMap(), MediaWiki\ResourceLoader\CodexModule\getStyleFiles(), MediaWiki\ResourceLoader\getThemePaths(), SearchHighlighter\highlightText(), NamespaceInfo\isMovable(), wfLoadExtension(), wfLoadExtensions(), wfLoadSkin(), and wfLoadSkins().
|
protected |
Get an attribute value that isn't cached by reading each extension.json file again.
string | $name |
Definition at line 592 of file ExtensionRegistry.php.
References BagOStuff\get().
ExtensionRegistry::getQueue | ( | ) |
Get the current load queue.
Not intended to be used outside of the installer.
Definition at line 332 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 constraint is asked for, but the extension isn't versioned |
Definition at line 555 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 272 of file ExtensionRegistry.php.
References BagOStuff\get().
|
staticprotected |
Fully expand autoloader paths.
string | $dir | |
string[] | $files |
Definition at line 663 of file ExtensionRegistry.php.
References $file.
ExtensionRegistry::queue | ( | $path | ) |
string | $path | Absolute path to the JSON file |
Definition at line 202 of file ExtensionRegistry.php.
References $path, and $wgExtensionInfoMTime.
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 395 of file ExtensionRegistry.php.
References $path, and wfDeprecatedMsg().
|
protected |
Save data in the cache.
BagOStuff | $cache | |
array | $data |
Definition at line 301 of file ExtensionRegistry.php.
References $wgDevelopmentWarnings, and BagOStuff\set().
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 632 of file ExtensionRegistry.php.
ExtensionRegistry::setCache | ( | BagOStuff | $cache | ) |
Set the cache to use for extension info.
Intended for use during testing.
BagOStuff | $cache |
Definition at line 175 of file ExtensionRegistry.php.
ExtensionRegistry::setCheckDevRequires | ( | $check | ) |
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 195 of file ExtensionRegistry.php.
ExtensionRegistry::setSettingsBuilder | ( | SettingsBuilder | $settingsBuilder | ) |
SettingsBuilder | $settingsBuilder |
Definition at line 675 of file ExtensionRegistry.php.
|
protected |
Items in the JSON file that aren't being set as globals.
Definition at line 103 of file ExtensionRegistry.php.
|
protected |
Whether to check dev-requires.
Definition at line 131 of file ExtensionRegistry.php.
|
protected |
Lazy-loaded attributes.
Definition at line 117 of file ExtensionRegistry.php.
|
protected |
Whether test classes and namespaces should be added to the auto loader.
Definition at line 138 of file ExtensionRegistry.php.
|
protected |
List of paths that should be loaded.
Definition at line 88 of file ExtensionRegistry.php.
|
protected |
Attributes for testing.
Definition at line 110 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 34 of file ExtensionRegistry.php.
Referenced by ConvertExtensionToRegistration\execute(), UpdateExtensionJsonSchema\execute(), 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 40 of file ExtensionRegistry.php.
Referenced by ConvertExtensionToRegistration\execute(), and UpdateExtensionJsonSchema\updateRequiredMwVersion().
const ExtensionRegistry::MEDIAWIKI_CORE = 'MediaWiki' |
"requires" key that applies to MediaWiki core
Definition at line 28 of file ExtensionRegistry.php.
Referenced by VersionChecker\checkArray(), ConvertExtensionToRegistration\execute(), and UpdateExtensionJsonSchema\updateRequiredMwVersion().
const ExtensionRegistry::MERGE_STRATEGY = '_merge_strategy' |
Special key that defines the merge strategy.
Definition at line 59 of file ExtensionRegistry.php.
Referenced by ExtensionProcessor\extractConfig2(), ExtensionProcessor\getExtractedInfo(), and UpdateExtensionJsonSchema\updateTo2().
const ExtensionRegistry::OLDEST_MANIFEST_VERSION = 1 |
Version of the oldest supported manifest version.
Definition at line 45 of file ExtensionRegistry.php.
Referenced by ExtensionJsonValidator\validate().