46 'currentmonthnamegen',
106 'numberofactiveusers',
126 'currentmonth' => 86400,
127 'currentmonth1' => 86400,
128 'currentmonthname' => 86400,
129 'currentmonthnamegen' => 86400,
130 'currentmonthabbrev' => 86400,
131 'currentday' => 3600,
132 'currentday2' => 3600,
133 'currentdayname' => 3600,
134 'currentyear' => 86400,
135 'currenttime' => 3600,
136 'currenthour' => 3600,
137 'localmonth' => 86400,
138 'localmonth1' => 86400,
139 'localmonthname' => 86400,
140 'localmonthnamegen' => 86400,
141 'localmonthabbrev' => 86400,
144 'localdayname' => 3600,
145 'localyear' => 86400,
148 'numberofarticles' => 3600,
149 'numberoffiles' => 3600,
150 'numberofedits' => 3600,
151 'currentweek' => 3600,
152 'currentdow' => 3600,
155 'numberofusers' => 3600,
156 'numberofactiveusers' => 3600,
157 'numberofpages' => 3600,
158 'currentversion' => 86400,
159 'currenttimestamp' => 3600,
160 'localtimestamp' => 3600,
161 'pagesinnamespace' => 3600,
162 'numberofadmins' => 3600,
163 'numberingroup' => 3600,
176 'expectunusedcategory',
205 $this->contLang = $contLang;
209 return $this->contLang;
219 public function get( $id ) {
220 if ( !isset( $this->mObjects[$id] ) ) {
221 $mw =
new MagicWord(
null, [],
false, $this->contLang );
223 $this->mObjects[$id] = $mw;
225 return $this->mObjects[$id];
234 if ( !$this->mVariableIDsInitialised ) {
236 Hooks::run(
'MagicWordwgVariableIDs', [ &$this->mVariableIDs ] );
237 $this->mVariableIDsInitialised =
true;
239 return $this->mVariableIDs;
247 return $this->mSubstIDs;
257 if ( array_key_exists( $id, $this->mCacheTTLs ) ) {
258 return $this->mCacheTTLs[$id];
270 if ( is_null( $this->mDoubleUnderscoreArray ) ) {
271 Hooks::run(
'GetDoubleUnderscoreIDs', [ &$this->mDoubleUnderscoreIDs ] );
272 $this->mDoubleUnderscoreArray = $this->
newArray( $this->mDoubleUnderscoreIDs );
274 return $this->mDoubleUnderscoreArray;
Internationalisation code.
Class for handling an array of magic words.
A factory that stores information about MagicWords, and creates them on demand with caching.
array $mCacheTTLs
Array of caching hints for ParserCache [ string => int ].
getSubstIDs()
Get an array of parser substitution modifier IDs.
string[] $mDoubleUnderscoreIDs
getVariableIDs()
Get an array of parser variable IDs.
MagicWordArray $mDoubleUnderscoreArray
getDoubleUnderscoreArray()
Get a MagicWordArray of double-underscore entities.
__construct(Language $contLang)
#-
newArray(array $names=[])
Get a new MagicWordArray with provided $names.
array $mObjects
[ string => MagicWord ]
bool $mVariableIDsInitialised
#-
getCacheTTL( $id)
Allow external reads of TTL array.
This class encapsulates "magic words" such as "#redirect", NOTOC, etc.
return[ 'OATHAuth'=> function(MediaWikiServices $services) { return new OATHAuth($services->getMainConfig(), $services->getDBLoadBalancerFactory());}, 'OATHUserRepository'=> function(MediaWikiServices $services) { global $wgOATHAuthDatabase;$auth=$services->getService( 'OATHAuth');return new OATHUserRepository($services->getDBLoadBalancerFactory() ->getMainLB( $wgOATHAuthDatabase), new \HashBagOStuff(['maxKey'=> 5]), $auth);}]