Go to the documentation of this file.
32 parent::__construct(
$query, $moduleName,
'si' );
42 $fit = $this->appendGeneralInfo( $p );
45 $fit = $this->appendNamespaces( $p );
47 case 'namespacealiases':
48 $fit = $this->appendNamespaceAliases( $p );
50 case 'specialpagealiases':
51 $fit = $this->appendSpecialPageAliases( $p );
54 $fit = $this->appendMagicWords( $p );
57 $fit = $this->appendInterwikiMap( $p,
$params[
'filteriw'] );
60 $fit = $this->appendDbReplLagInfo( $p,
$params[
'showalldb'] );
63 $fit = $this->appendStatistics( $p );
66 $fit = $this->appendUserGroups( $p,
$params[
'numberingroup'] );
69 $fit = $this->appendInstalledLibraries( $p );
72 $fit = $this->appendExtensions( $p );
74 case 'fileextensions':
75 $fit = $this->appendFileExtensions( $p );
78 $fit = $this->appendRightsInfo( $p );
81 $fit = $this->appendRestrictions( $p );
84 $fit = $this->appendLanguages( $p );
86 case 'languagevariants':
87 $fit = $this->appendLanguageVariants( $p );
90 $fit = $this->appendSkins( $p );
93 $fit = $this->appendExtensionTags( $p );
96 $fit = $this->appendFunctionHooks( $p );
99 $fit = $this->appendSubscribedHooks( $p );
102 $fit = $this->appendVariables( $p );
105 $fit = $this->appendProtocols( $p );
107 case 'defaultoptions':
108 $fit = $this->appendDefaultOptions( $p );
111 $fit = $this->appendUploadDialog( $p );
120 array_diff(
$params[
'prop'], $done ) ) );
127 protected function appendGeneralInfo(
$property ) {
132 $data[
'mainpage'] = $mainPage->getPrefixedText();
134 $data[
'sitename'] = $config->get(
'Sitename' );
140 $data[
'generator'] =
"MediaWiki {$config->get( 'Version' )}";
142 $data[
'phpversion'] = PHP_VERSION;
143 $data[
'phpsapi'] = PHP_SAPI;
144 if ( defined(
'HHVM_VERSION' ) ) {
145 $data[
'hhvmversion'] = HHVM_VERSION;
147 $data[
'dbtype'] = $config->get(
'DBtype' );
148 $data[
'dbversion'] = $this->
getDB()->getServerVersion();
151 $allowException =
true;
152 if ( !$config->get(
'AllowExternalImages' ) ) {
153 $data[
'imagewhitelistenabled'] = (bool)$config->get(
'EnableImageWhitelist' );
154 $allowFrom = $config->get(
'AllowExternalImagesFrom' );
155 $allowException = !empty( $allowFrom );
157 if ( $allowException ) {
162 $data[
'langconversion'] = !$config->get(
'DisableLangConversion' );
163 $data[
'titleconversion'] = !$config->get(
'DisableTitleConversion' );
165 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
166 if ( $contLang->linkPrefixExtension() ) {
170 $data[
'linkprefix'] =
"/^((?>.*[^$linkPrefixCharset]|))(.+)$/sDu";
172 $data[
'linkprefixcharset'] =
'';
173 $data[
'linkprefix'] =
'';
176 $linktrail = $contLang->linkTrail();
177 $data[
'linktrail'] = $linktrail ?:
'';
180 $data[
'invalidusernamechars'] = $config->get(
'InvalidUsernameCharacters' );
182 $data[
'allunicodefixes'] = (bool)$config->get(
'AllUnicodeFixes' );
183 $data[
'fixarabicunicode'] = (bool)$config->get(
'FixArabicUnicode' );
184 $data[
'fixmalayalamunicode'] = (bool)$config->get(
'FixMalayalamUnicode' );
189 $data[
'git-hash'] = $git;
190 $data[
'git-branch'] =
195 $data[
'case'] = $config->get(
'CapitalLinks' ) ?
'first-letter' :
'case-sensitive';
196 $data[
'lang'] = $config->get(
'LanguageCode' );
199 foreach ( $contLang->getFallbackLanguages()
as $code ) {
200 $fallbacks[] = [
'code' =>
$code ];
202 $data[
'fallback'] = $fallbacks;
205 if ( $contLang->hasVariants() ) {
207 foreach ( $contLang->getVariants()
as $code ) {
210 'name' => $contLang->getVariantname(
$code ),
213 $data[
'variants'] = $variants;
217 $data[
'rtl'] = $contLang->isRTL();
218 $data[
'fallback8bitEncoding'] = $contLang->fallback8bitEncoding();
221 if (
$data[
'readonly'] ) {
224 $data[
'writeapi'] =
true;
226 $data[
'maxarticlesize'] = $config->get(
'MaxArticleSize' ) * 1024;
228 $tz = $config->get(
'Localtimezone' );
229 $offset = $config->get(
'LocalTZoffset' );
230 $data[
'timezone'] = $tz;
231 $data[
'timeoffset'] = (int)$offset;
232 $data[
'articlepath'] = $config->get(
'ArticlePath' );
233 $data[
'scriptpath'] = $config->get(
'ScriptPath' );
234 $data[
'script'] = $config->get(
'Script' );
235 $data[
'variantarticlepath'] = $config->get(
'VariantArticlePath' );
237 $data[
'server'] = $config->get(
'Server' );
238 $data[
'servername'] = $config->get(
'ServerName' );
242 $data[
'misermode'] = (bool)$config->get(
'MiserMode' );
244 $data[
'uploadsenabled'] = UploadBase::isEnabled();
245 $data[
'maxuploadsize'] = UploadBase::getMaxUploadSize();
246 $data[
'minuploadchunksize'] = (int)$config->get(
'MinUploadChunkSize' );
248 $data[
'galleryoptions'] = $config->get(
'GalleryOptions' );
250 $data[
'thumblimits'] = $config->get(
'ThumbLimits' );
253 $data[
'imagelimits'] = [];
256 foreach ( $config->get(
'ImageLimits' )
as $k => $limit ) {
257 $data[
'imagelimits'][$k] = [
'width' => $limit[0],
'height' => $limit[1] ];
260 $favicon = $config->get(
'Favicon' );
261 if ( !empty( $favicon ) ) {
267 $data[
'centralidlookupprovider'] = $config->get(
'CentralIdLookupProvider' );
268 $providerIds = array_keys( $config->get(
'CentralIdLookupProviders' ) );
269 $data[
'allcentralidlookupproviders'] = $providerIds;
271 $data[
'interwikimagic'] = (bool)$config->get(
'InterwikiMagic' );
272 $data[
'magiclinks'] = $config->get(
'EnableMagicLinks' );
274 $data[
'categorycollation'] = $config->get(
'CategoryCollation' );
281 protected function appendNamespaces(
$property ) {
286 MediaWikiServices::getInstance()->getContentLanguage()->getFormattedNamespaces()
299 $data[$ns][
'canonical'] = strtr( $canonical,
'_',
' ' );
306 if ( $contentmodel ) {
307 $data[$ns][
'defaultcontentmodel'] = $contentmodel;
317 protected function appendNamespaceAliases(
$property ) {
318 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
319 $aliases = array_merge( $this->
getConfig()->
get(
'NamespaceAliases' ),
320 $contLang->getNamespaceAliases() );
323 foreach ( $aliases
as $title => $ns ) {
342 protected function appendSpecialPageAliases(
$property ) {
344 $services = MediaWikiServices::getInstance();
345 $aliases =
$services->getContentLanguage()->getSpecialPageAliases();
346 foreach (
$services->getSpecialPageFactory()->getNames()
as $specialpage ) {
347 if ( isset( $aliases[$specialpage] ) ) {
348 $arr = [
'realname' => $specialpage,
'aliases' => $aliases[$specialpage] ];
358 protected function appendMagicWords(
$property ) {
361 MediaWikiServices::getInstance()->getContentLanguage()->getMagicWords()
362 as $magicword => $aliases
364 $caseSensitive = array_shift( $aliases );
365 $arr = [
'name' => $magicword,
'aliases' => $aliases ];
366 $arr[
'case-sensitive'] = (bool)$caseSensitive;
378 } elseif (
$filter ===
'!local' ) {
386 $langCode =
$params[
'inlanguagecode'] ??
'';
389 $getPrefixes = MediaWikiServices::getInstance()->getInterwikiLookup()->getAllPrefixes( $local );
390 $extraLangPrefixes = $this->
getConfig()->get(
'ExtraInterlanguageLinkPrefixes' );
391 $localInterwikis = $this->
getConfig()->get(
'LocalInterwikis' );
394 foreach ( $getPrefixes
as $row ) {
395 $prefix = $row[
'iw_prefix'];
397 $val[
'prefix'] = $prefix;
398 if ( isset( $row[
'iw_local'] ) && $row[
'iw_local'] ==
'1' ) {
399 $val[
'local'] =
true;
401 if ( isset( $row[
'iw_trans'] ) && $row[
'iw_trans'] ==
'1' ) {
402 $val[
'trans'] =
true;
405 if ( isset( $langNames[$prefix] ) ) {
406 $val[
'language'] = $langNames[$prefix];
408 if ( in_array( $prefix, $localInterwikis ) ) {
409 $val[
'localinterwiki'] =
true;
411 if ( in_array( $prefix, $extraLangPrefixes ) ) {
412 $val[
'extralanglink'] =
true;
414 $linktext =
wfMessage(
"interlanguage-link-$prefix" );
415 if ( !$linktext->isDisabled() ) {
416 $val[
'linktext'] = $linktext->text();
419 $sitename =
wfMessage(
"interlanguage-link-sitename-$prefix" );
420 if ( !$sitename->isDisabled() ) {
421 $val[
'sitename'] = $sitename->text();
426 $val[
'protorel'] = substr( $row[
'iw_url'], 0, 2 ) ==
'//';
427 if ( isset( $row[
'iw_wikiid'] ) && $row[
'iw_wikiid'] !==
'' ) {
428 $val[
'wikiid'] = $row[
'iw_wikiid'];
430 if ( isset( $row[
'iw_api'] ) && $row[
'iw_api'] !==
'' ) {
431 $val[
'api'] = $row[
'iw_api'];
442 protected function appendDbReplLagInfo(
$property, $includeAll ) {
444 $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
445 $showHostnames = $this->
getConfig()->get(
'ShowHostnames' );
447 if ( !$showHostnames ) {
448 $this->
dieWithError(
'apierror-siteinfo-includealldenied',
'includeAllDenied' );
451 $lags = $lb->getLagTimes();
452 foreach ( $lags
as $i => $lag ) {
454 'host' => $lb->getServerName( $i ),
459 list( , $lag, $index ) = $lb->getMaxLag();
461 'host' => $showHostnames
462 ? $lb->getServerName( $index )
473 protected function appendStatistics(
$property ) {
489 protected function appendUserGroups(
$property, $numberInGroup ) {
495 foreach ( $config->get(
'GroupPermissions' )
as $group => $permissions ) {
498 'rights' => array_keys( $permissions,
true ),
501 if ( $numberInGroup ) {
502 $autopromote = $config->get(
'Autopromote' );
504 if ( $group ==
'user' ) {
507 } elseif ( $group !==
'*' && !isset( $autopromote[$group] ) ) {
513 'add' => $config->get(
'AddGroups' ),
514 'remove' => $config->get(
'RemoveGroups' ),
515 'add-self' => $config->get(
'GroupsAddToSelf' ),
516 'remove-self' => $config->get(
'GroupsRemoveFromSelf' )
519 foreach ( $groupArr
as $type => $rights ) {
520 if ( isset( $rights[$group] ) ) {
521 if ( $rights[$group] ===
true ) {
522 $groups = $allGroups;
524 $groups = array_intersect( $rights[$group], $allGroups );
527 $arr[
$type] = $groups;
543 protected function appendFileExtensions(
$property ) {
545 foreach ( array_unique( $this->
getConfig()->
get(
'FileExtensions' ) )
as $ext ) {
553 protected function appendInstalledLibraries(
$property ) {
555 $path =
"$IP/vendor/composer/installed.json";
556 if ( !file_exists(
$path ) ) {
562 foreach ( $installed->getInstalledDependencies()
as $name => $info ) {
563 if ( strpos( $info[
'type'],
'mediawiki-' ) === 0 ) {
570 'version' => $info[
'version'],
578 protected function appendExtensions(
$property ) {
580 foreach ( $this->
getConfig()->
get(
'ExtensionCredits' )
as $type => $extensions ) {
581 foreach ( $extensions
as $ext ) {
584 if ( isset(
$ext[
'name'] ) ) {
587 if ( isset(
$ext[
'namemsg'] ) ) {
590 if ( isset(
$ext[
'description'] ) ) {
591 $ret[
'description'] =
$ext[
'description'];
593 if ( isset(
$ext[
'descriptionmsg'] ) ) {
595 if ( is_array(
$ext[
'descriptionmsg'] ) ) {
596 $ret[
'descriptionmsg'] =
$ext[
'descriptionmsg'][0];
597 $ret[
'descriptionmsgparams'] = array_slice(
$ext[
'descriptionmsg'], 1 );
600 $ret[
'descriptionmsg'] =
$ext[
'descriptionmsg'];
603 if ( isset(
$ext[
'author'] ) ) {
604 $ret[
'author'] = is_array(
$ext[
'author'] ) ?
605 implode(
', ',
$ext[
'author'] ) :
$ext[
'author'];
607 if ( isset(
$ext[
'url'] ) ) {
610 if ( isset(
$ext[
'version'] ) ) {
613 if ( isset(
$ext[
'path'] ) ) {
614 $extensionPath = dirname(
$ext[
'path'] );
615 $gitInfo =
new GitInfo( $extensionPath );
616 $vcsVersion = $gitInfo->getHeadSHA1();
617 if ( $vcsVersion !==
false ) {
618 $ret[
'vcs-system'] =
'git';
619 $ret[
'vcs-version'] = $vcsVersion;
620 $ret[
'vcs-url'] = $gitInfo->getHeadViewUrl();
621 $vcsDate = $gitInfo->getHeadCommitDate();
622 if ( $vcsDate !==
false ) {
628 $ret[
'license-name'] =
$ext[
'license-name'] ??
'';
631 "License/{$ext['name']}"
638 "Credits/{$ext['name']}"
651 protected function appendRightsInfo(
$property ) {
653 $rightsPage = $config->get(
'RightsPage' );
654 if ( is_string( $rightsPage ) ) {
659 $url = $config->get(
'RightsUrl' );
661 $text = $config->get(
'RightsText' );
662 if (
$title && !strlen( $text ) ) {
663 $text =
$title->getPrefixedText();
668 'text' => (
string)$text,
674 protected function appendRestrictions(
$property ) {
677 'types' => $config->get(
'RestrictionTypes' ),
678 'levels' => $config->get(
'RestrictionLevels' ),
679 'cascadinglevels' => $config->get(
'CascadingRestrictionLevels' ),
680 'semiprotectedlevels' => $config->get(
'SemiprotectedRestrictionLevels' ),
696 public function appendLanguages(
$property ) {
698 $langCode =
$params[
'inlanguagecode'] ??
'';
718 public function appendLanguageVariants(
$property ) {
719 $langNames = LanguageConverter::$languagesWithVariants;
720 if ( $this->
getConfig()->
get(
'DisableLangConversion' ) ) {
727 foreach ( $langNames
as $langCode ) {
734 $data[$langCode] = [];
738 $variants =
$lang->getVariants();
740 foreach ( $variants
as $v ) {
741 $fallbacks =
$lang->getConverter()->getVariantFallbacks( $v );
742 if ( !is_array( $fallbacks ) ) {
743 $fallbacks = [ $fallbacks ];
745 $data[$langCode][$v] = [
746 'fallbacks' => $fallbacks,
749 $data[$langCode][$v][
'fallbacks'],
'variant'
759 public function appendSkins(
$property ) {
764 $msg = $this->
msg(
"skinname-{$name}" );
767 $msg->inLanguage(
$code );
769 $msg->inContentLanguage();
771 if ( $msg->exists() ) {
772 $displayName = $msg->text();
776 if ( !isset( $allowed[
$name] ) ) {
777 $skin[
'unusable'] =
true;
779 if (
$name === $default ) {
780 $skin[
'default'] =
true;
789 public function appendExtensionTags(
$property ) {
803 public function appendFunctionHooks(
$property ) {
812 public function appendVariables(
$property ) {
813 $variables = MediaWikiServices::getInstance()->getMagicWordFactory()->getVariableIDs();
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 public function appendSubscribedHooks(
$property ) {
841 $hooks = $this->
getConfig()->get(
'Hooks' );
846 foreach ( $myWgHooks
as $name => $subscribers ) {
865 count( $this->
getConfig()->
get(
'ExtraInterlanguageLinkPrefixes' ) ) &&
867 in_array(
'interwikimap',
$params[
'prop'] )
869 return 'anon-public-user-private';
884 'specialpagealiases',
914 'showalldb' =>
false,
915 'numberingroup' =>
false,
916 'inlanguagecode' =>
null,
922 'action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics'
923 =>
'apihelp-query+siteinfo-example-simple',
924 'action=query&meta=siteinfo&siprop=interwikimap&sifilteriw=local'
925 =>
'apihelp-query+siteinfo-example-interwiki',
926 'action=query&meta=siteinfo&siprop=dbrepllag&sishowalldb='
927 =>
'apihelp-query+siteinfo-example-replag',
932 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Siteinfo';
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 getCurrentWikiDbDomain()
static getExtAuthorsFileName( $extDir)
Obtains the full path of an extensions authors or credits file if one exists.
if(!isset( $args[0])) $lang
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 'ImportHandleUnknownUser':When a user doesn 't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false. $name:User name '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. '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 '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 since 1.28! 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.
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,...
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
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
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 getWikiIdFromDbDomain( $domain)
Get the wiki ID of a database domain.
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?
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 hasSubpages( $index)
Does the namespace allow subpages?
const META_BC_BOOLS
Key for the 'BC bools' metadata item.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password 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
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
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.
Allows to change the fields on the form that will be generated $name
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='')
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 bcp47( $code)
Get the normalised IETF language tag See unit test for examples.
static isCapitalized( $index)
Is the namespace first-letter capitalized?
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
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...
if(!is_readable( $file)) $ext
static factory( $code)
Get a cached or new language object for a given language code.
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
static legalChars()
Get a regex character class describing the legal characters in a link.
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place or wrap services the preferred way to define a new service is the $wgServiceWiringFiles array $services
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.
static fetchLanguageNames( $inLanguage=self::AS_AUTONYMS, $include='mw')
Get an array of language names, indexed by 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 use $formDescriptor instead 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 "<
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.