51 private LinkBatchFactory $linkBatchFactory;
66 private bool $fld_protection =
false;
67 private bool $fld_talkid =
false;
68 private bool $fld_subjectid =
false;
69 private bool $fld_url =
false;
70 private bool $fld_readable =
false;
71 private bool $fld_watched =
false;
72 private bool $fld_watchers =
false;
73 private bool $fld_visitingwatchers =
false;
74 private bool $fld_notificationtimestamp =
false;
75 private bool $fld_preload =
false;
76 private bool $fld_preloadcontent =
false;
77 private bool $fld_editintro =
false;
78 private bool $fld_displaytitle =
false;
79 private bool $fld_varianttitles =
false;
85 private $fld_linkclasses =
false;
90 private $fld_associatedpage =
false;
106 private $pageIsRedir;
116 private $pageTouched;
129 private $protections;
131 private $restrictionTypes;
137 private $visitingwatchers;
139 private $notificationtimestamps;
145 private $displaytitles;
147 private $variantTitles;
153 private $watchlistExpiries;
159 private $linkClasses;
162 private $showZeroWatchers =
false;
165 private $countTestedActions = 0;
171 LinkBatchFactory $linkBatchFactory,
187 parent::__construct( $queryModule, $moduleName,
'in' );
189 $this->linkBatchFactory = $linkBatchFactory;
190 $this->namespaceInfo = $namespaceInfo;
191 $this->titleFactory = $titleFactory;
192 $this->titleFormatter = $titleFormatter;
193 $this->watchedItemStore = $watchedItemStore;
194 $this->restrictionStore = $restrictionStore;
195 $this->linksMigration = $linksMigration;
196 $this->tempUserCreator = $tempUserCreator;
197 $this->userFactory = $userFactory;
198 $this->introMessageBuilder = $introMessageBuilder;
199 $this->preloadedContentBuilder = $preloadedContentBuilder;
200 $this->revisionLookup = $revisionLookup;
201 $this->urlUtils = $urlUtils;
202 $this->linkRenderer = $linkRenderer;
213 $pageSet->requestField(
'page_is_redirect' );
214 $pageSet->requestField(
'page_is_new' );
216 $pageSet->requestField(
'page_touched' );
217 $pageSet->requestField(
'page_latest' );
218 $pageSet->requestField(
'page_len' );
219 $pageSet->requestField(
'page_content_model' );
221 $pageSet->requestField(
'page_lang' );
227 if ( $this->params[
'prop'] !==
null ) {
228 $prop = array_fill_keys( $this->params[
'prop'],
true );
229 $this->fld_protection = isset( $prop[
'protection'] );
230 $this->fld_watched = isset( $prop[
'watched'] );
231 $this->fld_watchers = isset( $prop[
'watchers'] );
232 $this->fld_visitingwatchers = isset( $prop[
'visitingwatchers'] );
233 $this->fld_notificationtimestamp = isset( $prop[
'notificationtimestamp'] );
234 $this->fld_talkid = isset( $prop[
'talkid'] );
235 $this->fld_subjectid = isset( $prop[
'subjectid'] );
236 $this->fld_url = isset( $prop[
'url'] );
237 $this->fld_readable = isset( $prop[
'readable'] );
238 $this->fld_preload = isset( $prop[
'preload'] );
239 $this->fld_preloadcontent = isset( $prop[
'preloadcontent'] );
240 $this->fld_editintro = isset( $prop[
'editintro'] );
241 $this->fld_displaytitle = isset( $prop[
'displaytitle'] );
242 $this->fld_varianttitles = isset( $prop[
'varianttitles'] );
243 $this->fld_linkclasses = isset( $prop[
'linkclasses'] );
244 $this->fld_associatedpage = isset( $prop[
'associatedpage'] );
248 $this->titles = $pageSet->getGoodPages();
249 $this->missing = $pageSet->getMissingPages();
250 $this->everything = $this->titles + $this->missing;
254 ( $this->fld_preloadcontent || $this->fld_editintro ) &&
255 ( count( $this->everything ) > 1 || count( $this->
getPageSet()->getRevisionIDs() ) > 1 )
260 [
'apierror-info-singlepagerevision', $this->
getModulePrefix() ],
'invalidparammix'
264 uasort( $this->everything, Title::compare( ... ) );
265 if ( $this->params[
'continue'] !==
null ) {
269 $conttitle = $this->titleFactory->makeTitleSafe( $cont[0], $cont[1] );
271 foreach ( $this->everything as $pageid => $page ) {
272 if ( Title::compare( $page, $conttitle ) >= 0 ) {
275 unset( $this->titles[$pageid] );
276 unset( $this->missing[$pageid] );
277 unset( $this->everything[$pageid] );
282 $this->pageIsRedir = !$pageSet->isResolvingRedirects()
283 ? $pageSet->getCustomField(
'page_is_redirect' )
285 $this->pageIsNew = $pageSet->getCustomField(
'page_is_new' );
287 $this->pageTouched = $pageSet->getCustomField(
'page_touched' );
288 $this->pageLatest = $pageSet->getCustomField(
'page_latest' );
289 $this->pageLength = $pageSet->getCustomField(
'page_len' );
292 if ( $this->fld_protection ) {
293 $this->getProtectionInfo();
296 if ( $this->fld_watched || $this->fld_notificationtimestamp ) {
297 $this->getWatchedInfo();
300 if ( $this->fld_watchers ) {
301 $this->getWatcherInfo();
304 if ( $this->fld_visitingwatchers ) {
305 $this->getVisitingWatcherInfo();
309 if ( $this->fld_talkid || $this->fld_subjectid ) {
313 if ( $this->fld_displaytitle ) {
314 $this->getDisplayTitle();
317 if ( $this->fld_varianttitles ) {
318 $this->getVariantTitles();
321 if ( $this->fld_linkclasses ) {
322 $this->getLinkClasses( $this->params[
'linkcontext'] );
326 foreach ( $this->everything as $pageid => $page ) {
327 $pageInfo = $this->extractPageInfo( $pageid, $page );
328 $fit = $pageInfo !==
null && $result->addValue( [
331 ], $pageid, $pageInfo );
334 $page->getNamespace() .
'|' .
335 $this->titleFormatter->getText( $page ) );
347 private function extractPageInfo( $pageid, $page ) {
348 $title = $this->titleFactory->newFromPageIdentity( $page );
351 $pageExists = $pageid > 0;
352 $ns = $page->getNamespace();
353 $dbkey = $page->getDBkey();
355 $pageInfo[
'contentmodel'] = $title->getContentModel();
357 $pageLanguage = $title->getPageLanguage();
358 $pageInfo[
'pagelanguage'] = $pageLanguage->getCode();
359 $pageInfo[
'pagelanguagehtmlcode'] = $pageLanguage->getHtmlCode();
360 $pageInfo[
'pagelanguagedir'] = $pageLanguage->getDir();
363 $pageInfo[
'touched'] =
wfTimestamp( TS::ISO_8601, $this->pageTouched[$pageid] );
364 $pageInfo[
'lastrevid'] = (int)$this->pageLatest[$pageid];
365 $pageInfo[
'length'] = (int)$this->pageLength[$pageid];
367 if ( isset( $this->pageIsRedir[$pageid] ) && $this->pageIsRedir[$pageid] ) {
368 $pageInfo[
'redirect'] =
true;
370 if ( $this->pageIsNew[$pageid] ) {
371 $pageInfo[
'new'] =
true;
375 if ( $this->fld_protection ) {
376 $pageInfo[
'protection'] = [];
377 if ( isset( $this->protections[$ns][$dbkey] ) ) {
378 $pageInfo[
'protection'] =
379 $this->protections[$ns][$dbkey];
383 $pageInfo[
'restrictiontypes'] = [];
384 if ( isset( $this->restrictionTypes[$ns][$dbkey] ) ) {
385 $pageInfo[
'restrictiontypes'] =
386 $this->restrictionTypes[$ns][$dbkey];
391 if ( $this->fld_watched ) {
392 $pageInfo[
'watched'] =
false;
394 if ( isset( $this->watched[$ns][$dbkey] ) ) {
395 $pageInfo[
'watched'] = $this->watched[$ns][$dbkey];
398 if ( isset( $this->watchlistExpiries[$ns][$dbkey] ) ) {
399 $pageInfo[
'watchlistexpiry'] = $this->watchlistExpiries[$ns][$dbkey];
403 if ( $this->fld_watchers ) {
404 if ( $this->watchers !==
null && $this->watchers[$ns][$dbkey] !== 0 ) {
405 $pageInfo[
'watchers'] = $this->watchers[$ns][$dbkey];
406 } elseif ( $this->showZeroWatchers ) {
407 $pageInfo[
'watchers'] = 0;
411 if ( $this->fld_visitingwatchers ) {
412 if ( $this->visitingwatchers !==
null && $this->visitingwatchers[$ns][$dbkey] !== 0 ) {
413 $pageInfo[
'visitingwatchers'] = $this->visitingwatchers[$ns][$dbkey];
414 } elseif ( $this->showZeroWatchers ) {
415 $pageInfo[
'visitingwatchers'] = 0;
419 if ( $this->fld_notificationtimestamp ) {
420 $pageInfo[
'notificationtimestamp'] =
'';
421 if ( isset( $this->notificationtimestamps[$ns][$dbkey] ) ) {
422 $pageInfo[
'notificationtimestamp'] =
423 wfTimestamp( TS::ISO_8601, $this->notificationtimestamps[$ns][$dbkey] );
427 if ( $this->fld_talkid && isset( $this->talkids[$ns][$dbkey] ) ) {
428 $pageInfo[
'talkid'] = $this->talkids[$ns][$dbkey];
431 if ( $this->fld_subjectid && isset( $this->subjectids[$ns][$dbkey] ) ) {
432 $pageInfo[
'subjectid'] = $this->subjectids[$ns][$dbkey];
435 if ( $this->fld_associatedpage && $ns >=
NS_MAIN ) {
436 $pageInfo[
'associatedpage'] = $this->titleFormatter->getPrefixedText(
437 $this->namespaceInfo->getAssociatedPage( TitleValue::newFromPage( $page ) )
441 if ( $this->fld_url ) {
442 $pageInfo[
'fullurl'] = (string)$this->urlUtils->expand(
445 $pageInfo[
'editurl'] = (string)$this->urlUtils->expand(
448 $pageInfo[
'canonicalurl'] = (string)$this->urlUtils->expand(
452 if ( $this->fld_readable ) {
453 $pageInfo[
'readable'] = $this->
getAuthority()->definitelyCan(
'read', $page );
456 if ( $this->fld_preload ) {
458 $pageInfo[
'preload'] =
'';
462 $this->
getHookRunner()->onEditFormPreloadText( $text, $title );
464 $pageInfo[
'preload'] = $text;
468 if ( $this->fld_preloadcontent ) {
469 $newSection = $this->params[
'preloadnewsection'];
472 if ( !$pageExists || $newSection ) {
473 $content = $this->preloadedContentBuilder->getPreloadedContent(
474 $title->toPageIdentity(),
475 $this->getAuthority(),
476 $this->params[
'preloadcustom'],
477 $this->params[
'preloadparams'] ?? [],
478 $newSection ?
'new' : null
480 $defaultContent = $newSection ? null :
481 $this->preloadedContentBuilder->getDefaultContent( $title->toPageIdentity() );
482 $contentIsDefault = $defaultContent ? $content->equals( $defaultContent ) : $content->isEmpty();
485 $pageInfo[
'preloadcontent'][
'contentmodel'] = $content->getModel();
486 $pageInfo[
'preloadcontent'][
'contentformat'] = $content->getDefaultFormat();
491 $pageInfo[
'preloadisdefault'] = $contentIsDefault;
495 if ( $this->fld_editintro ) {
497 $localizerWithPage =
new class( $this, $page ) implements
MessageLocalizer {
499 private PageReference $page;
509 public function msg( $key, ...$params ) {
510 return $this->base->
msg( $key, ...$params )->page( $this->page );
515 'lessframes' => IntroMessageBuilder::LESS_FRAMES,
516 'moreframes' => IntroMessageBuilder::MORE_FRAMES,
519 $revId = array_key_first( $this->
getPageSet()->getLiveRevisionIDs() );
520 $revRecord = $revId ? $this->revisionLookup->getRevisionById( $revId ) :
null;
522 $messages = $this->introMessageBuilder->getIntroMessages(
523 $styleParamMap[ $this->params[
'editintrostyle'] ],
524 $this->params[
'editintroskip'] ?? [],
526 $title->toPageIdentity(),
528 $this->getAuthority(),
529 $this->params[
'editintrocustom'],
537 $pageInfo[
'editintro'] = $messages;
540 if ( $this->fld_displaytitle ) {
541 $pageInfo[
'displaytitle'] = $this->displaytitles[$pageid] ??
542 htmlspecialchars( $this->titleFormatter->getPrefixedText( $page ), ENT_NOQUOTES );
545 if ( $this->fld_varianttitles && isset( $this->variantTitles[$pageid] ) ) {
546 $pageInfo[
'varianttitles'] = $this->variantTitles[$pageid];
549 if ( $this->fld_linkclasses && isset( $this->linkClasses[$pageid] ) ) {
550 $pageInfo[
'linkclasses'] = $this->linkClasses[$pageid];
553 if ( $this->params[
'testactions'] ) {
555 if ( $this->countTestedActions >= $limit ) {
559 $detailLevel = $this->params[
'testactionsdetail'];
561 if ( $errorFormatter->getFormat() ===
'bc' ) {
563 $errorFormatter = $errorFormatter->newWithFormat(
'plaintext' );
566 $pageInfo[
'actions'] = [];
567 if ( $this->params[
'testactionsautocreate'] ) {
568 $pageInfo[
'wouldautocreate'] = [];
571 foreach ( $this->params[
'testactions'] as $action ) {
572 $this->countTestedActions++;
574 $shouldAutoCreate = $this->tempUserCreator->shouldAutoCreate( $this->
getUser(), $action );
576 if ( $shouldAutoCreate ) {
577 $authority = $this->userFactory->newTempPlaceholder();
582 if ( $detailLevel ===
'boolean' ) {
583 $pageInfo[
'actions'][$action] = $authority->definitelyCan( $action, $page );
585 $status =
new PermissionStatus();
586 if ( $detailLevel ===
'quick' ) {
587 $authority->probablyCan( $action, $page, $status );
589 $authority->definitelyCan( $action, $page, $status );
592 $pageInfo[
'actions'][$action] = $errorFormatter->arrayFromStatus( $status );
595 if ( $this->params[
'testactionsautocreate'] ) {
596 $pageInfo[
'wouldautocreate'][$action] = $shouldAutoCreate;
607 private function getProtectionInfo() {
608 $this->protections = [];
611 if ( count( $this->titles ) ) {
614 $this->
addFields( [
'pr_page',
'pr_type',
'pr_level',
615 'pr_expiry',
'pr_cascade' ] );
616 $this->
addWhereFld(
'pr_page', array_keys( $this->titles ) );
618 $res = $this->
select( __METHOD__ );
619 foreach ( $res as $row ) {
621 $page = $this->titles[$row->pr_page];
623 'type' => $row->pr_type,
624 'level' => $row->pr_level,
627 if ( $row->pr_cascade ) {
628 $a[
'cascade'] =
true;
630 $this->protections[$page->getNamespace()][$page->getDBkey()][] = $a;
635 if ( count( $this->missing ) ) {
637 $lb = $this->linkBatchFactory->newLinkBatch( $this->missing );
639 $this->
addFields( [
'pt_title',
'pt_namespace',
'pt_create_perm',
'pt_expiry' ] );
640 $this->
addWhere( $lb->constructSet(
'pt', $this->getDB() ) );
641 $res = $this->
select( __METHOD__ );
642 foreach ( $res as $row ) {
643 $this->protections[$row->pt_namespace][$row->pt_title][] = [
645 'level' => $row->pt_create_perm,
653 $images = $others = [];
654 foreach ( $this->everything as $page ) {
655 if ( $page->getNamespace() ===
NS_FILE ) {
656 $images[] = $page->getDBkey();
661 $this->restrictionTypes[$page->getNamespace()][$page->getDBkey()] =
662 array_values( $this->restrictionStore->listApplicableRestrictionTypes( $page ) );
665 if ( count( $others ) ) {
667 $this->
addTables( [
'page_restrictions',
'page' ] );
668 $this->
addFields( [
'pr_type',
'pr_level',
'pr_expiry',
669 'page_title',
'page_namespace',
'page_id' ] );
670 $this->
addWhere(
'pr_page = page_id' );
673 $res = $this->
select( __METHOD__ );
675 $protectedPages = [];
676 foreach ( $res as $row ) {
677 $protectedPages[$row->page_id] = [
678 'type' => $row->pr_type,
679 'level' => $row->pr_level,
681 'source' => $this->titleFormatter->formatTitle( $row->page_namespace, $row->page_title ),
685 if ( $protectedPages ) {
688 $lb = $this->linkBatchFactory->newLinkBatch( $others );
690 $queryInfo = $this->linksMigration->getQueryInfo(
'templatelinks' );
691 $res = $this->
getDB()->newSelectQueryBuilder()
692 ->select( [
'tl_from',
'lt_namespace',
'lt_title' ] )
693 ->tables( $queryInfo[
'tables'] )
694 ->joinConds( $queryInfo[
'joins'] )
695 ->where( [
'tl_from' => array_keys( $protectedPages ) ] )
696 ->andWhere( $lb->constructSet(
'tl', $this->getDB() ) )
697 ->useIndex( [
'templatelinks' =>
'PRIMARY' ] )
698 ->caller( __METHOD__ )
701 foreach ( $res as $row ) {
702 $protection = $protectedPages[$row->tl_from];
703 $this->protections[$row->lt_namespace][$row->lt_title][] = $protection;
710 if ( count( $images ) ) {
712 $this->
addTables( [
'page_restrictions',
'page' ] );
713 $this->
addFields( [
'pr_type',
'pr_level',
'pr_expiry',
714 'page_title',
'page_namespace',
'page_id' ] );
715 $this->
addWhere(
'pr_page = page_id' );
718 $res = $this->
select( __METHOD__ );
720 $protectedPages = [];
721 foreach ( $res as $row ) {
722 $protectedPages[$row->page_id] = [
723 'type' => $row->pr_type,
724 'level' => $row->pr_level,
726 'source' => $this->titleFormatter->formatTitle( $row->page_namespace, $row->page_title ),
730 if ( $protectedPages ) {
733 $res = $this->
getDB()->newSelectQueryBuilder()
734 ->select( [
'il_from',
'il_to' ] )
735 ->from(
'imagelinks' )
737 'il_from' => array_keys( $protectedPages ),
740 ->caller( __METHOD__ )
743 foreach ( $res as $row ) {
744 $protection = $protectedPages[$row->il_from];
745 $this->protections[
NS_FILE][$row->il_to][] = $protection;
757 private function getTSIDs() {
758 $getTitles = $this->talkids = $this->subjectids = [];
759 $nsInfo = $this->namespaceInfo;
762 foreach ( $this->everything as $page ) {
763 if ( $nsInfo->isTalk( $page->getNamespace() ) ) {
764 if ( $this->fld_subjectid ) {
765 $getTitles[] = $nsInfo->getSubjectPage( TitleValue::newFromPage( $page ) );
767 } elseif ( $this->fld_talkid ) {
768 $getTitles[] = $nsInfo->getTalkPage( TitleValue::newFromPage( $page ) );
771 if ( $getTitles === [] ) {
775 $db = $this->
getDB();
779 $lb = $this->linkBatchFactory->newLinkBatch( $getTitles );
782 $this->
addFields( [
'page_title',
'page_namespace',
'page_id' ] );
783 $this->
addWhere( $lb->constructSet(
'page', $db ) );
784 $res = $this->
select( __METHOD__ );
785 foreach ( $res as $row ) {
786 if ( $nsInfo->isTalk( $row->page_namespace ) ) {
787 $this->talkids[$nsInfo->getSubject( $row->page_namespace )][$row->page_title] =
788 (int)( $row->page_id );
790 $this->subjectids[$nsInfo->getTalk( $row->page_namespace )][$row->page_title] =
791 (int)( $row->page_id );
796 private function getDisplayTitle() {
797 $this->displaytitles = [];
799 $pageIds = array_keys( $this->titles );
801 if ( $pageIds === [] ) {
807 $this->
addFields( [
'pp_page',
'pp_value' ] );
809 $this->
addWhereFld(
'pp_propname',
'displaytitle' );
810 $res = $this->
select( __METHOD__ );
812 foreach ( $res as $row ) {
813 $this->displaytitles[$row->pp_page] = $row->pp_value;
824 private function getLinkClasses( ?LinkTarget $context_title =
null ) {
825 if ( $this->titles === [] ) {
836 foreach ( $this->titles as $pageId => $page ) {
837 $pdbk = $this->titleFormatter->getPrefixedDBkey( $page );
838 $pagemap[$pageId] = $pdbk;
839 $classes[$pdbk] = $this->linkRenderer->getLinkClasses( $page );
842 $context_title = $this->titleFactory->newFromLinkTarget(
843 $context_title ?? $this->titleFactory->newMainPage()
846 $pagemap, $classes, $context_title
853 $this->linkClasses = [];
854 foreach ( $this->titles as $pageId => $page ) {
855 $pdbk = $this->titleFormatter->getPrefixedDBkey( $page );
856 $this->linkClasses[$pageId] = preg_split(
857 '/\s+/', $classes[$pdbk] ??
'', -1, PREG_SPLIT_NO_EMPTY
862 private function getVariantTitles() {
863 if ( $this->titles === [] ) {
866 $this->variantTitles = [];
867 foreach ( $this->titles as $pageId => $page ) {
868 $this->variantTitles[$pageId] = isset( $this->displaytitles[$pageId] )
869 ? $this->getAllVariants( $this->displaytitles[$pageId] )
870 : $this->getAllVariants( $this->titleFormatter->getText( $page ), $page->getNamespace() );
874 private function getAllVariants(
string $text,
int $ns =
NS_MAIN ): array {
876 foreach ( $this->languageConverter->getVariants() as $variant ) {
877 $convertTitle = $this->languageConverter->autoConvert( $text, $variant );
879 $convertNs = $this->languageConverter->convertNamespace( $ns, $variant );
880 $convertTitle = $convertNs .
':' . $convertTitle;
882 $result[$variant] = $convertTitle;
891 private function getWatchedInfo() {
894 if ( !$user->isRegistered() || count( $this->everything ) == 0
895 || !$this->
getAuthority()->isAllowed(
'viewmywatchlist' )
901 $this->watchlistExpiries = [];
902 $this->notificationtimestamps = [];
904 $items = $this->watchedItemStore->loadWatchedItemsBatch( $user, $this->everything );
906 foreach ( $items as $item ) {
907 $nsId = $item->getTarget()->getNamespace();
908 $dbKey = $item->getTarget()->getDBkey();
910 if ( $this->fld_watched ) {
911 $this->watched[$nsId][$dbKey] =
true;
913 $expiry = $item->getExpiry( TS::ISO_8601 );
915 $this->watchlistExpiries[$nsId][$dbKey] = $expiry;
919 if ( $this->fld_notificationtimestamp ) {
920 $this->notificationtimestamps[$nsId][$dbKey] = $item->getNotificationTimestamp();
928 private function getWatcherInfo() {
929 if ( count( $this->everything ) == 0 ) {
933 $canUnwatchedpages = $this->
getAuthority()->isAllowed(
'unwatchedpages' );
934 $unwatchedPageThreshold =
936 if ( !$canUnwatchedpages && !is_int( $unwatchedPageThreshold ) ) {
940 $this->showZeroWatchers = $canUnwatchedpages;
943 if ( !$canUnwatchedpages ) {
944 $countOptions[
'minimumWatchers'] = $unwatchedPageThreshold;
947 $this->watchers = $this->watchedItemStore->countWatchersMultiple(
959 private function getVisitingWatcherInfo() {
960 $config = $this->getConfig();
961 $db = $this->
getDB();
963 $canUnwatchedpages = $this->
getAuthority()->isAllowed(
'unwatchedpages' );
965 if ( !$canUnwatchedpages && !is_int( $unwatchedPageThreshold ) ) {
969 $this->showZeroWatchers = $canUnwatchedpages;
971 $titlesWithThresholds = [];
972 if ( $this->titles ) {
973 $lb = $this->linkBatchFactory->newLinkBatch( $this->titles );
976 $this->resetQueryParams();
977 $this->
addTables( [
'page',
'revision' ] );
978 $this->
addFields( [
'page_namespace',
'page_title',
'rev_timestamp' ] );
980 'page_latest = rev_id',
981 $lb->constructSet(
'page', $db ),
983 $this->addOption(
'GROUP BY', [
'page_namespace',
'page_title' ] );
984 $timestampRes = $this->select( __METHOD__ );
988 foreach ( $timestampRes as $row ) {
989 $revTimestamp =
wfTimestamp( TS::UNIX, (
int)$row->rev_timestamp );
990 $timestamps[$row->page_namespace][$row->page_title] = (int)$revTimestamp - $age;
992 $titlesWithThresholds = array_map(
993 static function ( PageReference $target ) use ( $timestamps ) {
995 $target, $timestamps[$target->getNamespace()][$target->getDBkey()]
1002 if ( $this->missing ) {
1003 $titlesWithThresholds = array_merge(
1004 $titlesWithThresholds,
1006 static function ( PageReference $target ) {
1007 return [ $target, null ];
1013 $this->visitingwatchers = $this->watchedItemStore->countVisitingWatchersMultiple(
1014 $titlesWithThresholds,
1015 !$canUnwatchedpages ? $unwatchedPageThreshold : null
1032 if ( array_diff( (array)$params[
'prop'], $publicProps ) ) {
1037 if ( $params[
'testactions'] ) {
1048 ParamValidator::PARAM_ISMULTI =>
true,
1049 ParamValidator::PARAM_TYPE => [
1052 'watched', #
private
1053 'watchers', #
private
1054 'visitingwatchers', #
private
1055 'notificationtimestamp', #
private
1059 'readable', #
private
1061 'preloadcontent', #
private: checks current user
's permissions
1062 'editintro
', # private: checks current user's permissions
1065 'linkclasses', #
private: stub length (and possibly hook colors)
1070 EnumDef::PARAM_DEPRECATED_VALUES => [
1076 ParamValidator::PARAM_TYPE =>
'title',
1077 ParamValidator::PARAM_DEFAULT => $this->titleFactory->newMainPage()->getPrefixedText(),
1078 TitleDef::PARAM_RETURN_OBJECT =>
true,
1081 ParamValidator::PARAM_TYPE =>
'string',
1082 ParamValidator::PARAM_ISMULTI =>
true,
1084 'testactionsdetail' => [
1085 ParamValidator::PARAM_TYPE => [
'boolean',
'full',
'quick' ],
1086 ParamValidator::PARAM_DEFAULT =>
'boolean',
1089 'testactionsautocreate' =>
false,
1090 'preloadcustom' => [
1093 ParamValidator::PARAM_TYPE =>
'string',
1096 'preloadparams' => [
1097 ParamValidator::PARAM_ISMULTI =>
true,
1100 'preloadnewsection' => [
1101 ParamValidator::PARAM_TYPE =>
'boolean',
1102 ParamValidator::PARAM_DEFAULT =>
false,
1105 'editintrostyle' => [
1106 ParamValidator::PARAM_TYPE => [
'lessframes',
'moreframes' ],
1107 ParamValidator::PARAM_DEFAULT =>
'moreframes',
1110 'editintroskip' => [
1111 ParamValidator::PARAM_TYPE =>
'string',
1112 ParamValidator::PARAM_ISMULTI =>
true,
1115 'editintrocustom' => [
1118 ParamValidator::PARAM_TYPE =>
'string',
1129 $title = Title::newMainPage()->getPrefixedText();
1130 $mp = rawurlencode( $title );
1133 "action=query&prop=info&titles={$mp}"
1134 =>
'apihelp-query+info-example-simple',
1135 "action=query&prop=info&inprop=protection&titles={$mp}"
1136 =>
'apihelp-query+info-example-protection',
1142 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Info';