Go to the documentation of this file.
36 parent::__construct(
$query, $moduleName,
'si' );
46 $fit = $this->appendGeneralInfo( $p );
49 $fit = $this->appendNamespaces( $p );
51 case 'namespacealiases':
52 $fit = $this->appendNamespaceAliases( $p );
54 case 'specialpagealiases':
55 $fit = $this->appendSpecialPageAliases( $p );
58 $fit = $this->appendMagicWords( $p );
61 $filteriw = isset(
$params[
'filteriw'] ) ?
$params[
'filteriw'] :
false;
62 $fit = $this->appendInterwikiMap( $p, $filteriw );
65 $fit = $this->appendDbReplLagInfo( $p,
$params[
'showalldb'] );
68 $fit = $this->appendStatistics( $p );
71 $fit = $this->appendUserGroups( $p,
$params[
'numberingroup'] );
74 $fit = $this->appendInstalledLibraries( $p );
77 $fit = $this->appendExtensions( $p );
79 case 'fileextensions':
80 $fit = $this->appendFileExtensions( $p );
83 $fit = $this->appendRightsInfo( $p );
86 $fit = $this->appendRestrictions( $p );
89 $fit = $this->appendLanguages( $p );
91 case 'languagevariants':
92 $fit = $this->appendLanguageVariants( $p );
95 $fit = $this->appendSkins( $p );
98 $fit = $this->appendExtensionTags( $p );
100 case 'functionhooks':
101 $fit = $this->appendFunctionHooks( $p );
104 $fit = $this->appendSubscribedHooks( $p );
107 $fit = $this->appendVariables( $p );
110 $fit = $this->appendProtocols( $p );
112 case 'defaultoptions':
113 $fit = $this->appendDefaultOptions( $p );
116 $fit = $this->appendUploadDialog( $p );
125 array_diff(
$params[
'prop'], $done ) ) );
132 protected function appendGeneralInfo(
$property ) {
139 $data[
'mainpage'] = $mainPage->getPrefixedText();
141 $data[
'sitename'] = $config->get(
'Sitename' );
147 $data[
'generator'] =
"MediaWiki {$config->get( 'Version' )}";
149 $data[
'phpversion'] = PHP_VERSION;
150 $data[
'phpsapi'] = PHP_SAPI;
151 if ( defined(
'HHVM_VERSION' ) ) {
152 $data[
'hhvmversion'] = HHVM_VERSION;
154 $data[
'dbtype'] = $config->get(
'DBtype' );
155 $data[
'dbversion'] = $this->
getDB()->getServerVersion();
158 $allowException =
true;
159 if ( !$config->get(
'AllowExternalImages' ) ) {
160 $data[
'imagewhitelistenabled'] = (bool)$config->get(
'EnableImageWhitelist' );
161 $allowFrom = $config->get(
'AllowExternalImagesFrom' );
162 $allowException = !empty( $allowFrom );
164 if ( $allowException ) {
165 $data[
'externalimages'] = (
array)$allowFrom;
169 $data[
'langconversion'] = !$config->get(
'DisableLangConversion' );
170 $data[
'titleconversion'] = !$config->get(
'DisableTitleConversion' );
176 $data[
'linkprefix'] =
"/^((?>.*[^$linkPrefixCharset]|))(.+)$/sDu";
178 $data[
'linkprefixcharset'] =
'';
179 $data[
'linkprefix'] =
'';
183 $data[
'linktrail'] = $linktrail ?:
'';
186 $data[
'invalidusernamechars'] = $config->get(
'InvalidUsernameCharacters' );
188 $data[
'allunicodefixes'] = (bool)$config->get(
'AllUnicodeFixes' );
189 $data[
'fixarabicunicode'] = (bool)$config->get(
'FixArabicUnicode' );
190 $data[
'fixmalayalamunicode'] = (bool)$config->get(
'FixMalayalamUnicode' );
195 $data[
'git-hash'] = $git;
196 $data[
'git-branch'] =
201 $data[
'case'] = $config->get(
'CapitalLinks' ) ?
'first-letter' :
'case-sensitive';
202 $data[
'lang'] = $config->get(
'LanguageCode' );
206 $fallbacks[] = [
'code' =>
$code ];
208 $data[
'fallback'] = $fallbacks;
219 $data[
'variants'] = $variants;
224 $data[
'fallback8bitEncoding'] =
$wgContLang->fallback8bitEncoding();
227 if ( $data[
'readonly'] ) {
230 $data[
'writeapi'] = (bool)$config->get(
'EnableWriteAPI' );
232 $data[
'maxarticlesize'] = $config->get(
'MaxArticleSize' ) * 1024;
234 $tz = $config->get(
'Localtimezone' );
235 $offset = $config->get(
'LocalTZoffset' );
236 if ( is_null( $tz ) ) {
239 } elseif ( is_null( $offset ) ) {
242 $data[
'timezone'] = $tz;
243 $data[
'timeoffset'] = intval( $offset );
244 $data[
'articlepath'] = $config->get(
'ArticlePath' );
245 $data[
'scriptpath'] = $config->get(
'ScriptPath' );
246 $data[
'script'] = $config->get(
'Script' );
247 $data[
'variantarticlepath'] = $config->get(
'VariantArticlePath' );
249 $data[
'server'] = $config->get(
'Server' );
250 $data[
'servername'] = $config->get(
'ServerName' );
252 $data[
'time'] =
wfTimestamp( TS_ISO_8601, time() );
254 $data[
'misermode'] = (bool)$config->get(
'MiserMode' );
256 $data[
'uploadsenabled'] = UploadBase::isEnabled();
257 $data[
'maxuploadsize'] = UploadBase::getMaxUploadSize();
258 $data[
'minuploadchunksize'] = (int)$config->get(
'MinUploadChunkSize' );
260 $data[
'galleryoptions'] = $config->get(
'GalleryOptions' );
262 $data[
'thumblimits'] = $config->get(
'ThumbLimits' );
265 $data[
'imagelimits'] = [];
268 foreach ( $config->get(
'ImageLimits' )
as $k => $limit ) {
269 $data[
'imagelimits'][$k] = [
'width' => $limit[0],
'height' => $limit[1] ];
272 $favicon = $config->get(
'Favicon' );
273 if ( !empty( $favicon ) ) {
279 $data[
'centralidlookupprovider'] = $config->get(
'CentralIdLookupProvider' );
280 $providerIds = array_keys( $config->get(
'CentralIdLookupProviders' ) );
281 $data[
'allcentralidlookupproviders'] = $providerIds;
283 $data[
'interwikimagic'] = (bool)$config->get(
'InterwikiMagic' );
284 $data[
'magiclinks'] = $config->get(
'EnableMagicLinks' );
286 Hooks::run(
'APIQuerySiteInfoGeneralInfo', [ $this, &$data ] );
291 protected function appendNamespaces(
$property ) {
298 'id' => intval( $ns ),
307 $data[$ns][
'canonical'] = strtr( $canonical,
'_',
' ' );
314 if ( $contentmodel ) {
315 $data[$ns][
'defaultcontentmodel'] = $contentmodel;
325 protected function appendNamespaceAliases(
$property ) {
327 $aliases = array_merge( $this->
getConfig()->
get(
'NamespaceAliases' ),
328 $wgContLang->getNamespaceAliases() );
331 foreach ( $aliases
as $title => $ns ) {
337 'id' => intval( $ns )
350 protected function appendSpecialPageAliases(
$property ) {
355 if ( isset( $aliases[$specialpage] ) ) {
356 $arr = [
'realname' => $specialpage,
'aliases' => $aliases[$specialpage] ];
366 protected function appendMagicWords(
$property ) {
369 foreach (
$wgContLang->getMagicWords()
as $magicword => $aliases ) {
370 $caseSensitive = array_shift( $aliases );
371 $arr = [
'name' => $magicword,
'aliases' => $aliases ];
372 $arr[
'case-sensitive'] = (bool)$caseSensitive;
381 protected function appendInterwikiMap(
$property, $filter ) {
383 if ( $filter ===
'local' ) {
385 } elseif ( $filter ===
'!local' ) {
387 } elseif ( $filter ) {
392 $langCode = isset(
$params[
'inlanguagecode'] ) ?
$params[
'inlanguagecode'] :
'';
395 $getPrefixes = MediaWikiServices::getInstance()->getInterwikiLookup()->getAllPrefixes( $local );
396 $extraLangPrefixes = $this->
getConfig()->get(
'ExtraInterlanguageLinkPrefixes' );
397 $localInterwikis = $this->
getConfig()->get(
'LocalInterwikis' );
400 foreach ( $getPrefixes
as $row ) {
401 $prefix = $row[
'iw_prefix'];
403 $val[
'prefix'] = $prefix;
404 if ( isset( $row[
'iw_local'] ) && $row[
'iw_local'] ==
'1' ) {
405 $val[
'local'] =
true;
407 if ( isset( $row[
'iw_trans'] ) && $row[
'iw_trans'] ==
'1' ) {
408 $val[
'trans'] =
true;
411 if ( isset( $langNames[$prefix] ) ) {
412 $val[
'language'] = $langNames[$prefix];
414 if ( in_array( $prefix, $localInterwikis ) ) {
415 $val[
'localinterwiki'] =
true;
417 if ( in_array( $prefix, $extraLangPrefixes ) ) {
418 $val[
'extralanglink'] =
true;
420 $linktext =
wfMessage(
"interlanguage-link-$prefix" );
421 if ( !$linktext->isDisabled() ) {
422 $val[
'linktext'] = $linktext->text();
425 $sitename =
wfMessage(
"interlanguage-link-sitename-$prefix" );
426 if ( !$sitename->isDisabled() ) {
427 $val[
'sitename'] = $sitename->text();
432 $val[
'protorel'] = substr( $row[
'iw_url'], 0, 2 ) ==
'//';
433 if ( isset( $row[
'iw_wikiid'] ) && $row[
'iw_wikiid'] !==
'' ) {
434 $val[
'wikiid'] = $row[
'iw_wikiid'];
436 if ( isset( $row[
'iw_api'] ) && $row[
'iw_api'] !==
'' ) {
437 $val[
'api'] = $row[
'iw_api'];
448 protected function appendDbReplLagInfo(
$property, $includeAll ) {
451 $showHostnames = $this->
getConfig()->get(
'ShowHostnames' );
453 if ( !$showHostnames ) {
454 $this->
dieWithError(
'apierror-siteinfo-includealldenied',
'includeAllDenied' );
457 $lags = $lb->getLagTimes();
458 foreach ( $lags
as $i => $lag ) {
460 'host' => $lb->getServerName( $i ),
465 list( , $lag, $index ) = $lb->getMaxLag();
467 'host' => $showHostnames
468 ? $lb->getServerName( $index )
470 'lag' => intval( $lag )
479 protected function appendStatistics(
$property ) {
490 Hooks::run(
'APIQuerySiteInfoStatisticsInfo', [ &$data ] );
495 protected function appendUserGroups(
$property, $numberInGroup ) {
501 foreach ( $config->get(
'GroupPermissions' )
as $group => $permissions ) {
504 'rights' => array_keys( $permissions,
true ),
507 if ( $numberInGroup ) {
508 $autopromote = $config->get(
'Autopromote' );
510 if ( $group ==
'user' ) {
513 } elseif ( $group !==
'*' && !isset( $autopromote[$group] ) ) {
519 'add' => $config->get(
'AddGroups' ),
520 'remove' => $config->get(
'RemoveGroups' ),
521 'add-self' => $config->get(
'GroupsAddToSelf' ),
522 'remove-self' => $config->get(
'GroupsRemoveFromSelf' )
525 foreach ( $groupArr
as $type => $rights ) {
526 if ( isset( $rights[$group] ) ) {
527 if ( $rights[$group] ===
true ) {
528 $groups = $allGroups;
530 $groups = array_intersect( $rights[$group], $allGroups );
533 $arr[
$type] = $groups;
549 protected function appendFileExtensions(
$property ) {
551 foreach ( array_unique( $this->
getConfig()->
get(
'FileExtensions' ) )
as $ext ) {
552 $data[] = [
'ext' =>
$ext ];
559 protected function appendInstalledLibraries(
$property ) {
561 $path =
"$IP/vendor/composer/installed.json";
562 if ( !file_exists(
$path ) ) {
568 foreach ( $installed->getInstalledDependencies()
as $name => $info ) {
569 if ( strpos( $info[
'type'],
'mediawiki-' ) === 0 ) {
576 'version' => $info[
'version'],
584 protected function appendExtensions(
$property ) {
586 foreach ( $this->
getConfig()->
get(
'ExtensionCredits' )
as $type => $extensions ) {
587 foreach ( $extensions
as $ext ) {
590 if ( isset(
$ext[
'name'] ) ) {
593 if ( isset(
$ext[
'namemsg'] ) ) {
596 if ( isset(
$ext[
'description'] ) ) {
597 $ret[
'description'] =
$ext[
'description'];
599 if ( isset(
$ext[
'descriptionmsg'] ) ) {
601 if ( is_array(
$ext[
'descriptionmsg'] ) ) {
602 $ret[
'descriptionmsg'] =
$ext[
'descriptionmsg'][0];
603 $ret[
'descriptionmsgparams'] = array_slice(
$ext[
'descriptionmsg'], 1 );
606 $ret[
'descriptionmsg'] =
$ext[
'descriptionmsg'];
609 if ( isset(
$ext[
'author'] ) ) {
610 $ret[
'author'] = is_array(
$ext[
'author'] ) ?
611 implode(
', ',
$ext[
'author'] ) :
$ext[
'author'];
613 if ( isset(
$ext[
'url'] ) ) {
616 if ( isset(
$ext[
'version'] ) ) {
619 if ( isset(
$ext[
'path'] ) ) {
620 $extensionPath = dirname(
$ext[
'path'] );
621 $gitInfo =
new GitInfo( $extensionPath );
622 $vcsVersion = $gitInfo->getHeadSHA1();
623 if ( $vcsVersion !==
false ) {
624 $ret[
'vcs-system'] =
'git';
625 $ret[
'vcs-version'] = $vcsVersion;
626 $ret[
'vcs-url'] = $gitInfo->getHeadViewUrl();
627 $vcsDate = $gitInfo->getHeadCommitDate();
628 if ( $vcsDate !==
false ) {
634 $ret[
'license-name'] = isset(
$ext[
'license-name'] ) ?
$ext[
'license-name'] :
'';
637 "License/{$ext['name']}"
644 "Credits/{$ext['name']}"
657 protected function appendRightsInfo(
$property ) {
659 $rightsPage = $config->get(
'RightsPage' );
660 if ( is_string( $rightsPage ) ) {
665 $url = $config->get(
'RightsUrl' );
667 $text = $config->get(
'RightsText' );
669 $text =
$title->getPrefixedText();
674 'text' => $text ?:
''
680 protected function appendRestrictions(
$property ) {
683 'types' => $config->get(
'RestrictionTypes' ),
684 'levels' => $config->get(
'RestrictionLevels' ),
685 'cascadinglevels' => $config->get(
'CascadingRestrictionLevels' ),
686 'semiprotectedlevels' => $config->get(
'SemiprotectedRestrictionLevels' ),
702 public function appendLanguages(
$property ) {
704 $langCode = isset(
$params[
'inlanguagecode'] ) ?
$params[
'inlanguagecode'] :
'';
721 public function appendLanguageVariants(
$property ) {
722 $langNames = LanguageConverter::$languagesWithVariants;
723 if ( $this->
getConfig()->
get(
'DisableLangConversion' ) ) {
730 foreach ( $langNames
as $langCode ) {
737 $data[$langCode] = [];
741 $variants =
$lang->getVariants();
743 foreach ( $variants
as $v ) {
744 $fallbacks =
$lang->getConverter()->getVariantFallbacks( $v );
745 if ( !is_array( $fallbacks ) ) {
746 $fallbacks = [ $fallbacks ];
748 $data[$langCode][$v] = [
749 'fallbacks' => $fallbacks,
752 $data[$langCode][$v][
'fallbacks'],
'variant'
762 public function appendSkins(
$property ) {
767 $msg = $this->
msg(
"skinname-{$name}" );
770 $msg->inLanguage(
$code );
772 $msg->inContentLanguage();
774 if ( $msg->exists() ) {
775 $displayName = $msg->text();
779 if ( !isset( $allowed[
$name] ) ) {
780 $skin[
'unusable'] =
true;
782 if (
$name === $default ) {
783 $skin[
'default'] =
true;
792 public function appendExtensionTags(
$property ) {
795 $tags = array_map( [ $this,
'formatParserTags' ],
$wgParser->getTags() );
802 public function appendFunctionHooks(
$property ) {
812 public function appendVariables(
$property ) {
820 public function appendProtocols(
$property ) {
822 $protocols = array_values( $this->
getConfig()->
get(
'UrlProtocols' ) );
829 public function appendDefaultOptions(
$property ) {
835 public function appendUploadDialog(
$property ) {
836 $config = $this->
getConfig()->get(
'UploadDialog' );
840 private function formatParserTags( $item ) {
844 public function appendSubscribedHooks(
$property ) {
845 $hooks = $this->
getConfig()->get(
'Hooks' );
850 foreach ( $myWgHooks
as $name => $subscribers ) {
853 'subscribers' => array_map( [
'SpecialVersion',
'arrayToString' ], $subscribers ),
869 count( $this->
getConfig()->
get(
'ExtraInterlanguageLinkPrefixes' ) ) &&
871 in_array(
'interwikimap',
$params[
'prop'] )
873 return 'anon-public-user-private';
888 'specialpagealiases',
918 'showalldb' =>
false,
919 'numberingroup' =>
false,
920 'inlanguagecode' =>
null,
926 'action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics'
927 =>
'apihelp-query+siteinfo-example-simple',
928 'action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local'
929 =>
'apihelp-query+siteinfo-example-interwiki',
930 'action=query&meta=siteinfo&siprop=dbrepllag&sishowalldb='
931 =>
'apihelp-query+siteinfo-example-replag',
936 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Siteinfo';
getConfig()
Get the Config object.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
static isNonincludable( $index)
It is not possible to use pages from this namespace as template?
This is the main query class.
static getExtAuthorsFileName( $extDir)
Obtains the full path of an extensions authors or credits file if one exists.
if(!isset( $args[0])) $lang
wfGetLB( $wiki=false)
Get a load balancer object.
const META_TYPE
Key for the 'type' metadata item.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getExamplesMessages()
Returns usage examples for this module.
static newMainPage()
Create a new Title for the Main Page.
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:Array with elements of the form "language:title" in the order that they will be output. & $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
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
namespace and then decline to actually register it & $namespaces
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
static getNamespaceContentModel( $index)
Get the default content model for a namespace This does not mean that all pages in that namespace hav...
getResult()
Get the result object.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
static numberingroup( $group)
Find the number of users in a given user group.
wfReadOnly()
Check whether the wiki is in read-only mode.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Allows to change the fields on the form that will be generated $name
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
static getSkinNames()
Fetch the set of available skins.
static getDefaultOptions()
Combine the language default options with any site-specific options and add the default language vari...
static setContentValue(array &$arr, $name, $value, $flags=0)
Add an output value to the array by name and mark as META_CONTENT.
null for the 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
static getVariableIDs()
Get an array of parser variable IDs.
static setArrayType(array &$arr, $type, $kvpKeyName=null)
Set the array data type.
namespace and then decline to actually register it file or subcat img or subcat $title
static normalizeKey( $key)
Normalize a skin preference value to a form that can be loaded.
static fetchLanguageNames( $inLanguage=null, $include='mw')
Get an array of language names, indexed by code.
This is a base class for all Query modules.
getDB()
Get the Query database connection (read-only)
static isContent( $index)
Does this namespace contain content, for the purposes of calculating statistics, etc?
static hasSubpages( $index)
Does the namespace allow subpages?
const META_BC_BOOLS
Key for the 'BC bools' metadata item.
when a variable name is used in a it is silently declared as a new masking the global
$GLOBALS['wgAutoloadClasses']['LocalisationUpdate']
getHelpUrls()
Return links to more detailed help pages about the module.
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
static getExtLicenseFileName( $extDir)
Obtains the full path of an extensions copying or license file if one exists.
wfWikiID()
Get an ASCII string identifying this wiki This is used as a prefix in memcached keys.
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static getGitCurrentBranch( $dir)
static jobs()
Total number of jobs in the job queue.
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
static getGitHeadSha1( $dir)
static getAllGroups()
Return the set of defined explicit groups.
getCacheMode( $params)
Get the cache mode for the data generated by this module.
static isValidCode( $code)
Returns true if a language code string is of a valid form, whether or not it exists.
A fake language variant converter.
wfReadOnlyReason()
Check if the site is in read-only mode and return the message if so.
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 & $options
__construct(ApiQuery $queryModule, $moduleName, $paramPrefix='')
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
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
getParameter( $paramName, $parseLimit=true)
Get a value for the given parameter.
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
static isCapitalized( $index)
Is the namespace first-letter capitalized?
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
static getNames()
Returns a list of canonical special page names.
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
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
static factory( $code)
Get a cached or new language object for a given language code.
either a unescaped string or a HtmlArmor object 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 unset offset - wrap String Wrap the message in html(usually something like "<
static legalChars()
Get a regex character class describing the legal characters in a link.
setContinueEnumParameter( $paramName, $paramValue)
Set a query-continue value.
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 MediaWikiServices
static getAllowedSkins()
Fetch the list of user-selectable skins in regards to $wgSkipSkins.
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Reads an installed.json file and provides accessors to get what is installed.
static getCanonicalName( $index)
Returns the canonical (English) name for a given index.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
the array() calling protocol came about after MediaWiki 1.4rc1.
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 content language as $wgContLang