64 parent::__construct( $query, $moduleName,
'in' );
72 $pageSet->requestField(
'page_restrictions' );
76 $pageSet->requestField(
'page_is_redirect' );
77 $pageSet->requestField(
'page_is_new' );
79 $pageSet->requestField(
'page_touched' );
80 $pageSet->requestField(
'page_latest' );
81 $pageSet->requestField(
'page_len' );
82 if ( $config->get(
'ContentHandlerUseDB' ) ) {
83 $pageSet->requestField(
'page_content_model' );
85 if ( $config->get(
'PageLanguageUseDB' ) ) {
86 $pageSet->requestField(
'page_lang' );
99 if ( isset( $this->tokenFunctions ) ) {
109 $this->tokenFunctions = [
110 'edit' => [
'ApiQueryInfo',
'getEditToken' ],
111 'delete' => [
'ApiQueryInfo',
'getDeleteToken' ],
112 'protect' => [
'ApiQueryInfo',
'getProtectToken' ],
113 'move' => [
'ApiQueryInfo',
'getMoveToken' ],
114 'block' => [
'ApiQueryInfo',
'getBlockToken' ],
115 'unblock' => [
'ApiQueryInfo',
'getUnblockToken' ],
116 'email' => [
'ApiQueryInfo',
'getEmailToken' ],
117 'import' => [
'ApiQueryInfo',
'getImportToken' ],
118 'watch' => [
'ApiQueryInfo',
'getWatchToken' ],
120 Hooks::run(
'APIQueryInfoTokens', [ &$this->tokenFunctions ] );
142 if ( !$wgUser->isAllowed(
'edit' ) ) {
159 if ( !$wgUser->isAllowed(
'delete' ) ) {
176 if ( !$wgUser->isAllowed(
'protect' ) ) {
193 if ( !$wgUser->isAllowed(
'move' ) ) {
210 if ( !$wgUser->isAllowed(
'block' ) ) {
227 return self::getBlockToken( $pageid,
$title );
235 if ( !$wgUser->canSendEmail() || $wgUser->isBlockedFromEmailuser() ) {
252 if ( !$wgUser->isAllowedAny(
'import',
'importupload' ) ) {
269 if ( !$wgUser->isLoggedIn() ) {
286 if ( !$wgUser->isLoggedIn() ) {
300 if ( !is_null( $this->params[
'prop'] ) ) {
301 $prop = array_flip( $this->params[
'prop'] );
302 $this->fld_protection = isset( $prop[
'protection'] );
303 $this->fld_watched = isset( $prop[
'watched'] );
304 $this->fld_watchers = isset( $prop[
'watchers'] );
305 $this->fld_visitingwatchers = isset( $prop[
'visitingwatchers'] );
306 $this->fld_notificationtimestamp = isset( $prop[
'notificationtimestamp'] );
307 $this->fld_talkid = isset( $prop[
'talkid'] );
308 $this->fld_subjectid = isset( $prop[
'subjectid'] );
309 $this->fld_url = isset( $prop[
'url'] );
310 $this->fld_readable = isset( $prop[
'readable'] );
311 $this->fld_preload = isset( $prop[
'preload'] );
312 $this->fld_displaytitle = isset( $prop[
'displaytitle'] );
316 $this->titles = $pageSet->getGoodTitles();
317 $this->missing = $pageSet->getMissingTitles();
321 uasort( $this->everything, [
'Title',
'compare' ] );
322 if ( !is_null( $this->params[
'continue'] ) ) {
325 $cont = explode(
'|', $this->params[
'continue'] );
328 foreach ( $this->everything
as $pageid =>
$title ) {
332 unset( $this->titles[$pageid] );
333 unset( $this->missing[$pageid] );
334 unset( $this->everything[$pageid] );
338 $this->pageRestrictions = $pageSet->getCustomField(
'page_restrictions' );
340 $this->pageIsRedir = !$pageSet->isResolvingRedirects()
341 ? $pageSet->getCustomField(
'page_is_redirect' )
343 $this->pageIsNew = $pageSet->getCustomField(
'page_is_new' );
345 $this->pageTouched = $pageSet->getCustomField(
'page_touched' );
346 $this->pageLatest = $pageSet->getCustomField(
'page_latest' );
347 $this->pageLength = $pageSet->getCustomField(
'page_len' );
350 if ( $this->fld_protection ) {
354 if ( $this->fld_watched || $this->fld_notificationtimestamp ) {
358 if ( $this->fld_watchers ) {
362 if ( $this->fld_visitingwatchers ) {
367 if ( $this->fld_talkid || $this->fld_subjectid ) {
371 if ( $this->fld_displaytitle ) {
376 foreach ( $this->everything
as $pageid =>
$title ) {
378 $fit = $pageInfo !== null &&
$result->addValue( [
381 ], $pageid, $pageInfo );
384 $title->getNamespace() .
'|' .
400 $titleExists = $pageid > 0;
401 $ns =
$title->getNamespace();
402 $dbkey =
$title->getDBkey();
404 $pageInfo[
'contentmodel'] =
$title->getContentModel();
406 $pageLanguage =
$title->getPageLanguage();
407 $pageInfo[
'pagelanguage'] = $pageLanguage->getCode();
408 $pageInfo[
'pagelanguagehtmlcode'] = $pageLanguage->getHtmlCode();
409 $pageInfo[
'pagelanguagedir'] = $pageLanguage->getDir();
411 if ( $titleExists ) {
413 $pageInfo[
'lastrevid'] = intval( $this->pageLatest[$pageid] );
414 $pageInfo[
'length'] = intval( $this->pageLength[$pageid] );
416 if ( isset( $this->pageIsRedir[$pageid] ) && $this->pageIsRedir[$pageid] ) {
417 $pageInfo[
'redirect'] =
true;
419 if ( $this->pageIsNew[$pageid] ) {
420 $pageInfo[
'new'] =
true;
424 if ( !is_null( $this->params[
'token'] ) ) {
427 foreach ( $this->params[
'token']
as $t ) {
429 if ( $val ===
false ) {
430 $this->
setWarning(
"Action '$t' is not allowed for the current user" );
432 $pageInfo[$t .
'token'] = $val;
437 if ( $this->fld_protection ) {
438 $pageInfo[
'protection'] = [];
439 if ( isset( $this->protections[$ns][$dbkey] ) ) {
440 $pageInfo[
'protection'] =
441 $this->protections[$ns][$dbkey];
445 $pageInfo[
'restrictiontypes'] = [];
446 if ( isset( $this->restrictionTypes[$ns][$dbkey] ) ) {
447 $pageInfo[
'restrictiontypes'] =
448 $this->restrictionTypes[$ns][$dbkey];
453 if ( $this->fld_watched && $this->watched !== null ) {
454 $pageInfo[
'watched'] = $this->watched[$ns][$dbkey];
457 if ( $this->fld_watchers ) {
458 if ( $this->watchers !== null && $this->watchers[$ns][$dbkey] !== 0 ) {
459 $pageInfo[
'watchers'] = $this->watchers[$ns][$dbkey];
460 } elseif ( $this->showZeroWatchers ) {
461 $pageInfo[
'watchers'] = 0;
465 if ( $this->fld_visitingwatchers ) {
466 if ( $this->visitingwatchers !== null && $this->visitingwatchers[$ns][$dbkey] !== 0 ) {
467 $pageInfo[
'visitingwatchers'] = $this->visitingwatchers[$ns][$dbkey];
468 } elseif ( $this->showZeroWatchers ) {
469 $pageInfo[
'visitingwatchers'] = 0;
473 if ( $this->fld_notificationtimestamp ) {
474 $pageInfo[
'notificationtimestamp'] =
'';
475 if ( $this->notificationtimestamps[$ns][$dbkey] ) {
476 $pageInfo[
'notificationtimestamp'] =
481 if ( $this->fld_talkid && isset( $this->talkids[$ns][$dbkey] ) ) {
482 $pageInfo[
'talkid'] = $this->talkids[$ns][$dbkey];
485 if ( $this->fld_subjectid && isset( $this->subjectids[$ns][$dbkey] ) ) {
486 $pageInfo[
'subjectid'] = $this->subjectids[$ns][$dbkey];
489 if ( $this->fld_url ) {
494 if ( $this->fld_readable ) {
495 $pageInfo[
'readable'] =
$title->userCan(
'read', $this->
getUser() );
498 if ( $this->fld_preload ) {
499 if ( $titleExists ) {
500 $pageInfo[
'preload'] =
'';
505 $pageInfo[
'preload'] = $text;
509 if ( $this->fld_displaytitle ) {
510 if ( isset( $this->displaytitles[$pageid] ) ) {
511 $pageInfo[
'displaytitle'] = $this->displaytitles[$pageid];
513 $pageInfo[
'displaytitle'] =
$title->getPrefixedText();
517 if ( $this->params[
'testactions'] ) {
518 $limit = $this->
getMain()->canApiHighLimits() ? self::LIMIT_SML1 : self::LIMIT_SML2;
519 if ( $this->countTestedActions >=
$limit ) {
524 $pageInfo[
'actions'] = [];
525 foreach ( $this->params[
'testactions']
as $action ) {
526 $this->countTestedActions++;
527 $pageInfo[
'actions'][$action] =
$title->userCan( $action,
$user );
539 $this->protections = [];
540 $db = $this->
getDB();
543 if ( count( $this->titles ) ) {
546 $this->
addFields( [
'pr_page',
'pr_type',
'pr_level',
547 'pr_expiry',
'pr_cascade' ] );
548 $this->
addWhereFld(
'pr_page', array_keys( $this->titles ) );
551 foreach (
$res as $row ) {
553 $title = $this->titles[$row->pr_page];
555 'type' => $row->pr_type,
556 'level' => $row->pr_level,
557 'expiry' => $wgContLang->formatExpiry( $row->pr_expiry,
TS_ISO_8601 )
559 if ( $row->pr_cascade ) {
560 $a[
'cascade'] =
true;
562 $this->protections[
$title->getNamespace()][
$title->getDBkey()][] = $a;
565 foreach ( $this->titles
as $pageId =>
$title ) {
566 if ( $this->pageRestrictions[$pageId] ) {
567 $namespace =
$title->getNamespace();
568 $dbKey =
$title->getDBkey();
569 $restrictions = explode(
':', trim( $this->pageRestrictions[$pageId] ) );
570 foreach ( $restrictions
as $restrict ) {
571 $temp = explode(
'=', trim( $restrict ) );
572 if ( count( $temp ) == 1 ) {
574 $restriction = trim( $temp[0] );
576 if ( $restriction ==
'' ) {
579 $this->protections[$namespace][$dbKey][] = [
581 'level' => $restriction,
582 'expiry' =>
'infinity',
584 $this->protections[$namespace][$dbKey][] = [
586 'level' => $restriction,
587 'expiry' =>
'infinity',
590 $restriction = trim( $temp[1] );
591 if ( $restriction ==
'' ) {
594 $this->protections[$namespace][$dbKey][] = [
596 'level' => $restriction,
597 'expiry' =>
'infinity',
606 if ( count( $this->missing ) ) {
610 $this->
addFields( [
'pt_title',
'pt_namespace',
'pt_create_perm',
'pt_expiry' ] );
611 $this->
addWhere( $lb->constructSet(
'pt', $db ) );
613 foreach ( $res
as $row ) {
614 $this->protections[$row->pt_namespace][$row->pt_title][] = [
616 'level' => $row->pt_create_perm,
617 'expiry' => $wgContLang->formatExpiry( $row->pt_expiry,
TS_ISO_8601 )
624 $images = $others = [];
625 foreach ( $this->everything
as $title ) {
626 if ( $title->getNamespace() ==
NS_FILE ) {
627 $images[] = $title->getDBkey();
632 $this->restrictionTypes[$title->getNamespace()][$title->getDBkey()] =
633 array_values( $title->getRestrictionTypes() );
636 if ( count( $others ) ) {
640 $this->
addTables( [
'page_restrictions',
'page',
'templatelinks' ] );
641 $this->
addFields( [
'pr_type',
'pr_level',
'pr_expiry',
642 'page_title',
'page_namespace',
643 'tl_title',
'tl_namespace' ] );
644 $this->
addWhere( $lb->constructSet(
'tl', $db ) );
645 $this->
addWhere(
'pr_page = page_id' );
646 $this->
addWhere(
'pr_page = tl_from' );
650 foreach (
$res as $row ) {
652 $this->protections[$row->tl_namespace][$row->tl_title][] = [
653 'type' => $row->pr_type,
654 'level' => $row->pr_level,
655 'expiry' => $wgContLang->formatExpiry( $row->pr_expiry,
TS_ISO_8601 ),
656 'source' =>
$source->getPrefixedText()
661 if ( count( $images ) ) {
664 $this->
addTables( [
'page_restrictions',
'page',
'imagelinks' ] );
665 $this->
addFields( [
'pr_type',
'pr_level',
'pr_expiry',
666 'page_title',
'page_namespace',
'il_to' ] );
667 $this->
addWhere(
'pr_page = page_id' );
668 $this->
addWhere(
'pr_page = il_from' );
673 foreach (
$res as $row ) {
675 $this->protections[
NS_FILE][$row->il_to][] = [
676 'type' => $row->pr_type,
677 'level' => $row->pr_level,
678 'expiry' => $wgContLang->formatExpiry( $row->pr_expiry,
TS_ISO_8601 ),
679 'source' =>
$source->getPrefixedText()
690 $getTitles = $this->talkids = $this->subjectids = [];
693 foreach ( $this->everything
as $t ) {
695 if ( $this->fld_subjectid ) {
696 $getTitles[] = $t->getSubjectPage();
698 } elseif ( $this->fld_talkid ) {
699 $getTitles[] = $t->getTalkPage();
702 if ( !count( $getTitles ) ) {
706 $db = $this->
getDB();
713 $this->
addFields( [
'page_title',
'page_namespace',
'page_id' ] );
714 $this->
addWhere( $lb->constructSet(
'page', $db ) );
716 foreach ( $res
as $row ) {
719 intval( $row->page_id );
722 intval( $row->page_id );
728 $this->displaytitles = [];
730 $pageIds = array_keys( $this->titles );
732 if ( !count( $pageIds ) ) {
738 $this->
addFields( [
'pp_page',
'pp_value' ] );
740 $this->
addWhereFld(
'pp_propname',
'displaytitle' );
743 foreach (
$res as $row ) {
744 $this->displaytitles[$row->pp_page] = $row->pp_value;
755 if (
$user->isAnon() || count( $this->everything ) == 0
756 || !
$user->isAllowed(
'viewmywatchlist' )
762 $this->notificationtimestamps = [];
764 $store = MediaWikiServices::getInstance()->getWatchedItemStore();
765 $timestamps = $store->getNotificationTimestampsBatch(
$user, $this->everything );
767 if ( $this->fld_watched ) {
768 foreach ( $timestamps
as $namespaceId => $dbKeys ) {
769 $this->watched[$namespaceId] = array_map(
777 if ( $this->fld_notificationtimestamp ) {
778 $this->notificationtimestamps = $timestamps;
786 if ( count( $this->everything ) == 0 ) {
791 $canUnwatchedpages =
$user->isAllowed(
'unwatchedpages' );
792 $unwatchedPageThreshold = $this->
getConfig()->get(
'UnwatchedPageThreshold' );
793 if ( !$canUnwatchedpages && !is_int( $unwatchedPageThreshold ) ) {
797 $this->showZeroWatchers = $canUnwatchedpages;
800 if ( !$canUnwatchedpages ) {
801 $countOptions[
'minimumWatchers'] = $unwatchedPageThreshold;
804 $this->watchers = MediaWikiServices::getInstance()->getWatchedItemStore()->countWatchersMultiple(
819 $db = $this->
getDB();
821 $canUnwatchedpages =
$user->isAllowed(
'unwatchedpages' );
822 $unwatchedPageThreshold = $this->
getConfig()->get(
'UnwatchedPageThreshold' );
823 if ( !$canUnwatchedpages && !is_int( $unwatchedPageThreshold ) ) {
827 $this->showZeroWatchers = $canUnwatchedpages;
829 $titlesWithThresholds = [];
830 if ( $this->titles ) {
835 $this->
addTables( [
'page',
'revision' ] );
836 $this->
addFields( [
'page_namespace',
'page_title',
'rev_timestamp' ] );
838 'page_latest = rev_id',
839 $lb->constructSet(
'page', $db ),
841 $this->
addOption(
'GROUP BY', [
'page_namespace',
'page_title' ] );
842 $timestampRes = $this->
select( __METHOD__ );
844 $age = $config->get(
'WatchersMaxAge' );
846 foreach ( $timestampRes
as $row ) {
848 $timestamps[$row->page_namespace][$row->page_title] = $revTimestamp - $age;
850 $titlesWithThresholds = array_map(
860 if ( $this->missing ) {
861 $titlesWithThresholds = array_merge(
862 $titlesWithThresholds,
865 return [ $target, null ];
871 $store = MediaWikiServices::getInstance()->getWatchedItemStore();
872 $this->visitingwatchers = $store->countVisitingWatchersMultiple(
873 $titlesWithThresholds,
874 !$canUnwatchedpages ? $unwatchedPageThreshold : null
888 if ( array_diff( (
array)
$params[
'prop'], $publicProps ) ) {
893 if ( $params[
'testactions'] ) {
897 if ( !is_null( $params[
'token'] ) ) {
912 'watchers', #
private
913 'visitingwatchers', #
private
914 'notificationtimestamp', #
private
917 'readable', #
private
942 'action=query&prop=info&titles=Main%20Page'
943 =>
'apihelp-query+info-example-simple',
944 'action=query&prop=info&inprop=protection&titles=Main%20Page'
945 =>
'apihelp-query+info-example-protection',
950 return 'https://www.mediawiki.org/wiki/API:Info';
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below...
getDB()
Get the Query database connection (read-only)
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
getResult()
Get the result object.
addWhereFld($field, $value)
Equivalent to addWhere(array($field => $value))
static getImportToken($pageid, $title)
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
getMain()
Get the main module.
static isTalk($index)
Is the given namespace a talk namespace?
This is a base class for all Query modules.
lacksSameOriginSecurity()
Returns true if the current request breaks the same-origin policy.
extractRequestParams($parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user...
getPageSet()
Get the PageSet object to work on.
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
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
select($method, $extraQuery=[], array &$hookData=null)
Execute a SELECT query based on the values in the internal arrays.
when a variable name is used in a it is silently declared as a new local masking the global
wfExpandUrl($url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
addWhere($value)
Add a set of WHERE clauses to the internal array.
const TS_ISO_8601
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
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
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
static getOptionsToken($pageid, $title)
A query module to show basic page information.
static getMoveToken($pageid, $title)
getWatchedInfo()
Get information about watched status and put it in $this->watched and $this->notificationtimestamps.
getConfig()
Get the Config object.
static getUnblockToken($pageid, $title)
addOption($name, $value=null)
Add an option such as LIMIT or USE INDEX.
requestExtraData($pageSet)
static makeTitleSafe($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
namespace and then decline to actually register it file or subcat img or subcat $title
getTSIDs()
Get talk page IDs (if requested) and subject page IDs (if requested) and put them in $talkids and $su...
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
__construct(ApiQuery $query, $moduleName)
This is the main query class.
setWarning($warning)
Set warning section for this module.
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
dieContinueUsageIf($condition)
Die with the $prefix.
static getProtectToken($pageid, $title)
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter...
static getDeleteToken($pageid, $title)
static getEmailToken($pageid, $title)
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
getWatcherInfo()
Get the count of watchers and put it in $this->watchers.
static getBlockToken($pageid, $title)
getTokenFunctions()
Get an array mapping token names to their handler functions.
static getTalk($index)
Get the talk namespace index for a given namespace.
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
getProtectionInfo()
Get information about protections and put it in $protections.
addFields($value)
Add a set of fields to select to the internal array.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
setContinueEnumParameter($paramName, $paramValue)
Set a query-continue value.
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
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
static getWatchToken($pageid, $title)
static compare(LinkTarget $a, LinkTarget $b)
Callback for usort() to do title sorts by (namespace, title)
$fld_notificationtimestamp
const PARAM_DEPRECATED
(boolean) Is the parameter deprecated (will show a warning)?
extractPageInfo($pageid, $title)
Get a result array with information about a title.
getVisitingWatcherInfo()
Get the count of watchers who have visited recent edits and put it in $this->visitingwatchers.
static getEditToken($pageid, $title)
static getSubject($index)
Get the subject namespace index for a given namespace Special namespaces (NS_MEDIA, NS_SPECIAL) are always the subject.
getUser()
Get the User object.
addTables($tables, $alias=null)
Add a set of tables to the internal array.
static makeTitle($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
resetQueryParams()
Blank the internal arrays with query parameters.