MediaWiki  1.28.0
ExtensionProcessor Class Reference
Inheritance diagram for ExtensionProcessor:
Collaboration diagram for ExtensionProcessor:

Public Member Functions

 extractInfo ($path, array $info, $version)
 
 getExtraAutoloaderPaths ($dir, array $info)
 Get the path for additional autoloaders, e.g. More...
 
 getExtractedInfo ()
 
 getRequirements (array $info)
 Get the requirements for the provided info. More...
 

Protected Member Functions

 extractConfig (array $info)
 Set configuration settings. More...
 
 extractCredits ($path, array $info)
 
 extractExtensionMessagesFiles ($dir, array $info)
 
 extractHooks (array $info)
 
 extractMessagesDirs ($dir, array $info)
 Set message-related settings, which need to be expanded to use absolute paths. More...
 
 extractNamespaces (array $info)
 Register namespaces with the appropriate global settings. More...
 
 extractParserTestFiles ($dir, array $info)
 
 extractResourceLoaderModules ($dir, array $info)
 
 extractServiceWiringFiles ($dir, array $info)
 
 storeToArray ($path, $name, $value, &$array)
 

Protected Attributes

array $attributes = []
 Any thing else in the $info that hasn't already been processed. More...
 
callable[] $callbacks = []
 Things to be called once registration of these extensions are done. More...
 
array $credits = []
 
array array $defines = []
 Things that should be define()'d. More...
 
array $globals
 Stuff that is going to be set to $GLOBALS. More...
 

Static Protected Attributes

static array static array $creditsAttributes
 Keys that are part of the extension credits. More...
 
static array $globalSettings
 Keys that should be set to $GLOBALS. More...
 
static array $mergeStrategies
 Mapping of global settings to their specific merge strategies. More...
 
static array $notAttributes
 Things that are not 'attributes', but are not in $globalSettings or $creditsAttributes. More...
 

Detailed Description

Definition at line 3 of file ExtensionProcessor.php.

Member Function Documentation

ExtensionProcessor::extractConfig ( array  $info)
protected

Set configuration settings.

Todo:
In the future, this should be done via Config interfaces
Parameters
array$info

Definition at line 363 of file ExtensionProcessor.php.

References as, and globals.

Referenced by extractInfo().

ExtensionProcessor::extractCredits (   $path,
array  $info 
)
protected
Parameters
string$path
array$info
Exceptions
Exception

Definition at line 332 of file ExtensionProcessor.php.

References $credits, $name, $path, as, and globals.

Referenced by extractInfo().

ExtensionProcessor::extractExtensionMessagesFiles (   $dir,
array  $info 
)
protected

Definition at line 302 of file ExtensionProcessor.php.

References $dir, globals, and use.

Referenced by extractInfo().

ExtensionProcessor::extractHooks ( array  $info)
protected

Definition at line 219 of file ExtensionProcessor.php.

References $name, $value, as, and globals.

Referenced by extractInfo().

ExtensionProcessor::extractInfo (   $path,
array  $info,
  $version 
)
ExtensionProcessor::extractMessagesDirs (   $dir,
array  $info 
)
protected

Set message-related settings, which need to be expanded to use absolute paths.

Parameters
string$dir
array$info

Definition at line 317 of file ExtensionProcessor.php.

References $files, $name, array(), as, and globals.

Referenced by extractInfo().

ExtensionProcessor::extractNamespaces ( array  $info)
protected

Register namespaces with the appropriate global settings.

Parameters
array$info

Definition at line 238 of file ExtensionProcessor.php.

References as, and globals.

Referenced by extractInfo().

ExtensionProcessor::extractParserTestFiles (   $dir,
array  $info 
)
protected

Definition at line 387 of file ExtensionProcessor.php.

References $path, as, and globals.

Referenced by extractInfo().

ExtensionProcessor::extractResourceLoaderModules (   $dir,
array  $info 
)
protected

Definition at line 269 of file ExtensionProcessor.php.

References $dir, $name, as, and globals.

Referenced by extractInfo().

ExtensionProcessor::extractServiceWiringFiles (   $dir,
array  $info 
)
protected

Definition at line 379 of file ExtensionProcessor.php.

References $path, as, and globals.

Referenced by extractInfo().

ExtensionProcessor::getExtraAutoloaderPaths (   $dir,
array  $info 
)

Get the path for additional autoloaders, e.g.

the one of Composer.

Parameters
string$dir
array$info
Returns
array Containing the paths for autoloader file(s).
Since
1.27

Implements Processor.

Definition at line 413 of file ExtensionProcessor.php.

References $path.

ExtensionProcessor::getExtractedInfo ( )
Returns
array With following keys: 'globals' - variables to be set to $GLOBALS 'defines' - constants to define 'callbacks' - functions to be executed by the registry 'credits' - metadata to be stored by registry 'attributes' - registration info which isn't a global variable

Implements Processor.

Definition at line 192 of file ExtensionProcessor.php.

References $attributes, $callbacks, $credits, $defines, $globals, as, globals, and ExtensionRegistry\MERGE_STRATEGY.

ExtensionProcessor::getRequirements ( array  $info)

Get the requirements for the provided info.

Since
1.26
Parameters
array$info
Returns
array Where keys are the name to have a constraint on, like 'MediaWiki'. Values are a constraint string like "1.26.1".

Implements Processor.

Definition at line 209 of file ExtensionProcessor.php.

References ExtensionRegistry\MEDIAWIKI_CORE.

ExtensionProcessor::storeToArray (   $path,
  $name,
  $value,
$array 
)
protected
Parameters
string$path
string$name
array$value
array&$array
Exceptions
InvalidArgumentException

Definition at line 402 of file ExtensionProcessor.php.

References $name, and $value.

Referenced by extractInfo().

Member Data Documentation

array ExtensionProcessor::$attributes = []
protected

Any thing else in the $info that hasn't already been processed.

Definition at line 157 of file ExtensionProcessor.php.

Referenced by getExtractedInfo().

callable [] ExtensionProcessor::$callbacks = []
protected

Things to be called once registration of these extensions are done.

Definition at line 144 of file ExtensionProcessor.php.

Referenced by getExtractedInfo().

array ExtensionProcessor::$credits = []
protected

Definition at line 149 of file ExtensionProcessor.php.

Referenced by extractCredits(), and getExtractedInfo().

array static array ExtensionProcessor::$creditsAttributes
staticprotected
Initial value:
= [
'name',
'namemsg',
'author',
'version',
'url',
'description',
'descriptionmsg',
'license-name',
]

Keys that are part of the extension credits.

Definition at line 84 of file ExtensionProcessor.php.

array array ExtensionProcessor::$defines = []
protected

Things that should be define()'d.

Definition at line 137 of file ExtensionProcessor.php.

Referenced by getExtractedInfo().

array ExtensionProcessor::$globals
protected
Initial value:
= [
'wgExtensionMessagesFiles' => []

Stuff that is going to be set to $GLOBALS.

Some keys are pre-set to arrays so we can += to them

Definition at line 127 of file ExtensionProcessor.php.

Referenced by MockExtensionProcessor\__construct(), and getExtractedInfo().

array ExtensionProcessor::$globalSettings
staticprotected

Keys that should be set to $GLOBALS.

Definition at line 10 of file ExtensionProcessor.php.

array ExtensionProcessor::$mergeStrategies
staticprotected
Initial value:
= [
'wgGroupPermissions' => 'array_plus_2d'

Mapping of global settings to their specific merge strategies.

See also
ExtensionRegistry::exportExtractedData
getExtractedInfo

Definition at line 64 of file ExtensionProcessor.php.

array ExtensionProcessor::$notAttributes
staticprotected
Initial value:
= [
'callback',
'Hooks',
'namespaces',
'ResourceFileModulePaths',
'ResourceModules',
'ResourceModuleSkinStyles',
'ExtensionMessagesFiles',
'MessagesDirs',
'type',
'config',
'config_prefix',
'ServiceWiringFiles',
'ParserTestFiles',
'AutoloadClasses',
'manifest_version',
'load_composer_autoloader',
]

Things that are not 'attributes', but are not in $globalSettings or $creditsAttributes.

Definition at line 101 of file ExtensionProcessor.php.


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