76 private bool $fld_protection =
false;
77 private bool $fld_talkid =
false;
78 private bool $fld_subjectid =
false;
79 private bool $fld_url =
false;
80 private bool $fld_readable =
false;
81 private bool $fld_watched =
false;
82 private bool $fld_watchers =
false;
83 private bool $fld_visitingwatchers =
false;
84 private bool $fld_notificationtimestamp =
false;
85 private bool $fld_preload =
false;
86 private bool $fld_preloadcontent =
false;
87 private bool $fld_editintro =
false;
88 private bool $fld_displaytitle =
false;
89 private bool $fld_varianttitles =
false;
95 private $fld_linkclasses =
false;
100 private $fld_associatedpage =
false;
116 private $pageIsRedir;
126 private $pageTouched;
139 private $protections;
141 private $restrictionTypes;
147 private $visitingwatchers;
149 private $notificationtimestamps;
155 private $displaytitles;
157 private $variantTitles;
163 private $watchlistExpiries;
169 private $linkClasses;
172 private $showZeroWatchers =
false;
175 private $countTestedActions = 0;
196 parent::__construct( $queryModule, $moduleName,
'in' );
198 $this->linkBatchFactory = $linkBatchFactory;
199 $this->namespaceInfo = $namespaceInfo;
200 $this->titleFactory = $titleFactory;
201 $this->titleFormatter = $titleFormatter;
202 $this->watchedItemStore = $watchedItemStore;
203 $this->restrictionStore = $restrictionStore;
204 $this->linksMigration = $linksMigration;
205 $this->tempUserCreator = $tempUserCreator;
206 $this->userFactory = $userFactory;
207 $this->introMessageBuilder = $introMessageBuilder;
208 $this->preloadedContentBuilder = $preloadedContentBuilder;
209 $this->revisionLookup = $revisionLookup;
210 $this->urlUtils = $urlUtils;
221 $pageSet->requestField(
'page_is_redirect' );
222 $pageSet->requestField(
'page_is_new' );
224 $pageSet->requestField(
'page_touched' );
225 $pageSet->requestField(
'page_latest' );
226 $pageSet->requestField(
'page_len' );
227 $pageSet->requestField(
'page_content_model' );
229 $pageSet->requestField(
'page_lang' );
235 if ( $this->params[
'prop'] !==
null ) {
236 $prop = array_fill_keys( $this->params[
'prop'],
true );
237 $this->fld_protection = isset( $prop[
'protection'] );
238 $this->fld_watched = isset( $prop[
'watched'] );
239 $this->fld_watchers = isset( $prop[
'watchers'] );
240 $this->fld_visitingwatchers = isset( $prop[
'visitingwatchers'] );
241 $this->fld_notificationtimestamp = isset( $prop[
'notificationtimestamp'] );
242 $this->fld_talkid = isset( $prop[
'talkid'] );
243 $this->fld_subjectid = isset( $prop[
'subjectid'] );
244 $this->fld_url = isset( $prop[
'url'] );
245 $this->fld_readable = isset( $prop[
'readable'] );
246 $this->fld_preload = isset( $prop[
'preload'] );
247 $this->fld_preloadcontent = isset( $prop[
'preloadcontent'] );
248 $this->fld_editintro = isset( $prop[
'editintro'] );
249 $this->fld_displaytitle = isset( $prop[
'displaytitle'] );
250 $this->fld_varianttitles = isset( $prop[
'varianttitles'] );
251 $this->fld_linkclasses = isset( $prop[
'linkclasses'] );
252 $this->fld_associatedpage = isset( $prop[
'associatedpage'] );
256 $this->titles = $pageSet->getGoodPages();
257 $this->missing = $pageSet->getMissingPages();
258 $this->everything = $this->titles + $this->missing;
262 ( $this->fld_preloadcontent || $this->fld_editintro ) &&
263 ( count( $this->everything ) > 1 || count( $this->
getPageSet()->getRevisionIDs() ) > 1 )
268 [
'apierror-info-singlepagerevision', $this->
getModulePrefix() ],
'invalidparammix'
272 uasort( $this->everything, [ Title::class,
'compare' ] );
273 if ( $this->params[
'continue'] !==
null ) {
277 $conttitle = $this->titleFactory->makeTitleSafe( $cont[0], $cont[1] );
279 foreach ( $this->everything as $pageid => $page ) {
280 if ( Title::compare( $page, $conttitle ) >= 0 ) {
283 unset( $this->titles[$pageid] );
284 unset( $this->missing[$pageid] );
285 unset( $this->everything[$pageid] );
290 $this->pageIsRedir = !$pageSet->isResolvingRedirects()
291 ? $pageSet->getCustomField(
'page_is_redirect' )
293 $this->pageIsNew = $pageSet->getCustomField(
'page_is_new' );
295 $this->pageTouched = $pageSet->getCustomField(
'page_touched' );
296 $this->pageLatest = $pageSet->getCustomField(
'page_latest' );
297 $this->pageLength = $pageSet->getCustomField(
'page_len' );
300 if ( $this->fld_protection ) {
301 $this->getProtectionInfo();
304 if ( $this->fld_watched || $this->fld_notificationtimestamp ) {
305 $this->getWatchedInfo();
308 if ( $this->fld_watchers ) {
309 $this->getWatcherInfo();
312 if ( $this->fld_visitingwatchers ) {
313 $this->getVisitingWatcherInfo();
317 if ( $this->fld_talkid || $this->fld_subjectid ) {
321 if ( $this->fld_displaytitle ) {
322 $this->getDisplayTitle();
325 if ( $this->fld_varianttitles ) {
326 $this->getVariantTitles();
329 if ( $this->fld_linkclasses ) {
330 $this->getLinkClasses( $this->params[
'linkcontext'] );
334 foreach ( $this->everything as $pageid => $page ) {
335 $pageInfo = $this->extractPageInfo( $pageid, $page );
336 $fit = $pageInfo !==
null && $result->addValue( [
339 ], $pageid, $pageInfo );
342 $page->getNamespace() .
'|' .
343 $this->titleFormatter->getText( $page ) );
355 private function extractPageInfo( $pageid, $page ) {
356 $title = $this->titleFactory->newFromPageIdentity( $page );
359 $pageExists = $pageid > 0;
360 $ns = $page->getNamespace();
361 $dbkey = $page->getDBkey();
363 $pageInfo[
'contentmodel'] = $title->getContentModel();
365 $pageLanguage = $title->getPageLanguage();
366 $pageInfo[
'pagelanguage'] = $pageLanguage->getCode();
367 $pageInfo[
'pagelanguagehtmlcode'] = $pageLanguage->getHtmlCode();
368 $pageInfo[
'pagelanguagedir'] = $pageLanguage->getDir();
371 $pageInfo[
'touched'] =
wfTimestamp( TS_ISO_8601, $this->pageTouched[$pageid] );
372 $pageInfo[
'lastrevid'] = (int)$this->pageLatest[$pageid];
373 $pageInfo[
'length'] = (int)$this->pageLength[$pageid];
375 if ( isset( $this->pageIsRedir[$pageid] ) && $this->pageIsRedir[$pageid] ) {
376 $pageInfo[
'redirect'] =
true;
378 if ( $this->pageIsNew[$pageid] ) {
379 $pageInfo[
'new'] =
true;
383 if ( $this->fld_protection ) {
384 $pageInfo[
'protection'] = [];
385 if ( isset( $this->protections[$ns][$dbkey] ) ) {
386 $pageInfo[
'protection'] =
387 $this->protections[$ns][$dbkey];
391 $pageInfo[
'restrictiontypes'] = [];
392 if ( isset( $this->restrictionTypes[$ns][$dbkey] ) ) {
393 $pageInfo[
'restrictiontypes'] =
394 $this->restrictionTypes[$ns][$dbkey];
399 if ( $this->fld_watched ) {
400 $pageInfo[
'watched'] =
false;
402 if ( isset( $this->watched[$ns][$dbkey] ) ) {
403 $pageInfo[
'watched'] = $this->watched[$ns][$dbkey];
406 if ( isset( $this->watchlistExpiries[$ns][$dbkey] ) ) {
407 $pageInfo[
'watchlistexpiry'] = $this->watchlistExpiries[$ns][$dbkey];
411 if ( $this->fld_watchers ) {
412 if ( $this->watchers !==
null && $this->watchers[$ns][$dbkey] !== 0 ) {
413 $pageInfo[
'watchers'] = $this->watchers[$ns][$dbkey];
414 } elseif ( $this->showZeroWatchers ) {
415 $pageInfo[
'watchers'] = 0;
419 if ( $this->fld_visitingwatchers ) {
420 if ( $this->visitingwatchers !==
null && $this->visitingwatchers[$ns][$dbkey] !== 0 ) {
421 $pageInfo[
'visitingwatchers'] = $this->visitingwatchers[$ns][$dbkey];
422 } elseif ( $this->showZeroWatchers ) {
423 $pageInfo[
'visitingwatchers'] = 0;
427 if ( $this->fld_notificationtimestamp ) {
428 $pageInfo[
'notificationtimestamp'] =
'';
429 if ( isset( $this->notificationtimestamps[$ns][$dbkey] ) ) {
430 $pageInfo[
'notificationtimestamp'] =
431 wfTimestamp( TS_ISO_8601, $this->notificationtimestamps[$ns][$dbkey] );
435 if ( $this->fld_talkid && isset( $this->talkids[$ns][$dbkey] ) ) {
436 $pageInfo[
'talkid'] = $this->talkids[$ns][$dbkey];
439 if ( $this->fld_subjectid && isset( $this->subjectids[$ns][$dbkey] ) ) {
440 $pageInfo[
'subjectid'] = $this->subjectids[$ns][$dbkey];
443 if ( $this->fld_associatedpage && $ns >=
NS_MAIN ) {
444 $pageInfo[
'associatedpage'] = $this->titleFormatter->getPrefixedText(
445 $this->namespaceInfo->getAssociatedPage( TitleValue::newFromPage( $page ) )
449 if ( $this->fld_url ) {
450 $pageInfo[
'fullurl'] = (string)$this->urlUtils->expand(
453 $pageInfo[
'editurl'] = (string)$this->urlUtils->expand(
456 $pageInfo[
'canonicalurl'] = (string)$this->urlUtils->expand(
460 if ( $this->fld_readable ) {
461 $pageInfo[
'readable'] = $this->
getAuthority()->definitelyCan(
'read', $page );
464 if ( $this->fld_preload ) {
466 $pageInfo[
'preload'] =
'';
470 $this->
getHookRunner()->onEditFormPreloadText( $text, $title );
472 $pageInfo[
'preload'] = $text;
476 if ( $this->fld_preloadcontent ) {
477 $newSection = $this->params[
'preloadnewsection'];
480 if ( !$pageExists || $newSection ) {
481 $content = $this->preloadedContentBuilder->getPreloadedContent(
482 $title->toPageIdentity(),
483 $this->getAuthority(),
484 $this->params[
'preloadcustom'],
485 $this->params[
'preloadparams'] ?? [],
486 $newSection ?
'new' : null
488 $defaultContent = $newSection ? null :
489 $this->preloadedContentBuilder->getDefaultContent( $title->toPageIdentity() );
490 $contentIsDefault = $defaultContent ? $content->equals( $defaultContent ) : $content->isEmpty();
493 $pageInfo[
'preloadcontent'][
'contentmodel'] = $content->getModel();
494 $pageInfo[
'preloadcontent'][
'contentformat'] = $content->getDefaultFormat();
499 $pageInfo[
'preloadisdefault'] = $contentIsDefault;
503 if ( $this->fld_editintro ) {
505 $localizerWithPage =
new class( $this, $page ) implements
MessageLocalizer {
507 private PageReference $page;
517 public function msg( $key, ...$params ) {
518 return $this->base->
msg( $key, ...$params )->page( $this->page );
523 'lessframes' => IntroMessageBuilder::LESS_FRAMES,
524 'moreframes' => IntroMessageBuilder::MORE_FRAMES,
527 $revId = array_key_first( $this->
getPageSet()->getLiveRevisionIDs() );
528 $revRecord = $revId ? $this->revisionLookup->getRevisionById( $revId ) :
null;
530 $messages = $this->introMessageBuilder->getIntroMessages(
531 $styleParamMap[ $this->params[
'editintrostyle'] ],
532 $this->params[
'editintroskip'] ?? [],
534 $title->toPageIdentity(),
536 $this->getAuthority(),
537 $this->params[
'editintrocustom'],
545 $pageInfo[
'editintro'] = $messages;
548 if ( $this->fld_displaytitle ) {
549 $pageInfo[
'displaytitle'] = $this->displaytitles[$pageid] ??
550 htmlspecialchars( $this->titleFormatter->getPrefixedText( $page ), ENT_NOQUOTES );
553 if ( $this->fld_varianttitles && isset( $this->variantTitles[$pageid] ) ) {
554 $pageInfo[
'varianttitles'] = $this->variantTitles[$pageid];
557 if ( $this->fld_linkclasses && isset( $this->linkClasses[$pageid] ) ) {
558 $pageInfo[
'linkclasses'] = $this->linkClasses[$pageid];
561 if ( $this->params[
'testactions'] ) {
563 if ( $this->countTestedActions >= $limit ) {
567 $detailLevel = $this->params[
'testactionsdetail'];
569 if ( $errorFormatter->getFormat() ===
'bc' ) {
571 $errorFormatter = $errorFormatter->newWithFormat(
'plaintext' );
574 $pageInfo[
'actions'] = [];
575 if ( $this->params[
'testactionsautocreate'] ) {
576 $pageInfo[
'wouldautocreate'] = [];
579 foreach ( $this->params[
'testactions'] as $action ) {
580 $this->countTestedActions++;
582 $shouldAutoCreate = $this->tempUserCreator->shouldAutoCreate( $this->
getUser(), $action );
584 if ( $shouldAutoCreate ) {
585 $authority = $this->userFactory->newTempPlaceholder();
590 if ( $detailLevel ===
'boolean' ) {
591 $pageInfo[
'actions'][$action] = $authority->authorizeRead( $action, $page );
593 $status =
new PermissionStatus();
594 if ( $detailLevel ===
'quick' ) {
595 $authority->probablyCan( $action, $page, $status );
597 $authority->definitelyCan( $action, $page, $status );
600 $pageInfo[
'actions'][$action] = $errorFormatter->arrayFromStatus( $status );
603 if ( $this->params[
'testactionsautocreate'] ) {
604 $pageInfo[
'wouldautocreate'][$action] = $shouldAutoCreate;
615 private function getProtectionInfo() {
616 $this->protections = [];
617 $db = $this->
getDB();
620 if ( count( $this->titles ) ) {
623 $this->
addFields( [
'pr_page',
'pr_type',
'pr_level',
624 'pr_expiry',
'pr_cascade' ] );
625 $this->
addWhereFld(
'pr_page', array_keys( $this->titles ) );
627 $res = $this->
select( __METHOD__ );
628 foreach ( $res as $row ) {
630 $page = $this->titles[$row->pr_page];
632 'type' => $row->pr_type,
633 'level' => $row->pr_level,
636 if ( $row->pr_cascade ) {
637 $a[
'cascade'] =
true;
639 $this->protections[$page->getNamespace()][$page->getDBkey()][] = $a;
644 if ( count( $this->missing ) ) {
646 $lb = $this->linkBatchFactory->newLinkBatch( $this->missing );
648 $this->
addFields( [
'pt_title',
'pt_namespace',
'pt_create_perm',
'pt_expiry' ] );
649 $this->
addWhere( $lb->constructSet(
'pt', $db ) );
650 $res = $this->
select( __METHOD__ );
651 foreach ( $res as $row ) {
652 $this->protections[$row->pt_namespace][$row->pt_title][] = [
654 'level' => $row->pt_create_perm,
662 $images = $others = [];
663 foreach ( $this->everything as $page ) {
664 if ( $page->getNamespace() ===
NS_FILE ) {
665 $images[] = $page->getDBkey();
670 $this->restrictionTypes[$page->getNamespace()][$page->getDBkey()] =
671 array_values( $this->restrictionStore->listApplicableRestrictionTypes( $page ) );
674 [ $blNamespace, $blTitle ] = $this->linksMigration->getTitleFields(
'templatelinks' );
675 $queryInfo = $this->linksMigration->getQueryInfo(
'templatelinks' );
677 if ( count( $others ) ) {
679 $lb = $this->linkBatchFactory->newLinkBatch( $others );
681 $this->
addTables( array_merge( [
'page_restrictions',
'page' ], $queryInfo[
'tables'] ) );
683 $this->
addOption(
'USE INDEX', [
'templatelinks' =>
'PRIMARY' ] );
684 $this->
addFields( [
'pr_type',
'pr_level',
'pr_expiry',
685 'page_title',
'page_namespace',
686 $blNamespace, $blTitle ] );
687 $this->
addWhere( $lb->constructSet(
'tl', $db ) );
688 $this->
addWhere(
'pr_page = page_id' );
689 $this->
addWhere(
'pr_page = tl_from' );
693 $res = $this->
select( __METHOD__ );
694 foreach ( $res as $row ) {
695 $this->protections[$row->$blNamespace][$row->$blTitle][] = [
696 'type' => $row->pr_type,
697 'level' => $row->pr_level,
699 'source' => $this->titleFormatter->formatTitle( $row->page_namespace, $row->page_title ),
704 if ( count( $images ) ) {
707 $this->
addTables( [
'page_restrictions',
'page',
'imagelinks' ] );
708 $this->
addFields( [
'pr_type',
'pr_level',
'pr_expiry',
709 'page_title',
'page_namespace',
'il_to' ] );
710 $this->
addWhere(
'pr_page = page_id' );
711 $this->
addWhere(
'pr_page = il_from' );
715 $res = $this->
select( __METHOD__ );
716 foreach ( $res as $row ) {
717 $this->protections[
NS_FILE][$row->il_to][] = [
718 'type' => $row->pr_type,
719 'level' => $row->pr_level,
721 'source' => $this->titleFormatter->formatTitle( $row->page_namespace, $row->page_title ),
731 private function getTSIDs() {
732 $getTitles = $this->talkids = $this->subjectids = [];
733 $nsInfo = $this->namespaceInfo;
736 foreach ( $this->everything as $page ) {
737 if ( $nsInfo->isTalk( $page->getNamespace() ) ) {
738 if ( $this->fld_subjectid ) {
739 $getTitles[] = $nsInfo->getSubjectPage( TitleValue::newFromPage( $page ) );
741 } elseif ( $this->fld_talkid ) {
742 $getTitles[] = $nsInfo->getTalkPage( TitleValue::newFromPage( $page ) );
745 if ( $getTitles === [] ) {
749 $db = $this->
getDB();
753 $lb = $this->linkBatchFactory->newLinkBatch( $getTitles );
756 $this->
addFields( [
'page_title',
'page_namespace',
'page_id' ] );
757 $this->
addWhere( $lb->constructSet(
'page', $db ) );
758 $res = $this->
select( __METHOD__ );
759 foreach ( $res as $row ) {
760 if ( $nsInfo->isTalk( $row->page_namespace ) ) {
761 $this->talkids[$nsInfo->getSubject( $row->page_namespace )][$row->page_title] =
762 (int)( $row->page_id );
764 $this->subjectids[$nsInfo->getTalk( $row->page_namespace )][$row->page_title] =
765 (int)( $row->page_id );
770 private function getDisplayTitle() {
771 $this->displaytitles = [];
773 $pageIds = array_keys( $this->titles );
775 if ( $pageIds === [] ) {
781 $this->
addFields( [
'pp_page',
'pp_value' ] );
783 $this->
addWhereFld(
'pp_propname',
'displaytitle' );
784 $res = $this->
select( __METHOD__ );
786 foreach ( $res as $row ) {
787 $this->displaytitles[$row->pp_page] = $row->pp_value;
798 private function getLinkClasses( ?LinkTarget $context_title =
null ) {
799 if ( $this->titles === [] ) {
810 foreach ( $this->titles as $pageId => $page ) {
811 $pdbk = $this->titleFormatter->getPrefixedDBkey( $page );
812 $pagemap[$pageId] = $pdbk;
813 $classes[$pdbk] = isset( $this->pageIsRedir[$pageId] ) && $this->pageIsRedir[$pageId] ?
'mw-redirect' :
'';
816 $context_title = $this->titleFactory->newFromLinkTarget(
817 $context_title ?? $this->titleFactory->newMainPage()
820 $pagemap, $classes, $context_title
827 $this->linkClasses = [];
828 foreach ( $this->titles as $pageId => $page ) {
829 $pdbk = $this->titleFormatter->getPrefixedDBkey( $page );
830 $this->linkClasses[$pageId] = preg_split(
831 '/\s+/', $classes[$pdbk] ??
'', -1, PREG_SPLIT_NO_EMPTY
836 private function getVariantTitles() {
837 if ( $this->titles === [] ) {
840 $this->variantTitles = [];
841 foreach ( $this->titles as $pageId => $page ) {
842 $this->variantTitles[$pageId] = isset( $this->displaytitles[$pageId] )
843 ? $this->getAllVariants( $this->displaytitles[$pageId] )
844 : $this->getAllVariants( $this->titleFormatter->getText( $page ), $page->getNamespace() );
848 private function getAllVariants( $text, $ns =
NS_MAIN ) {
850 foreach ( $this->languageConverter->getVariants() as $variant ) {
851 $convertTitle = $this->languageConverter->autoConvert( $text, $variant );
853 $convertNs = $this->languageConverter->convertNamespace( $ns, $variant );
854 $convertTitle = $convertNs .
':' . $convertTitle;
856 $result[$variant] = $convertTitle;
865 private function getWatchedInfo() {
868 if ( !$user->isRegistered() || count( $this->everything ) == 0
869 || !$this->
getAuthority()->isAllowed(
'viewmywatchlist' )
875 $this->watchlistExpiries = [];
876 $this->notificationtimestamps = [];
879 $items = $this->watchedItemStore->loadWatchedItemsBatch( $user, $this->everything );
881 foreach ( $items as $item ) {
882 $nsId = $item->getTarget()->getNamespace();
883 $dbKey = $item->getTarget()->getDBkey();
885 if ( $this->fld_watched ) {
886 $this->watched[$nsId][$dbKey] =
true;
888 $expiry = $item->getExpiry( TS_ISO_8601 );
890 $this->watchlistExpiries[$nsId][$dbKey] = $expiry;
894 if ( $this->fld_notificationtimestamp ) {
895 $this->notificationtimestamps[$nsId][$dbKey] = $item->getNotificationTimestamp();
903 private function getWatcherInfo() {
904 if ( count( $this->everything ) == 0 ) {
908 $canUnwatchedpages = $this->
getAuthority()->isAllowed(
'unwatchedpages' );
909 $unwatchedPageThreshold =
911 if ( !$canUnwatchedpages && !is_int( $unwatchedPageThreshold ) ) {
915 $this->showZeroWatchers = $canUnwatchedpages;
918 if ( !$canUnwatchedpages ) {
919 $countOptions[
'minimumWatchers'] = $unwatchedPageThreshold;
922 $this->watchers = $this->watchedItemStore->countWatchersMultiple(
934 private function getVisitingWatcherInfo() {
936 $db = $this->
getDB();
938 $canUnwatchedpages = $this->
getAuthority()->isAllowed(
'unwatchedpages' );
940 if ( !$canUnwatchedpages && !is_int( $unwatchedPageThreshold ) ) {
944 $this->showZeroWatchers = $canUnwatchedpages;
946 $titlesWithThresholds = [];
947 if ( $this->titles ) {
948 $lb = $this->linkBatchFactory->newLinkBatch( $this->titles );
952 $this->
addTables( [
'page',
'revision' ] );
953 $this->
addFields( [
'page_namespace',
'page_title',
'rev_timestamp' ] );
955 'page_latest = rev_id',
956 $lb->constructSet(
'page', $db ),
958 $this->
addOption(
'GROUP BY', [
'page_namespace',
'page_title' ] );
959 $timestampRes = $this->
select( __METHOD__ );
963 foreach ( $timestampRes as $row ) {
964 $revTimestamp =
wfTimestamp( TS_UNIX, (
int)$row->rev_timestamp );
965 $timestamps[$row->page_namespace][$row->page_title] = (int)$revTimestamp - $age;
967 $titlesWithThresholds = array_map(
968 static function ( PageReference $target ) use ( $timestamps ) {
970 $target, $timestamps[$target->getNamespace()][$target->getDBkey()]
977 if ( $this->missing ) {
978 $titlesWithThresholds = array_merge(
979 $titlesWithThresholds,
981 static function ( PageReference $target ) {
982 return [ $target, null ];
988 $this->visitingwatchers = $this->watchedItemStore->countVisitingWatchersMultiple(
989 $titlesWithThresholds,
990 !$canUnwatchedpages ? $unwatchedPageThreshold : null
1006 if ( array_diff( (array)
$params[
'prop'], $publicProps ) ) {
1011 if (
$params[
'testactions'] ) {
1021 ParamValidator::PARAM_ISMULTI =>
true,
1022 ParamValidator::PARAM_TYPE => [
1025 'watched', #
private
1026 'watchers', #
private
1027 'visitingwatchers', #
private
1028 'notificationtimestamp', #
private
1032 'readable', #
private
1034 'preloadcontent', #
private: checks current user
's permissions
1035 'editintro
', # private: checks current user's permissions
1038 'linkclasses', #
private: stub length (and possibly hook colors)
1043 EnumDef::PARAM_DEPRECATED_VALUES => [
1049 ParamValidator::PARAM_TYPE =>
'title',
1050 ParamValidator::PARAM_DEFAULT => $this->titleFactory->newMainPage()->getPrefixedText(),
1051 TitleDef::PARAM_RETURN_OBJECT =>
true,
1054 ParamValidator::PARAM_TYPE =>
'string',
1055 ParamValidator::PARAM_ISMULTI =>
true,
1057 'testactionsdetail' => [
1058 ParamValidator::PARAM_TYPE => [
'boolean',
'full',
'quick' ],
1059 ParamValidator::PARAM_DEFAULT =>
'boolean',
1062 'testactionsautocreate' =>
false,
1063 'preloadcustom' => [
1066 ParamValidator::PARAM_TYPE =>
'string',
1069 'preloadparams' => [
1070 ParamValidator::PARAM_ISMULTI =>
true,
1073 'preloadnewsection' => [
1074 ParamValidator::PARAM_TYPE =>
'boolean',
1075 ParamValidator::PARAM_DEFAULT =>
false,
1078 'editintrostyle' => [
1079 ParamValidator::PARAM_TYPE => [
'lessframes',
'moreframes' ],
1080 ParamValidator::PARAM_DEFAULT =>
'moreframes',
1083 'editintroskip' => [
1084 ParamValidator::PARAM_TYPE =>
'string',
1085 ParamValidator::PARAM_ISMULTI =>
true,
1088 'editintrocustom' => [
1091 ParamValidator::PARAM_TYPE =>
'string',
1101 $title = Title::newMainPage()->getPrefixedText();
1102 $mp = rawurlencode( $title );
1105 "action=query&prop=info&titles={$mp}"
1106 =>
'apihelp-query+info-example-simple',
1107 "action=query&prop=info&inprop=protection&titles={$mp}"
1108 =>
'apihelp-query+info-example-protection',
1113 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Info';