MediaWiki master
MediaWiki\Parser\MagicWordFactory Class Reference

Store information about magic words, and create/cache MagicWord objects. More...

Public Member Functions

 __construct (private readonly Language $contLang, HookContainer $hookContainer,)
 
 get ( $id)
 Get a MagicWord object for a given internal ID.
 
 getCacheTTL ( $id)
 Allow external reads of TTL array.
 
 getContentLanguage ()
 
 getDoubleUnderscoreArray ()
 Get a MagicWordArray of double-underscore entities.
 
 getSubstArray ()
 
 getSubstIDs ()
 Get an array of parser substitution modifier IDs.
 
 getVariableIDs ()
 Get an array of parser variable IDs.
 
 newArray (array $names=[])
 Get a new MagicWordArray with provided $names.
 

Detailed Description

Store information about magic words, and create/cache MagicWord objects.

See docs/magicword.md.

Possible future improvements:

  • Simultaneous searching for a number of magic words
  • $mObjects in shared memory
Since
1.32

Definition at line 25 of file MagicWordFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Parser\MagicWordFactory::__construct ( private readonly Language $contLang,
HookContainer $hookContainer )
Access: internal
For ServiceWiring only

Definition at line 145 of file MagicWordFactory.php.

Member Function Documentation

◆ get()

MediaWiki\Parser\MagicWordFactory::get ( $id)

Get a MagicWord object for a given internal ID.

Parameters
string$idThe internal name of the magic word
Returns
MagicWord

Definition at line 162 of file MagicWordFactory.php.

◆ getCacheTTL()

MediaWiki\Parser\MagicWordFactory::getCacheTTL ( $id)

Allow external reads of TTL array.

Parameters
string$id
Returns
int
Deprecated
Since 1.40

Definition at line 211 of file MagicWordFactory.php.

◆ getContentLanguage()

MediaWiki\Parser\MagicWordFactory::getContentLanguage ( )

Definition at line 152 of file MagicWordFactory.php.

◆ getDoubleUnderscoreArray()

MediaWiki\Parser\MagicWordFactory::getDoubleUnderscoreArray ( )

Get a MagicWordArray of double-underscore entities.

Definition at line 218 of file MagicWordFactory.php.

◆ getSubstArray()

MediaWiki\Parser\MagicWordFactory::getSubstArray ( )
Access: internal
for use in {
See also
Parser::braceSubstitution} only

Definition at line 200 of file MagicWordFactory.php.

◆ getSubstIDs()

MediaWiki\Parser\MagicWordFactory::getSubstIDs ( )

Get an array of parser substitution modifier IDs.

Returns
string[]
Deprecated
since 1.42, use {
See also
getSubstArray} instead

Definition at line 192 of file MagicWordFactory.php.

◆ getVariableIDs()

MediaWiki\Parser\MagicWordFactory::getVariableIDs ( )

Get an array of parser variable IDs.

Returns
string[]

Definition at line 176 of file MagicWordFactory.php.

◆ newArray()

MediaWiki\Parser\MagicWordFactory::newArray ( array $names = [])

Get a new MagicWordArray with provided $names.

Parameters
string[]$names
Returns
MagicWordArray

Definition at line 232 of file MagicWordFactory.php.


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