MediaWiki  1.23.2
ApiQueryWatchlist.php
Go to the documentation of this file.
1 <?php
34 
35  public function __construct( $query, $moduleName ) {
36  parent::__construct( $query, $moduleName, 'wl' );
37  }
38 
39  public function execute() {
40  $this->run();
41  }
42 
43  public function executeGenerator( $resultPageSet ) {
44  $this->run( $resultPageSet );
45  }
46 
47  private $fld_ids = false, $fld_title = false, $fld_patrol = false,
48  $fld_flags = false, $fld_timestamp = false, $fld_user = false,
49  $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false,
51  $fld_loginfo = false;
52 
57  private function run( $resultPageSet = null ) {
58  $this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' );
59 
60  $params = $this->extractRequestParams();
61 
62  $user = $this->getUser();
63  $wlowner = $this->getWatchlistUser( $params );
64 
65  if ( !is_null( $params['prop'] ) && is_null( $resultPageSet ) ) {
66  $prop = array_flip( $params['prop'] );
67 
68  $this->fld_ids = isset( $prop['ids'] );
69  $this->fld_title = isset( $prop['title'] );
70  $this->fld_flags = isset( $prop['flags'] );
71  $this->fld_user = isset( $prop['user'] );
72  $this->fld_userid = isset( $prop['userid'] );
73  $this->fld_comment = isset( $prop['comment'] );
74  $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
75  $this->fld_timestamp = isset( $prop['timestamp'] );
76  $this->fld_sizes = isset( $prop['sizes'] );
77  $this->fld_patrol = isset( $prop['patrol'] );
78  $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
79  $this->fld_loginfo = isset( $prop['loginfo'] );
80 
81  if ( $this->fld_patrol ) {
82  if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
83  $this->dieUsage( 'patrol property is not available', 'patrol' );
84  }
85  }
86  }
87 
88  $this->addFields( array(
89  'rc_id',
90  'rc_namespace',
91  'rc_title',
92  'rc_timestamp',
93  'rc_type',
94  'rc_deleted',
95  ) );
96 
97  if ( is_null( $resultPageSet ) ) {
98  $this->addFields( array(
99  'rc_cur_id',
100  'rc_this_oldid',
101  'rc_last_oldid',
102  ) );
103 
104  $this->addFieldsIf( array( 'rc_type', 'rc_minor', 'rc_bot' ), $this->fld_flags );
105  $this->addFieldsIf( 'rc_user', $this->fld_user || $this->fld_userid );
106  $this->addFieldsIf( 'rc_user_text', $this->fld_user );
107  $this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment );
108  $this->addFieldsIf( 'rc_patrolled', $this->fld_patrol );
109  $this->addFieldsIf( array( 'rc_old_len', 'rc_new_len' ), $this->fld_sizes );
110  $this->addFieldsIf( 'wl_notificationtimestamp', $this->fld_notificationtimestamp );
111  $this->addFieldsIf(
112  array( 'rc_logid', 'rc_log_type', 'rc_log_action', 'rc_params' ),
113  $this->fld_loginfo
114  );
115  } elseif ( $params['allrev'] ) {
116  $this->addFields( 'rc_this_oldid' );
117  } else {
118  $this->addFields( 'rc_cur_id' );
119  }
120 
121  $this->addTables( array(
122  'recentchanges',
123  'watchlist',
124  ) );
125 
126  $userId = $wlowner->getId();
127  $this->addJoinConds( array( 'watchlist' => array( 'INNER JOIN',
128  array(
129  'wl_user' => $userId,
130  'wl_namespace=rc_namespace',
131  'wl_title=rc_title'
132  )
133  ) ) );
134 
135  $db = $this->getDB();
136 
137  $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'],
138  $params['start'], $params['end'] );
139  // Include in ORDER BY for uniqueness
140  $this->addWhereRange( 'rc_id', $params['dir'], null, null );
141 
142  if ( !is_null( $params['continue'] ) ) {
143  $cont = explode( '|', $params['continue'] );
144  $this->dieContinueUsageIf( count( $cont ) != 2 );
145  $op = ( $params['dir'] === 'newer' ? '>' : '<' );
146  $continueTimestamp = $db->addQuotes( $db->timestamp( $cont[0] ) );
147  $continueId = (int)$cont[1];
148  $this->dieContinueUsageIf( $continueId != $cont[1] );
149  $this->addWhere( "rc_timestamp $op $continueTimestamp OR " .
150  "(rc_timestamp = $continueTimestamp AND " .
151  "rc_id $op= $continueId)"
152  );
153  }
154 
155  $this->addWhereFld( 'wl_namespace', $params['namespace'] );
156 
157  if ( !$params['allrev'] ) {
158  $this->addTables( 'page' );
159  $this->addJoinConds( array( 'page' => array( 'LEFT JOIN', 'rc_cur_id=page_id' ) ) );
160  $this->addWhere( 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG );
161  }
162 
163  if ( !is_null( $params['show'] ) ) {
164  $show = array_flip( $params['show'] );
165 
166  /* Check for conflicting parameters. */
167  if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
168  || ( isset( $show['bot'] ) && isset( $show['!bot'] ) )
169  || ( isset( $show['anon'] ) && isset( $show['!anon'] ) )
170  || ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
171  ) {
172  $this->dieUsageMsg( 'show' );
173  }
174 
175  // Check permissions.
176  if ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ) {
177  if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
178  $this->dieUsage(
179  'You need the patrol right to request the patrolled flag',
180  'permissiondenied'
181  );
182  }
183  }
184 
185  /* Add additional conditions to query depending upon parameters. */
186  $this->addWhereIf( 'rc_minor = 0', isset( $show['!minor'] ) );
187  $this->addWhereIf( 'rc_minor != 0', isset( $show['minor'] ) );
188  $this->addWhereIf( 'rc_bot = 0', isset( $show['!bot'] ) );
189  $this->addWhereIf( 'rc_bot != 0', isset( $show['bot'] ) );
190  $this->addWhereIf( 'rc_user = 0', isset( $show['anon'] ) );
191  $this->addWhereIf( 'rc_user != 0', isset( $show['!anon'] ) );
192  $this->addWhereIf( 'rc_patrolled = 0', isset( $show['!patrolled'] ) );
193  $this->addWhereIf( 'rc_patrolled != 0', isset( $show['patrolled'] ) );
194  }
195 
196  if ( !is_null( $params['type'] ) ) {
197  $this->addWhereFld( 'rc_type', $this->parseRCType( $params['type'] ) );
198  }
199 
200  if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
201  $this->dieUsage( 'user and excludeuser cannot be used together', 'user-excludeuser' );
202  }
203  if ( !is_null( $params['user'] ) ) {
204  $this->addWhereFld( 'rc_user_text', $params['user'] );
205  }
206  if ( !is_null( $params['excludeuser'] ) ) {
207  $this->addWhere( 'rc_user_text != ' . $db->addQuotes( $params['excludeuser'] ) );
208  }
209 
210  // This is an index optimization for mysql, as done in the Special:Watchlist page
211  $this->addWhereIf(
212  "rc_timestamp > ''",
213  !isset( $params['start'] ) && !isset( $params['end'] ) && $db->getType() == 'mysql'
214  );
215 
216  // Paranoia: avoid brute force searches (bug 17342)
217  if ( !is_null( $params['user'] ) || !is_null( $params['excludeuser'] ) ) {
218  if ( !$user->isAllowed( 'deletedhistory' ) ) {
219  $bitmask = Revision::DELETED_USER;
220  } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
222  } else {
223  $bitmask = 0;
224  }
225  if ( $bitmask ) {
226  $this->addWhere( $this->getDB()->bitAnd( 'rc_deleted', $bitmask ) . " != $bitmask" );
227  }
228  }
229 
230  // LogPage::DELETED_ACTION hides the affected page, too. So hide those
231  // entirely from the watchlist, or someone could guess the title.
232  if ( !$user->isAllowed( 'deletedhistory' ) ) {
233  $bitmask = LogPage::DELETED_ACTION;
234  } elseif ( !$user->isAllowed( 'suppressrevision' ) ) {
236  } else {
237  $bitmask = 0;
238  }
239  if ( $bitmask ) {
240  $this->addWhere( $this->getDB()->makeList( array(
241  'rc_type != ' . RC_LOG,
242  $this->getDB()->bitAnd( 'rc_deleted', $bitmask ) . " != $bitmask",
243  ), LIST_OR ) );
244  }
245 
246  $this->addOption( 'LIMIT', $params['limit'] + 1 );
247 
248  $ids = array();
249  $count = 0;
250  $res = $this->select( __METHOD__ );
251 
252  foreach ( $res as $row ) {
253  if ( ++$count > $params['limit'] ) {
254  // We've reached the one extra which shows that there are
255  // additional pages to be had. Stop here...
256  $this->setContinueEnumParameter( 'continue', "$row->rc_timestamp|$row->rc_id" );
257  break;
258  }
259 
260  if ( is_null( $resultPageSet ) ) {
261  $vals = $this->extractRowInfo( $row );
262  $fit = $this->getResult()->addValue( array( 'query', $this->getModuleName() ), null, $vals );
263  if ( !$fit ) {
264  $this->setContinueEnumParameter( 'continue', "$row->rc_timestamp|$row->rc_id" );
265  break;
266  }
267  } else {
268  if ( $params['allrev'] ) {
269  $ids[] = intval( $row->rc_this_oldid );
270  } else {
271  $ids[] = intval( $row->rc_cur_id );
272  }
273  }
274  }
275 
276  if ( is_null( $resultPageSet ) ) {
277  $this->getResult()->setIndexedTagName_internal(
278  array( 'query', $this->getModuleName() ),
279  'item'
280  );
281  } elseif ( $params['allrev'] ) {
282  $resultPageSet->populateFromRevisionIDs( $ids );
283  } else {
284  $resultPageSet->populateFromPageIDs( $ids );
285  }
286  }
287 
288  private function extractRowInfo( $row ) {
289  /* Determine the title of the page that has been changed. */
290  $title = Title::makeTitle( $row->rc_namespace, $row->rc_title );
291  $user = $this->getUser();
292 
293  /* Our output data. */
294  $vals = array();
295 
296  $type = intval( $row->rc_type );
297 
298  /* Determine what kind of change this was. */
299  switch ( $type ) {
300  case RC_EDIT:
301  $vals['type'] = 'edit';
302  break;
303  case RC_NEW:
304  $vals['type'] = 'new';
305  break;
306  case RC_MOVE:
307  $vals['type'] = 'move';
308  break;
309  case RC_LOG:
310  $vals['type'] = 'log';
311  break;
312  case RC_EXTERNAL:
313  $vals['type'] = 'external';
314  break;
316  $vals['type'] = 'move over redirect';
317  break;
318  default:
319  $vals['type'] = $type;
320  }
321 
322  $anyHidden = false;
323 
324  /* Create a new entry in the result for the title. */
325  if ( $this->fld_title || $this->fld_ids ) {
326  // These should already have been filtered out of the query, but just in case.
327  if ( $type === RC_LOG && ( $row->rc_deleted & LogPage::DELETED_ACTION ) ) {
328  $vals['actionhidden'] = '';
329  $anyHidden = true;
330  }
331  if ( $type !== RC_LOG ||
333  ) {
334  if ( $this->fld_title ) {
336  }
337  if ( $this->fld_ids ) {
338  $vals['pageid'] = intval( $row->rc_cur_id );
339  $vals['revid'] = intval( $row->rc_this_oldid );
340  $vals['old_revid'] = intval( $row->rc_last_oldid );
341  }
342  }
343  }
344 
345  /* Add user data and 'anon' flag, if user is anonymous. */
346  if ( $this->fld_user || $this->fld_userid ) {
347  if ( $row->rc_deleted & Revision::DELETED_USER ) {
348  $vals['userhidden'] = '';
349  $anyHidden = true;
350  }
351  if ( Revision::userCanBitfield( $row->rc_deleted, Revision::DELETED_USER, $user ) ) {
352  if ( $this->fld_userid ) {
353  $vals['userid'] = $row->rc_user;
354  // for backwards compatibility
355  $vals['user'] = $row->rc_user;
356  }
357 
358  if ( $this->fld_user ) {
359  $vals['user'] = $row->rc_user_text;
360  }
361 
362  if ( !$row->rc_user ) {
363  $vals['anon'] = '';
364  }
365  }
366  }
367 
368  /* Add flags, such as new, minor, bot. */
369  if ( $this->fld_flags ) {
370  if ( $row->rc_bot ) {
371  $vals['bot'] = '';
372  }
373  if ( $row->rc_type == RC_NEW ) {
374  $vals['new'] = '';
375  }
376  if ( $row->rc_minor ) {
377  $vals['minor'] = '';
378  }
379  }
380 
381  /* Add sizes of each revision. (Only available on 1.10+) */
382  if ( $this->fld_sizes ) {
383  $vals['oldlen'] = intval( $row->rc_old_len );
384  $vals['newlen'] = intval( $row->rc_new_len );
385  }
386 
387  /* Add the timestamp. */
388  if ( $this->fld_timestamp ) {
389  $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $row->rc_timestamp );
390  }
391 
392  if ( $this->fld_notificationtimestamp ) {
393  $vals['notificationtimestamp'] = ( $row->wl_notificationtimestamp == null )
394  ? ''
395  : wfTimestamp( TS_ISO_8601, $row->wl_notificationtimestamp );
396  }
397 
398  /* Add edit summary / log summary. */
399  if ( $this->fld_comment || $this->fld_parsedcomment ) {
400  if ( $row->rc_deleted & Revision::DELETED_COMMENT ) {
401  $vals['commenthidden'] = '';
402  $anyHidden = true;
403  }
404  if ( Revision::userCanBitfield( $row->rc_deleted, Revision::DELETED_COMMENT, $user ) ) {
405  if ( $this->fld_comment && isset( $row->rc_comment ) ) {
406  $vals['comment'] = $row->rc_comment;
407  }
408 
409  if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) {
410  $vals['parsedcomment'] = Linker::formatComment( $row->rc_comment, $title );
411  }
412  }
413  }
414 
415  /* Add the patrolled flag */
416  if ( $this->fld_patrol && $row->rc_patrolled == 1 ) {
417  $vals['patrolled'] = '';
418  }
419 
420  if ( $this->fld_patrol && ChangesList::isUnpatrolled( $row, $user ) ) {
421  $vals['unpatrolled'] = '';
422  }
423 
424  if ( $this->fld_loginfo && $row->rc_type == RC_LOG ) {
425  if ( $row->rc_deleted & LogPage::DELETED_ACTION ) {
426  $vals['actionhidden'] = '';
427  $anyHidden = true;
428  }
429  if ( LogEventsList::userCanBitfield( $row->rc_deleted, LogPage::DELETED_ACTION, $user ) ) {
430  $vals['logid'] = intval( $row->rc_logid );
431  $vals['logtype'] = $row->rc_log_type;
432  $vals['logaction'] = $row->rc_log_action;
433  $logEntry = DatabaseLogEntry::newFromRow( (array)$row );
435  $this->getResult(),
436  $vals,
437  $logEntry->getParameters(),
438  $logEntry->getType(),
439  $logEntry->getSubtype(),
440  $logEntry->getTimestamp()
441  );
442  }
443  }
444 
445  if ( $anyHidden && ( $row->rc_deleted & Revision::DELETED_RESTRICTED ) ) {
446  $vals['suppressed'] = '';
447  }
448 
449  return $vals;
450  }
451 
457  private function parseRCType( $type ) {
458  if ( is_array( $type ) ) {
459  $retval = array();
460  foreach ( $type as $t ) {
461  $retval[] = $this->parseRCType( $t );
462  }
463 
464  return $retval;
465  }
466 
467  switch ( $type ) {
468  case 'edit':
469  return RC_EDIT;
470  case 'new':
471  return RC_NEW;
472  case 'log':
473  return RC_LOG;
474  case 'external':
475  return RC_EXTERNAL;
476  default:
477  ApiBase::dieDebug( __METHOD__, "Unknown type '$type'" );
478  }
479  }
480 
481  public function getAllowedParams() {
482  return array(
483  'allrev' => false,
484  'start' => array(
485  ApiBase::PARAM_TYPE => 'timestamp'
486  ),
487  'end' => array(
488  ApiBase::PARAM_TYPE => 'timestamp'
489  ),
490  'namespace' => array(
491  ApiBase::PARAM_ISMULTI => true,
492  ApiBase::PARAM_TYPE => 'namespace'
493  ),
494  'user' => array(
495  ApiBase::PARAM_TYPE => 'user',
496  ),
497  'excludeuser' => array(
498  ApiBase::PARAM_TYPE => 'user',
499  ),
500  'dir' => array(
501  ApiBase::PARAM_DFLT => 'older',
503  'newer',
504  'older'
505  )
506  ),
507  'limit' => array(
508  ApiBase::PARAM_DFLT => 10,
509  ApiBase::PARAM_TYPE => 'limit',
510  ApiBase::PARAM_MIN => 1,
513  ),
514  'prop' => array(
515  ApiBase::PARAM_ISMULTI => true,
516  ApiBase::PARAM_DFLT => 'ids|title|flags',
518  'ids',
519  'title',
520  'flags',
521  'user',
522  'userid',
523  'comment',
524  'parsedcomment',
525  'timestamp',
526  'patrol',
527  'sizes',
528  'notificationtimestamp',
529  'loginfo',
530  )
531  ),
532  'show' => array(
533  ApiBase::PARAM_ISMULTI => true,
535  'minor',
536  '!minor',
537  'bot',
538  '!bot',
539  'anon',
540  '!anon',
541  'patrolled',
542  '!patrolled',
543  )
544  ),
545  'type' => array(
546  ApiBase::PARAM_ISMULTI => true,
548  'edit',
549  'external',
550  'new',
551  'log',
552  )
553  ),
554  'owner' => array(
555  ApiBase::PARAM_TYPE => 'user'
556  ),
557  'token' => array(
558  ApiBase::PARAM_TYPE => 'string'
559  ),
560  'continue' => null,
561  );
562  }
563 
564  public function getParamDescription() {
565  $p = $this->getModulePrefix();
566 
567  return array(
568  'allrev' => 'Include multiple revisions of the same page within given timeframe',
569  'start' => 'The timestamp to start enumerating from',
570  'end' => 'The timestamp to end enumerating',
571  'namespace' => 'Filter changes to only the given namespace(s)',
572  'user' => 'Only list changes by this user',
573  'excludeuser' => 'Don\'t list changes by this user',
574  'dir' => $this->getDirectionDescription( $p ),
575  'limit' => 'How many total results to return per request',
576  'prop' => array(
577  'Which additional items to get (non-generator mode only).',
578  ' ids - Adds revision ids and page ids',
579  ' title - Adds title of the page',
580  ' flags - Adds flags for the edit',
581  ' user - Adds the user who made the edit',
582  ' userid - Adds user id of whom made the edit',
583  ' comment - Adds comment of the edit',
584  ' parsedcomment - Adds parsed comment of the edit',
585  ' timestamp - Adds timestamp of the edit',
586  ' patrol - Tags edits that are patrolled',
587  ' sizes - Adds the old and new lengths of the page',
588  ' notificationtimestamp - Adds timestamp of when the user was last notified about the edit',
589  ' loginfo - Adds log information where appropriate',
590  ),
591  'show' => array(
592  'Show only items that meet this criteria.',
593  "For example, to see only minor edits done by logged-in users, set {$p}show=minor|!anon"
594  ),
595  'type' => array(
596  'Which types of changes to show',
597  ' edit - Regular page edits',
598  ' external - External changes',
599  ' new - Page creations',
600  ' log - Log entries',
601  ),
602  'owner' => 'The name of the user whose watchlist you\'d like to access',
603  'token' => 'Give a security token (settable in preferences) to ' .
604  'allow access to another user\'s watchlist',
605  'continue' => 'When more results are available, use this to continue',
606  );
607  }
608 
609  public function getResultProperties() {
610  global $wgLogTypes;
611 
612  return array(
613  '' => array(
614  'type' => array(
616  'edit',
617  'new',
618  'move',
619  'log',
620  'move over redirect'
621  )
622  )
623  ),
624  'ids' => array(
625  'pageid' => 'integer',
626  'revid' => 'integer',
627  'old_revid' => 'integer'
628  ),
629  'title' => array(
630  'ns' => 'namespace',
631  'title' => 'string'
632  ),
633  'user' => array(
634  'user' => 'string',
635  'anon' => 'boolean'
636  ),
637  'userid' => array(
638  'userid' => 'integer',
639  'anon' => 'boolean'
640  ),
641  'flags' => array(
642  'new' => 'boolean',
643  'minor' => 'boolean',
644  'bot' => 'boolean'
645  ),
646  'patrol' => array(
647  'patrolled' => 'boolean'
648  ),
649  'timestamp' => array(
650  'timestamp' => 'timestamp'
651  ),
652  'sizes' => array(
653  'oldlen' => 'integer',
654  'newlen' => 'integer'
655  ),
656  'notificationtimestamp' => array(
657  'notificationtimestamp' => array(
658  ApiBase::PROP_TYPE => 'timestamp',
659  ApiBase::PROP_NULLABLE => true
660  )
661  ),
662  'comment' => array(
663  'comment' => array(
664  ApiBase::PROP_TYPE => 'string',
665  ApiBase::PROP_NULLABLE => true
666  )
667  ),
668  'parsedcomment' => array(
669  'parsedcomment' => array(
670  ApiBase::PROP_TYPE => 'string',
671  ApiBase::PROP_NULLABLE => true
672  )
673  ),
674  'loginfo' => array(
675  'logid' => array(
676  ApiBase::PROP_TYPE => 'integer',
677  ApiBase::PROP_NULLABLE => true
678  ),
679  'logtype' => array(
680  ApiBase::PROP_TYPE => $wgLogTypes,
681  ApiBase::PROP_NULLABLE => true
682  ),
683  'logaction' => array(
684  ApiBase::PROP_TYPE => 'string',
685  ApiBase::PROP_NULLABLE => true
686  )
687  )
688  );
689  }
690 
691  public function getDescription() {
692  return "Get all recent changes to pages in the logged in user's watchlist.";
693  }
694 
695  public function getPossibleErrors() {
696  return array_merge( parent::getPossibleErrors(), array(
697  array( 'code' => 'bad_wlowner', 'info' => 'Specified user does not exist' ),
698  array(
699  'code' => 'bad_wltoken',
700  'info' => 'Incorrect watchlist token provided -- ' .
701  'please set a correct token in Special:Preferences'
702  ),
703  array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ),
704  array( 'code' => 'patrol', 'info' => 'patrol property is not available' ),
705  array( 'show' ),
706  array(
707  'code' => 'permissiondenied',
708  'info' => 'You need the patrol right to request the patrolled flag'
709  ),
710  array( 'code' => 'user-excludeuser', 'info' => 'user and excludeuser cannot be used together' ),
711  ) );
712  }
713 
714  public function getExamples() {
715  return array(
716  'api.php?action=query&list=watchlist',
717  'api.php?action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment',
718  'api.php?action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment',
719  'api.php?action=query&generator=watchlist&prop=info',
720  'api.php?action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user',
721  'api.php?action=query&list=watchlist&wlowner=Bob_Smith&wltoken=123ABC'
722  );
723  }
724 
725  public function getHelpUrls() {
726  return 'https://www.mediawiki.org/wiki/API:Watchlist';
727  }
728 }
Revision\DELETED_USER
const DELETED_USER
Definition: Revision.php:67
Title\makeTitle
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:398
Revision\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: Revision.php:68
ApiQueryBase\addFields
addFields( $value)
Add a set of fields to select to the internal array.
Definition: ApiQueryBase.php:117
ApiQueryWatchlist\$fld_title
$fld_title
Definition: ApiQueryWatchlist.php:47
RC_EXTERNAL
const RC_EXTERNAL
Definition: Defines.php:183
Revision\DELETED_COMMENT
const DELETED_COMMENT
Definition: Revision.php:66
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
ApiQueryLogEvents\addLogParams
static addLogParams( $result, &$vals, $params, $type, $action, $ts, $legacy=false)
Definition: ApiQueryLogEvents.php:248
ApiQueryWatchlist\getParamDescription
getParamDescription()
Returns an array of parameter descriptions.
Definition: ApiQueryWatchlist.php:564
ApiQueryWatchlist\getExamples
getExamples()
Returns usage examples for this module.
Definition: ApiQueryWatchlist.php:714
ApiQueryWatchlist\$fld_user
$fld_user
Definition: ApiQueryWatchlist.php:48
ApiQueryBase\addTimestampWhereRange
addTimestampWhereRange( $field, $dir, $start, $end, $sort=true)
Add a WHERE clause corresponding to a range, similar to addWhereRange, but converts $start and $end t...
Definition: ApiQueryBase.php:240
ApiBase\dieUsageMsg
dieUsageMsg( $error)
Output the error message related to a certain array.
Definition: ApiBase.php:1929
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:2483
RC_MOVE_OVER_REDIRECT
const RC_MOVE_OVER_REDIRECT
Definition: Defines.php:182
ApiBase\PARAM_TYPE
const PARAM_TYPE
Definition: ApiBase.php:50
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:205
ApiQueryBase\select
select( $method, $extraQuery=array())
Execute a SELECT query based on the values in the internal arrays.
Definition: ApiQueryBase.php:274
RC_LOG
const RC_LOG
Definition: Defines.php:181
ApiQueryWatchlist\$fld_userid
$fld_userid
Definition: ApiQueryWatchlist.php:50
RC_MOVE
const RC_MOVE
Definition: Defines.php:180
ApiQueryBase\getDirectionDescription
getDirectionDescription( $p='', $extraDirText='')
Gets the personalised direction parameter description.
Definition: ApiQueryBase.php:524
$params
$params
Definition: styleTest.css.php:40
RC_EDIT
const RC_EDIT
Definition: Defines.php:178
ApiQueryWatchlist\$fld_loginfo
$fld_loginfo
Definition: ApiQueryWatchlist.php:51
ApiQueryWatchlist\$fld_notificationtimestamp
$fld_notificationtimestamp
Definition: ApiQueryWatchlist.php:50
Revision\userCanBitfield
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this revision,...
Definition: Revision.php:1641
ApiQueryBase\addOption
addOption( $name, $value=null)
Add an option such as LIMIT or USE INDEX.
Definition: ApiQueryBase.php:252
Linker\formatComment
static formatComment( $comment, $title=null, $local=false)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Definition: Linker.php:1254
ContextSource\getUser
getUser()
Get the User object.
Definition: ContextSource.php:132
ApiQueryBase\addFieldsIf
addFieldsIf( $value, $condition)
Same as addFields(), but add the fields only if a condition is met.
Definition: ApiQueryBase.php:131
ApiQueryWatchlist\getResultProperties
getResultProperties()
Returns possible properties in the result, grouped by the value of the prop parameter that shows them...
Definition: ApiQueryWatchlist.php:609
ApiQueryGeneratorBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Overrides base in case of generator & smart continue to notify ApiQueryMain instead of adding them to...
Definition: ApiQueryBase.php:676
ApiBase\PARAM_MIN
const PARAM_MIN
Definition: ApiBase.php:56
LIST_OR
const LIST_OR
Definition: Defines.php:206
DatabaseLogEntry\newFromRow
static newFromRow( $row)
Constructs new LogEntry from database result row.
Definition: LogEntry.php:163
ApiQueryWatchlist\$fld_sizes
$fld_sizes
Definition: ApiQueryWatchlist.php:49
ApiQueryWatchlist\getPossibleErrors
getPossibleErrors()
Definition: ApiQueryWatchlist.php:695
ApiBase\LIMIT_BIG1
const LIMIT_BIG1
Definition: ApiBase.php:78
TS_ISO_8601
const TS_ISO_8601
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.
Definition: GlobalFunctions.php:2448
ApiQueryBase\getDB
getDB()
Get the Query database connection (read-only)
Definition: ApiQueryBase.php:417
ApiBase\PARAM_MAX
const PARAM_MAX
Definition: ApiBase.php:52
ApiQueryWatchlist\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiQueryWatchlist.php:481
ApiQueryBase\addTables
addTables( $tables, $alias=null)
Add a set of tables to the internal array.
Definition: ApiQueryBase.php:82
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
ApiQueryWatchlist\executeGenerator
executeGenerator( $resultPageSet)
Execute this module as a generator.
Definition: ApiQueryWatchlist.php:43
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
ApiBase\PROP_TYPE
const PROP_TYPE
Definition: ApiBase.php:74
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition: LogPage.php:33
ApiBase\getModulePrefix
getModulePrefix()
Get parameter prefix (usually two letters or an empty string).
Definition: ApiBase.php:165
ApiQueryBase\addWhereRange
addWhereRange( $field, $dir, $start, $end, $sort=true)
Add a WHERE clause corresponding to a range, and an ORDER BY clause to sort in the right direction.
Definition: ApiQueryBase.php:205
ApiQueryWatchlist\extractRowInfo
extractRowInfo( $row)
Definition: ApiQueryWatchlist.php:288
ApiQueryWatchlist\__construct
__construct( $query, $moduleName)
Definition: ApiQueryWatchlist.php:35
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
ApiBase\getWatchlistUser
getWatchlistUser( $params)
Gets the user for whom to get the watchlist.
Definition: ApiBase.php:2070
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the $prefix.
Definition: ApiBase.php:1965
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\PROP_NULLABLE
const PROP_NULLABLE
Definition: ApiBase.php:76
ApiQueryWatchlist\$fld_timestamp
$fld_timestamp
Definition: ApiQueryWatchlist.php:48
ApiQueryBase\addJoinConds
addJoinConds( $join_conds)
Add a set of JOIN conditions to the internal array.
Definition: ApiQueryBase.php:106
ApiQueryBase\addWhereFld
addWhereFld( $field, $value)
Equivalent to addWhere(array($field => $value))
Definition: ApiQueryBase.php:185
RC_NEW
const RC_NEW
Definition: Defines.php:179
ApiQueryWatchlist\getDescription
getDescription()
Returns the description string for this module.
Definition: ApiQueryWatchlist.php:691
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237
$count
$count
Definition: UtfNormalTest2.php:96
ApiQueryGeneratorBase
Definition: ApiQueryBase.php:626
ApiQueryWatchlist\getHelpUrls
getHelpUrls()
Definition: ApiQueryWatchlist.php:725
DB_SLAVE
const DB_SLAVE
Definition: Defines.php:55
ApiQueryWatchlist
This query action allows clients to retrieve a list of recently modified pages that are part of the l...
Definition: ApiQueryWatchlist.php:33
ApiQueryBase\selectNamedDB
selectNamedDB( $name, $db, $groups)
Selects the query database connection with the given name.
Definition: ApiQueryBase.php:433
ApiQueryWatchlist\$fld_ids
$fld_ids
Definition: ApiQueryWatchlist.php:47
ApiBase\LIMIT_BIG2
const LIMIT_BIG2
Definition: ApiBase.php:79
LogEventsList\userCanBitfield
static userCanBitfield( $bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
Definition: LogEventsList.php:456
ApiQueryWatchlist\$fld_patrol
$fld_patrol
Definition: ApiQueryWatchlist.php:47
ApiBase\PARAM_DFLT
const PARAM_DFLT
Definition: ApiBase.php:46
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
ApiQueryWatchlist\$fld_comment
$fld_comment
Definition: ApiQueryWatchlist.php:49
ApiBase\PARAM_MAX2
const PARAM_MAX2
Definition: ApiBase.php:54
ApiQueryWatchlist\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition: ApiQueryWatchlist.php:39
LogPage\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: LogPage.php:36
ApiQueryBase\addWhere
addWhere( $value)
Add a set of WHERE clauses to the internal array.
Definition: ApiQueryBase.php:152
ChangesList\isUnpatrolled
static isUnpatrolled( $rc, User $user)
Definition: ChangesList.php:574
$t
$t
Definition: testCompression.php:65
ApiQueryWatchlist\$fld_parsedcomment
$fld_parsedcomment
Definition: ApiQueryWatchlist.php:49
$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
ApiQueryWatchlist\run
run( $resultPageSet=null)
Definition: ApiQueryWatchlist.php:57
ApiQueryWatchlist\parseRCType
parseRCType( $type)
Copied from ApiQueryRecentChanges.
Definition: ApiQueryWatchlist.php:457
$res
$res
Definition: database.txt:21
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:2006
$retval
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account incomplete not yet checked for validity & $retval
Definition: hooks.txt:237
ApiQueryWatchlist\$fld_flags
$fld_flags
Definition: ApiQueryWatchlist.php:48
ApiQueryBase\addWhereIf
addWhereIf( $value, $condition)
Same as addWhere(), but add the WHERE clauses only if a condition is met.
Definition: ApiQueryBase.php:170
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:339
$type
$type
Definition: testCompression.php:46