MediaWiki  1.23.8
ApiPageSet.php
Go to the documentation of this file.
1 <?php
41 class ApiPageSet extends ApiBase {
46  const DISABLE_GENERATORS = 1;
47 
48  private $mDbSource;
49  private $mParams;
51  private $mConvertTitles;
53 
54  private $mAllPages = array(); // [ns][dbkey] => page_id or negative when missing
55  private $mTitles = array();
56  private $mGoodTitles = array();
57  private $mMissingTitles = array();
58  private $mInvalidTitles = array();
59  private $mMissingPageIDs = array();
60  private $mRedirectTitles = array();
61  private $mSpecialTitles = array();
63  private $mInterwikiTitles = array();
65  private $mConvertedTitles = array();
66  private $mGoodRevIDs = array();
67  private $mMissingRevIDs = array();
68  private $mFakePageId = -1;
69  private $mCacheMode = 'public';
74  private $mDefaultNamespace = NS_MAIN;
75 
83  private static function addValues( array &$result, $values, $flag = null, $name = null ) {
84  foreach ( $values as $val ) {
85  if ( $val instanceof Title ) {
86  $v = array();
87  ApiQueryBase::addTitleInfo( $v, $val );
88  } elseif ( $name !== null ) {
89  $v = array( $name => $val );
90  } else {
91  $v = $val;
92  }
93  if ( $flag !== null ) {
94  $v[$flag] = '';
95  }
96  $result[] = $v;
97  }
98  }
99 
108  public function __construct( ApiBase $dbSource, $flags = 0, $defaultNamespace = NS_MAIN ) {
109  parent::__construct( $dbSource->getMain(), $dbSource->getModuleName() );
110  $this->mDbSource = $dbSource;
111  $this->mAllowGenerator = ( $flags & ApiPageSet::DISABLE_GENERATORS ) == 0;
112  $this->mDefaultNamespace = $defaultNamespace;
113 
114  $this->profileIn();
115  $this->mParams = $this->extractRequestParams();
116  $this->mResolveRedirects = $this->mParams['redirects'];
117  $this->mConvertTitles = $this->mParams['converttitles'];
118  $this->profileOut();
119  }
120 
125  public function executeDryRun() {
126  $this->executeInternal( true );
127  }
128 
132  public function execute() {
133  $this->executeInternal( false );
134  }
135 
141  private function executeInternal( $isDryRun ) {
142  $this->profileIn();
143 
144  $generatorName = $this->mAllowGenerator ? $this->mParams['generator'] : null;
145  if ( isset( $generatorName ) ) {
146  $dbSource = $this->mDbSource;
147  $isQuery = $dbSource instanceof ApiQuery;
148  if ( !$isQuery ) {
149  // If the parent container of this pageset is not ApiQuery, we must create it to run generator
150  $dbSource = $this->getMain()->getModuleManager()->getModule( 'query' );
151  // Enable profiling for query module because it will be used for db sql profiling
152  $dbSource->profileIn();
153  }
154  $generator = $dbSource->getModuleManager()->getModule( $generatorName, null, true );
155  if ( $generator === null ) {
156  $this->dieUsage( 'Unknown generator=' . $generatorName, 'badgenerator' );
157  }
158  if ( !$generator instanceof ApiQueryGeneratorBase ) {
159  $this->dieUsage( "Module $generatorName cannot be used as a generator", 'badgenerator' );
160  }
161  // Create a temporary pageset to store generator's output,
162  // add any additional fields generator may need, and execute pageset to populate titles/pageids
163  $tmpPageSet = new ApiPageSet( $dbSource, ApiPageSet::DISABLE_GENERATORS );
164  $generator->setGeneratorMode( $tmpPageSet );
165  $this->mCacheMode = $generator->getCacheMode( $generator->extractRequestParams() );
166 
167  if ( !$isDryRun ) {
168  $generator->requestExtraData( $tmpPageSet );
169  }
170  $tmpPageSet->executeInternal( $isDryRun );
171 
172  // populate this pageset with the generator output
173  $this->profileOut();
174  $generator->profileIn();
175 
176  if ( !$isDryRun ) {
177  $generator->executeGenerator( $this );
178  wfRunHooks( 'APIQueryGeneratorAfterExecute', array( &$generator, &$this ) );
179  } else {
180  // Prevent warnings from being reported on these parameters
181  $main = $this->getMain();
182  foreach ( $generator->extractRequestParams() as $paramName => $param ) {
183  $main->getVal( $generator->encodeParamName( $paramName ) );
184  }
185  }
186  $generator->profileOut();
187  $this->profileIn();
188 
189  if ( !$isDryRun ) {
190  $this->resolvePendingRedirects();
191  }
192 
193  if ( !$isQuery ) {
194  // If this pageset is not part of the query, we called profileIn() above
195  $dbSource->profileOut();
196  }
197  } else {
198  // Only one of the titles/pageids/revids is allowed at the same time
199  $dataSource = null;
200  if ( isset( $this->mParams['titles'] ) ) {
201  $dataSource = 'titles';
202  }
203  if ( isset( $this->mParams['pageids'] ) ) {
204  if ( isset( $dataSource ) ) {
205  $this->dieUsage( "Cannot use 'pageids' at the same time as '$dataSource'", 'multisource' );
206  }
207  $dataSource = 'pageids';
208  }
209  if ( isset( $this->mParams['revids'] ) ) {
210  if ( isset( $dataSource ) ) {
211  $this->dieUsage( "Cannot use 'revids' at the same time as '$dataSource'", 'multisource' );
212  }
213  $dataSource = 'revids';
214  }
215 
216  if ( !$isDryRun ) {
217  // Populate page information with the original user input
218  switch ( $dataSource ) {
219  case 'titles':
220  $this->initFromTitles( $this->mParams['titles'] );
221  break;
222  case 'pageids':
223  $this->initFromPageIds( $this->mParams['pageids'] );
224  break;
225  case 'revids':
226  if ( $this->mResolveRedirects ) {
227  $this->setWarning( 'Redirect resolution cannot be used ' .
228  'together with the revids= parameter. Any redirects ' .
229  'the revids= point to have not been resolved.' );
230  }
231  $this->mResolveRedirects = false;
232  $this->initFromRevIDs( $this->mParams['revids'] );
233  break;
234  default:
235  // Do nothing - some queries do not need any of the data sources.
236  break;
237  }
238  }
239  }
240  $this->profileOut();
241  }
242 
247  public function isResolvingRedirects() {
249  }
250 
259  public function getDataSource() {
260  if ( $this->mAllowGenerator && isset( $this->mParams['generator'] ) ) {
261  return 'generator';
262  }
263  if ( isset( $this->mParams['titles'] ) ) {
264  return 'titles';
265  }
266  if ( isset( $this->mParams['pageids'] ) ) {
267  return 'pageids';
268  }
269  if ( isset( $this->mParams['revids'] ) ) {
270  return 'revids';
271  }
272 
273  return null;
274  }
275 
281  public function requestField( $fieldName ) {
282  $this->mRequestedPageFields[$fieldName] = null;
283  }
284 
291  public function getCustomField( $fieldName ) {
292  return $this->mRequestedPageFields[$fieldName];
293  }
294 
301  public function getPageTableFields() {
302  // Ensure we get minimum required fields
303  // DON'T change this order
304  $pageFlds = array(
305  'page_namespace' => null,
306  'page_title' => null,
307  'page_id' => null,
308  );
309 
310  if ( $this->mResolveRedirects ) {
311  $pageFlds['page_is_redirect'] = null;
312  }
313 
314  // only store non-default fields
315  $this->mRequestedPageFields = array_diff_key( $this->mRequestedPageFields, $pageFlds );
316 
317  $pageFlds = array_merge( $pageFlds, $this->mRequestedPageFields );
318 
319  return array_keys( $pageFlds );
320  }
321 
328  public function getAllTitlesByNamespace() {
329  return $this->mAllPages;
330  }
331 
336  public function getTitles() {
337  return $this->mTitles;
338  }
339 
344  public function getTitleCount() {
345  return count( $this->mTitles );
346  }
347 
352  public function getGoodTitles() {
353  return $this->mGoodTitles;
354  }
355 
360  public function getGoodTitleCount() {
361  return count( $this->mGoodTitles );
362  }
363 
369  public function getMissingTitles() {
370  return $this->mMissingTitles;
371  }
372 
378  public function getInvalidTitles() {
379  return $this->mInvalidTitles;
380  }
381 
386  public function getMissingPageIDs() {
387  return $this->mMissingPageIDs;
388  }
389 
395  public function getRedirectTitles() {
396  return $this->mRedirectTitles;
397  }
398 
406  public function getRedirectTitlesAsResult( $result = null ) {
407  $values = array();
408  foreach ( $this->getRedirectTitles() as $titleStrFrom => $titleTo ) {
409  $r = array(
410  'from' => strval( $titleStrFrom ),
411  'to' => $titleTo->getPrefixedText(),
412  );
413  if ( $titleTo->hasFragment() ) {
414  $r['tofragment'] = $titleTo->getFragment();
415  }
416  $values[] = $r;
417  }
418  if ( !empty( $values ) && $result ) {
419  $result->setIndexedTagName( $values, 'r' );
420  }
421 
422  return $values;
423  }
424 
430  public function getNormalizedTitles() {
432  }
433 
441  public function getNormalizedTitlesAsResult( $result = null ) {
442  $values = array();
443  foreach ( $this->getNormalizedTitles() as $rawTitleStr => $titleStr ) {
444  $values[] = array(
445  'from' => $rawTitleStr,
446  'to' => $titleStr
447  );
448  }
449  if ( !empty( $values ) && $result ) {
450  $result->setIndexedTagName( $values, 'n' );
451  }
452 
453  return $values;
454  }
455 
461  public function getConvertedTitles() {
463  }
464 
472  public function getConvertedTitlesAsResult( $result = null ) {
473  $values = array();
474  foreach ( $this->getConvertedTitles() as $rawTitleStr => $titleStr ) {
475  $values[] = array(
476  'from' => $rawTitleStr,
477  'to' => $titleStr
478  );
479  }
480  if ( !empty( $values ) && $result ) {
481  $result->setIndexedTagName( $values, 'c' );
482  }
483 
484  return $values;
485  }
486 
492  public function getInterwikiTitles() {
494  }
495 
504  public function getInterwikiTitlesAsResult( $result = null, $iwUrl = false ) {
505  $values = array();
506  foreach ( $this->getInterwikiTitles() as $rawTitleStr => $interwikiStr ) {
507  $item = array(
508  'title' => $rawTitleStr,
509  'iw' => $interwikiStr,
510  );
511  if ( $iwUrl ) {
512  $title = Title::newFromText( $rawTitleStr );
513  $item['url'] = $title->getFullURL( '', false, PROTO_CURRENT );
514  }
515  $values[] = $item;
516  }
517  if ( !empty( $values ) && $result ) {
518  $result->setIndexedTagName( $values, 'i' );
519  }
520 
521  return $values;
522  }
523 
538  public function getInvalidTitlesAndRevisions( $invalidChecks = array( 'invalidTitles',
539  'special', 'missingIds', 'missingRevIds', 'missingTitles', 'interwikiTitles' )
540  ) {
541  $result = array();
542  if ( in_array( "invalidTitles", $invalidChecks ) ) {
543  self::addValues( $result, $this->getInvalidTitles(), 'invalid', 'title' );
544  }
545  if ( in_array( "special", $invalidChecks ) ) {
546  self::addValues( $result, $this->getSpecialTitles(), 'special', 'title' );
547  }
548  if ( in_array( "missingIds", $invalidChecks ) ) {
549  self::addValues( $result, $this->getMissingPageIDs(), 'missing', 'pageid' );
550  }
551  if ( in_array( "missingRevIds", $invalidChecks ) ) {
552  self::addValues( $result, $this->getMissingRevisionIDs(), 'missing', 'revid' );
553  }
554  if ( in_array( "missingTitles", $invalidChecks ) ) {
555  self::addValues( $result, $this->getMissingTitles(), 'missing' );
556  }
557  if ( in_array( "interwikiTitles", $invalidChecks ) ) {
559  }
560 
561  return $result;
562  }
563 
568  public function getRevisionIDs() {
569  return $this->mGoodRevIDs;
570  }
571 
576  public function getMissingRevisionIDs() {
577  return $this->mMissingRevIDs;
578  }
579 
586  public function getMissingRevisionIDsAsResult( $result = null ) {
587  $values = array();
588  foreach ( $this->getMissingRevisionIDs() as $revid ) {
589  $values[$revid] = array(
590  'revid' => $revid
591  );
592  }
593  if ( !empty( $values ) && $result ) {
594  $result->setIndexedTagName( $values, 'rev' );
595  }
596 
597  return $values;
598  }
599 
604  public function getSpecialTitles() {
605  return $this->mSpecialTitles;
606  }
607 
612  public function getRevisionCount() {
613  return count( $this->getRevisionIDs() );
614  }
615 
620  public function populateFromTitles( $titles ) {
621  $this->profileIn();
622  $this->initFromTitles( $titles );
623  $this->profileOut();
624  }
625 
630  public function populateFromPageIDs( $pageIDs ) {
631  $this->profileIn();
632  $this->initFromPageIds( $pageIDs );
633  $this->profileOut();
634  }
635 
641  public function populateFromQueryResult( $db, $queryResult ) {
642  $this->profileIn();
643  $this->initFromQueryResult( $queryResult );
644  $this->profileOut();
645  }
646 
651  public function populateFromRevisionIDs( $revIDs ) {
652  $this->profileIn();
653  $this->initFromRevIDs( $revIDs );
654  $this->profileOut();
655  }
656 
661  public function processDbRow( $row ) {
662  // Store Title object in various data structures
663  $title = Title::newFromRow( $row );
664 
665  $pageId = intval( $row->page_id );
666  $this->mAllPages[$row->page_namespace][$row->page_title] = $pageId;
667  $this->mTitles[] = $title;
668 
669  if ( $this->mResolveRedirects && $row->page_is_redirect == '1' ) {
670  $this->mPendingRedirectIDs[$pageId] = $title;
671  } else {
672  $this->mGoodTitles[$pageId] = $title;
673  }
674 
675  foreach ( $this->mRequestedPageFields as $fieldName => &$fieldValues ) {
676  $fieldValues[$pageId] = $row->$fieldName;
677  }
678  }
679 
684  public function finishPageSetGeneration() {
685  wfDeprecated( __METHOD__, '1.21' );
686  }
687 
704  private function initFromTitles( $titles ) {
705  // Get validated and normalized title objects
706  $linkBatch = $this->processTitlesArray( $titles );
707  if ( $linkBatch->isEmpty() ) {
708  return;
709  }
710 
711  $db = $this->getDB();
712  $set = $linkBatch->constructSet( 'page', $db );
713 
714  // Get pageIDs data from the `page` table
715  $this->profileDBIn();
716  $res = $db->select( 'page', $this->getPageTableFields(), $set,
717  __METHOD__ );
718  $this->profileDBOut();
719 
720  // Hack: get the ns:titles stored in array(ns => array(titles)) format
721  $this->initFromQueryResult( $res, $linkBatch->data, true ); // process Titles
722 
723  // Resolve any found redirects
724  $this->resolvePendingRedirects();
725  }
726 
731  private function initFromPageIds( $pageids ) {
732  if ( !$pageids ) {
733  return;
734  }
735 
736  $pageids = array_map( 'intval', $pageids ); // paranoia
737  $remaining = array_flip( $pageids );
738 
739  $pageids = self::getPositiveIntegers( $pageids );
740 
741  $res = null;
742  if ( !empty( $pageids ) ) {
743  $set = array(
744  'page_id' => $pageids
745  );
746  $db = $this->getDB();
747 
748  // Get pageIDs data from the `page` table
749  $this->profileDBIn();
750  $res = $db->select( 'page', $this->getPageTableFields(), $set,
751  __METHOD__ );
752  $this->profileDBOut();
753  }
754 
755  $this->initFromQueryResult( $res, $remaining, false ); // process PageIDs
756 
757  // Resolve any found redirects
758  $this->resolvePendingRedirects();
759  }
760 
771  private function initFromQueryResult( $res, &$remaining = null, $processTitles = null ) {
772  if ( !is_null( $remaining ) && is_null( $processTitles ) ) {
773  ApiBase::dieDebug( __METHOD__, 'Missing $processTitles parameter when $remaining is provided' );
774  }
775 
776  $usernames = array();
777  if ( $res ) {
778  foreach ( $res as $row ) {
779  $pageId = intval( $row->page_id );
780 
781  // Remove found page from the list of remaining items
782  if ( isset( $remaining ) ) {
783  if ( $processTitles ) {
784  unset( $remaining[$row->page_namespace][$row->page_title] );
785  } else {
786  unset( $remaining[$pageId] );
787  }
788  }
789 
790  // Store any extra fields requested by modules
791  $this->processDbRow( $row );
792 
793  // Need gender information
794  if ( MWNamespace::hasGenderDistinction( $row->page_namespace ) ) {
795  $usernames[] = $row->page_title;
796  }
797  }
798  }
799 
800  if ( isset( $remaining ) ) {
801  // Any items left in the $remaining list are added as missing
802  if ( $processTitles ) {
803  // The remaining titles in $remaining are non-existent pages
804  foreach ( $remaining as $ns => $dbkeys ) {
805  foreach ( array_keys( $dbkeys ) as $dbkey ) {
806  $title = Title::makeTitle( $ns, $dbkey );
807  $this->mAllPages[$ns][$dbkey] = $this->mFakePageId;
808  $this->mMissingTitles[$this->mFakePageId] = $title;
809  $this->mFakePageId--;
810  $this->mTitles[] = $title;
811 
812  // need gender information
813  if ( MWNamespace::hasGenderDistinction( $ns ) ) {
814  $usernames[] = $dbkey;
815  }
816  }
817  }
818  } else {
819  // The remaining pageids do not exist
820  if ( !$this->mMissingPageIDs ) {
821  $this->mMissingPageIDs = array_keys( $remaining );
822  } else {
823  $this->mMissingPageIDs = array_merge( $this->mMissingPageIDs, array_keys( $remaining ) );
824  }
825  }
826  }
827 
828  // Get gender information
829  $genderCache = GenderCache::singleton();
830  $genderCache->doQuery( $usernames, __METHOD__ );
831  }
832 
838  private function initFromRevIDs( $revids ) {
839  if ( !$revids ) {
840  return;
841  }
842 
843  $revids = array_map( 'intval', $revids ); // paranoia
844  $db = $this->getDB();
845  $pageids = array();
846  $remaining = array_flip( $revids );
847 
848  $revids = self::getPositiveIntegers( $revids );
849 
850  if ( !empty( $revids ) ) {
851  $tables = array( 'revision', 'page' );
852  $fields = array( 'rev_id', 'rev_page' );
853  $where = array( 'rev_id' => $revids, 'rev_page = page_id' );
854 
855  // Get pageIDs data from the `page` table
856  $this->profileDBIn();
857  $res = $db->select( $tables, $fields, $where, __METHOD__ );
858  foreach ( $res as $row ) {
859  $revid = intval( $row->rev_id );
860  $pageid = intval( $row->rev_page );
861  $this->mGoodRevIDs[$revid] = $pageid;
862  $pageids[$pageid] = '';
863  unset( $remaining[$revid] );
864  }
865  $this->profileDBOut();
866  }
867 
868  $this->mMissingRevIDs = array_keys( $remaining );
869 
870  // Populate all the page information
871  $this->initFromPageIds( array_keys( $pageids ) );
872  }
873 
879  private function resolvePendingRedirects() {
880  if ( $this->mResolveRedirects ) {
881  $db = $this->getDB();
882  $pageFlds = $this->getPageTableFields();
883 
884  // Repeat until all redirects have been resolved
885  // The infinite loop is prevented by keeping all known pages in $this->mAllPages
886  while ( $this->mPendingRedirectIDs ) {
887  // Resolve redirects by querying the pagelinks table, and repeat the process
888  // Create a new linkBatch object for the next pass
889  $linkBatch = $this->getRedirectTargets();
890 
891  if ( $linkBatch->isEmpty() ) {
892  break;
893  }
894 
895  $set = $linkBatch->constructSet( 'page', $db );
896  if ( $set === false ) {
897  break;
898  }
899 
900  // Get pageIDs data from the `page` table
901  $this->profileDBIn();
902  $res = $db->select( 'page', $pageFlds, $set, __METHOD__ );
903  $this->profileDBOut();
904 
905  // Hack: get the ns:titles stored in array(ns => array(titles)) format
906  $this->initFromQueryResult( $res, $linkBatch->data, true );
907  }
908  }
909  }
910 
918  private function getRedirectTargets() {
919  $lb = new LinkBatch();
920  $db = $this->getDB();
921 
922  $this->profileDBIn();
923  $res = $db->select(
924  'redirect',
925  array(
926  'rd_from',
927  'rd_namespace',
928  'rd_fragment',
929  'rd_interwiki',
930  'rd_title'
931  ), array( 'rd_from' => array_keys( $this->mPendingRedirectIDs ) ),
932  __METHOD__
933  );
934  $this->profileDBOut();
935  foreach ( $res as $row ) {
936  $rdfrom = intval( $row->rd_from );
937  $from = $this->mPendingRedirectIDs[$rdfrom]->getPrefixedText();
938  $to = Title::makeTitle(
939  $row->rd_namespace,
940  $row->rd_title,
941  $row->rd_fragment,
942  $row->rd_interwiki
943  );
944  unset( $this->mPendingRedirectIDs[$rdfrom] );
945  if ( !$to->isExternal() && !isset( $this->mAllPages[$row->rd_namespace][$row->rd_title] ) ) {
946  $lb->add( $row->rd_namespace, $row->rd_title );
947  }
948  $this->mRedirectTitles[$from] = $to;
949  }
950 
951  if ( $this->mPendingRedirectIDs ) {
952  // We found pages that aren't in the redirect table
953  // Add them
954  foreach ( $this->mPendingRedirectIDs as $id => $title ) {
955  $page = WikiPage::factory( $title );
956  $rt = $page->insertRedirect();
957  if ( !$rt ) {
958  // What the hell. Let's just ignore this
959  continue;
960  }
961  $lb->addObj( $rt );
962  $this->mRedirectTitles[$title->getPrefixedText()] = $rt;
963  unset( $this->mPendingRedirectIDs[$id] );
964  }
965  }
966 
967  return $lb;
968  }
969 
983  public function getCacheMode( $params = null ) {
984  return $this->mCacheMode;
985  }
986 
996  private function processTitlesArray( $titles ) {
997  $usernames = array();
998  $linkBatch = new LinkBatch();
999 
1000  foreach ( $titles as $title ) {
1001  if ( is_string( $title ) ) {
1002  $titleObj = Title::newFromText( $title, $this->mDefaultNamespace );
1003  } else {
1004  $titleObj = $title;
1005  }
1006  if ( !$titleObj ) {
1007  // Handle invalid titles gracefully
1008  $this->mAllPages[0][$title] = $this->mFakePageId;
1009  $this->mInvalidTitles[$this->mFakePageId] = $title;
1010  $this->mFakePageId--;
1011  continue; // There's nothing else we can do
1012  }
1013  $unconvertedTitle = $titleObj->getPrefixedText();
1014  $titleWasConverted = false;
1015  if ( $titleObj->isExternal() ) {
1016  // This title is an interwiki link.
1017  $this->mInterwikiTitles[$unconvertedTitle] = $titleObj->getInterwiki();
1018  } else {
1019  // Variants checking
1021  if ( $this->mConvertTitles &&
1022  count( $wgContLang->getVariants() ) > 1 &&
1023  !$titleObj->exists()
1024  ) {
1025  // Language::findVariantLink will modify titleText and titleObj into
1026  // the canonical variant if possible
1027  $titleText = is_string( $title ) ? $title : $titleObj->getPrefixedText();
1028  $wgContLang->findVariantLink( $titleText, $titleObj );
1029  $titleWasConverted = $unconvertedTitle !== $titleObj->getPrefixedText();
1030  }
1031 
1032  if ( $titleObj->getNamespace() < 0 ) {
1033  // Handle Special and Media pages
1034  $titleObj = $titleObj->fixSpecialName();
1035  $this->mSpecialTitles[$this->mFakePageId] = $titleObj;
1036  $this->mFakePageId--;
1037  } else {
1038  // Regular page
1039  $linkBatch->addObj( $titleObj );
1040  }
1041  }
1042 
1043  // Make sure we remember the original title that was
1044  // given to us. This way the caller can correlate new
1045  // titles with the originally requested when e.g. the
1046  // namespace is localized or the capitalization is
1047  // different
1048  if ( $titleWasConverted ) {
1049  $this->mConvertedTitles[$unconvertedTitle] = $titleObj->getPrefixedText();
1050  // In this case the page can't be Special.
1051  if ( is_string( $title ) && $title !== $unconvertedTitle ) {
1052  $this->mNormalizedTitles[$title] = $unconvertedTitle;
1053  }
1054  } elseif ( is_string( $title ) && $title !== $titleObj->getPrefixedText() ) {
1055  $this->mNormalizedTitles[$title] = $titleObj->getPrefixedText();
1056  }
1057 
1058  // Need gender information
1059  if ( MWNamespace::hasGenderDistinction( $titleObj->getNamespace() ) ) {
1060  $usernames[] = $titleObj->getText();
1061  }
1062  }
1063  // Get gender information
1064  $genderCache = GenderCache::singleton();
1065  $genderCache->doQuery( $usernames, __METHOD__ );
1066 
1067  return $linkBatch;
1068  }
1069 
1074  protected function getDB() {
1075  return $this->mDbSource->getDB();
1076  }
1077 
1084  private static function getPositiveIntegers( $array ) {
1085  // bug 25734 API: possible issue with revids validation
1086  // It seems with a load of revision rows, MySQL gets upset
1087  // Remove any < 0 integers, as they can't be valid
1088  foreach ( $array as $i => $int ) {
1089  if ( $int < 0 ) {
1090  unset( $array[$i] );
1091  }
1092  }
1093 
1094  return $array;
1095  }
1097  public function getAllowedParams( $flags = 0 ) {
1098  $result = array(
1099  'titles' => array(
1100  ApiBase::PARAM_ISMULTI => true
1101  ),
1102  'pageids' => array(
1103  ApiBase::PARAM_TYPE => 'integer',
1104  ApiBase::PARAM_ISMULTI => true
1105  ),
1106  'revids' => array(
1107  ApiBase::PARAM_TYPE => 'integer',
1108  ApiBase::PARAM_ISMULTI => true
1109  ),
1110  'redirects' => false,
1111  'converttitles' => false,
1112  );
1113  if ( $this->mAllowGenerator ) {
1115  $result['generator'] = array(
1117  );
1118  } else {
1119  $result['generator'] = null;
1120  }
1121  }
1122 
1123  return $result;
1124  }
1126  private static $generators = null;
1127 
1132  private function getGenerators() {
1133  if ( self::$generators === null ) {
1135  if ( !( $query instanceof ApiQuery ) ) {
1136  // If the parent container of this pageset is not ApiQuery,
1137  // we must create it to get module manager
1138  $query = $this->getMain()->getModuleManager()->getModule( 'query' );
1139  }
1140  $gens = array();
1141  $mgr = $query->getModuleManager();
1142  foreach ( $mgr->getNamesWithClasses() as $name => $class ) {
1143  if ( is_subclass_of( $class, 'ApiQueryGeneratorBase' ) ) {
1144  $gens[] = $name;
1145  }
1146  }
1147  sort( $gens );
1148  self::$generators = $gens;
1149  }
1150 
1151  return self::$generators;
1152  }
1154  public function getParamDescription() {
1155  return array(
1156  'titles' => 'A list of titles to work on',
1157  'pageids' => 'A list of page IDs to work on',
1158  'revids' => 'A list of revision IDs to work on',
1159  'generator' => array(
1160  'Get the list of pages to work on by executing the specified query module.',
1161  'NOTE: generator parameter names must be prefixed with a \'g\', see examples'
1162  ),
1163  'redirects' => 'Automatically resolve redirects',
1164  'converttitles' => array(
1165  'Convert titles to other variants if necessary. Only works if ' .
1166  'the wiki\'s content language supports variant conversion.',
1167  'Languages that support variant conversion include ' .
1168  implode( ', ', LanguageConverter::$languagesWithVariants )
1169  ),
1170  );
1171  }
1173  public function getPossibleErrors() {
1174  return array_merge( parent::getPossibleErrors(), array(
1175  array(
1176  'code' => 'multisource',
1177  'info' => "Cannot use 'pageids' at the same time as 'dataSource'"
1178  ),
1179  array(
1180  'code' => 'multisource',
1181  'info' => "Cannot use 'revids' at the same time as 'dataSource'"
1182  ),
1183  array(
1184  'code' => 'badgenerator',
1185  'info' => 'Module $generatorName cannot be used as a generator'
1186  ),
1187  ) );
1188  }
1189 }
GenderCache\singleton
static singleton()
Definition: GenderCache.php:39
ApiPageSet\$mConvertedTitles
$mConvertedTitles
Definition: ApiPageSet.php:65
ApiPageSet\getTitleCount
getTitleCount()
Returns the number of unique pages (not revisions) in the set.
Definition: ApiPageSet.php:343
ApiPageSet\$mRedirectTitles
$mRedirectTitles
Definition: ApiPageSet.php:60
ApiPageSet\initFromTitles
initFromTitles( $titles)
This method populates internal variables with page information based on the given array of title stri...
Definition: ApiPageSet.php:703
Title\makeTitle
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:398
ApiPageSet\$mSpecialTitles
$mSpecialTitles
Definition: ApiPageSet.php:61
$result
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. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag '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 '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. '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 '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 '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 wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() '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 User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers '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) '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. 'LinkBegin':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
Definition: hooks.txt:1528
ApiPageSet\$mMissingTitles
$mMissingTitles
Definition: ApiPageSet.php:57
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:189
ApiQuery
This is the main query class.
Definition: ApiQuery.php:38
ApiPageSet\processDbRow
processDbRow( $row)
Extract all requested fields from the row received from the database.
Definition: ApiPageSet.php:660
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
MWNamespace\hasGenderDistinction
static hasGenderDistinction( $index)
Does the namespace (potentially) have different aliases for different genders.
Definition: Namespace.php:406
ApiPageSet\$mResolveRedirects
$mResolveRedirects
Definition: ApiPageSet.php:50
LinkBatch
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition: LinkBatch.php:30
$tables
namespace and then decline to actually register it RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist & $tables
Definition: hooks.txt:815
ApiPageSet\getGoodTitleCount
getGoodTitleCount()
Returns the number of found unique pages (not revisions) in the set.
Definition: ApiPageSet.php:359
ApiPageSet\processTitlesArray
processTitlesArray( $titles)
Given an array of title strings, convert them into Title objects.
Definition: ApiPageSet.php:995
ApiPageSet\getTitles
getTitles()
All Title objects provided.
Definition: ApiPageSet.php:335
ApiPageSet\getConvertedTitles
getConvertedTitles()
Get a list of title conversions - maps a title to its converted version.
Definition: ApiPageSet.php:460
ApiPageSet\__construct
__construct(ApiBase $dbSource, $flags=0, $defaultNamespace=NS_MAIN)
Constructor.
Definition: ApiPageSet.php:107
ApiPageSet\getInvalidTitles
getInvalidTitles()
Titles that were deemed invalid by Title::newFromText() The array's index will be unique and negative...
Definition: ApiPageSet.php:377
ApiBase\profileDBIn
profileDBIn()
Start module profiling.
Definition: ApiBase.php:2266
ApiBase\PARAM_TYPE
const PARAM_TYPE
Definition: ApiBase.php:50
ApiPageSet\initFromQueryResult
initFromQueryResult( $res, &$remaining=null, $processTitles=null)
Iterate through the result of the query on 'page' table, and for each row create and store title obje...
Definition: ApiPageSet.php:770
ApiPageSet\requestField
requestField( $fieldName)
Request an additional field from the page table.
Definition: ApiPageSet.php:280
ApiPageSet\execute
execute()
Populate the PageSet from the request parameters.
Definition: ApiPageSet.php:131
$from
$from
Definition: importImages.php:90
ApiBase\profileDBOut
profileDBOut()
End database profiling.
Definition: ApiBase.php:2283
ApiPageSet\$mDefaultNamespace
int $mDefaultNamespace
Definition: ApiPageSet.php:73
ApiPageSet\$mCacheMode
$mCacheMode
Definition: ApiPageSet.php:69
ApiPageSet\$mInterwikiTitles
$mInterwikiTitles
Definition: ApiPageSet.php:63
ApiPageSet\$mPendingRedirectIDs
$mPendingRedirectIDs
Definition: ApiPageSet.php:64
$params
$params
Definition: styleTest.css.php:40
ApiPageSet\resolvePendingRedirects
resolvePendingRedirects()
Resolve any redirects in the result if redirect resolution was requested.
Definition: ApiPageSet.php:878
ApiPageSet\populateFromRevisionIDs
populateFromRevisionIDs( $revIDs)
Populate this PageSet from a list of revision IDs.
Definition: ApiPageSet.php:650
ApiPageSet\$mConvertTitles
$mConvertTitles
Definition: ApiPageSet.php:51
$wgContLang
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 content language as $wgContLang
Definition: design.txt:56
$flags
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Definition: hooks.txt:2113
ApiPageSet\populateFromTitles
populateFromTitles( $titles)
Populate this PageSet from a list of Titles.
Definition: ApiPageSet.php:619
ApiPageSet\$mGoodRevIDs
$mGoodRevIDs
Definition: ApiPageSet.php:66
ApiPageSet
This class contains a list of pages that the client has requested.
Definition: ApiPageSet.php:41
ApiBase
This abstract class implements many basic API functions, and is the base of all API classes.
Definition: ApiBase.php:42
ApiPageSet\executeDryRun
executeDryRun()
In case execute() is not called, call this method to mark all relevant parameters as used This preven...
Definition: ApiPageSet.php:124
ApiPageSet\getRedirectTitlesAsResult
getRedirectTitlesAsResult( $result=null)
Get a list of redirect resolutions - maps a title to its redirect target.
Definition: ApiPageSet.php:405
ApiPageSet\getPageTableFields
getPageTableFields()
Get the fields that have to be queried from the page table: the ones requested through requestField()...
Definition: ApiPageSet.php:300
ApiPageSet\finishPageSetGeneration
finishPageSetGeneration()
Do not use, does nothing, will be removed.
Definition: ApiPageSet.php:683
ApiPageSet\$mAllowGenerator
$mAllowGenerator
Definition: ApiPageSet.php:52
ApiPageSet\getConvertedTitlesAsResult
getConvertedTitlesAsResult( $result=null)
Get a list of title conversions - maps a title to its converted version as a result array.
Definition: ApiPageSet.php:471
ApiPageSet\$mParams
$mParams
Definition: ApiPageSet.php:49
NS_MAIN
const NS_MAIN
Definition: Defines.php:79
ApiPageSet\getMissingTitles
getMissingTitles()
Title objects that were NOT found in the database.
Definition: ApiPageSet.php:368
ApiBase\profileOut
profileOut()
End module profiling.
Definition: ApiBase.php:2217
$lb
if( $wgAPIRequestLog) $lb
Definition: api.php:126
WikiPage\factory
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
Definition: WikiPage.php:103
wfDeprecated
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
Definition: GlobalFunctions.php:1127
$titles
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles
Definition: linkcache.txt:17
ApiPageSet\populateFromQueryResult
populateFromQueryResult( $db, $queryResult)
Populate this PageSet from a rowset returned from the database.
Definition: ApiPageSet.php:640
Title\newFromRow
static newFromRow( $row)
Make a Title object from a DB row.
Definition: Title.php:345
ApiPageSet\getGenerators
getGenerators()
Get an array of all available generators.
Definition: ApiPageSet.php:1131
ApiPageSet\getDataSource
getDataSource()
Return the parameter name that is the source of data for this PageSet.
Definition: ApiPageSet.php:258
ApiPageSet\getInvalidTitlesAndRevisions
getInvalidTitlesAndRevisions( $invalidChecks=array( 'invalidTitles', 'special', 'missingIds', 'missingRevIds', 'missingTitles', 'interwikiTitles'))
Get an array of invalid/special/missing titles.
Definition: ApiPageSet.php:537
PROTO_CURRENT
const PROTO_CURRENT
Definition: Defines.php:270
ApiPageSet\getParamDescription
getParamDescription()
Returns an array of parameter descriptions.
Definition: ApiPageSet.php:1153
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4010
ApiPageSet\getRevisionIDs
getRevisionIDs()
Get the list of revision IDs (requested with the revids= parameter)
Definition: ApiPageSet.php:567
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
ApiPageSet\$mTitles
$mTitles
Definition: ApiPageSet.php:55
ApiPageSet\getRedirectTitles
getRedirectTitles()
Get a list of redirect resolutions - maps a title to its redirect target, as an array of output-ready...
Definition: ApiPageSet.php:394
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
ApiPageSet\getGoodTitles
getGoodTitles()
Title objects that were found in the database.
Definition: ApiPageSet.php:351
ApiPageSet\isResolvingRedirects
isResolvingRedirects()
Check whether this PageSet is resolving redirects.
Definition: ApiPageSet.php:246
ApiPageSet\$mGoodTitles
$mGoodTitles
Definition: ApiPageSet.php:56
ApiBase\extractRequestParams
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:687
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
ApiPageSet\getCacheMode
getCacheMode( $params=null)
Get the cache mode for the data generated by this module.
Definition: ApiPageSet.php:982
ApiPageSet\initFromRevIDs
initFromRevIDs( $revids)
Does the same as initFromTitles(), but is based on revision IDs instead.
Definition: ApiPageSet.php:837
ApiBase\dieUsage
dieUsage( $description, $errorCode, $httpRespCode=0, $extradata=null)
Throw a UsageException, which will (if uncaught) call the main module's error handler and die with an...
Definition: ApiBase.php:1363
ApiBase\GET_VALUES_FOR_HELP
const GET_VALUES_FOR_HELP
getAllowedParams() flag: When set, the result could take longer to generate, but should be more thoro...
Definition: ApiBase.php:88
ApiPageSet\getInterwikiTitles
getInterwikiTitles()
Get a list of interwiki titles - maps a title to its interwiki prefix.
Definition: ApiPageSet.php:491
ApiPageSet\getPossibleErrors
getPossibleErrors()
Returns a list of all possible errors returned by the module.
Definition: ApiPageSet.php:1172
ApiPageSet\getAllTitlesByNamespace
getAllTitlesByNamespace()
Returns an array [ns][dbkey] => page_id for all requested titles.
Definition: ApiPageSet.php:327
ApiPageSet\$mMissingRevIDs
$mMissingRevIDs
Definition: ApiPageSet.php:67
ApiPageSet\$generators
static $generators
Definition: ApiPageSet.php:1125
ApiPageSet\$mDbSource
$mDbSource
Definition: ApiPageSet.php:48
ApiPageSet\$mMissingPageIDs
$mMissingPageIDs
Definition: ApiPageSet.php:59
ApiPageSet\getNormalizedTitlesAsResult
getNormalizedTitlesAsResult( $result=null)
Get a list of title normalizations - maps a title to its normalized version in the form of result arr...
Definition: ApiPageSet.php:440
ApiPageSet\populateFromPageIDs
populateFromPageIDs( $pageIDs)
Populate this PageSet from a list of page IDs.
Definition: ApiPageSet.php:629
ApiPageSet\addValues
static addValues(array &$result, $values, $flag=null, $name=null)
Add all items from $values into the result.
Definition: ApiPageSet.php:82
ApiPageSet\getDB
getDB()
Get the database connection (read-only)
Definition: ApiPageSet.php:1073
ApiPageSet\getAllowedParams
getAllowedParams( $flags=0)
Definition: ApiPageSet.php:1096
ApiPageSet\getInterwikiTitlesAsResult
getInterwikiTitlesAsResult( $result=null, $iwUrl=false)
Get a list of interwiki titles - maps a title to its interwiki prefix as result.
Definition: ApiPageSet.php:503
ApiBase\profileIn
profileIn()
Start module profiling.
Definition: ApiBase.php:2206
ApiPageSet\getMissingPageIDs
getMissingPageIDs()
Page IDs that were not found in the database.
Definition: ApiPageSet.php:385
ApiPageSet\$mRequestedPageFields
$mRequestedPageFields
Definition: ApiPageSet.php:70
ApiBase\setWarning
setWarning( $warning)
Set warning section for this module.
Definition: ApiBase.php:245
ApiPageSet\getRedirectTargets
getRedirectTargets()
Get the targets of the pending redirects from the database.
Definition: ApiPageSet.php:917
ApiQueryGeneratorBase
Definition: ApiQueryBase.php:626
Title
Represents a title within MediaWiki.
Definition: Title.php:35
ApiPageSet\getMissingRevisionIDsAsResult
getMissingRevisionIDsAsResult( $result=null)
Revision IDs that were not found in the database as result array.
Definition: ApiPageSet.php:585
ApiBase\getModuleManager
getModuleManager()
Get the module manager, or null if this module has no sub-modules.
Definition: ApiBase.php:157
ApiPageSet\initFromPageIds
initFromPageIds( $pageids)
Does the same as initFromTitles(), but is based on page IDs instead.
Definition: ApiPageSet.php:730
ApiPageSet\executeInternal
executeInternal( $isDryRun)
Populate the PageSet from the request parameters.
Definition: ApiPageSet.php:140
as
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
Definition: distributors.txt:9
ApiBase\getModuleName
getModuleName()
Get the name of the module being executed by this instance.
Definition: ApiBase.php:148
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
Definition: ApiBase.php:48
ApiPageSet\getMissingRevisionIDs
getMissingRevisionIDs()
Revision IDs that were not found in the database.
Definition: ApiPageSet.php:575
ApiBase\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiBase.php:565
ApiBase\getMain
getMain()
Get the main module.
Definition: ApiBase.php:188
ApiPageSet\$mInvalidTitles
$mInvalidTitles
Definition: ApiPageSet.php:58
ApiPageSet\getCustomField
getCustomField( $fieldName)
Get the value of a custom field previously requested through requestField()
Definition: ApiPageSet.php:290
ApiPageSet\getRevisionCount
getRevisionCount()
Returns the number of revisions (requested with revids= parameter).
Definition: ApiPageSet.php:611
ApiPageSet\$mAllPages
$mAllPages
Definition: ApiPageSet.php:54
$query
return true to allow those checks to and false if checking is done use this to change the tables headers temp or archived zone change it to an object instance and return false override the list derivative used the name of the old file when set the default code will be skipped add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition: hooks.txt:1105
ApiPageSet\DISABLE_GENERATORS
const DISABLE_GENERATORS
Constructor flag: The new instance of ApiPageSet will ignore the 'generator=' parameter.
Definition: ApiPageSet.php:46
ApiPageSet\$mFakePageId
$mFakePageId
Definition: ApiPageSet.php:68
ApiPageSet\getSpecialTitles
getSpecialTitles()
Get the list of titles with negative namespace.
Definition: ApiPageSet.php:603
$res
$res
Definition: database.txt:21
ApiPageSet\getNormalizedTitles
getNormalizedTitles()
Get a list of title normalizations - maps a title to its normalized version.
Definition: ApiPageSet.php:429
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:2010
ApiPageSet\$mNormalizedTitles
$mNormalizedTitles
Definition: ApiPageSet.php:62
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:339
ApiPageSet\getPositiveIntegers
static getPositiveIntegers( $array)
Returns the input array of integers with all values < 0 removed.
Definition: ApiPageSet.php:1083