Movatterモバイル変換


[0]ホーム

URL:


MediaWiki master
QueryPage.php
Go to the documentation of this file.
1<?php
24namespaceMediaWiki\SpecialPage;
25
26use Exception;
27useMediaWiki\Cache\LinkBatchFactory;
28useMediaWiki\Config\Config;
29useMediaWiki\HookContainer\HookRunner;
30useMediaWiki\Html\Html;
31useMediaWiki\Linker\LinkTarget;
32useMediaWiki\MainConfigNames;
33useMediaWiki\MediaWikiServices;
34useMediaWiki\Output\OutputPage;
35useMediaWiki\Skin\Skin;
36useMediaWiki\Specials\SpecialAncientPages;
37useMediaWiki\Specials\SpecialBrokenRedirects;
38useMediaWiki\Specials\SpecialDeadendPages;
39useMediaWiki\Specials\SpecialDoubleRedirects;
40useMediaWiki\Specials\SpecialFewestRevisions;
41useMediaWiki\Specials\SpecialLinkSearch;
42useMediaWiki\Specials\SpecialListDuplicatedFiles;
43useMediaWiki\Specials\SpecialListRedirects;
44useMediaWiki\Specials\SpecialLonelyPages;
45useMediaWiki\Specials\SpecialLongPages;
46useMediaWiki\Specials\SpecialMediaStatistics;
47useMediaWiki\Specials\SpecialMIMESearch;
48useMediaWiki\Specials\SpecialMostCategories;
49useMediaWiki\Specials\SpecialMostImages;
50useMediaWiki\Specials\SpecialMostInterwikis;
51useMediaWiki\Specials\SpecialMostLinked;
52useMediaWiki\Specials\SpecialMostLinkedCategories;
53useMediaWiki\Specials\SpecialMostLinkedTemplates;
54useMediaWiki\Specials\SpecialMostRevisions;
55useMediaWiki\Specials\SpecialShortPages;
56useMediaWiki\Specials\SpecialUncategorizedCategories;
57useMediaWiki\Specials\SpecialUncategorizedImages;
58useMediaWiki\Specials\SpecialUncategorizedPages;
59useMediaWiki\Specials\SpecialUncategorizedTemplates;
60useMediaWiki\Specials\SpecialUnusedCategories;
61useMediaWiki\Specials\SpecialUnusedImages;
62useMediaWiki\Specials\SpecialUnusedTemplates;
63useMediaWiki\Specials\SpecialUnwatchedPages;
64useMediaWiki\Specials\SpecialWantedCategories;
65useMediaWiki\Specials\SpecialWantedFiles;
66useMediaWiki\Specials\SpecialWantedPages;
67useMediaWiki\Specials\SpecialWantedTemplates;
68useMediaWiki\Specials\SpecialWithoutInterwiki;
69use stdClass;
70useWikimedia\Rdbms\DBError;
71useWikimedia\Rdbms\IConnectionProvider;
72useWikimedia\Rdbms\IDatabase;
73useWikimedia\Rdbms\ILoadBalancer;
74useWikimedia\Rdbms\IReadableDatabase;
75useWikimedia\Rdbms\IResultWrapper;
76useWikimedia\Rdbms\SelectQueryBuilder;
77
87abstractclassQueryPageextendsSpecialPage {
89protected$listoutput =false;
90
92protected$offset = 0;
93
95protected$limit = 0;
96
104protected$numRows;
105
109protected$cachedTimestamp =null;
110
114protected$shownavigation =true;
115
117private $loadBalancer =null;
118
120private $databaseProvider =null;
121
123private $linkBatchFactory =null;
124
135publicstaticfunctiongetPages() {
136static $qp =null;
137
138if ( $qp ===null ) {
139 $qp = [
140 [ SpecialAncientPages::class,'Ancientpages' ],
141 [ SpecialBrokenRedirects::class,'BrokenRedirects' ],
142 [ SpecialDeadendPages::class,'Deadendpages' ],
143 [ SpecialDoubleRedirects::class,'DoubleRedirects' ],
144 [ SpecialListDuplicatedFiles::class,'ListDuplicatedFiles' ],
145 [ SpecialLinkSearch::class,'LinkSearch' ],
146 [ SpecialListRedirects::class,'Listredirects' ],
147 [ SpecialLonelyPages::class,'Lonelypages' ],
148 [ SpecialLongPages::class,'Longpages' ],
149 [ SpecialMediaStatistics::class,'MediaStatistics', SpecialMediaStatistics::MAX_LIMIT ],
150 [ SpecialMIMESearch::class,'MIMEsearch' ],
151 [ SpecialMostCategories::class,'Mostcategories' ],
152 [ SpecialMostImages::class,'Mostimages' ],
153 [ SpecialMostInterwikis::class,'Mostinterwikis' ],
154 [ SpecialMostLinkedCategories::class,'Mostlinkedcategories' ],
155 [ SpecialMostLinkedTemplates::class,'Mostlinkedtemplates' ],
156 [ SpecialMostLinked::class,'Mostlinked' ],
157 [ SpecialMostRevisions::class,'Mostrevisions' ],
158 [ SpecialFewestRevisions::class,'Fewestrevisions' ],
159 [ SpecialShortPages::class,'Shortpages' ],
160 [ SpecialUncategorizedCategories::class,'Uncategorizedcategories' ],
161 [ SpecialUncategorizedPages::class,'Uncategorizedpages' ],
162 [ SpecialUncategorizedImages::class,'Uncategorizedimages' ],
163 [ SpecialUncategorizedTemplates::class,'Uncategorizedtemplates' ],
164 [ SpecialUnusedCategories::class,'Unusedcategories' ],
165 [ SpecialUnusedImages::class,'Unusedimages' ],
166 [ SpecialWantedCategories::class,'Wantedcategories' ],
167 [ SpecialWantedFiles::class,'Wantedfiles' ],
168 [ SpecialWantedPages::class,'Wantedpages' ],
169 [ SpecialWantedTemplates::class,'Wantedtemplates' ],
170 [ SpecialUnwatchedPages::class,'Unwatchedpages' ],
171 [ SpecialUnusedTemplates::class,'Unusedtemplates' ],
172 [ SpecialWithoutInterwiki::class,'Withoutinterwiki' ],
173 ];
174 (newHookRunner(MediaWikiServices::getInstance()->getHookContainer() ) )->onWgQueryPages( $qp );
175 }
176
177return $qp;
178 }
179
184finalprotectedfunctionsetLinkBatchFactory(LinkBatchFactory $linkBatchFactory ) {
185 $this->linkBatchFactory = $linkBatchFactory;
186 }
187
192finalprotectedfunctiongetLinkBatchFactory():LinkBatchFactory {
193if ( $this->linkBatchFactory === null ) {
194// Fallback if not provided
195// TODO Change to wfWarn in a future release
196 $this->linkBatchFactory =MediaWikiServices::getInstance()->getLinkBatchFactory();
197 }
198return $this->linkBatchFactory;
199 }
200
206publicstaticfunctiongetDisabledQueryPages(Config $config ) {
207 $disableQueryPageUpdate = $config->get(MainConfigNames::DisableQueryPageUpdate );
208
209if ( !is_array( $disableQueryPageUpdate ) ) {
210return [];
211 }
212
213 $pages = [];
214foreach ( $disableQueryPageUpdate as $name => $runMode ) {
215if ( is_int( $name ) ) {
216// The run mode may be omitted
217 $pages[$runMode] ='disabled';
218 }else {
219 $pages[$name] = $runMode;
220 }
221 }
222return $pages;
223 }
224
230protectedfunctionsetListoutput( $bool ) {
231 $this->listoutput = $bool;
232 }
233
257abstractpublicfunctiongetQueryInfo();
258
267protectedfunctiongetOrderFields() {
268return ['value' ];
269 }
270
282publicfunctionusesTimestamps() {
283returnfalse;
284 }
285
292protectedfunctionsortDescending() {
293returntrue;
294 }
295
316publicfunctionisExpensive() {
317return $this->getConfig()->get(MainConfigNames::DisableQueryPages );
318 }
319
328publicfunctionisCacheable() {
329returntrue;
330 }
331
339publicfunctionisCached() {
340return $this->isExpensive() && $this->getConfig()->get(MainConfigNames::MiserMode );
341 }
342
349publicfunctionisSyndicated() {
350returntrue;
351 }
352
362abstractprotectedfunctionformatResult( $skin, $result );
363
370protectedfunctiongetPageHeader() {
371return'';
372 }
373
381protectedfunctionshowEmptyText() {
382 $this->getOutput()->addWikiMsg('specialpage-empty' );
383 }
384
393protectedfunctionlinkParameters() {
394return [];
395 }
396
407publicfunctionrecache( $limit, $unused =true ) {
408if ( !$this->isCacheable() ) {
409return 0;
410 }
411
412 $fname = static::class .'::recache';
413 $dbw = $this->getDatabaseProvider()->getPrimaryDatabase();
414
415// Do query
416 $res = $this->reallyDoQuery( $limit,false );
417 $num =false;
418if ( $res ) {
419 $num = $res->numRows();
420// Fetch results
421 $vals = [];
422foreach ( $res as $i => $row ) {
423if ( isset( $row->value ) ) {
424if ( $this->usesTimestamps() ) {
425 $value = (int)wfTimestamp( TS_UNIX, $row->value );
426 }else {
427 $value = intval( $row->value );// T16414
428 }
429 }else {
430 $value = $i;
431 }
432
433 $vals[] = [
434'qc_type' => $this->getName(),
435'qc_namespace' => $row->namespace,
436'qc_title' => $row->title,
437'qc_value' => $value
438 ];
439 }
440
441 $dbw->doAtomicSection(
442 $fname,
443function (IDatabase $dbw, $fname ) {
444// Clear out any old cached data
446 ->deleteFrom('querycache' )
447 ->where( ['qc_type' => $this->getName() ] )
448 ->caller( $fname )->execute();
449// Update the querycache_info record for the page
451 ->insertInto('querycache_info' )
452 ->row( ['qci_type' => $this->getName(),'qci_timestamp' => $dbw->timestamp() ] )
453 ->onDuplicateKeyUpdate()
454 ->uniqueIndexFields( ['qci_type' ] )
455 ->set( ['qci_timestamp' => $dbw->timestamp() ] )
456 ->caller( $fname )->execute();
457 }
458 );
459// Save results into the querycache table on the primary DB
460if ( count( $vals ) ) {
461foreach ( array_chunk( $vals, 500 ) as $chunk ) {
463 ->insertInto('querycache' )
464 ->rows( $chunk )
465 ->caller( $fname )->execute();
466 }
467 }
468 }
469
470return $num;
471 }
472
478protectedfunctiongetRecacheDB() {
479return $this->getDBLoadBalancer()
480 ->getConnection( ILoadBalancer::DB_REPLICA,'vslow' );
481 }
482
489publicfunctiondelete(LinkTarget $title ) {
490if ( $this->isCached() ) {
491 $dbw = $this->getDatabaseProvider()->getPrimaryDatabase();
492 $dbw->newDeleteQueryBuilder()
493 ->deleteFrom('querycache' )
494 ->where( [
495'qc_type' => $this->getName(),
496'qc_namespace' => $title->getNamespace(),
497'qc_title' => $title->getDBkey(),
498 ] )
499 ->caller( __METHOD__ )->execute();
500 }
501 }
502
508publicfunctiondeleteAllCachedData() {
509 $fname = static::class .'::' . __FUNCTION__;
510 $dbw = $this->getDatabaseProvider()->getPrimaryDatabase();
511 $dbw->newDeleteQueryBuilder()
512 ->deleteFrom('querycache' )
513 ->where( ['qc_type' => $this->getName() ] )
514 ->caller( $fname )->execute();
515 $dbw->newDeleteQueryBuilder()
516 ->deleteFrom('querycachetwo' )
517 ->where( ['qcc_type' => $this->getName() ] )
518 ->caller( $fname )->execute();
519 $dbw->newDeleteQueryBuilder()
520 ->deleteFrom('querycache_info' )
521 ->where( ['qci_type' => $this->getName() ] )
522 ->caller( $fname )->execute();
523 }
524
533publicfunctionreallyDoQuery( $limit, $offset =false ) {
534 $fname = static::class .'::reallyDoQuery';
535 $dbr = $this->getRecacheDB();
536 $query = $this->getQueryInfo();
537 $order = $this->getOrderFields();
538
539if ( $this->sortDescending() ) {
540foreach ( $order as &$field ) {
541 $field .=' DESC';
542 }
543 }
544
545 $tables = isset( $query['tables'] ) ? (array)$query['tables'] : [];
546 $fields = isset( $query['fields'] ) ? (array)$query['fields'] : [];
547 $conds = isset( $query['conds'] ) ? (array)$query['conds'] : [];
548 $options = isset( $query['options'] ) ? (array)$query['options'] : [];
549 $join_conds = isset( $query['join_conds'] ) ? (array)$query['join_conds'] : [];
550
551 $queryBuilder = $dbr->newSelectQueryBuilder()
552 ->tables( $tables )
553 ->fields( $fields )
554 ->conds( $conds )
555 ->caller( $fname )
556 ->options( $options )
557 ->joinConds( $join_conds );
558if ( $order ) {
559 $queryBuilder->orderBy( $order );
560 }
561
562if ( $limit !==false ) {
563 $queryBuilder->limit( intval( $limit ) );
564 }
565
566if ( $offset !==false ) {
567 $queryBuilder->offset( intval( $offset ) );
568 }
569
570return $queryBuilder->fetchResultSet();
571 }
572
579publicfunctiondoQuery( $offset =false, $limit =false ) {
580if ( $this->isCached() && $this->isCacheable() ) {
581return $this->fetchFromCache( $limit, $offset );
582 }else {
583return $this->reallyDoQuery( $limit, $offset );
584 }
585 }
586
596publicfunctionfetchFromCache( $limit, $offset =false ) {
597 $dbr = $this->getDatabaseProvider()->getReplicaDatabase();
598 $queryBuilder = $dbr->newSelectQueryBuilder()
599 ->select( ['qc_type','namespace' =>'qc_namespace','title' =>'qc_title','value' =>'qc_value' ] )
600 ->from('querycache' )
601 ->where( ['qc_type' => $this->getName() ] );
602
603if ( $limit !==false ) {
604 $queryBuilder->limit( intval( $limit ) );
605 }
606
607if ( $offset !==false ) {
608 $queryBuilder->offset( intval( $offset ) );
609 }
610
611 $order = $this->getCacheOrderFields();
612if ( $this->sortDescending() ) {
613 $queryBuilder->orderBy( $order, SelectQueryBuilder::SORT_DESC );
614 }else {
615 $queryBuilder->orderBy( $order );
616 }
617
618return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
619 }
620
628protectedfunctiongetCacheOrderFields() {
629return ['value' ];
630 }
631
635publicfunctiongetCachedTimestamp() {
636if ( $this->cachedTimestamp ===null ) {
637 $dbr = $this->getDatabaseProvider()->getReplicaDatabase();
638 $fname = static::class .'::getCachedTimestamp';
639 $this->cachedTimestamp = $dbr->newSelectQueryBuilder()
640 ->select('qci_timestamp' )
641 ->from('querycache_info' )
642 ->where( ['qci_type' => $this->getName() ] )
643 ->caller( $fname )->fetchField();
644 }
645return $this->cachedTimestamp;
646 }
647
660protectedfunctiongetLimitOffset() {
661 [ $limit, $offset ] = $this->getRequest()
662 ->getLimitOffsetForUser( $this->getUser() );
663if ( $this->getConfig()->get(MainConfigNames::MiserMode ) ) {
664 $maxResults = $this->getMaxResults();
665// Can't display more than max results on a page
666 $limit = min( $limit, $maxResults );
667// Can't skip over more than the end of $maxResults
668 $offset = min( $offset, $maxResults + 1 );
669 }
670return [ $limit, $offset ];
671 }
672
681protectedfunctiongetDBLimit( $uiLimit, $uiOffset ) {
682 $maxResults = $this->getMaxResults();
683if ( $this->getConfig()->get(MainConfigNames::MiserMode ) ) {
684 $limit = min( $uiLimit + 1, $maxResults - $uiOffset );
685return max( $limit, 0 );
686 }else {
687return $uiLimit + 1;
688 }
689 }
690
701protectedfunctiongetMaxResults() {
702// Max of 10000, unless we store more than 10000 in query cache.
703return max( $this->getConfig()->get(MainConfigNames::QueryCacheLimit ), 10000 );
704 }
705
712publicfunctionexecute( $par ) {
713 $this->checkPermissions();
714
715 $this->setHeaders();
716 $this->outputHeader();
717
718 $out = $this->getOutput();
719
720if ( $this->isCached() && !$this->isCacheable() ) {
721 $out->addWikiMsg('querypage-disabled' );
722return;
723 }
724
725 $out->setSyndicated( $this->isSyndicated() );
726
727if ( $this->limit == 0 && $this->offset == 0 ) {
728 [ $this->limit, $this->offset ] = $this->getLimitOffset();
729 }
730 $dbLimit = $this->getDBLimit( $this->limit, $this->offset );
731// @todo Use doQuery()
732if ( !$this->isCached() ) {
733// select one extra row for navigation
734 $res = $this->reallyDoQuery( $dbLimit, $this->offset );
735 }else {
736// Get the cached result, select one extra row for navigation
737 $res = $this->fetchFromCache( $dbLimit, $this->offset );
738if ( !$this->listoutput ) {
739// Fetch the timestamp of this update
740 $ts = $this->getCachedTimestamp();
741 $lang = $this->getLanguage();
742 $maxResults = $lang->formatNum( $this->getConfig()->get(
744
745if ( $ts ) {
746 $user = $this->getUser();
747 $updated = $lang->userTimeAndDate( $ts, $user );
748 $updateddate = $lang->userDate( $ts, $user );
749 $updatedtime = $lang->userTime( $ts, $user );
750 $out->addMeta('Data-Cache-Time', $ts );
751 $out->addJsConfigVars('dataCacheTime', $ts );
752 $out->addWikiMsg('perfcachedts', $updated, $updateddate, $updatedtime, $maxResults );
753 }else {
754 $out->addWikiMsg('perfcached', $maxResults );
755 }
756
757// If updates on this page have been disabled, let the user know
758// that the data set won't be refreshed for now
759 $disabledQueryPages = self::getDisabledQueryPages( $this->getConfig() );
760if ( isset( $disabledQueryPages[$this->getName()] ) ) {
761 $runMode = $disabledQueryPages[$this->getName()];
762if ( $runMode ==='disabled' ) {
763 $out->wrapWikiMsg(
764"<div class=\"mw-querypage-no-updates\">\n$1\n</div>",
765'querypage-no-updates'
766 );
767 }else {
768// Messages used here: querypage-updates-periodical
769 $out->wrapWikiMsg(
770"<div class=\"mw-querypage-updates-" . $runMode ."\">\n$1\n</div>",
771'querypage-updates-' . $runMode
772 );
773 }
774 }
775 }
776 }
777
778 $this->numRows = $res->numRows();
779
780 $dbr = $this->getRecacheDB();
781 $this->preprocessResults( $dbr, $res );
782
783 $out->addHTML( Html::openElement('div', ['class' =>'mw-spcontent' ] ) );
784
785// Top header and navigation
786if ( $this->shownavigation ) {
787 $out->addHTML( $this->getPageHeader() );
788if ( $this->numRows > 0 ) {
789 $out->addHTML( $this->msg('showingresultsinrange' )->numParams(
790 min( $this->numRows, $this->limit ),// do not show the one extra row, if exist
791 $this->offset + 1, ( min( $this->numRows, $this->limit ) + $this->offset ) )->parseAsBlock() );
792// Disable the "next" link when we reach the end
793 $miserMaxResults = $this->getConfig()->get(MainConfigNames::MiserMode )
794 && ( $this->offset + $this->limit >= $this->getMaxResults() );
795 $atEnd = ( $this->numRows <= $this->limit ) || $miserMaxResults;
796 $paging = $this->buildPrevNextNavigation( $this->offset,
797 $this->limit, $this->linkParameters(), $atEnd, $par );
798 $out->addHTML('<p>' . $paging .'</p>' );
799 }else {
800// No results to show, so don't bother with "showing X of Y" etc.
801// -- just let the user know and give up now
802 $this->showEmptyText();
803 $out->addHTML( Html::closeElement('div' ) );
804return;
805 }
806 }
807
808// The actual results; specialist subclasses will want to handle this
809// with more than a straight list, so we hand them the info, plus
810// an OutputPage, and let them get on with it
811 $this->outputResults( $out,
812 $this->getSkin(),
813 $dbr,// Should use IResultWrapper for this
814 $res,
815 min( $this->numRows, $this->limit ),// do not format the one extra row, if exist
816 $this->offset );
817
818// Repeat the paging links at the bottom
819if ( $this->shownavigation ) {
820// @phan-suppress-next-line PhanPossiblyUndeclaredVariable paging is set when used here
821 $out->addHTML('<p>' . $paging .'</p>' );
822 }
823
824 $out->addHTML( Html::closeElement('div' ) );
825 }
826
840protectedfunctionoutputResults( $out, $skin, $dbr, $res, $num, $offset ) {
841if ( $num > 0 ) {
842 $html = [];
843if ( !$this->listoutput ) {
844 $html[] = $this->openList( $offset );
845 }
846
847// $res might contain the whole 1,000 rows, so we read up to
848// $num [should update this to use a Pager]
849// phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition.Found
850for ( $i = 0; $i < $num && $row = $res->fetchObject(); $i++ ) {
851 $line = $this->formatResult( $skin, $row );
852if ( $line ) {
853 $html[] = $this->listoutput
854 ? $line
855 :"<li>{$line}</li>\n";
856 }
857 }
858
859if ( !$this->listoutput ) {
860 $html[] = $this->closeList();
861 }
862
863 $html = $this->listoutput
864 ? $this->getContentLanguage()->listToText( $html )
865 : implode('', $html );
866
867 $out->addHTML( $html );
868 }
869 }
870
875protectedfunctionopenList( $offset ) {
876return"\n<ol start='" . ( $offset + 1 ) ."' class='special'>\n";
877 }
878
882protectedfunctioncloseList() {
883return"</ol>\n";
884 }
885
892protectedfunctionpreprocessResults( $db, $res ) {
893 }
894
907protectedfunctionexecuteLBFromResultWrapper(IResultWrapper $res, $ns =null ) {
908if ( !$res->numRows() ) {
909return;
910 }
911
912 $batch = $this->getLinkBatchFactory()->newLinkBatch()->setCaller( __METHOD__ );
913foreach ( $res as $row ) {
914 $batch->add( $ns ?? (int)$row->namespace, $row->title );
915 }
916 $batch->execute();
917
918 $res->seek( 0 );
919 }
920
926finalprotectedfunctionsetDBLoadBalancer(ILoadBalancer $loadBalancer ) {
927 $this->loadBalancer = $loadBalancer;
928 }
929
935finalprotectedfunctiongetDBLoadBalancer():ILoadBalancer {
936if ( $this->loadBalancer === null ) {
937// Fallback if not provided
938// TODO Change to wfWarn in a future release
939 $this->loadBalancer =MediaWikiServices::getInstance()->getDBLoadBalancer();
940 }
941return $this->loadBalancer;
942 }
943
948finalprotectedfunctionsetDatabaseProvider(IConnectionProvider $databaseProvider ) {
949 $this->databaseProvider = $databaseProvider;
950 }
951
957if ( $this->databaseProvider === null ) {
958 $this->databaseProvider = MediaWikiServices::getInstance()->getConnectionProvider();
959 }
960return $this->databaseProvider;
961 }
962}
963
965class_alias( QueryPage::class,'QueryPage' );
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
DefinitionGlobalFunctions.php:1331
if
if(!defined('MW_SETUP_CALLBACK'))
DefinitionWebStart.php:82
MediaWiki\Cache\LinkBatchFactory
DefinitionLinkBatchFactory.php:39
MediaWiki\HookContainer\HookRunner
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
DefinitionHookRunner.php:592
MediaWiki\Html\Html
This class is a collection of static functions that serve two purposes:
DefinitionHtml.php:57
MediaWiki\MainConfigNames
A class containing constants representing the names of configuration variables.
DefinitionMainConfigNames.php:22
MediaWiki\MainConfigNames\DisableQueryPages
const DisableQueryPages
Name constant for the DisableQueryPages setting, for use with Config::get()
DefinitionMainConfigNames.php:1368
MediaWiki\MainConfigNames\QueryCacheLimit
const QueryCacheLimit
Name constant for the QueryCacheLimit setting, for use with Config::get()
DefinitionMainConfigNames.php:1374
MediaWiki\MainConfigNames\MiserMode
const MiserMode
Name constant for the MiserMode setting, for use with Config::get()
DefinitionMainConfigNames.php:1362
MediaWiki\MainConfigNames\DisableQueryPageUpdate
const DisableQueryPageUpdate
Name constant for the DisableQueryPageUpdate setting, for use with Config::get()
DefinitionMainConfigNames.php:4083
MediaWiki\MediaWikiServices
Service locator for MediaWiki core services.
DefinitionMediaWikiServices.php:250
MediaWiki\MediaWikiServices\getInstance
static getInstance()
Returns the global default instance of the top level service locator.
DefinitionMediaWikiServices.php:338
MediaWiki\Output\OutputPage
This is one of the Core classes and should be read at least once by any new developers.
DefinitionOutputPage.php:97
MediaWiki\Skin\Skin
The base class for all skins.
DefinitionSkin.php:58
MediaWiki\SpecialPage\QueryPage
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
DefinitionQueryPage.php:87
MediaWiki\SpecialPage\QueryPage\getPageHeader
getPageHeader()
The content returned by this function will be output before any result.
DefinitionQueryPage.php:370
MediaWiki\SpecialPage\QueryPage\linkParameters
linkParameters()
If using extra form wheely-dealies, return a set of parameters here as an associative array.
DefinitionQueryPage.php:393
MediaWiki\SpecialPage\QueryPage\$shownavigation
bool $shownavigation
Whether to show prev/next links.
DefinitionQueryPage.php:114
MediaWiki\SpecialPage\QueryPage\$listoutput
bool $listoutput
Whether or not we want plain listoutput rather than an ordered list.
DefinitionQueryPage.php:89
MediaWiki\SpecialPage\QueryPage\getOrderFields
getOrderFields()
Subclasses return an array of fields to order by here.
DefinitionQueryPage.php:267
MediaWiki\SpecialPage\QueryPage\preprocessResults
preprocessResults( $db, $res)
Do any necessary preprocessing of the result object.
DefinitionQueryPage.php:892
MediaWiki\SpecialPage\QueryPage\getCachedTimestamp
getCachedTimestamp()
DefinitionQueryPage.php:635
MediaWiki\SpecialPage\QueryPage\setDatabaseProvider
setDatabaseProvider(IConnectionProvider $databaseProvider)
DefinitionQueryPage.php:948
MediaWiki\SpecialPage\QueryPage\getLimitOffset
getLimitOffset()
Returns limit and offset, as returned by $this->getRequest()->getLimitOffsetForUser().
DefinitionQueryPage.php:660
MediaWiki\SpecialPage\QueryPage\$offset
int $offset
The offset and limit in use, as passed to the query() function.
DefinitionQueryPage.php:92
MediaWiki\SpecialPage\QueryPage\getDBLimit
getDBLimit( $uiLimit, $uiOffset)
What is limit to fetch from DB.
DefinitionQueryPage.php:681
MediaWiki\SpecialPage\QueryPage\isCached
isCached()
Whether or not the output of the page in question is retrieved from the database cache.
DefinitionQueryPage.php:339
MediaWiki\SpecialPage\QueryPage\$limit
int $limit
DefinitionQueryPage.php:95
MediaWiki\SpecialPage\QueryPage\execute
execute( $par)
This is the actual workhorse.
DefinitionQueryPage.php:712
MediaWiki\SpecialPage\QueryPage\setListoutput
setListoutput( $bool)
A mutator for $this->listoutput;.
DefinitionQueryPage.php:230
MediaWiki\SpecialPage\QueryPage\executeLBFromResultWrapper
executeLBFromResultWrapper(IResultWrapper $res, $ns=null)
Creates a new LinkBatch object, adds all pages from the passed result wrapper (MUST include title and...
DefinitionQueryPage.php:907
MediaWiki\SpecialPage\QueryPage\getMaxResults
getMaxResults()
Get max number of results we can return in miser mode.
DefinitionQueryPage.php:701
MediaWiki\SpecialPage\QueryPage\isExpensive
isExpensive()
Should this query page only be updated offline on large wikis?
DefinitionQueryPage.php:316
MediaWiki\SpecialPage\QueryPage\getPages
static getPages()
Get a list of query page classes and their associated special pages, for periodic updates.
DefinitionQueryPage.php:135
MediaWiki\SpecialPage\QueryPage\fetchFromCache
fetchFromCache( $limit, $offset=false)
Fetch the query results from the query cache.
DefinitionQueryPage.php:596
MediaWiki\SpecialPage\QueryPage\setDBLoadBalancer
setDBLoadBalancer(ILoadBalancer $loadBalancer)
DefinitionQueryPage.php:926
MediaWiki\SpecialPage\QueryPage\$cachedTimestamp
string null false $cachedTimestamp
DefinitionQueryPage.php:109
MediaWiki\SpecialPage\QueryPage\deleteAllCachedData
deleteAllCachedData()
Remove all cached value This is needed when the page is no longer using the cache.
DefinitionQueryPage.php:508
MediaWiki\SpecialPage\QueryPage\showEmptyText
showEmptyText()
Outputs some kind of an informative message (via OutputPage) to let the user know that the query retu...
DefinitionQueryPage.php:381
MediaWiki\SpecialPage\QueryPage\doQuery
doQuery( $offset=false, $limit=false)
Somewhat deprecated, you probably want to be using execute()
DefinitionQueryPage.php:579
MediaWiki\SpecialPage\QueryPage\outputResults
outputResults( $out, $skin, $dbr, $res, $num, $offset)
Format and output report results using the given information plus OutputPage.
DefinitionQueryPage.php:840
MediaWiki\SpecialPage\QueryPage\getRecacheDB
getRecacheDB()
Get a DB connection to be used for slow recache queries.
DefinitionQueryPage.php:478
MediaWiki\SpecialPage\QueryPage\getLinkBatchFactory
getLinkBatchFactory()
DefinitionQueryPage.php:192
MediaWiki\SpecialPage\QueryPage\getDisabledQueryPages
static getDisabledQueryPages(Config $config)
Get a list of disabled query pages and their run mode.
DefinitionQueryPage.php:206
MediaWiki\SpecialPage\QueryPage\sortDescending
sortDescending()
Override to sort by increasing values.
DefinitionQueryPage.php:292
MediaWiki\SpecialPage\QueryPage\$numRows
int $numRows
The number of rows returned by the query.
DefinitionQueryPage.php:104
MediaWiki\SpecialPage\QueryPage\recache
recache( $limit, $unused=true)
Clear the cache and save new results.
DefinitionQueryPage.php:407
MediaWiki\SpecialPage\QueryPage\usesTimestamps
usesTimestamps()
Does this query return timestamps rather than integers in its 'value' field? If true,...
DefinitionQueryPage.php:282
MediaWiki\SpecialPage\QueryPage\closeList
closeList()
DefinitionQueryPage.php:882
MediaWiki\SpecialPage\QueryPage\isSyndicated
isSyndicated()
Sometimes we don't want to build rss / atom feeds.
DefinitionQueryPage.php:349
MediaWiki\SpecialPage\QueryPage\openList
openList( $offset)
DefinitionQueryPage.php:875
MediaWiki\SpecialPage\QueryPage\getDatabaseProvider
getDatabaseProvider()
DefinitionQueryPage.php:956
MediaWiki\SpecialPage\QueryPage\getDBLoadBalancer
getDBLoadBalancer()
DefinitionQueryPage.php:935
MediaWiki\SpecialPage\QueryPage\getQueryInfo
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
MediaWiki\SpecialPage\QueryPage\setLinkBatchFactory
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
DefinitionQueryPage.php:184
MediaWiki\SpecialPage\QueryPage\formatResult
formatResult( $skin, $result)
Formats the results of the query for display.
MediaWiki\SpecialPage\QueryPage\getCacheOrderFields
getCacheOrderFields()
Return the order fields for fetchFromCache.
DefinitionQueryPage.php:628
MediaWiki\SpecialPage\QueryPage\isCacheable
isCacheable()
Is the output of this query cacheable? Non-cacheable expensive pages will be disabled in miser mode a...
DefinitionQueryPage.php:328
MediaWiki\SpecialPage\QueryPage\reallyDoQuery
reallyDoQuery( $limit, $offset=false)
Run the query and return the result.
DefinitionQueryPage.php:533
MediaWiki\SpecialPage\SpecialPage
Parent class for all special pages.
DefinitionSpecialPage.php:65
MediaWiki\SpecialPage\SpecialPage\getHookContainer
getHookContainer()
DefinitionSpecialPage.php:1195
MediaWiki\Specials\SpecialAncientPages
Implements Special:Ancientpages.
DefinitionSpecialAncientPages.php:38
MediaWiki\Specials\SpecialBrokenRedirects
List of redirects to non-existent pages.
DefinitionSpecialBrokenRedirects.php:62
MediaWiki\Specials\SpecialDeadendPages
List of pages that contain no links to other pages.
DefinitionSpecialDeadendPages.php:34
MediaWiki\Specials\SpecialDoubleRedirects
List of redirects to another redirecting page.
DefinitionSpecialDoubleRedirects.php:42
MediaWiki\Specials\SpecialFewestRevisions
List articles with the fewest revisions.
DefinitionSpecialFewestRevisions.php:44
MediaWiki\Specials\SpecialLinkSearch
Special:LinkSearch to search the external-links table.
DefinitionSpecialLinkSearch.php:45
MediaWiki\Specials\SpecialListDuplicatedFiles
List all files where the current version is a duplicate of the current version of another file.
DefinitionSpecialListDuplicatedFiles.php:44
MediaWiki\Specials\SpecialListRedirects
Lists all the redirecting pages on the wiki.
DefinitionSpecialListRedirects.php:43
MediaWiki\Specials\SpecialLonelyPages
List of articles with no article linking to them, thus being lonely.
DefinitionSpecialLonelyPages.php:36
MediaWiki\Specials\SpecialLongPages
Implements Special:Longpages.
DefinitionSpecialLongPages.php:32
MediaWiki\Specials\SpecialMIMESearch
Search the database for files of the requested MIME type, comparing this with the 'img_major_mime' an...
DefinitionSpecialMIMESearch.php:46
MediaWiki\Specials\SpecialMediaStatistics
Implements Special:MediaStatistics.
DefinitionSpecialMediaStatistics.php:43
MediaWiki\Specials\SpecialMostCategories
List of pages that have the highest category count.
DefinitionSpecialMostCategories.php:43
MediaWiki\Specials\SpecialMostImages
List of the most used images.
DefinitionSpecialMostImages.php:34
MediaWiki\Specials\SpecialMostInterwikis
List of pages that have the highest interwiki count.
DefinitionSpecialMostInterwikis.php:41
MediaWiki\Specials\SpecialMostLinkedCategories
List of categories with the most pages in them.
DefinitionSpecialMostLinkedCategories.php:45
MediaWiki\Specials\SpecialMostLinkedTemplates
List of templates with a large number of transclusion links, i.e.
DefinitionSpecialMostLinkedTemplates.php:43
MediaWiki\Specials\SpecialMostLinked
List of pages ordered by the number of pages linking to them.
DefinitionSpecialMostLinked.php:45
MediaWiki\Specials\SpecialMostRevisions
Implements Special:Mostrevisions.
DefinitionSpecialMostRevisions.php:36
MediaWiki\Specials\SpecialShortPages
List of the shortest pages in the database.
DefinitionSpecialShortPages.php:41
MediaWiki\Specials\SpecialUncategorizedCategories
List of uncategorized category pages.
DefinitionSpecialUncategorizedCategories.php:36
MediaWiki\Specials\SpecialUncategorizedImages
List of file pages which haven't been categorised.
DefinitionSpecialUncategorizedImages.php:34
MediaWiki\Specials\SpecialUncategorizedPages
List of pages without any category.
DefinitionSpecialUncategorizedPages.php:36
MediaWiki\Specials\SpecialUncategorizedTemplates
List of all uncategorised pages in the Template namespace.
DefinitionSpecialUncategorizedTemplates.php:34
MediaWiki\Specials\SpecialUnusedCategories
Implements Special:Unusedcategories.
DefinitionSpecialUnusedCategories.php:37
MediaWiki\Specials\SpecialUnusedImages
List of unused images.
DefinitionSpecialUnusedImages.php:33
MediaWiki\Specials\SpecialUnusedTemplates
Lists of unused templates.
DefinitionSpecialUnusedTemplates.php:40
MediaWiki\Specials\SpecialUnwatchedPages
List of pages that are not on anyone's watchlist.
DefinitionSpecialUnwatchedPages.php:45
MediaWiki\Specials\SpecialWantedCategories
List of the most wanted categories.
DefinitionSpecialWantedCategories.php:41
MediaWiki\Specials\SpecialWantedFiles
List of the most linked non-existent files.
DefinitionSpecialWantedFiles.php:40
MediaWiki\Specials\SpecialWantedPages
List of the most-linked pages that do not exist.
DefinitionSpecialWantedPages.php:34
MediaWiki\Specials\SpecialWantedTemplates
List of the most wanted templates.
DefinitionSpecialWantedTemplates.php:38
MediaWiki\Specials\SpecialWithoutInterwiki
List of pages without any language links.
DefinitionSpecialWithoutInterwiki.php:39
Wikimedia\Rdbms\DBError
Database error base class.
DefinitionDBError.php:36
Wikimedia\Rdbms\SelectQueryBuilder
Build SELECT queries with a fluent interface.
DefinitionSelectQueryBuilder.php:26
MediaWiki\Config\Config
Interface for configuration instances.
DefinitionConfig.php:32
MediaWiki\Config\Config\get
get( $name)
Get a configuration variable such as "Sitename" or "UploadMaintenance.".
MediaWiki\Linker\LinkTarget
Represents the target of a wiki link.
DefinitionLinkTarget.php:33
Wikimedia\Rdbms\IConnectionProvider
Provide primary and replica IDatabase connections.
DefinitionIConnectionProvider.php:35
Wikimedia\Rdbms\IDatabase
Interface to a relational database.
DefinitionIDatabase.php:45
Wikimedia\Rdbms\IDatabase\newDeleteQueryBuilder
newDeleteQueryBuilder()
Get an DeleteQueryBuilder bound to this connection.
Wikimedia\Rdbms\IDatabase\newInsertQueryBuilder
newInsertQueryBuilder()
Get an InsertQueryBuilder bound to this connection.
Wikimedia\Rdbms\ILoadBalancer
This class is a delegate to ILBFactory for a given database cluster.
DefinitionILoadBalancer.php:113
Wikimedia\Rdbms\IReadableDatabase
A database connection without write operations.
DefinitionIReadableDatabase.php:34
Wikimedia\Rdbms\IResultWrapper
Result wrapper for grabbing data queried from an IDatabase object.
DefinitionIResultWrapper.php:26
Wikimedia\Rdbms\IResultWrapper\numRows
numRows()
Get the number of rows in a result object.
Wikimedia\Rdbms\IResultWrapper\seek
seek( $pos)
Change the position of the cursor in a result object.
Wikimedia\Rdbms\Platform\ISQLPlatform\timestamp
timestamp( $ts=0)
Convert a timestamp in one of the formats accepted by ConvertibleTimestamp to the format used for ins...
MediaWiki\SpecialPage
DefinitionAuthManagerSpecialPage.php:3

[8]ページ先頭

©2009-2025 Movatter.jp