862468d9373f9a30301690a889bfd75f82cddb62
[lhc/web/wiklou.git] / includes / api / ApiPageSet.php
1 <?php
2 /**
3 *
4 *
5 * Created on Sep 24, 2006
6 *
7 * Copyright © 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * http://www.gnu.org/copyleft/gpl.html
23 *
24 * @file
25 */
26
27 if ( !defined( 'MEDIAWIKI' ) ) {
28 // Eclipse helper - will be ignored in production
29 require_once( 'ApiQueryBase.php' );
30 }
31
32 /**
33 * This class contains a list of pages that the client has requested.
34 * Initially, when the client passes in titles=, pageids=, or revisions=
35 * parameter, an instance of the ApiPageSet class will normalize titles,
36 * determine if the pages/revisions exist, and prefetch any additional page
37 * data requested.
38 *
39 * When a generator is used, the result of the generator will become the input
40 * for the second instance of this class, and all subsequent actions will use
41 * the second instance for all their work.
42 *
43 * @ingroup API
44 */
45 class ApiPageSet extends ApiQueryBase {
46
47 private $mAllPages; // [ns][dbkey] => page_id or negative when missing
48 private $mTitles, $mGoodTitles, $mMissingTitles, $mInvalidTitles;
49 private $mMissingPageIDs, $mRedirectTitles, $mSpecialTitles;
50 private $mNormalizedTitles, $mInterwikiTitles;
51 private $mResolveRedirects, $mPendingRedirectIDs;
52 private $mConvertTitles, $mConvertedTitles;
53 private $mGoodRevIDs, $mMissingRevIDs;
54 private $mFakePageId;
55
56 private $mRequestedPageFields;
57
58 /**
59 * Constructor
60 * @param $query ApiQuery
61 * @param $resolveRedirects bool Whether redirects should be resolved
62 * @param $convertTitles bool
63 */
64 public function __construct( $query, $resolveRedirects = false, $convertTitles = false ) {
65 parent::__construct( $query, 'query' );
66
67 $this->mAllPages = array();
68 $this->mTitles = array();
69 $this->mGoodTitles = array();
70 $this->mMissingTitles = array();
71 $this->mInvalidTitles = array();
72 $this->mMissingPageIDs = array();
73 $this->mRedirectTitles = array();
74 $this->mNormalizedTitles = array();
75 $this->mInterwikiTitles = array();
76 $this->mGoodRevIDs = array();
77 $this->mMissingRevIDs = array();
78 $this->mSpecialTitles = array();
79
80 $this->mRequestedPageFields = array();
81 $this->mResolveRedirects = $resolveRedirects;
82 if ( $resolveRedirects ) {
83 $this->mPendingRedirectIDs = array();
84 }
85
86 $this->mConvertTitles = $convertTitles;
87 $this->mConvertedTitles = array();
88
89 $this->mFakePageId = - 1;
90 }
91
92 /**
93 * Check whether this PageSet is resolving redirects
94 * @return bool
95 */
96 public function isResolvingRedirects() {
97 return $this->mResolveRedirects;
98 }
99
100 /**
101 * Request an additional field from the page table. Must be called
102 * before execute()
103 * @param $fieldName string Field name
104 */
105 public function requestField( $fieldName ) {
106 $this->mRequestedPageFields[$fieldName] = null;
107 }
108
109 /**
110 * Get the value of a custom field previously requested through
111 * requestField()
112 * @param $fieldName string Field name
113 * @return mixed Field value
114 */
115 public function getCustomField( $fieldName ) {
116 return $this->mRequestedPageFields[$fieldName];
117 }
118
119 /**
120 * Get the fields that have to be queried from the page table:
121 * the ones requested through requestField() and a few basic ones
122 * we always need
123 * @return array of field names
124 */
125 public function getPageTableFields() {
126 // Ensure we get minimum required fields
127 // DON'T change this order
128 $pageFlds = array(
129 'page_namespace' => null,
130 'page_title' => null,
131 'page_id' => null,
132 );
133
134 if ( $this->mResolveRedirects ) {
135 $pageFlds['page_is_redirect'] = null;
136 }
137
138 // only store non-default fields
139 $this->mRequestedPageFields = array_diff_key( $this->mRequestedPageFields, $pageFlds );
140
141 $pageFlds = array_merge( $pageFlds, $this->mRequestedPageFields );
142 return array_keys( $pageFlds );
143 }
144
145 /**
146 * Returns an array [ns][dbkey] => page_id for all requested titles.
147 * page_id is a unique negative number in case title was not found.
148 * Invalid titles will also have negative page IDs and will be in namespace 0
149 * @return array
150 */
151 public function getAllTitlesByNamespace() {
152 return $this->mAllPages;
153 }
154
155 /**
156 * All Title objects provided.
157 * @return array of Title objects
158 */
159 public function getTitles() {
160 return $this->mTitles;
161 }
162
163 /**
164 * Returns the number of unique pages (not revisions) in the set.
165 * @return int
166 */
167 public function getTitleCount() {
168 return count( $this->mTitles );
169 }
170
171 /**
172 * Title objects that were found in the database.
173 * @return array page_id (int) => Title (obj)
174 */
175 public function getGoodTitles() {
176 return $this->mGoodTitles;
177 }
178
179 /**
180 * Returns the number of found unique pages (not revisions) in the set.
181 * @return int
182 */
183 public function getGoodTitleCount() {
184 return count( $this->mGoodTitles );
185 }
186
187 /**
188 * Title objects that were NOT found in the database.
189 * The array's index will be negative for each item
190 * @return array of Title objects
191 */
192 public function getMissingTitles() {
193 return $this->mMissingTitles;
194 }
195
196 /**
197 * Titles that were deemed invalid by Title::newFromText()
198 * The array's index will be unique and negative for each item
199 * @return array of strings (not Title objects)
200 */
201 public function getInvalidTitles() {
202 return $this->mInvalidTitles;
203 }
204
205 /**
206 * Page IDs that were not found in the database
207 * @return array of page IDs
208 */
209 public function getMissingPageIDs() {
210 return $this->mMissingPageIDs;
211 }
212
213 /**
214 * Get a list of redirect resolutions - maps a title to its redirect
215 * target.
216 * @return array prefixed_title (string) => Title object
217 */
218 public function getRedirectTitles() {
219 return $this->mRedirectTitles;
220 }
221
222 /**
223 * Get a list of title normalizations - maps a title to its normalized
224 * version.
225 * @return array raw_prefixed_title (string) => prefixed_title (string)
226 */
227 public function getNormalizedTitles() {
228 return $this->mNormalizedTitles;
229 }
230
231 /**
232 * Get a list of title conversions - maps a title to its converted
233 * version.
234 * @return array raw_prefixed_title (string) => prefixed_title (string)
235 */
236 public function getConvertedTitles() {
237 return $this->mConvertedTitles;
238 }
239
240 /**
241 * Get a list of interwiki titles - maps a title to its interwiki
242 * prefix.
243 * @return array raw_prefixed_title (string) => interwiki_prefix (string)
244 */
245 public function getInterwikiTitles() {
246 return $this->mInterwikiTitles;
247 }
248
249 /**
250 * Get the list of revision IDs (requested with the revids= parameter)
251 * @return array revID (int) => pageID (int)
252 */
253 public function getRevisionIDs() {
254 return $this->mGoodRevIDs;
255 }
256
257 /**
258 * Revision IDs that were not found in the database
259 * @return array of revision IDs
260 */
261 public function getMissingRevisionIDs() {
262 return $this->mMissingRevIDs;
263 }
264
265 /**
266 * Get the list of titles with negative namespace
267 * @return array Title
268 */
269 public function getSpecialTitles() {
270 return $this->mSpecialTitles;
271 }
272
273 /**
274 * Returns the number of revisions (requested with revids= parameter)\
275 * @return int
276 */
277 public function getRevisionCount() {
278 return count( $this->getRevisionIDs() );
279 }
280
281 /**
282 * Populate the PageSet from the request parameters.
283 */
284 public function execute() {
285 $this->profileIn();
286 $params = $this->extractRequestParams();
287
288 // Only one of the titles/pageids/revids is allowed at the same time
289 $dataSource = null;
290 if ( isset( $params['titles'] ) ) {
291 $dataSource = 'titles';
292 }
293 if ( isset( $params['pageids'] ) ) {
294 if ( isset( $dataSource ) ) {
295 $this->dieUsage( "Cannot use 'pageids' at the same time as '$dataSource'", 'multisource' );
296 }
297 $dataSource = 'pageids';
298 }
299 if ( isset( $params['revids'] ) ) {
300 if ( isset( $dataSource ) ) {
301 $this->dieUsage( "Cannot use 'revids' at the same time as '$dataSource'", 'multisource' );
302 }
303 $dataSource = 'revids';
304 }
305
306 switch ( $dataSource ) {
307 case 'titles':
308 $this->initFromTitles( $params['titles'] );
309 break;
310 case 'pageids':
311 $this->initFromPageIds( $params['pageids'] );
312 break;
313 case 'revids':
314 if ( $this->mResolveRedirects ) {
315 $this->setWarning( 'Redirect resolution cannot be used together with the revids= parameter. ' .
316 'Any redirects the revids= point to have not been resolved.' );
317 }
318 $this->mResolveRedirects = false;
319 $this->initFromRevIDs( $params['revids'] );
320 break;
321 default:
322 // Do nothing - some queries do not need any of the data sources.
323 break;
324 }
325 $this->profileOut();
326 }
327
328 /**
329 * Populate this PageSet from a list of Titles
330 * @param $titles array of Title objects
331 */
332 public function populateFromTitles( $titles ) {
333 $this->profileIn();
334 $this->initFromTitles( $titles );
335 $this->profileOut();
336 }
337
338 /**
339 * Populate this PageSet from a list of page IDs
340 * @param $pageIDs array of page IDs
341 */
342 public function populateFromPageIDs( $pageIDs ) {
343 $this->profileIn();
344 $this->initFromPageIds( $pageIDs );
345 $this->profileOut();
346 }
347
348 /**
349 * Populate this PageSet from a rowset returned from the database
350 * @param $db Database object
351 * @param $queryResult ResultWrapper Query result object
352 */
353 public function populateFromQueryResult( $db, $queryResult ) {
354 $this->profileIn();
355 $this->initFromQueryResult( $queryResult );
356 $this->profileOut();
357 }
358
359 /**
360 * Populate this PageSet from a list of revision IDs
361 * @param $revIDs array of revision IDs
362 */
363 public function populateFromRevisionIDs( $revIDs ) {
364 $this->profileIn();
365 $this->initFromRevIDs( $revIDs );
366 $this->profileOut();
367 }
368
369 /**
370 * Extract all requested fields from the row received from the database
371 * @param $row Result row
372 */
373 public function processDbRow( $row ) {
374 // Store Title object in various data structures
375 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
376
377 $pageId = intval( $row->page_id );
378 $this->mAllPages[$row->page_namespace][$row->page_title] = $pageId;
379 $this->mTitles[] = $title;
380
381 if ( $this->mResolveRedirects && $row->page_is_redirect == '1' ) {
382 $this->mPendingRedirectIDs[$pageId] = $title;
383 } else {
384 $this->mGoodTitles[$pageId] = $title;
385 }
386
387 foreach ( $this->mRequestedPageFields as $fieldName => &$fieldValues ) {
388 $fieldValues[$pageId] = $row-> $fieldName;
389 }
390 }
391
392 /**
393 * Resolve redirects, if applicable
394 */
395 public function finishPageSetGeneration() {
396 $this->profileIn();
397 $this->resolvePendingRedirects();
398 $this->profileOut();
399 }
400
401 /**
402 * This method populates internal variables with page information
403 * based on the given array of title strings.
404 *
405 * Steps:
406 * #1 For each title, get data from `page` table
407 * #2 If page was not found in the DB, store it as missing
408 *
409 * Additionally, when resolving redirects:
410 * #3 If no more redirects left, stop.
411 * #4 For each redirect, get its target from the `redirect` table.
412 * #5 Substitute the original LinkBatch object with the new list
413 * #6 Repeat from step #1
414 *
415 * @param $titles array of Title objects or strings
416 */
417 private function initFromTitles( $titles ) {
418 // Get validated and normalized title objects
419 $linkBatch = $this->processTitlesArray( $titles );
420 if ( $linkBatch->isEmpty() ) {
421 return;
422 }
423
424 $db = $this->getDB();
425 $set = $linkBatch->constructSet( 'page', $db );
426
427 // Get pageIDs data from the `page` table
428 $this->profileDBIn();
429 $res = $db->select( 'page', $this->getPageTableFields(), $set,
430 __METHOD__ );
431 $this->profileDBOut();
432
433 // Hack: get the ns:titles stored in array(ns => array(titles)) format
434 $this->initFromQueryResult( $res, $linkBatch->data, true ); // process Titles
435
436 // Resolve any found redirects
437 $this->resolvePendingRedirects();
438 }
439
440 /**
441 * Does the same as initFromTitles(), but is based on page IDs instead
442 * @param $pageids array of page IDs
443 */
444 private function initFromPageIds( $pageids ) {
445 if ( !count( $pageids ) ) {
446 return;
447 }
448
449 $pageids = array_map( 'intval', $pageids ); // paranoia
450 $remaining = array_flip( $pageids );
451
452 $pageids = self::getPositiveIntegers( $pageids );
453
454 $set = array(
455 'page_id' => $pageids
456 );
457 $db = $this->getDB();
458
459 // Get pageIDs data from the `page` table
460 $this->profileDBIn();
461 $res = $db->select( 'page', $this->getPageTableFields(), $set,
462 __METHOD__ );
463 $this->profileDBOut();
464
465 $this->initFromQueryResult( $res, $remaining, false ); // process PageIDs
466
467 // Resolve any found redirects
468 $this->resolvePendingRedirects();
469 }
470
471 /**
472 * Iterate through the result of the query on 'page' table,
473 * and for each row create and store title object and save any extra fields requested.
474 * @param $res ResultWrapper DB Query result
475 * @param $remaining array of either pageID or ns/title elements (optional).
476 * If given, any missing items will go to $mMissingPageIDs and $mMissingTitles
477 * @param $processTitles bool Must be provided together with $remaining.
478 * If true, treat $remaining as an array of [ns][title]
479 * If false, treat it as an array of [pageIDs]
480 */
481 private function initFromQueryResult( $res, &$remaining = null, $processTitles = null ) {
482 if ( !is_null( $remaining ) && is_null( $processTitles ) ) {
483 ApiBase::dieDebug( __METHOD__, 'Missing $processTitles parameter when $remaining is provided' );
484 }
485
486 foreach ( $res as $row ) {
487 $pageId = intval( $row->page_id );
488
489 // Remove found page from the list of remaining items
490 if ( isset( $remaining ) ) {
491 if ( $processTitles ) {
492 unset( $remaining[$row->page_namespace][$row->page_title] );
493 } else {
494 unset( $remaining[$pageId] );
495 }
496 }
497
498 // Store any extra fields requested by modules
499 $this->processDbRow( $row );
500 }
501
502 if ( isset( $remaining ) ) {
503 // Any items left in the $remaining list are added as missing
504 if ( $processTitles ) {
505 // The remaining titles in $remaining are non-existent pages
506 foreach ( $remaining as $ns => $dbkeys ) {
507 foreach ( array_keys( $dbkeys ) as $dbkey ) {
508 $title = Title::makeTitle( $ns, $dbkey );
509 $this->mAllPages[$ns][$dbkey] = $this->mFakePageId;
510 $this->mMissingTitles[$this->mFakePageId] = $title;
511 $this->mFakePageId--;
512 $this->mTitles[] = $title;
513 }
514 }
515 } else {
516 // The remaining pageids do not exist
517 if ( !$this->mMissingPageIDs ) {
518 $this->mMissingPageIDs = array_keys( $remaining );
519 } else {
520 $this->mMissingPageIDs = array_merge( $this->mMissingPageIDs, array_keys( $remaining ) );
521 }
522 }
523 }
524 }
525
526 /**
527 * Does the same as initFromTitles(), but is based on revision IDs
528 * instead
529 * @param $revids array of revision IDs
530 */
531 private function initFromRevIDs( $revids ) {
532 if ( !count( $revids ) ) {
533 return;
534 }
535
536 $revids = array_map( 'intval', $revids ); // paranoia
537 $db = $this->getDB();
538 $pageids = array();
539 $remaining = array_flip( $revids );
540
541 $revids = self::getPositiveIntegers( $revids );
542
543 $tables = array( 'revision', 'page' );
544 $fields = array( 'rev_id', 'rev_page' );
545 $where = array( 'rev_id' => $revids, 'rev_page = page_id' );
546
547 // Get pageIDs data from the `page` table
548 $this->profileDBIn();
549 $res = $db->select( $tables, $fields, $where, __METHOD__ );
550 foreach ( $res as $row ) {
551 $revid = intval( $row->rev_id );
552 $pageid = intval( $row->rev_page );
553 $this->mGoodRevIDs[$revid] = $pageid;
554 $pageids[$pageid] = '';
555 unset( $remaining[$revid] );
556 }
557 $this->profileDBOut();
558
559 $this->mMissingRevIDs = array_keys( $remaining );
560
561 // Populate all the page information
562 $this->initFromPageIds( array_keys( $pageids ) );
563 }
564
565 /**
566 * Resolve any redirects in the result if redirect resolution was
567 * requested. This function is called repeatedly until all redirects
568 * have been resolved.
569 */
570 private function resolvePendingRedirects() {
571 if ( $this->mResolveRedirects ) {
572 $db = $this->getDB();
573 $pageFlds = $this->getPageTableFields();
574
575 // Repeat until all redirects have been resolved
576 // The infinite loop is prevented by keeping all known pages in $this->mAllPages
577 while ( $this->mPendingRedirectIDs ) {
578 // Resolve redirects by querying the pagelinks table, and repeat the process
579 // Create a new linkBatch object for the next pass
580 $linkBatch = $this->getRedirectTargets();
581
582 if ( $linkBatch->isEmpty() ) {
583 break;
584 }
585
586 $set = $linkBatch->constructSet( 'page', $db );
587 if ( $set === false ) {
588 break;
589 }
590
591 // Get pageIDs data from the `page` table
592 $this->profileDBIn();
593 $res = $db->select( 'page', $pageFlds, $set, __METHOD__ );
594 $this->profileDBOut();
595
596 // Hack: get the ns:titles stored in array(ns => array(titles)) format
597 $this->initFromQueryResult( $res, $linkBatch->data, true );
598 }
599 }
600 }
601
602 /**
603 * Get the targets of the pending redirects from the database
604 *
605 * Also creates entries in the redirect table for redirects that don't
606 * have one.
607 * @return LinkBatch
608 */
609 private function getRedirectTargets() {
610 $lb = new LinkBatch();
611 $db = $this->getDB();
612
613 $this->profileDBIn();
614 $res = $db->select(
615 'redirect',
616 array(
617 'rd_from',
618 'rd_namespace',
619 'rd_fragment',
620 'rd_interwiki',
621 'rd_title'
622 ), array( 'rd_from' => array_keys( $this->mPendingRedirectIDs ) ),
623 __METHOD__
624 );
625 $this->profileDBOut();
626 foreach ( $res as $row ) {
627 $rdfrom = intval( $row->rd_from );
628 $from = $this->mPendingRedirectIDs[$rdfrom]->getPrefixedText();
629 $to = Title::makeTitle( $row->rd_namespace, $row->rd_title, $row->rd_fragment, $row->rd_interwiki );
630 unset( $this->mPendingRedirectIDs[$rdfrom] );
631 if ( !isset( $this->mAllPages[$row->rd_namespace][$row->rd_title] ) ) {
632 $lb->add( $row->rd_namespace, $row->rd_title );
633 }
634 $this->mRedirectTitles[$from] = $to;
635 }
636
637 if ( $this->mPendingRedirectIDs ) {
638 // We found pages that aren't in the redirect table
639 // Add them
640 foreach ( $this->mPendingRedirectIDs as $id => $title ) {
641 $article = new Article( $title );
642 $rt = $article->insertRedirect();
643 if ( !$rt ) {
644 // What the hell. Let's just ignore this
645 continue;
646 }
647 $lb->addObj( $rt );
648 $this->mRedirectTitles[$title->getPrefixedText()] = $rt;
649 unset( $this->mPendingRedirectIDs[$id] );
650 }
651 }
652 return $lb;
653 }
654
655 /**
656 * Given an array of title strings, convert them into Title objects.
657 * Alternativelly, an array of Title objects may be given.
658 * This method validates access rights for the title,
659 * and appends normalization values to the output.
660 *
661 * @param $titles array of Title objects or strings
662 * @return LinkBatch
663 */
664 private function processTitlesArray( $titles ) {
665 $linkBatch = new LinkBatch();
666
667 foreach ( $titles as $title ) {
668 $titleObj = is_string( $title ) ? Title::newFromText( $title ) : $title;
669 if ( !$titleObj ) {
670 // Handle invalid titles gracefully
671 $this->mAllpages[0][$title] = $this->mFakePageId;
672 $this->mInvalidTitles[$this->mFakePageId] = $title;
673 $this->mFakePageId--;
674 continue; // There's nothing else we can do
675 }
676 $unconvertedTitle = $titleObj->getPrefixedText();
677 $titleWasConverted = false;
678 $iw = $titleObj->getInterwiki();
679 if ( strval( $iw ) !== '' ) {
680 // This title is an interwiki link.
681 $this->mInterwikiTitles[$titleObj->getPrefixedText()] = $iw;
682 } else {
683 // Variants checking
684 global $wgContLang;
685 if ( $this->mConvertTitles &&
686 count( $wgContLang->getVariants() ) > 1 &&
687 !$titleObj->exists() ) {
688 // Language::findVariantLink will modify titleObj into
689 // the canonical variant if possible
690 $wgContLang->findVariantLink( $title, $titleObj );
691 $titleWasConverted = $unconvertedTitle !== $titleObj->getPrefixedText();
692 }
693
694 if ( $titleObj->getNamespace() < 0 ) {
695 // Handle Special and Media pages
696 $titleObj = $titleObj->fixSpecialName();
697 $this->mSpecialTitles[$this->mFakePageId] = $titleObj;
698 $this->mFakePageId--;
699 } else {
700 // Regular page
701 $linkBatch->addObj( $titleObj );
702 }
703 }
704
705 // Make sure we remember the original title that was
706 // given to us. This way the caller can correlate new
707 // titles with the originally requested when e.g. the
708 // namespace is localized or the capitalization is
709 // different
710 if ( $titleWasConverted ) {
711 $this->mConvertedTitles[$title] = $titleObj->getPrefixedText();
712 } elseif ( is_string( $title ) && $title !== $titleObj->getPrefixedText() ) {
713 $this->mNormalizedTitles[$title] = $titleObj->getPrefixedText();
714 }
715 }
716
717 return $linkBatch;
718 }
719
720 /**
721 * Returns the input array of integers with all values < 0 removed
722 *
723 * @param $array array
724 * @return array
725 */
726 private static function getPositiveIntegers( $array ) {
727 // bug 25734 API: possible issue with revids validation
728 // It seems with a load of revision rows, MySQL gets upset
729 // Remove any < 0 integers, as they can't be valid
730 foreach( $array as $i => $int ) {
731 if ( $int < 0 ) {
732 unset( $array[$i] );
733 }
734 }
735
736 return $array;
737 }
738
739 protected function getAllowedParams() {
740 return array(
741 'titles' => array(
742 ApiBase::PARAM_ISMULTI => true
743 ),
744 'pageids' => array(
745 ApiBase::PARAM_TYPE => 'integer',
746 ApiBase::PARAM_ISMULTI => true
747 ),
748 'revids' => array(
749 ApiBase::PARAM_TYPE => 'integer',
750 ApiBase::PARAM_ISMULTI => true
751 )
752 );
753 }
754
755 protected function getParamDescription() {
756 return array(
757 'titles' => 'A list of titles to work on',
758 'pageids' => 'A list of page IDs to work on',
759 'revids' => 'A list of revision IDs to work on'
760 );
761 }
762
763 public function getPossibleErrors() {
764 return array_merge( parent::getPossibleErrors(), array(
765 array( 'code' => 'multisource', 'info' => "Cannot use 'pageids' at the same time as 'dataSource'" ),
766 array( 'code' => 'multisource', 'info' => "Cannot use 'revids' at the same time as 'dataSource'" ),
767 ) );
768 }
769
770 public function getVersion() {
771 return __CLASS__ . ': $Id$';
772 }
773 }