MediaWiki  1.27.1
ExtensionRegistry Class Reference

ExtensionRegistry class. More...

Collaboration diagram for ExtensionRegistry:

Public Member Functions

 __construct ()
 
 clearQueue ()
 Clear the current load queue. More...
 
 getAllThings ()
 Get information about all things. More...
 
 getAttribute ($name)
 
 getQueue ()
 Get the current load queue. More...
 
 isLoaded ($name)
 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...
 

Static Public Member Functions

static getInstance ()
 

Public Attributes

const CACHE_VERSION = 3
 Bump whenever the registration cache needs resetting. More...
 
const MANIFEST_VERSION = 1
 Version of the highest supported manifest version. 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)
 
 markLoaded ($name, array $credits)
 Mark a thing as loaded. More...
 
 processAutoLoader ($dir, array $info)
 Register classes with the autoloader. More...
 

Protected Attributes

array $attributes = []
 Items in the JSON file that aren't being set as globals. More...
 
BagOStuff $cache
 
array $queued = []
 List of paths that should be loaded. More...
 

Private Attributes

array $loaded = []
 Array of loaded things, keyed by name, values are credits information. More...
 

Static Private Attributes

static ExtensionRegistry $instance
 

Detailed Description

ExtensionRegistry class.

The Registry loads JSON files, and uses a Processor to extract information from them. It also registers classes with the autoloader.

Since
1.25

Definition at line 12 of file ExtensionRegistry.php.

Constructor & Destructor Documentation

ExtensionRegistry::__construct ( )

Definition at line 84 of file ExtensionRegistry.php.

References $e, cache, and ObjectCache\getLocalServerInstance().

Member Function Documentation

ExtensionRegistry::clearQueue ( )

Clear the current load queue.

Not intended to be used outside of the installer.

Definition at line 162 of file ExtensionRegistry.php.

ExtensionRegistry::exportExtractedData ( array  $info)
protected

Definition at line 233 of file ExtensionRegistry.php.

References $GLOBALS, $key, $name, $path, as, attributes, and wfArrayPlus2d().

Referenced by loadFromQueue().

ExtensionRegistry::getAllThings ( )

Get information about all things.

Returns
array

Definition at line 334 of file ExtensionRegistry.php.

References $loaded.

ExtensionRegistry::getAttribute (   $name)
Parameters
string$name
Returns
array

Definition at line 321 of file ExtensionRegistry.php.

References $name, and attributes.

ExtensionRegistry::getQueue ( )

Get the current load queue.

Not intended to be used outside of the installer.

Returns
array

Definition at line 154 of file ExtensionRegistry.php.

References $queued.

ExtensionRegistry::isLoaded (   $name)

Whether a thing has been loaded.

Parameters
string$name
Returns
bool

Definition at line 313 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.

Parameters
string$pathAbsolute path to the JSON file

Definition at line 302 of file ExtensionRegistry.php.

References $path, loadFromQueue(), and queue().

ExtensionRegistry::loadFromQueue ( )

Definition at line 116 of file ExtensionRegistry.php.

References $key, $wgVersion, cache, exportExtractedData(), global, readFromQueue(), and wfMemcKey().

Referenced by load().

ExtensionRegistry::markLoaded (   $name,
array  $credits 
)
protected

Mark a thing as loaded.

Parameters
string$name
array$credits

Definition at line 344 of file ExtensionRegistry.php.

References $name.

ExtensionRegistry::processAutoLoader (   $dir,
array  $info 
)
protected

Register classes with the autoloader.

Parameters
string$dir
array$info
Returns
array

Definition at line 355 of file ExtensionRegistry.php.

References $dir, and use.

Referenced by readFromQueue().

ExtensionRegistry::queue (   $path)
Parameters
string$pathAbsolute path to the JSON file

Definition at line 98 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.

Parameters
array$queuekeys are filenames, values are ignored
Returns
array extracted info
Exceptions
Exception

Definition at line 173 of file ExtensionRegistry.php.

References $GLOBALS, $path, $version, $wgVersion, as, global, and processAutoLoader().

Referenced by loadFromQueue().

Member Data Documentation

array ExtensionRegistry::$attributes = []
protected

Items in the JSON file that aren't being set as globals.

Definition at line 66 of file ExtensionRegistry.php.

BagOStuff ExtensionRegistry::$cache
protected

Definition at line 44 of file ExtensionRegistry.php.

ExtensionRegistry ExtensionRegistry::$instance
staticprivate

Definition at line 71 of file ExtensionRegistry.php.

array ExtensionRegistry::$loaded = []
private

Array of loaded things, keyed by name, values are credits information.

Definition at line 51 of file ExtensionRegistry.php.

Referenced by getAllThings().

array ExtensionRegistry::$queued = []
protected

List of paths that should be loaded.

Definition at line 58 of file ExtensionRegistry.php.

Referenced by getQueue().

const ExtensionRegistry::CACHE_VERSION = 3

Bump whenever the registration cache needs resetting.

Definition at line 32 of file ExtensionRegistry.php.

const ExtensionRegistry::MANIFEST_VERSION = 1

Version of the highest supported manifest version.

Definition at line 22 of file ExtensionRegistry.php.

Referenced by ValidateRegistrationFile\execute(), ConvertExtensionToRegistration\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().

const ExtensionRegistry::MERGE_STRATEGY = '_merge_strategy'

Special key that defines the merge strategy.

Since
1.26

Definition at line 39 of file ExtensionRegistry.php.

Referenced by 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().


The documentation for this class was generated from the following file: