MediaWiki  master
ApiQuerySiteinfo.php
Go to the documentation of this file.
1 <?php
33 
34  public function __construct( ApiQuery $query, $moduleName ) {
35  parent::__construct( $query, $moduleName, 'si' );
36  }
37 
38  public function execute() {
39  $params = $this->extractRequestParams();
40  $done = [];
41  $fit = false;
42  foreach ( $params['prop'] as $p ) {
43  switch ( $p ) {
44  case 'general':
45  $fit = $this->appendGeneralInfo( $p );
46  break;
47  case 'namespaces':
48  $fit = $this->appendNamespaces( $p );
49  break;
50  case 'namespacealiases':
51  $fit = $this->appendNamespaceAliases( $p );
52  break;
53  case 'specialpagealiases':
54  $fit = $this->appendSpecialPageAliases( $p );
55  break;
56  case 'magicwords':
57  $fit = $this->appendMagicWords( $p );
58  break;
59  case 'interwikimap':
60  $filteriw = isset( $params['filteriw'] ) ? $params['filteriw'] : false;
61  $fit = $this->appendInterwikiMap( $p, $filteriw );
62  break;
63  case 'dbrepllag':
64  $fit = $this->appendDbReplLagInfo( $p, $params['showalldb'] );
65  break;
66  case 'statistics':
67  $fit = $this->appendStatistics( $p );
68  break;
69  case 'usergroups':
70  $fit = $this->appendUserGroups( $p, $params['numberingroup'] );
71  break;
72  case 'libraries':
73  $fit = $this->appendInstalledLibraries( $p );
74  break;
75  case 'extensions':
76  $fit = $this->appendExtensions( $p );
77  break;
78  case 'fileextensions':
79  $fit = $this->appendFileExtensions( $p );
80  break;
81  case 'rightsinfo':
82  $fit = $this->appendRightsInfo( $p );
83  break;
84  case 'restrictions':
85  $fit = $this->appendRestrictions( $p );
86  break;
87  case 'languages':
88  $fit = $this->appendLanguages( $p );
89  break;
90  case 'skins':
91  $fit = $this->appendSkins( $p );
92  break;
93  case 'extensiontags':
94  $fit = $this->appendExtensionTags( $p );
95  break;
96  case 'functionhooks':
97  $fit = $this->appendFunctionHooks( $p );
98  break;
99  case 'showhooks':
100  $fit = $this->appendSubscribedHooks( $p );
101  break;
102  case 'variables':
103  $fit = $this->appendVariables( $p );
104  break;
105  case 'protocols':
106  $fit = $this->appendProtocols( $p );
107  break;
108  case 'defaultoptions':
109  $fit = $this->appendDefaultOptions( $p );
110  break;
111  case 'uploaddialog':
112  $fit = $this->appendUploadDialog( $p );
113  break;
114  default:
115  ApiBase::dieDebug( __METHOD__, "Unknown prop=$p" );
116  }
117  if ( !$fit ) {
118  // Abuse siprop as a query-continue parameter
119  // and set it to all unprocessed props
120  $this->setContinueEnumParameter( 'prop', implode( '|',
121  array_diff( $params['prop'], $done ) ) );
122  break;
123  }
124  $done[] = $p;
125  }
126  }
127 
128  protected function appendGeneralInfo( $property ) {
130 
131  $config = $this->getConfig();
132 
133  $data = [];
134  $mainPage = Title::newMainPage();
135  $data['mainpage'] = $mainPage->getPrefixedText();
136  $data['base'] = wfExpandUrl( $mainPage->getFullURL(), PROTO_CURRENT );
137  $data['sitename'] = $config->get( 'Sitename' );
138 
139  // wgLogo can either be a relative or an absolute path
140  // make sure we always return an absolute path
141  $data['logo'] = wfExpandUrl( $config->get( 'Logo' ), PROTO_RELATIVE );
142 
143  $data['generator'] = "MediaWiki {$config->get( 'Version' )}";
144 
145  $data['phpversion'] = PHP_VERSION;
146  $data['phpsapi'] = PHP_SAPI;
147  if ( defined( 'HHVM_VERSION' ) ) {
148  $data['hhvmversion'] = HHVM_VERSION;
149  }
150  $data['dbtype'] = $config->get( 'DBtype' );
151  $data['dbversion'] = $this->getDB()->getServerVersion();
152 
153  $allowFrom = [ '' ];
154  $allowException = true;
155  if ( !$config->get( 'AllowExternalImages' ) ) {
156  $data['imagewhitelistenabled'] = (bool)$config->get( 'EnableImageWhitelist' );
157  $allowFrom = $config->get( 'AllowExternalImagesFrom' );
158  $allowException = !empty( $allowFrom );
159  }
160  if ( $allowException ) {
161  $data['externalimages'] = (array)$allowFrom;
162  ApiResult::setIndexedTagName( $data['externalimages'], 'prefix' );
163  }
164 
165  $data['langconversion'] = !$config->get( 'DisableLangConversion' );
166  $data['titleconversion'] = !$config->get( 'DisableTitleConversion' );
167 
168  if ( $wgContLang->linkPrefixExtension() ) {
169  $linkPrefixCharset = $wgContLang->linkPrefixCharset();
170  $data['linkprefixcharset'] = $linkPrefixCharset;
171  // For backwards compatibility
172  $data['linkprefix'] = "/^((?>.*[^$linkPrefixCharset]|))(.+)$/sDu";
173  } else {
174  $data['linkprefixcharset'] = '';
175  $data['linkprefix'] = '';
176  }
177 
178  $linktrail = $wgContLang->linkTrail();
179  $data['linktrail'] = $linktrail ?: '';
180 
181  $data['legaltitlechars'] = Title::legalChars();
182  $data['invalidusernamechars'] = $config->get( 'InvalidUsernameCharacters' );
183 
184  $data['allunicodefixes'] = (bool)$config->get( 'AllUnicodeFixes' );
185  $data['fixarabicunicode'] = (bool)$config->get( 'FixArabicUnicode' );
186  $data['fixmalayalamunicode'] = (bool)$config->get( 'FixMalayalamUnicode' );
187 
188  global $IP;
189  $git = SpecialVersion::getGitHeadSha1( $IP );
190  if ( $git ) {
191  $data['git-hash'] = $git;
192  $data['git-branch'] =
194  }
195 
196  // 'case-insensitive' option is reserved for future
197  $data['case'] = $config->get( 'CapitalLinks' ) ? 'first-letter' : 'case-sensitive';
198  $data['lang'] = $config->get( 'LanguageCode' );
199 
200  $fallbacks = [];
201  foreach ( $wgContLang->getFallbackLanguages() as $code ) {
202  $fallbacks[] = [ 'code' => $code ];
203  }
204  $data['fallback'] = $fallbacks;
205  ApiResult::setIndexedTagName( $data['fallback'], 'lang' );
206 
207  if ( $wgContLang->hasVariants() ) {
208  $variants = [];
209  foreach ( $wgContLang->getVariants() as $code ) {
210  $variants[] = [
211  'code' => $code,
212  'name' => $wgContLang->getVariantname( $code ),
213  ];
214  }
215  $data['variants'] = $variants;
216  ApiResult::setIndexedTagName( $data['variants'], 'lang' );
217  }
218 
219  $data['rtl'] = $wgContLang->isRTL();
220  $data['fallback8bitEncoding'] = $wgContLang->fallback8bitEncoding();
221 
222  $data['readonly'] = wfReadOnly();
223  if ( $data['readonly'] ) {
224  $data['readonlyreason'] = wfReadOnlyReason();
225  }
226  $data['writeapi'] = (bool)$config->get( 'EnableWriteAPI' );
227 
228  $data['maxarticlesize'] = $config->get( 'MaxArticleSize' ) * 1024;
229 
230  $tz = $config->get( 'Localtimezone' );
231  $offset = $config->get( 'LocalTZoffset' );
232  if ( is_null( $tz ) ) {
233  $tz = 'UTC';
234  $offset = 0;
235  } elseif ( is_null( $offset ) ) {
236  $offset = 0;
237  }
238  $data['timezone'] = $tz;
239  $data['timeoffset'] = intval( $offset );
240  $data['articlepath'] = $config->get( 'ArticlePath' );
241  $data['scriptpath'] = $config->get( 'ScriptPath' );
242  $data['script'] = $config->get( 'Script' );
243  $data['variantarticlepath'] = $config->get( 'VariantArticlePath' );
244  $data[ApiResult::META_BC_BOOLS][] = 'variantarticlepath';
245  $data['server'] = $config->get( 'Server' );
246  $data['servername'] = $config->get( 'ServerName' );
247  $data['wikiid'] = wfWikiID();
248  $data['time'] = wfTimestamp( TS_ISO_8601, time() );
249 
250  $data['misermode'] = (bool)$config->get( 'MiserMode' );
251 
252  $data['uploadsenabled'] = UploadBase::isEnabled();
253  $data['maxuploadsize'] = UploadBase::getMaxUploadSize();
254  $data['minuploadchunksize'] = (int)$config->get( 'MinUploadChunkSize' );
255 
256  $data['thumblimits'] = $config->get( 'ThumbLimits' );
257  ApiResult::setArrayType( $data['thumblimits'], 'BCassoc' );
258  ApiResult::setIndexedTagName( $data['thumblimits'], 'limit' );
259  $data['imagelimits'] = [];
260  ApiResult::setArrayType( $data['imagelimits'], 'BCassoc' );
261  ApiResult::setIndexedTagName( $data['imagelimits'], 'limit' );
262  foreach ( $config->get( 'ImageLimits' ) as $k => $limit ) {
263  $data['imagelimits'][$k] = [ 'width' => $limit[0], 'height' => $limit[1] ];
264  }
265 
266  $favicon = $config->get( 'Favicon' );
267  if ( !empty( $favicon ) ) {
268  // wgFavicon can either be a relative or an absolute path
269  // make sure we always return an absolute path
270  $data['favicon'] = wfExpandUrl( $favicon, PROTO_RELATIVE );
271  }
272 
273  $data['centralidlookupprovider'] = $config->get( 'CentralIdLookupProvider' );
274  $providerIds = array_keys( $config->get( 'CentralIdLookupProviders' ) );
275  $data['allcentralidlookupproviders'] = $providerIds;
276 
277  $data['interwikimagic'] = (bool)$config->get( 'InterwikiMagic' );
278 
279  Hooks::run( 'APIQuerySiteInfoGeneralInfo', [ $this, &$data ] );
280 
281  return $this->getResult()->addValue( 'query', $property, $data );
282  }
283 
284  protected function appendNamespaces( $property ) {
286  $data = [
287  ApiResult::META_TYPE => 'assoc',
288  ];
289  foreach ( $wgContLang->getFormattedNamespaces() as $ns => $title ) {
290  $data[$ns] = [
291  'id' => intval( $ns ),
292  'case' => MWNamespace::isCapitalized( $ns ) ? 'first-letter' : 'case-sensitive',
293  ];
294  ApiResult::setContentValue( $data[$ns], 'name', $title );
295  $canonical = MWNamespace::getCanonicalName( $ns );
296 
297  $data[$ns]['subpages'] = MWNamespace::hasSubpages( $ns );
298 
299  if ( $canonical ) {
300  $data[$ns]['canonical'] = strtr( $canonical, '_', ' ' );
301  }
302 
303  $data[$ns]['content'] = MWNamespace::isContent( $ns );
304  $data[$ns]['nonincludable'] = MWNamespace::isNonincludable( $ns );
305 
306  $contentmodel = MWNamespace::getNamespaceContentModel( $ns );
307  if ( $contentmodel ) {
308  $data[$ns]['defaultcontentmodel'] = $contentmodel;
309  }
310  }
311 
312  ApiResult::setArrayType( $data, 'assoc' );
313  ApiResult::setIndexedTagName( $data, 'ns' );
314 
315  return $this->getResult()->addValue( 'query', $property, $data );
316  }
317 
318  protected function appendNamespaceAliases( $property ) {
320  $aliases = array_merge( $this->getConfig()->get( 'NamespaceAliases' ),
321  $wgContLang->getNamespaceAliases() );
322  $namespaces = $wgContLang->getNamespaces();
323  $data = [];
324  foreach ( $aliases as $title => $ns ) {
325  if ( $namespaces[$ns] == $title ) {
326  // Don't list duplicates
327  continue;
328  }
329  $item = [
330  'id' => intval( $ns )
331  ];
332  ApiResult::setContentValue( $item, 'alias', strtr( $title, '_', ' ' ) );
333  $data[] = $item;
334  }
335 
336  sort( $data );
337 
338  ApiResult::setIndexedTagName( $data, 'ns' );
339 
340  return $this->getResult()->addValue( 'query', $property, $data );
341  }
342 
343  protected function appendSpecialPageAliases( $property ) {
345  $data = [];
346  $aliases = $wgContLang->getSpecialPageAliases();
347  foreach ( SpecialPageFactory::getNames() as $specialpage ) {
348  if ( isset( $aliases[$specialpage] ) ) {
349  $arr = [ 'realname' => $specialpage, 'aliases' => $aliases[$specialpage] ];
350  ApiResult::setIndexedTagName( $arr['aliases'], 'alias' );
351  $data[] = $arr;
352  }
353  }
354  ApiResult::setIndexedTagName( $data, 'specialpage' );
355 
356  return $this->getResult()->addValue( 'query', $property, $data );
357  }
358 
359  protected function appendMagicWords( $property ) {
361  $data = [];
362  foreach ( $wgContLang->getMagicWords() as $magicword => $aliases ) {
363  $caseSensitive = array_shift( $aliases );
364  $arr = [ 'name' => $magicword, 'aliases' => $aliases ];
365  $arr['case-sensitive'] = (bool)$caseSensitive;
366  ApiResult::setIndexedTagName( $arr['aliases'], 'alias' );
367  $data[] = $arr;
368  }
369  ApiResult::setIndexedTagName( $data, 'magicword' );
370 
371  return $this->getResult()->addValue( 'query', $property, $data );
372  }
373 
374  protected function appendInterwikiMap( $property, $filter ) {
375  $local = null;
376  if ( $filter === 'local' ) {
377  $local = 1;
378  } elseif ( $filter === '!local' ) {
379  $local = 0;
380  } elseif ( $filter ) {
381  ApiBase::dieDebug( __METHOD__, "Unknown filter=$filter" );
382  }
383 
384  $params = $this->extractRequestParams();
385  $langCode = isset( $params['inlanguagecode'] ) ? $params['inlanguagecode'] : '';
386  $langNames = Language::fetchLanguageNames( $langCode );
387 
388  $getPrefixes = Interwiki::getAllPrefixes( $local );
389  $extraLangPrefixes = $this->getConfig()->get( 'ExtraInterlanguageLinkPrefixes' );
390  $localInterwikis = $this->getConfig()->get( 'LocalInterwikis' );
391  $data = [];
392 
393  foreach ( $getPrefixes as $row ) {
394  $prefix = $row['iw_prefix'];
395  $val = [];
396  $val['prefix'] = $prefix;
397  if ( isset( $row['iw_local'] ) && $row['iw_local'] == '1' ) {
398  $val['local'] = true;
399  }
400  if ( isset( $row['iw_trans'] ) && $row['iw_trans'] == '1' ) {
401  $val['trans'] = true;
402  }
403 
404  if ( isset( $langNames[$prefix] ) ) {
405  $val['language'] = $langNames[$prefix];
406  }
407  if ( in_array( $prefix, $localInterwikis ) ) {
408  $val['localinterwiki'] = true;
409  }
410  if ( in_array( $prefix, $extraLangPrefixes ) ) {
411  $val['extralanglink'] = true;
412 
413  $linktext = wfMessage( "interlanguage-link-$prefix" );
414  if ( !$linktext->isDisabled() ) {
415  $val['linktext'] = $linktext->text();
416  }
417 
418  $sitename = wfMessage( "interlanguage-link-sitename-$prefix" );
419  if ( !$sitename->isDisabled() ) {
420  $val['sitename'] = $sitename->text();
421  }
422  }
423 
424  $val['url'] = wfExpandUrl( $row['iw_url'], PROTO_CURRENT );
425  $val['protorel'] = substr( $row['iw_url'], 0, 2 ) == '//';
426  if ( isset( $row['iw_wikiid'] ) && $row['iw_wikiid'] !== '' ) {
427  $val['wikiid'] = $row['iw_wikiid'];
428  }
429  if ( isset( $row['iw_api'] ) && $row['iw_api'] !== '' ) {
430  $val['api'] = $row['iw_api'];
431  }
432 
433  $data[] = $val;
434  }
435 
436  ApiResult::setIndexedTagName( $data, 'iw' );
437 
438  return $this->getResult()->addValue( 'query', $property, $data );
439  }
440 
441  protected function appendDbReplLagInfo( $property, $includeAll ) {
442  $data = [];
443  $lb = wfGetLB();
444  $showHostnames = $this->getConfig()->get( 'ShowHostnames' );
445  if ( $includeAll ) {
446  if ( !$showHostnames ) {
447  $this->dieUsage(
448  'Cannot view all servers info unless $wgShowHostnames is true',
449  'includeAllDenied'
450  );
451  }
452 
453  $lags = $lb->getLagTimes();
454  foreach ( $lags as $i => $lag ) {
455  $data[] = [
456  'host' => $lb->getServerName( $i ),
457  'lag' => $lag
458  ];
459  }
460  } else {
461  list( , $lag, $index ) = $lb->getMaxLag();
462  $data[] = [
463  'host' => $showHostnames
464  ? $lb->getServerName( $index )
465  : '',
466  'lag' => intval( $lag )
467  ];
468  }
469 
470  ApiResult::setIndexedTagName( $data, 'db' );
471 
472  return $this->getResult()->addValue( 'query', $property, $data );
473  }
474 
475  protected function appendStatistics( $property ) {
476  $data = [];
477  $data['pages'] = intval( SiteStats::pages() );
478  $data['articles'] = intval( SiteStats::articles() );
479  $data['edits'] = intval( SiteStats::edits() );
480  $data['images'] = intval( SiteStats::images() );
481  $data['users'] = intval( SiteStats::users() );
482  $data['activeusers'] = intval( SiteStats::activeUsers() );
483  $data['admins'] = intval( SiteStats::numberingroup( 'sysop' ) );
484  $data['jobs'] = intval( SiteStats::jobs() );
485 
486  Hooks::run( 'APIQuerySiteInfoStatisticsInfo', [ &$data ] );
487 
488  return $this->getResult()->addValue( 'query', $property, $data );
489  }
490 
491  protected function appendUserGroups( $property, $numberInGroup ) {
492  $config = $this->getConfig();
493 
494  $data = [];
495  $result = $this->getResult();
496  $allGroups = array_values( User::getAllGroups() );
497  foreach ( $config->get( 'GroupPermissions' ) as $group => $permissions ) {
498  $arr = [
499  'name' => $group,
500  'rights' => array_keys( $permissions, true ),
501  ];
502 
503  if ( $numberInGroup ) {
504  $autopromote = $config->get( 'Autopromote' );
505 
506  if ( $group == 'user' ) {
507  $arr['number'] = SiteStats::users();
508  // '*' and autopromote groups have no size
509  } elseif ( $group !== '*' && !isset( $autopromote[$group] ) ) {
510  $arr['number'] = SiteStats::numberingroup( $group );
511  }
512  }
513 
514  $groupArr = [
515  'add' => $config->get( 'AddGroups' ),
516  'remove' => $config->get( 'RemoveGroups' ),
517  'add-self' => $config->get( 'GroupsAddToSelf' ),
518  'remove-self' => $config->get( 'GroupsRemoveFromSelf' )
519  ];
520 
521  foreach ( $groupArr as $type => $rights ) {
522  if ( isset( $rights[$group] ) ) {
523  if ( $rights[$group] === true ) {
524  $groups = $allGroups;
525  } else {
526  $groups = array_intersect( $rights[$group], $allGroups );
527  }
528  if ( $groups ) {
529  $arr[$type] = $groups;
530  ApiResult::setArrayType( $arr[$type], 'BCarray' );
531  ApiResult::setIndexedTagName( $arr[$type], 'group' );
532  }
533  }
534  }
535 
536  ApiResult::setIndexedTagName( $arr['rights'], 'permission' );
537  $data[] = $arr;
538  }
539 
540  ApiResult::setIndexedTagName( $data, 'group' );
541 
542  return $result->addValue( 'query', $property, $data );
543  }
544 
545  protected function appendFileExtensions( $property ) {
546  $data = [];
547  foreach ( array_unique( $this->getConfig()->get( 'FileExtensions' ) ) as $ext ) {
548  $data[] = [ 'ext' => $ext ];
549  }
550  ApiResult::setIndexedTagName( $data, 'fe' );
551 
552  return $this->getResult()->addValue( 'query', $property, $data );
553  }
554 
555  protected function appendInstalledLibraries( $property ) {
556  global $IP;
557  $path = "$IP/vendor/composer/installed.json";
558  if ( !file_exists( $path ) ) {
559  return true;
560  }
561 
562  $data = [];
563  $installed = new ComposerInstalled( $path );
564  foreach ( $installed->getInstalledDependencies() as $name => $info ) {
565  if ( strpos( $info['type'], 'mediawiki-' ) === 0 ) {
566  // Skip any extensions or skins since they'll be listed
567  // in their proper section
568  continue;
569  }
570  $data[] = [
571  'name' => $name,
572  'version' => $info['version'],
573  ];
574  }
575  ApiResult::setIndexedTagName( $data, 'library' );
576 
577  return $this->getResult()->addValue( 'query', $property, $data );
578 
579  }
580 
581  protected function appendExtensions( $property ) {
582  $data = [];
583  foreach ( $this->getConfig()->get( 'ExtensionCredits' ) as $type => $extensions ) {
584  foreach ( $extensions as $ext ) {
585  $ret = [];
586  $ret['type'] = $type;
587  if ( isset( $ext['name'] ) ) {
588  $ret['name'] = $ext['name'];
589  }
590  if ( isset( $ext['namemsg'] ) ) {
591  $ret['namemsg'] = $ext['namemsg'];
592  }
593  if ( isset( $ext['description'] ) ) {
594  $ret['description'] = $ext['description'];
595  }
596  if ( isset( $ext['descriptionmsg'] ) ) {
597  // Can be a string or [ key, param1, param2, ... ]
598  if ( is_array( $ext['descriptionmsg'] ) ) {
599  $ret['descriptionmsg'] = $ext['descriptionmsg'][0];
600  $ret['descriptionmsgparams'] = array_slice( $ext['descriptionmsg'], 1 );
601  ApiResult::setIndexedTagName( $ret['descriptionmsgparams'], 'param' );
602  } else {
603  $ret['descriptionmsg'] = $ext['descriptionmsg'];
604  }
605  }
606  if ( isset( $ext['author'] ) ) {
607  $ret['author'] = is_array( $ext['author'] ) ?
608  implode( ', ', $ext['author'] ) : $ext['author'];
609  }
610  if ( isset( $ext['url'] ) ) {
611  $ret['url'] = $ext['url'];
612  }
613  if ( isset( $ext['version'] ) ) {
614  $ret['version'] = $ext['version'];
615  }
616  if ( isset( $ext['path'] ) ) {
617  $extensionPath = dirname( $ext['path'] );
618  $gitInfo = new GitInfo( $extensionPath );
619  $vcsVersion = $gitInfo->getHeadSHA1();
620  if ( $vcsVersion !== false ) {
621  $ret['vcs-system'] = 'git';
622  $ret['vcs-version'] = $vcsVersion;
623  $ret['vcs-url'] = $gitInfo->getHeadViewUrl();
624  $vcsDate = $gitInfo->getHeadCommitDate();
625  if ( $vcsDate !== false ) {
626  $ret['vcs-date'] = wfTimestamp( TS_ISO_8601, $vcsDate );
627  }
628  }
629 
630  if ( SpecialVersion::getExtLicenseFileName( $extensionPath ) ) {
631  $ret['license-name'] = isset( $ext['license-name'] ) ? $ext['license-name'] : '';
632  $ret['license'] = SpecialPage::getTitleFor(
633  'Version',
634  "License/{$ext['name']}"
635  )->getLinkURL();
636  }
637 
638  if ( SpecialVersion::getExtAuthorsFileName( $extensionPath ) ) {
639  $ret['credits'] = SpecialPage::getTitleFor(
640  'Version',
641  "Credits/{$ext['name']}"
642  )->getLinkURL();
643  }
644  }
645  $data[] = $ret;
646  }
647  }
648 
649  ApiResult::setIndexedTagName( $data, 'ext' );
650 
651  return $this->getResult()->addValue( 'query', $property, $data );
652  }
653 
654  protected function appendRightsInfo( $property ) {
655  $config = $this->getConfig();
656  $rightsPage = $config->get( 'RightsPage' );
657  if ( is_string( $rightsPage ) ) {
658  $title = Title::newFromText( $rightsPage );
659  $url = wfExpandUrl( $title, PROTO_CURRENT );
660  } else {
661  $title = false;
662  $url = $config->get( 'RightsUrl' );
663  }
664  $text = $config->get( 'RightsText' );
665  if ( !$text && $title ) {
666  $text = $title->getPrefixedText();
667  }
668 
669  $data = [
670  'url' => $url ?: '',
671  'text' => $text ?: ''
672  ];
673 
674  return $this->getResult()->addValue( 'query', $property, $data );
675  }
676 
677  protected function appendRestrictions( $property ) {
678  $config = $this->getConfig();
679  $data = [
680  'types' => $config->get( 'RestrictionTypes' ),
681  'levels' => $config->get( 'RestrictionLevels' ),
682  'cascadinglevels' => $config->get( 'CascadingRestrictionLevels' ),
683  'semiprotectedlevels' => $config->get( 'SemiprotectedRestrictionLevels' ),
684  ];
685 
686  ApiResult::setArrayType( $data['types'], 'BCarray' );
687  ApiResult::setArrayType( $data['levels'], 'BCarray' );
688  ApiResult::setArrayType( $data['cascadinglevels'], 'BCarray' );
689  ApiResult::setArrayType( $data['semiprotectedlevels'], 'BCarray' );
690 
691  ApiResult::setIndexedTagName( $data['types'], 'type' );
692  ApiResult::setIndexedTagName( $data['levels'], 'level' );
693  ApiResult::setIndexedTagName( $data['cascadinglevels'], 'level' );
694  ApiResult::setIndexedTagName( $data['semiprotectedlevels'], 'level' );
695 
696  return $this->getResult()->addValue( 'query', $property, $data );
697  }
698 
699  public function appendLanguages( $property ) {
700  $params = $this->extractRequestParams();
701  $langCode = isset( $params['inlanguagecode'] ) ? $params['inlanguagecode'] : '';
702  $langNames = Language::fetchLanguageNames( $langCode );
703 
704  $data = [];
705 
706  foreach ( $langNames as $code => $name ) {
707  $lang = [ 'code' => $code ];
709  $data[] = $lang;
710  }
711  ApiResult::setIndexedTagName( $data, 'lang' );
712 
713  return $this->getResult()->addValue( 'query', $property, $data );
714  }
715 
716  public function appendSkins( $property ) {
717  $data = [];
718  $allowed = Skin::getAllowedSkins();
719  $default = Skin::normalizeKey( 'default' );
720  foreach ( Skin::getSkinNames() as $name => $displayName ) {
721  $msg = $this->msg( "skinname-{$name}" );
722  $code = $this->getParameter( 'inlanguagecode' );
723  if ( $code && Language::isValidCode( $code ) ) {
724  $msg->inLanguage( $code );
725  } else {
726  $msg->inContentLanguage();
727  }
728  if ( $msg->exists() ) {
729  $displayName = $msg->text();
730  }
731  $skin = [ 'code' => $name ];
732  ApiResult::setContentValue( $skin, 'name', $displayName );
733  if ( !isset( $allowed[$name] ) ) {
734  $skin['unusable'] = true;
735  }
736  if ( $name === $default ) {
737  $skin['default'] = true;
738  }
739  $data[] = $skin;
740  }
741  ApiResult::setIndexedTagName( $data, 'skin' );
742 
743  return $this->getResult()->addValue( 'query', $property, $data );
744  }
745 
746  public function appendExtensionTags( $property ) {
748  $wgParser->firstCallInit();
749  $tags = array_map( [ $this, 'formatParserTags' ], $wgParser->getTags() );
750  ApiResult::setArrayType( $tags, 'BCarray' );
751  ApiResult::setIndexedTagName( $tags, 't' );
752 
753  return $this->getResult()->addValue( 'query', $property, $tags );
754  }
755 
756  public function appendFunctionHooks( $property ) {
758  $wgParser->firstCallInit();
759  $hooks = $wgParser->getFunctionHooks();
760  ApiResult::setArrayType( $hooks, 'BCarray' );
761  ApiResult::setIndexedTagName( $hooks, 'h' );
762 
763  return $this->getResult()->addValue( 'query', $property, $hooks );
764  }
765 
766  public function appendVariables( $property ) {
767  $variables = MagicWord::getVariableIDs();
768  ApiResult::setArrayType( $variables, 'BCarray' );
769  ApiResult::setIndexedTagName( $variables, 'v' );
770 
771  return $this->getResult()->addValue( 'query', $property, $variables );
772  }
773 
774  public function appendProtocols( $property ) {
775  // Make a copy of the global so we don't try to set the _element key of it - bug 45130
776  $protocols = array_values( $this->getConfig()->get( 'UrlProtocols' ) );
777  ApiResult::setArrayType( $protocols, 'BCarray' );
778  ApiResult::setIndexedTagName( $protocols, 'p' );
779 
780  return $this->getResult()->addValue( 'query', $property, $protocols );
781  }
782 
783  public function appendDefaultOptions( $property ) {
785  $options[ApiResult::META_BC_BOOLS] = array_keys( $options );
786  return $this->getResult()->addValue( 'query', $property, $options );
787  }
788 
789  public function appendUploadDialog( $property ) {
790  $config = $this->getConfig()->get( 'UploadDialog' );
791  return $this->getResult()->addValue( 'query', $property, $config );
792  }
793 
794  private function formatParserTags( $item ) {
795  return "<{$item}>";
796  }
797 
798  public function appendSubscribedHooks( $property ) {
799  $hooks = $this->getConfig()->get( 'Hooks' );
800  $myWgHooks = $hooks;
801  ksort( $myWgHooks );
802 
803  $data = [];
804  foreach ( $myWgHooks as $name => $subscribers ) {
805  $arr = [
806  'name' => $name,
807  'subscribers' => array_map( [ 'SpecialVersion', 'arrayToString' ], $subscribers ),
808  ];
809 
810  ApiResult::setArrayType( $arr['subscribers'], 'array' );
811  ApiResult::setIndexedTagName( $arr['subscribers'], 's' );
812  $data[] = $arr;
813  }
814 
815  ApiResult::setIndexedTagName( $data, 'hook' );
816 
817  return $this->getResult()->addValue( 'query', $property, $data );
818  }
819 
820  public function getCacheMode( $params ) {
821  // Messages for $wgExtraInterlanguageLinkPrefixes depend on user language
822  if (
823  count( $this->getConfig()->get( 'ExtraInterlanguageLinkPrefixes' ) ) &&
824  !is_null( $params['prop'] ) &&
825  in_array( 'interwikimap', $params['prop'] )
826  ) {
827  return 'anon-public-user-private';
828  }
829 
830  return 'public';
831  }
832 
833  public function getAllowedParams() {
834  return [
835  'prop' => [
836  ApiBase::PARAM_DFLT => 'general',
837  ApiBase::PARAM_ISMULTI => true,
839  'general',
840  'namespaces',
841  'namespacealiases',
842  'specialpagealiases',
843  'magicwords',
844  'interwikimap',
845  'dbrepllag',
846  'statistics',
847  'usergroups',
848  'libraries',
849  'extensions',
850  'fileextensions',
851  'rightsinfo',
852  'restrictions',
853  'languages',
854  'skins',
855  'extensiontags',
856  'functionhooks',
857  'showhooks',
858  'variables',
859  'protocols',
860  'defaultoptions',
861  'uploaddialog',
862  ],
864  ],
865  'filteriw' => [
867  'local',
868  '!local',
869  ]
870  ],
871  'showalldb' => false,
872  'numberingroup' => false,
873  'inlanguagecode' => null,
874  ];
875  }
876 
877  protected function getExamplesMessages() {
878  return [
879  'action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics'
880  => 'apihelp-query+siteinfo-example-simple',
881  'action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local'
882  => 'apihelp-query+siteinfo-example-interwiki',
883  'action=query&meta=siteinfo&siprop=dbrepllag&sishowalldb='
884  => 'apihelp-query+siteinfo-example-replag',
885  ];
886  }
887 
888  public function getHelpUrls() {
889  return 'https://www.mediawiki.org/wiki/API:Siteinfo';
890  }
891 }
appendLanguages($property)
static getVariableIDs()
Get an array of parser variable IDs.
Definition: MagicWord.php:271
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below...
Definition: ApiBase.php:88
getDB()
Get the Query database connection (read-only)
static getExtAuthorsFileName($extDir)
Obtains the full path of an extensions authors or credits file if one exists.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
appendSpecialPageAliases($property)
the array() calling protocol came about after MediaWiki 1.4rc1.
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition: hooks.txt:1435
getResult()
Get the result object.
Definition: ApiBase.php:577
appendRestrictions($property)
static jobs()
Definition: SiteStats.php:203
appendFunctionHooks($property)
$property
appendRightsInfo($property)
getParameter($paramName, $parseLimit=true)
Get a value for the given parameter.
Definition: ApiBase.php:702
static isNonincludable($index)
It is not possible to use pages from this namespace as template?
static newMainPage()
Create a new Title for the Main Page.
Definition: Title.php:548
$IP
Definition: WebStart.php:58
static getTitleFor($name, $subpage=false, $fragment= '')
Get a localised Title object for a specified special page name.
Definition: SpecialPage.php:80
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition: ApiBase.php:50
$wgParser
Definition: Setup.php:816
if(!isset($args[0])) $lang
This is a base class for all Query modules.
static getSkinNames()
Fetch the set of available skins.
Definition: Skin.php:49
extractRequestParams($parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user...
Definition: ApiBase.php:678
const PROTO_CURRENT
Definition: Defines.php:265
const META_TYPE
Key for the 'type' metadata item.
Definition: ApiResult.php:108
static activeUsers()
Definition: SiteStats.php:161
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
Definition: ApiBase.php:157
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:256
when a variable name is used in a it is silently declared as a new local masking the global
Definition: design.txt:93
wfExpandUrl($url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
static setContentValue(array &$arr, $name, $value, $flags=0)
Add an output value to the array by name and mark as META_CONTENT.
Definition: ApiResult.php:480
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:618
appendSubscribedHooks($property)
static getMaxUploadSize($forType=null)
Get the MediaWiki maximum uploaded file size for given type of upload, based on $wgMaxUploadSize.
static fetchLanguageNames($inLanguage=null, $include= 'mw')
Get an array of language names, indexed by code.
Definition: Language.php:798
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message.Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item.Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page.Return false to stop further processing of the tag $reader:XMLReader object &$pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision.Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag.Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload.Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports.&$fullInterwikiPrefix:Interwiki prefix, may contain colons.&$pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable.Can be used to lazy-load the import sources list.&$importSources:The value of $wgImportSources.Modify as necessary.See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page.$context:IContextSource object &$pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect.&$title:Title object for the current page &$request:WebRequest &$ignoreRedirect:boolean to skip redirect check &$target:Title/string of redirect target &$article:Article object 'InternalParseBeforeLinks':during Parser's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings.&$parser:Parser object &$text:string containing partially parsed text &$stripState:Parser's internal StripState object 'InternalParseBeforeSanitize':during Parser's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings.Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments.&$parser:Parser object &$text:string containing partially parsed text &$stripState:Parser's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not.Return true without providing an interwiki to continue interwiki search.$prefix:interwiki prefix we are looking for.&$iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user's email has been invalidated successfully.$user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification.Callee may modify $url and $query, URL will be constructed as $url.$query &$url:URL to index.php &$query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) &$article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() &$ip:IP being check &$result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from &$allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn't match your organization.$addr:The e-mail address entered by the user &$result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user &$result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we're looking for a messages file for &$file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED!Use $magicWords in a file listed in $wgExtensionMessagesFiles instead.Use this to define synonyms of magic words depending of the language &$magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces.Do not use this hook to add namespaces.Use CanonicalNamespaces for that.&$namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED!Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead.Use to define aliases of special pages names depending of the language &$specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names.&$names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page's language links.This is called in various places to allow extensions to define the effective language links for a page.$title:The page's Title.&$links:Associative array mapping language codes to prefixed links of the form"language:title".&$linkFlags:Associative array mapping prefixed links to arrays of flags.Currently unused, but planned to provide support for marking individual language links in the UI, e.g.for featured articles. 'LanguageSelector':Hook to change the language selector available on a page.$out:The output page.$cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED!Use HtmlPageLinkRendererBegin instead.Used when generating internal and interwiki links in Linker::link(), before processing starts.Return false to skip default processing and return $ret.See documentation for Linker::link() for details on the expected meanings of parameters.$skin:the Skin object $target:the Title that the link is pointing to &$html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1814
static getAllGroups()
Return the set of defined explicit groups.
Definition: User.php:4914
static getNamespaceContentModel($index)
Get the default content model for a namespace This does not mean that all pages in that namespace hav...
static isCapitalized($index)
Is the namespace first-letter capitalized?
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
static edits()
Definition: SiteStats.php:129
msg()
Get a Message object with context set Parameters are the same as wfMessage()
appendFileExtensions($property)
wfGetLB($wiki=false)
Get a load balancer object.
wfReadOnly()
Check whether the wiki is in read-only mode.
static getCanonicalName($index)
Returns the canonical (English) name for a given index.
$GLOBALS['IP']
appendProtocols($property)
static getNames()
Returns a list of canonical special page names.
static getGitCurrentBranch($dir)
const TS_ISO_8601
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.
__construct(ApiQuery $query, $moduleName)
getConfig()
Get the Config object.
static isValidCode($code)
Returns true if a language code string is of a valid form, whether or not it exists.
Definition: Language.php:333
$params
static getExtLicenseFileName($extDir)
Obtains the full path of an extensions copying or license file if one exists.
appendDefaultOptions($property)
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned after processing after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock()-offset Set to overwrite offset parameter in $wgRequest set to ''to unsetoffset-wrap String Wrap the message in html(usually something like"&lt
Allows to change the fields on the form that will be generated are created Can be used to omit specific feeds from being outputted You must not use this hook to add use OutputPage::addFeedLink() instead.&$feedLinks conditions will AND in the final query as a Content object as a Content object $title
Definition: hooks.txt:312
static hasSubpages($index)
Does the namespace allow subpages?
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:131
const PROTO_RELATIVE
Definition: Defines.php:264
wfWikiID()
Get an ASCII string identifying this wiki This is used as a prefix in memcached keys.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned $skin
Definition: hooks.txt:1816
This is the main query class.
Definition: ApiQuery.php:38
appendUserGroups($property, $numberInGroup)
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
Definition: hooks.txt:1816
namespace and then decline to actually register it & $namespaces
Definition: hooks.txt:927
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
Definition: hooks.txt:776
appendInstalledLibraries($property)
static isEnabled()
Returns true if uploads are enabled.
Definition: UploadBase.php:103
static normalizeKey($key)
Normalize a skin preference value to a form that can be loaded.
Definition: Skin.php:93
static images()
Definition: SiteStats.php:169
appendUploadDialog($property)
appendMagicWords($property)
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
appendVariables($property)
$linkPrefixCharset
static getAllPrefixes($local=null)
Returns all interwiki prefixes.
Definition: Interwiki.php:103
wfReadOnlyReason()
Check if the site is in read-only mode and return the message if so.
appendDbReplLagInfo($property, $includeAll)
static isContent($index)
Does this namespace contain content, for the purposes of calculating statistics, etc?
appendNamespaceAliases($property)
appendNamespaces($property)
static articles()
Definition: SiteStats.php:137
static pages()
Definition: SiteStats.php:145
appendExtensionTags($property)
appendExtensions($property)
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition: ApiBase.php:53
setContinueEnumParameter($paramName, $paramValue)
Set a query-continue value.
const META_BC_BOOLS
Key for the 'BC bools' metadata item.
Definition: ApiResult.php:134
dieUsage($description, $errorCode, $httpRespCode=0, $extradata=null)
Throw a UsageException, which will (if uncaught) call the main module's error handler and die with an...
Definition: ApiBase.php:1481
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive $limit
Definition: hooks.txt:1020
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
Definition: design.txt:56
appendGeneralInfo($property)
static legalChars()
Get a regex character class describing the legal characters in a link.
Definition: Title.php:585
Reads an installed.json file and provides accessors to get what is installed.
$extensions
static numberingroup($group)
Find the number of users in a given user group.
Definition: SiteStats.php:179
static dieDebug($method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:2191
static getDefaultOptions()
Combine the language default options with any site-specific options and add the default language vari...
Definition: User.php:1561
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.
Definition: ApiResult.php:730
A query action to return meta information about the wiki site.
appendStatistics($property)
static getAllowedSkins()
Fetch the list of user-selectable skins in regards to $wgSkipSkins.
Definition: Skin.php:72
static users()
Definition: SiteStats.php:153
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
Definition: hooks.txt:2376
appendInterwikiMap($property, $filter)
static getGitHeadSha1($dir)
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:310