56 LoggerInterface $logger
58 $pageLang = $parser->getFunctionLang();
65 return $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format(
'm' ),
true );
67 return $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format(
'n' ),
true );
68 case 'currentmonthname':
69 return $pageLang->getMonthName( MWTimestamp::getInstance( $ts )->format(
'n' ) );
70 case 'currentmonthnamegen':
71 return $pageLang->getMonthNameGen( MWTimestamp::getInstance( $ts )->format(
'n' ) );
72 case 'currentmonthabbrev':
73 return $pageLang->getMonthAbbreviation( MWTimestamp::getInstance( $ts )->format(
'n' ) );
75 return $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format(
'j' ),
true );
77 return $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format(
'd' ),
true );
79 return $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format(
'm' ),
true );
81 return $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format(
'n' ),
true );
82 case 'localmonthname':
83 return $pageLang->getMonthName( MWTimestamp::getLocalInstance( $ts )->format(
'n' ) );
84 case 'localmonthnamegen':
85 return $pageLang->getMonthNameGen( MWTimestamp::getLocalInstance( $ts )->format(
'n' ) );
86 case 'localmonthabbrev':
87 return $pageLang->getMonthAbbreviation( MWTimestamp::getLocalInstance( $ts )->format(
'n' ) );
89 return $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format(
'j' ),
true );
91 return $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format(
'd' ),
true );
106 case 'rootpagenamee':
114 case 'basepagenamee':
121 if (
$title->canHaveTalkPage() ) {
122 $talkPage =
$title->getTalkPage();
126 case 'talkpagenamee':
127 if (
$title->canHaveTalkPage() ) {
128 $talkPage =
$title->getTalkPage();
132 case 'subjectpagename':
133 $subjPage =
$title->getSubjectPage();
135 case 'subjectpagenamee':
136 $subjPage =
$title->getSubjectPage();
142 $value =
$title->getArticleID();
144 $value = $parser->
getOptions()->getSpeculativePageId();
146 $parser->
getOutput()->setSpeculativePageIdUsed( $value );
149 return (
string)$value;
151 $namespace =
$title->getNamespace();
153 $svcOptions->
get(
'MiserMode' ) &&
154 !$parser->
getOptions()->getInterfaceMessage() &&
171 if ( $value === 0 ) {
173 $value = $rev ? $rev->getId() : $value;
176 $value = $parser->
getOptions()->getSpeculativeRevId();
178 $parser->
getOutput()->setSpeculativeRevIdUsed( $value );
181 return (
string)$value;
184 return strval( (
int)self::getRevisionTimestampSubstring(
185 $parser, $logger, 6, 2, self::MAX_TTS, $id
189 $parser, $logger, 6, 2, self::MAX_TTS, $id
191 case 'revisionmonth':
193 $parser, $logger, 4, 2, self::MAX_TTS, $id
195 case 'revisionmonth1':
196 return strval( (
int)self::getRevisionTimestampSubstring(
197 $parser, $logger, 4, 2, self::MAX_TTS, $id
201 $parser, $logger, 0, 4, self::MAX_TTS, $id
203 case 'revisiontimestamp':
205 $parser, $logger, 0, 14, self::MAX_TTS, $id
218 return str_replace(
'_',
' ',
222 case 'namespacenumber':
223 return $title->getNamespace();
225 return $title->canHaveTalkPage()
226 ? str_replace(
'_',
' ',
$title->getTalkNsText() )
229 return $title->canHaveTalkPage()
233 return str_replace(
'_',
' ',
$title->getSubjectNsText() );
234 case 'subjectspacee':
236 case 'currentdayname':
237 return $pageLang->getWeekdayName( (
int)MWTimestamp::getInstance( $ts )->format(
'w' ) + 1 );
239 return $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format(
'Y' ),
true );
241 return $pageLang->time(
wfTimestamp( TS_MW, $ts ),
false,
false );
243 return $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format(
'H' ),
true );
247 return $pageLang->formatNum( (
int)MWTimestamp::getInstance( $ts )->format(
'W' ) );
249 return $pageLang->formatNum( MWTimestamp::getInstance( $ts )->format(
'w' ) );
251 return $pageLang->getWeekdayName(
252 (
int)MWTimestamp::getLocalInstance( $ts )->format(
'w' ) + 1
255 return $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format(
'Y' ),
true );
257 return $pageLang->time(
258 MWTimestamp::getLocalInstance( $ts )->format(
'YmdHis' ),
263 return $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format(
'H' ),
true );
267 return $pageLang->formatNum( (
int)MWTimestamp::getLocalInstance( $ts )->format(
'W' ) );
269 return $pageLang->formatNum( MWTimestamp::getLocalInstance( $ts )->format(
'w' ) );
270 case 'numberofarticles':
272 case 'numberoffiles':
274 case 'numberofusers':
276 case 'numberofactiveusers':
278 case 'numberofpages':
280 case 'numberofadmins':
282 case 'numberofedits':
284 case 'currenttimestamp':
286 case 'localtimestamp':
287 return MWTimestamp::getLocalInstance( $ts )->format(
'YmdHis' );
288 case 'currentversion':
291 return (
string)$svcOptions->
get(
'ArticlePath' );
293 return (
string)$svcOptions->
get(
'Sitename' );
295 return (
string)$svcOptions->
get(
'Server' );
297 return (
string)$svcOptions->
get(
'ServerName' );
299 return (
string)$svcOptions->
get(
'ScriptPath' );
301 return (
string)$svcOptions->
get(
'StylePath' );
302 case 'directionmark':
303 return $pageLang->getDirMark();
304 case 'contentlanguage':
305 return (
string)$svcOptions->
get(
'LanguageCode' );
307 return $pageLang->getCode();
308 case 'cascadingsources':