MediaWiki  1.32.0
ApiQueryRecentChanges.php
Go to the documentation of this file.
1 <?php
26 
34 
35  public function __construct( ApiQuery $query, $moduleName ) {
36  parent::__construct( $query, $moduleName, 'rc' );
37  }
38 
39  private $commentStore;
40 
41  private $fld_comment = false, $fld_parsedcomment = false, $fld_user = false, $fld_userid = false,
42  $fld_flags = false, $fld_timestamp = false, $fld_title = false, $fld_ids = false,
43  $fld_sizes = false, $fld_redirect = false, $fld_patrolled = false, $fld_loginfo = false,
44  $fld_tags = false, $fld_sha1 = false, $token = [];
45 
46  private $tokenFunctions;
47 
55  protected function getTokenFunctions() {
56  // Don't call the hooks twice
57  if ( isset( $this->tokenFunctions ) ) {
58  return $this->tokenFunctions;
59  }
60 
61  // If we're in a mode that breaks the same-origin policy, no tokens can
62  // be obtained
63  if ( $this->lacksSameOriginSecurity() ) {
64  return [];
65  }
66 
67  $this->tokenFunctions = [
68  'patrol' => [ self::class, 'getPatrolToken' ]
69  ];
70  Hooks::run( 'APIQueryRecentChangesTokens', [ &$this->tokenFunctions ] );
71 
72  return $this->tokenFunctions;
73  }
74 
82  public static function getPatrolToken( $pageid, $title, $rc = null ) {
83  global $wgUser;
84 
85  $validTokenUser = false;
86 
87  if ( $rc ) {
88  if ( ( $wgUser->useRCPatrol() && $rc->getAttribute( 'rc_type' ) == RC_EDIT ) ||
89  ( $wgUser->useNPPatrol() && $rc->getAttribute( 'rc_type' ) == RC_NEW )
90  ) {
91  $validTokenUser = true;
92  }
93  } elseif ( $wgUser->useRCPatrol() || $wgUser->useNPPatrol() ) {
94  $validTokenUser = true;
95  }
96 
97  if ( $validTokenUser ) {
98  // The patrol token is always the same, let's exploit that
99  static $cachedPatrolToken = null;
100 
101  if ( is_null( $cachedPatrolToken ) ) {
102  $cachedPatrolToken = $wgUser->getEditToken( 'patrol' );
103  }
104 
105  return $cachedPatrolToken;
106  }
107 
108  return false;
109  }
110 
115  public function initProperties( $prop ) {
116  $this->fld_comment = isset( $prop['comment'] );
117  $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
118  $this->fld_user = isset( $prop['user'] );
119  $this->fld_userid = isset( $prop['userid'] );
120  $this->fld_flags = isset( $prop['flags'] );
121  $this->fld_timestamp = isset( $prop['timestamp'] );
122  $this->fld_title = isset( $prop['title'] );
123  $this->fld_ids = isset( $prop['ids'] );
124  $this->fld_sizes = isset( $prop['sizes'] );
125  $this->fld_redirect = isset( $prop['redirect'] );
126  $this->fld_patrolled = isset( $prop['patrolled'] );
127  $this->fld_loginfo = isset( $prop['loginfo'] );
128  $this->fld_tags = isset( $prop['tags'] );
129  $this->fld_sha1 = isset( $prop['sha1'] );
130  }
131 
132  public function execute() {
133  $this->run();
134  }
135 
136  public function executeGenerator( $resultPageSet ) {
137  $this->run( $resultPageSet );
138  }
139 
145  public function run( $resultPageSet = null ) {
147 
148  $user = $this->getUser();
149  /* Get the parameters of the request. */
150  $params = $this->extractRequestParams();
151 
152  /* Build our basic query. Namely, something along the lines of:
153  * SELECT * FROM recentchanges WHERE rc_timestamp > $start
154  * AND rc_timestamp < $end AND rc_namespace = $namespace
155  */
156  $this->addTables( 'recentchanges' );
157  $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
158 
159  if ( !is_null( $params['continue'] ) ) {
160  $cont = explode( '|', $params['continue'] );
161  $this->dieContinueUsageIf( count( $cont ) != 2 );
162  $db = $this->getDB();
163  $timestamp = $db->addQuotes( $db->timestamp( $cont[0] ) );
164  $id = intval( $cont[1] );
165  $this->dieContinueUsageIf( $id != $cont[1] );
166  $op = $params['dir'] === 'older' ? '<' : '>';
167  $this->addWhere(
168  "rc_timestamp $op $timestamp OR " .
169  "(rc_timestamp = $timestamp AND " .
170  "rc_id $op= $id)"
171  );
172  }
173 
174  $order = $params['dir'] === 'older' ? 'DESC' : 'ASC';
175  $this->addOption( 'ORDER BY', [
176  "rc_timestamp $order",
177  "rc_id $order",
178  ] );
179 
180  $this->addWhereFld( 'rc_namespace', $params['namespace'] );
181 
182  if ( !is_null( $params['type'] ) ) {
183  try {
184  $this->addWhereFld( 'rc_type', RecentChange::parseToRCType( $params['type'] ) );
185  } catch ( Exception $e ) {
186  ApiBase::dieDebug( __METHOD__, $e->getMessage() );
187  }
188  }
189 
190  $title = $params['title'];
191  if ( !is_null( $title ) ) {
192  $titleObj = Title::newFromText( $title );
193  if ( is_null( $titleObj ) ) {
194  $this->dieWithError( [ 'apierror-invalidtitle', wfEscapeWikiText( $title ) ] );
195  }
196  $this->addWhereFld( 'rc_namespace', $titleObj->getNamespace() );
197  $this->addWhereFld( 'rc_title', $titleObj->getDBkey() );
198  }
199 
200  if ( !is_null( $params['show'] ) ) {
201  $show = array_flip( $params['show'] );
202 
203  /* Check for conflicting parameters. */
204  if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
205  || ( isset( $show['bot'] ) && isset( $show['!bot'] ) )
206  || ( isset( $show['anon'] ) && isset( $show['!anon'] ) )
207  || ( isset( $show['redirect'] ) && isset( $show['!redirect'] ) )
208  || ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) )
209  || ( isset( $show['patrolled'] ) && isset( $show['unpatrolled'] ) )
210  || ( isset( $show['!patrolled'] ) && isset( $show['unpatrolled'] ) )
211  || ( isset( $show['autopatrolled'] ) && isset( $show['!autopatrolled'] ) )
212  || ( isset( $show['autopatrolled'] ) && isset( $show['unpatrolled'] ) )
213  || ( isset( $show['autopatrolled'] ) && isset( $show['!patrolled'] ) )
214  ) {
215  $this->dieWithError( 'apierror-show' );
216  }
217 
218  // Check permissions
219  if ( isset( $show['patrolled'] )
220  || isset( $show['!patrolled'] )
221  || isset( $show['unpatrolled'] )
222  || isset( $show['autopatrolled'] )
223  || isset( $show['!autopatrolled'] )
224  ) {
225  if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
226  $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
227  }
228  }
229 
230  /* Add additional conditions to query depending upon parameters. */
231  $this->addWhereIf( 'rc_minor = 0', isset( $show['!minor'] ) );
232  $this->addWhereIf( 'rc_minor != 0', isset( $show['minor'] ) );
233  $this->addWhereIf( 'rc_bot = 0', isset( $show['!bot'] ) );
234  $this->addWhereIf( 'rc_bot != 0', isset( $show['bot'] ) );
235  if ( isset( $show['anon'] ) || isset( $show['!anon'] ) ) {
236  $actorMigration = ActorMigration::newMigration();
237  $actorQuery = $actorMigration->getJoin( 'rc_user' );
238  $this->addTables( $actorQuery['tables'] );
239  $this->addJoinConds( $actorQuery['joins'] );
240  $this->addWhereIf(
241  $actorMigration->isAnon( $actorQuery['fields']['rc_user'] ), isset( $show['anon'] )
242  );
243  $this->addWhereIf(
244  $actorMigration->isNotAnon( $actorQuery['fields']['rc_user'] ), isset( $show['!anon'] )
245  );
246  }
247  $this->addWhereIf( 'rc_patrolled = 0', isset( $show['!patrolled'] ) );
248  $this->addWhereIf( 'rc_patrolled != 0', isset( $show['patrolled'] ) );
249  $this->addWhereIf( 'page_is_redirect = 1', isset( $show['redirect'] ) );
250 
251  if ( isset( $show['unpatrolled'] ) ) {
252  // See ChangesList::isUnpatrolled
253  if ( $user->useRCPatrol() ) {
254  $this->addWhere( 'rc_patrolled = ' . RecentChange::PRC_UNPATROLLED );
255  } elseif ( $user->useNPPatrol() ) {
256  $this->addWhere( 'rc_patrolled = ' . RecentChange::PRC_UNPATROLLED );
257  $this->addWhereFld( 'rc_type', RC_NEW );
258  }
259  }
260 
261  $this->addWhereIf(
262  'rc_patrolled != ' . RecentChange::PRC_AUTOPATROLLED,
263  isset( $show['!autopatrolled'] )
264  );
265  $this->addWhereIf(
266  'rc_patrolled = ' . RecentChange::PRC_AUTOPATROLLED,
267  isset( $show['autopatrolled'] )
268  );
269 
270  // Don't throw log entries out the window here
271  $this->addWhereIf(
272  'page_is_redirect = 0 OR page_is_redirect IS NULL',
273  isset( $show['!redirect'] )
274  );
275  }
276 
277  $this->requireMaxOneParameter( $params, 'user', 'excludeuser' );
278 
279  if ( !is_null( $params['user'] ) ) {
280  // Don't query by user ID here, it might be able to use the rc_user_text index.
281  $actorQuery = ActorMigration::newMigration()
282  ->getWhere( $this->getDB(), 'rc_user', User::newFromName( $params['user'], false ), false );
283  $this->addTables( $actorQuery['tables'] );
284  $this->addJoinConds( $actorQuery['joins'] );
285  $this->addWhere( $actorQuery['conds'] );
286  }
287 
288  if ( !is_null( $params['excludeuser'] ) ) {
289  // Here there's no chance to use the rc_user_text index, so allow ID to be used.
290  $actorQuery = ActorMigration::newMigration()
291  ->getWhere( $this->getDB(), 'rc_user', User::newFromName( $params['excludeuser'], false ) );
292  $this->addTables( $actorQuery['tables'] );
293  $this->addJoinConds( $actorQuery['joins'] );
294  $this->addWhere( 'NOT(' . $actorQuery['conds'] . ')' );
295  }
296 
297  /* Add the fields we're concerned with to our query. */
298  $this->addFields( [
299  'rc_id',
300  'rc_timestamp',
301  'rc_namespace',
302  'rc_title',
303  'rc_cur_id',
304  'rc_type',
305  'rc_deleted'
306  ] );
307 
308  $showRedirects = false;
309  /* Determine what properties we need to display. */
310  if ( !is_null( $params['prop'] ) ) {
311  $prop = array_flip( $params['prop'] );
312 
313  /* Set up internal members based upon params. */
314  $this->initProperties( $prop );
315 
316  if ( $this->fld_patrolled && !$user->useRCPatrol() && !$user->useNPPatrol() ) {
317  $this->dieWithError( 'apierror-permissiondenied-patrolflag', 'permissiondenied' );
318  }
319 
320  /* Add fields to our query if they are specified as a needed parameter. */
321  $this->addFieldsIf( [ 'rc_this_oldid', 'rc_last_oldid' ], $this->fld_ids );
322  if ( $this->fld_user || $this->fld_userid ) {
323  $actorQuery = ActorMigration::newMigration()->getJoin( 'rc_user' );
324  $this->addTables( $actorQuery['tables'] );
325  $this->addFields( $actorQuery['fields'] );
326  $this->addJoinConds( $actorQuery['joins'] );
327  }
328  $this->addFieldsIf( [ 'rc_minor', 'rc_type', 'rc_bot' ], $this->fld_flags );
329  $this->addFieldsIf( [ 'rc_old_len', 'rc_new_len' ], $this->fld_sizes );
330  $this->addFieldsIf( [ 'rc_patrolled', 'rc_log_type' ], $this->fld_patrolled );
331  $this->addFieldsIf(
332  [ 'rc_logid', 'rc_log_type', 'rc_log_action', 'rc_params' ],
333  $this->fld_loginfo
334  );
335  $showRedirects = $this->fld_redirect || isset( $show['redirect'] )
336  || isset( $show['!redirect'] );
337  }
338  $this->addFieldsIf( [ 'rc_this_oldid' ],
339  $resultPageSet && $params['generaterevisions'] );
340 
341  if ( $this->fld_tags ) {
342  $this->addTables( 'tag_summary' );
343  $this->addJoinConds( [ 'tag_summary' => [ 'LEFT JOIN', [ 'rc_id=ts_rc_id' ] ] ] );
344  $this->addFields( 'ts_tags' );
345  }
346 
347  if ( $this->fld_sha1 ) {
348  $this->addTables( 'revision' );
349  $this->addJoinConds( [ 'revision' => [ 'LEFT JOIN',
350  [ 'rc_this_oldid=rev_id' ] ] ] );
351  $this->addFields( [ 'rev_sha1', 'rev_deleted' ] );
352  }
353 
354  if ( $params['toponly'] || $showRedirects ) {
355  $this->addTables( 'page' );
356  $this->addJoinConds( [ 'page' => [ 'LEFT JOIN',
357  [ 'rc_namespace=page_namespace', 'rc_title=page_title' ] ] ] );
358  $this->addFields( 'page_is_redirect' );
359 
360  if ( $params['toponly'] ) {
361  $this->addWhere( 'rc_this_oldid = page_latest' );
362  }
363  }
364 
365  if ( !is_null( $params['tag'] ) ) {
366  $this->addTables( 'change_tag' );
367  $this->addJoinConds( [ 'change_tag' => [ 'INNER JOIN', [ 'rc_id=ct_rc_id' ] ] ] );
368  if ( $wgChangeTagsSchemaMigrationStage > MIGRATION_WRITE_BOTH ) {
369  $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
370  try {
371  $this->addWhereFld( 'ct_tag_id', $changeTagDefStore->getId( $params['tag'] ) );
372  } catch ( NameTableAccessException $exception ) {
373  // Return nothing.
374  $this->addWhere( '1=0' );
375  }
376  } else {
377  $this->addWhereFld( 'ct_tag', $params['tag'] );
378  }
379  }
380 
381  // Paranoia: avoid brute force searches (T19342)
382  if ( !is_null( $params['user'] ) || !is_null( $params['excludeuser'] ) ) {
383  if ( !$user->isAllowed( 'deletedhistory' ) ) {
384  $bitmask = RevisionRecord::DELETED_USER;
385  } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
386  $bitmask = RevisionRecord::DELETED_USER | RevisionRecord::DELETED_RESTRICTED;
387  } else {
388  $bitmask = 0;
389  }
390  if ( $bitmask ) {
391  $this->addWhere( $this->getDB()->bitAnd( 'rc_deleted', $bitmask ) . " != $bitmask" );
392  }
393  }
394  if ( $this->getRequest()->getCheck( 'namespace' ) ) {
395  // LogPage::DELETED_ACTION hides the affected page, too.
396  if ( !$user->isAllowed( 'deletedhistory' ) ) {
397  $bitmask = LogPage::DELETED_ACTION;
398  } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
400  } else {
401  $bitmask = 0;
402  }
403  if ( $bitmask ) {
404  $this->addWhere( $this->getDB()->makeList( [
405  'rc_type != ' . RC_LOG,
406  $this->getDB()->bitAnd( 'rc_deleted', $bitmask ) . " != $bitmask",
407  ], LIST_OR ) );
408  }
409  }
410 
411  $this->token = $params['token'];
412 
413  if ( $this->fld_comment || $this->fld_parsedcomment || $this->token ) {
414  $this->commentStore = CommentStore::getStore();
415  $commentQuery = $this->commentStore->getJoin( 'rc_comment' );
416  $this->addTables( $commentQuery['tables'] );
417  $this->addFields( $commentQuery['fields'] );
418  $this->addJoinConds( $commentQuery['joins'] );
419  }
420 
421  $this->addOption( 'LIMIT', $params['limit'] + 1 );
422 
423  $hookData = [];
424  $count = 0;
425  /* Perform the actual query. */
426  $res = $this->select( __METHOD__, [], $hookData );
427 
428  $revids = [];
429  $titles = [];
430 
431  $result = $this->getResult();
432 
433  /* Iterate through the rows, adding data extracted from them to our query result. */
434  foreach ( $res as $row ) {
435  if ( $count === 0 && $resultPageSet !== null ) {
436  // Set the non-continue since the list of recentchanges is
437  // prone to having entries added at the start frequently.
438  $this->getContinuationManager()->addGeneratorNonContinueParam(
439  $this, 'continue', "$row->rc_timestamp|$row->rc_id"
440  );
441  }
442  if ( ++$count > $params['limit'] ) {
443  // We've reached the one extra which shows that there are
444  // additional pages to be had. Stop here...
445  $this->setContinueEnumParameter( 'continue', "$row->rc_timestamp|$row->rc_id" );
446  break;
447  }
448 
449  if ( is_null( $resultPageSet ) ) {
450  /* Extract the data from a single row. */
451  $vals = $this->extractRowInfo( $row );
452 
453  /* Add that row's data to our final output. */
454  $fit = $this->processRow( $row, $vals, $hookData ) &&
455  $result->addValue( [ 'query', $this->getModuleName() ], null, $vals );
456  if ( !$fit ) {
457  $this->setContinueEnumParameter( 'continue', "$row->rc_timestamp|$row->rc_id" );
458  break;
459  }
460  } elseif ( $params['generaterevisions'] ) {
461  $revid = (int)$row->rc_this_oldid;
462  if ( $revid > 0 ) {
463  $revids[] = $revid;
464  }
465  } else {
466  $titles[] = Title::makeTitle( $row->rc_namespace, $row->rc_title );
467  }
468  }
469 
470  if ( is_null( $resultPageSet ) ) {
471  /* Format the result */
472  $result->addIndexedTagName( [ 'query', $this->getModuleName() ], 'rc' );
473  } elseif ( $params['generaterevisions'] ) {
474  $resultPageSet->populateFromRevisionIDs( $revids );
475  } else {
476  $resultPageSet->populateFromTitles( $titles );
477  }
478  }
479 
487  public function extractRowInfo( $row ) {
488  /* Determine the title of the page that has been changed. */
489  $title = Title::makeTitle( $row->rc_namespace, $row->rc_title );
490  $user = $this->getUser();
491 
492  /* Our output data. */
493  $vals = [];
494 
495  $type = intval( $row->rc_type );
496  $vals['type'] = RecentChange::parseFromRCType( $type );
497 
498  $anyHidden = false;
499 
500  /* Create a new entry in the result for the title. */
501  if ( $this->fld_title || $this->fld_ids ) {
502  if ( $type === RC_LOG && ( $row->rc_deleted & LogPage::DELETED_ACTION ) ) {
503  $vals['actionhidden'] = true;
504  $anyHidden = true;
505  }
506  if ( $type !== RC_LOG ||
508  ) {
509  if ( $this->fld_title ) {
511  }
512  if ( $this->fld_ids ) {
513  $vals['pageid'] = intval( $row->rc_cur_id );
514  $vals['revid'] = intval( $row->rc_this_oldid );
515  $vals['old_revid'] = intval( $row->rc_last_oldid );
516  }
517  }
518  }
519 
520  if ( $this->fld_ids ) {
521  $vals['rcid'] = intval( $row->rc_id );
522  }
523 
524  /* Add user data and 'anon' flag, if user is anonymous. */
525  if ( $this->fld_user || $this->fld_userid ) {
526  if ( $row->rc_deleted & RevisionRecord::DELETED_USER ) {
527  $vals['userhidden'] = true;
528  $anyHidden = true;
529  }
530  if ( RevisionRecord::userCanBitfield( $row->rc_deleted, RevisionRecord::DELETED_USER, $user ) ) {
531  if ( $this->fld_user ) {
532  $vals['user'] = $row->rc_user_text;
533  }
534 
535  if ( $this->fld_userid ) {
536  $vals['userid'] = (int)$row->rc_user;
537  }
538 
539  if ( !$row->rc_user ) {
540  $vals['anon'] = true;
541  }
542  }
543  }
544 
545  /* Add flags, such as new, minor, bot. */
546  if ( $this->fld_flags ) {
547  $vals['bot'] = (bool)$row->rc_bot;
548  $vals['new'] = $row->rc_type == RC_NEW;
549  $vals['minor'] = (bool)$row->rc_minor;
550  }
551 
552  /* Add sizes of each revision. (Only available on 1.10+) */
553  if ( $this->fld_sizes ) {
554  $vals['oldlen'] = intval( $row->rc_old_len );
555  $vals['newlen'] = intval( $row->rc_new_len );
556  }
557 
558  /* Add the timestamp. */
559  if ( $this->fld_timestamp ) {
560  $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $row->rc_timestamp );
561  }
562 
563  /* Add edit summary / log summary. */
564  if ( $this->fld_comment || $this->fld_parsedcomment ) {
565  if ( $row->rc_deleted & RevisionRecord::DELETED_COMMENT ) {
566  $vals['commenthidden'] = true;
567  $anyHidden = true;
568  }
569  if ( RevisionRecord::userCanBitfield(
570  $row->rc_deleted, RevisionRecord::DELETED_COMMENT, $user
571  ) ) {
572  $comment = $this->commentStore->getComment( 'rc_comment', $row )->text;
573  if ( $this->fld_comment ) {
574  $vals['comment'] = $comment;
575  }
576 
577  if ( $this->fld_parsedcomment ) {
578  $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
579  }
580  }
581  }
582 
583  if ( $this->fld_redirect ) {
584  $vals['redirect'] = (bool)$row->page_is_redirect;
585  }
586 
587  /* Add the patrolled flag */
588  if ( $this->fld_patrolled ) {
589  $vals['patrolled'] = $row->rc_patrolled != RecentChange::PRC_UNPATROLLED;
590  $vals['unpatrolled'] = ChangesList::isUnpatrolled( $row, $user );
591  $vals['autopatrolled'] = $row->rc_patrolled == RecentChange::PRC_AUTOPATROLLED;
592  }
593 
594  if ( $this->fld_loginfo && $row->rc_type == RC_LOG ) {
595  if ( $row->rc_deleted & LogPage::DELETED_ACTION ) {
596  $vals['actionhidden'] = true;
597  $anyHidden = true;
598  }
599  if ( LogEventsList::userCanBitfield( $row->rc_deleted, LogPage::DELETED_ACTION, $user ) ) {
600  $vals['logid'] = intval( $row->rc_logid );
601  $vals['logtype'] = $row->rc_log_type;
602  $vals['logaction'] = $row->rc_log_action;
603  $vals['logparams'] = LogFormatter::newFromRow( $row )->formatParametersForApi();
604  }
605  }
606 
607  if ( $this->fld_tags ) {
608  if ( $row->ts_tags ) {
609  $tags = explode( ',', $row->ts_tags );
610  ApiResult::setIndexedTagName( $tags, 'tag' );
611  $vals['tags'] = $tags;
612  } else {
613  $vals['tags'] = [];
614  }
615  }
616 
617  if ( $this->fld_sha1 && $row->rev_sha1 !== null ) {
618  if ( $row->rev_deleted & RevisionRecord::DELETED_TEXT ) {
619  $vals['sha1hidden'] = true;
620  $anyHidden = true;
621  }
622  if ( RevisionRecord::userCanBitfield(
623  $row->rev_deleted, RevisionRecord::DELETED_TEXT, $user
624  ) ) {
625  if ( $row->rev_sha1 !== '' ) {
626  $vals['sha1'] = Wikimedia\base_convert( $row->rev_sha1, 36, 16, 40 );
627  } else {
628  $vals['sha1'] = '';
629  }
630  }
631  }
632 
633  if ( !is_null( $this->token ) ) {
635  foreach ( $this->token as $t ) {
636  $val = call_user_func( $tokenFunctions[$t], $row->rc_cur_id,
637  $title, RecentChange::newFromRow( $row ) );
638  if ( $val === false ) {
639  $this->addWarning( [ 'apiwarn-tokennotallowed', $t ] );
640  } else {
641  $vals[$t . 'token'] = $val;
642  }
643  }
644  }
645 
646  if ( $anyHidden && ( $row->rc_deleted & RevisionRecord::DELETED_RESTRICTED ) ) {
647  $vals['suppressed'] = true;
648  }
649 
650  return $vals;
651  }
652 
653  public function getCacheMode( $params ) {
654  if ( isset( $params['show'] ) ) {
655  foreach ( $params['show'] as $show ) {
656  if ( $show === 'patrolled' || $show === '!patrolled' ) {
657  return 'private';
658  }
659  }
660  }
661  if ( isset( $params['token'] ) ) {
662  return 'private';
663  }
664  if ( $this->userCanSeeRevDel() ) {
665  return 'private';
666  }
667  if ( !is_null( $params['prop'] ) && in_array( 'parsedcomment', $params['prop'] ) ) {
668  // formatComment() calls wfMessage() among other things
669  return 'anon-public-user-private';
670  }
671 
672  return 'public';
673  }
674 
675  public function getAllowedParams() {
676  return [
677  'start' => [
678  ApiBase::PARAM_TYPE => 'timestamp'
679  ],
680  'end' => [
681  ApiBase::PARAM_TYPE => 'timestamp'
682  ],
683  'dir' => [
684  ApiBase::PARAM_DFLT => 'older',
686  'newer',
687  'older'
688  ],
689  ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
690  ],
691  'namespace' => [
692  ApiBase::PARAM_ISMULTI => true,
693  ApiBase::PARAM_TYPE => 'namespace',
695  ],
696  'user' => [
697  ApiBase::PARAM_TYPE => 'user'
698  ],
699  'excludeuser' => [
700  ApiBase::PARAM_TYPE => 'user'
701  ],
702  'tag' => null,
703  'prop' => [
704  ApiBase::PARAM_ISMULTI => true,
705  ApiBase::PARAM_DFLT => 'title|timestamp|ids',
707  'user',
708  'userid',
709  'comment',
710  'parsedcomment',
711  'flags',
712  'timestamp',
713  'title',
714  'ids',
715  'sizes',
716  'redirect',
717  'patrolled',
718  'loginfo',
719  'tags',
720  'sha1',
721  ],
723  ],
724  'token' => [
726  ApiBase::PARAM_TYPE => array_keys( $this->getTokenFunctions() ),
728  ],
729  'show' => [
730  ApiBase::PARAM_ISMULTI => true,
732  'minor',
733  '!minor',
734  'bot',
735  '!bot',
736  'anon',
737  '!anon',
738  'redirect',
739  '!redirect',
740  'patrolled',
741  '!patrolled',
742  'unpatrolled',
743  'autopatrolled',
744  '!autopatrolled',
745  ]
746  ],
747  'limit' => [
748  ApiBase::PARAM_DFLT => 10,
749  ApiBase::PARAM_TYPE => 'limit',
750  ApiBase::PARAM_MIN => 1,
753  ],
754  'type' => [
755  ApiBase::PARAM_DFLT => 'edit|new|log|categorize',
756  ApiBase::PARAM_ISMULTI => true,
758  ],
759  'toponly' => false,
760  'title' => null,
761  'continue' => [
762  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
763  ],
764  'generaterevisions' => false,
765  ];
766  }
767 
768  protected function getExamplesMessages() {
769  return [
770  'action=query&list=recentchanges'
771  => 'apihelp-query+recentchanges-example-simple',
772  'action=query&generator=recentchanges&grcshow=!patrolled&prop=info'
773  => 'apihelp-query+recentchanges-example-generator',
774  ];
775  }
776 
777  public function getHelpUrls() {
778  return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Recentchanges';
779  }
780 }
ApiQueryRecentChanges\getPatrolToken
static getPatrolToken( $pageid, $title, $rc=null)
Definition: ApiQueryRecentChanges.php:82
ApiQueryRecentChanges\run
run( $resultPageSet=null)
Generates and outputs the result of this query based upon the provided parameters.
Definition: ApiQueryRecentChanges.php:145
ApiQueryRecentChanges\$fld_comment
$fld_comment
Definition: ApiQueryRecentChanges.php:41
$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:244
if
if($IP===false)
Definition: cleanupArchiveUserText.php:4
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:280
ApiQueryBase\processRow
processRow( $row, array &$data, array &$hookData)
Call the ApiQueryBaseProcessRow hook.
Definition: ApiQueryBase.php:400
ApiQueryBase\addFields
addFields( $value)
Add a set of fields to select to the internal array.
Definition: ApiQueryBase.php:192
ApiQueryRecentChanges\$fld_ids
$fld_ids
Definition: ApiQueryRecentChanges.php:42
ApiQuery
This is the main query class.
Definition: ApiQuery.php:36
Revision\RevisionRecord
Page revision base class.
Definition: RevisionRecord.php:45
ApiBase\addWarning
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
Definition: ApiBase.php:1906
ApiQueryRecentChanges
A query action to enumerate the recent changes that were done to the wiki.
Definition: ApiQueryRecentChanges.php:33
ApiQueryRecentChanges\extractRowInfo
extractRowInfo( $row)
Extracts from a single sql row the data needed to describe one recent change.
Definition: ApiQueryRecentChanges.php:487
ApiQueryRecentChanges\$commentStore
$commentStore
Definition: ApiQueryRecentChanges.php:39
captcha-old.count
count
Definition: captcha-old.py:249
ApiBase\dieWithError
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition: ApiBase.php:1987
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:313
ApiBase\PARAM_HELP_MSG
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition: ApiBase.php:124
$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. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUnknownUser':When a user doesn 't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false. $name:User name 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. '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 '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 '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 '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. '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 IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() '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 Sanitizer::validateEmail(), 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. 'LanguageGetMagic':DEPRECATED since 1.16! 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) '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 '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:Array with elements of the form "language:title" in the order that they will be output. & $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. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED since 1.28! Use HtmlPageLinkRendererBegin instead. 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:2034
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1954
ApiQueryRecentChanges\getTokenFunctions
getTokenFunctions()
Get an array mapping token names to their handler functions.
Definition: ApiQueryRecentChanges.php:55
ApiBase\PARAM_TYPE
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
Definition: ApiBase.php:87
ApiBase\getResult
getResult()
Get the result object.
Definition: ApiBase.php:659
RC_LOG
const RC_LOG
Definition: Defines.php:144
ApiQueryRecentChanges\$fld_sizes
$fld_sizes
Definition: ApiQueryRecentChanges.php:43
ApiQueryRecentChanges\execute
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Definition: ApiQueryRecentChanges.php:132
RecentChange\getChangeTypes
static getChangeTypes()
Get an array of all change types.
Definition: RecentChange.php:181
$params
$params
Definition: styleTest.css.php:44
ApiQueryRecentChanges\$fld_userid
$fld_userid
Definition: ApiQueryRecentChanges.php:41
MIGRATION_WRITE_BOTH
const MIGRATION_WRITE_BOTH
Definition: Defines.php:316
RC_EDIT
const RC_EDIT
Definition: Defines.php:142
User\newFromName
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
Definition: User.php:592
$res
$res
Definition: database.txt:21
ContextSource\getRequest
getRequest()
Definition: ContextSource.php:71
ApiQueryBase\addOption
addOption( $name, $value=null)
Add an option such as LIMIT or USE INDEX.
Definition: ApiQueryBase.php:325
RecentChange\parseToRCType
static parseToRCType( $type)
Parsing text to RC_* constants.
Definition: RecentChange.php:148
ContextSource\getUser
getUser()
Definition: ContextSource.php:120
ApiBase\lacksSameOriginSecurity
lacksSameOriginSecurity()
Returns true if the current request breaks the same-origin policy.
Definition: ApiBase.php:587
ActorMigration\newMigration
static newMigration()
Static constructor.
Definition: ActorMigration.php:111
ApiQueryBase\addFieldsIf
addFieldsIf( $value, $condition)
Same as addFields(), but add the fields only if a condition is met.
Definition: ApiQueryBase.php:206
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
ApiQueryRecentChanges\$fld_redirect
$fld_redirect
Definition: ApiQueryRecentChanges.php:43
ApiQueryGeneratorBase\setContinueEnumParameter
setContinueEnumParameter( $paramName, $paramValue)
Overridden to set the generator param if in generator mode.
Definition: ApiQueryGeneratorBase.php:84
ApiBase\PARAM_DEPRECATED
const PARAM_DEPRECATED
(boolean) Is the parameter deprecated (will show a warning)?
Definition: ApiBase.php:105
$query
null for the wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition: hooks.txt:1627
NS_SPECIAL
const NS_SPECIAL
Definition: Defines.php:53
ApiQueryRecentChanges\getAllowedParams
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Definition: ApiQueryRecentChanges.php:675
ApiBase\PARAM_MIN
const PARAM_MIN
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition: ApiBase.php:99
ApiQueryRecentChanges\$fld_flags
$fld_flags
Definition: ApiQueryRecentChanges.php:42
LIST_OR
const LIST_OR
Definition: Defines.php:46
$title
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:964
$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
LogFormatter\newFromRow
static newFromRow( $row)
Handy shortcut for constructing a formatter directly from database row.
Definition: LogFormatter.php:76
ApiQueryRecentChanges\executeGenerator
executeGenerator( $resultPageSet)
Execute this module as a generator.
Definition: ApiQueryRecentChanges.php:136
ApiBase\LIMIT_BIG1
const LIMIT_BIG1
Fast query, standard limit.
Definition: ApiBase.php:252
ApiQueryRecentChanges\$fld_title
$fld_title
Definition: ApiQueryRecentChanges.php:42
ApiQueryRecentChanges\$fld_parsedcomment
$fld_parsedcomment
Definition: ApiQueryRecentChanges.php:41
ApiQueryBase\getDB
getDB()
Get the Query database connection (read-only)
Definition: ApiQueryBase.php:105
ApiBase\PARAM_MAX
const PARAM_MAX
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition: ApiBase.php:90
RecentChange\newFromRow
static newFromRow( $row)
Definition: RecentChange.php:134
ApiQueryBase\addTables
addTables( $tables, $alias=null)
Add a set of tables to the internal array.
Definition: ApiQueryBase.php:158
ApiQueryBase\select
select( $method, $extraQuery=[], array &$hookData=null)
Execute a SELECT query based on the values in the internal arrays.
Definition: ApiQueryBase.php:350
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
ApiQueryRecentChanges\$fld_user
$fld_user
Definition: ApiQueryRecentChanges.php:41
ApiBase\extractRequestParams
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Definition: ApiBase.php:770
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:545
ApiBase\PARAM_EXTRA_NAMESPACES
const PARAM_EXTRA_NAMESPACES
(int[]) When PARAM_TYPE is 'namespace', include these as additional possible values.
Definition: ApiBase.php:186
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition: LogPage.php:34
ApiQueryRecentChanges\__construct
__construct(ApiQuery $query, $moduleName)
Definition: ApiQueryRecentChanges.php:35
$wgChangeTagsSchemaMigrationStage
int $wgChangeTagsSchemaMigrationStage
change_tag table schema migration stage.
Definition: DefaultSettings.php:9020
ApiBase\getContinuationManager
getContinuationManager()
Get the continuation manager.
Definition: ApiBase.php:699
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:616
$e
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
Definition: hooks.txt:2213
NS_MEDIA
const NS_MEDIA
Definition: Defines.php:52
ApiBase\dieContinueUsageIf
dieContinueUsageIf( $condition)
Die with the 'badcontinue' error.
Definition: ApiBase.php:2155
ApiQueryRecentChanges\initProperties
initProperties( $prop)
Sets internal state to include the desired properties in the output.
Definition: ApiQueryRecentChanges.php:115
ApiQueryBase\addJoinConds
addJoinConds( $join_conds)
Add a set of JOIN conditions to the internal array.
Definition: ApiQueryBase.php:181
wfEscapeWikiText
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Definition: GlobalFunctions.php:1617
ApiQueryBase\addWhereFld
addWhereFld( $field, $value)
Equivalent to addWhere(array($field => $value))
Definition: ApiQueryBase.php:260
RC_NEW
const RC_NEW
Definition: Defines.php:143
ApiBase\requireMaxOneParameter
requireMaxOneParameter( $params, $required)
Die if more than one of a certain set of parameters is set and not false.
Definition: ApiBase.php:939
RecentChange\PRC_AUTOPATROLLED
const PRC_AUTOPATROLLED
Definition: RecentChange.php:79
Linker\formatComment
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Definition: Linker.php:1088
ApiQueryGeneratorBase
Definition: ApiQueryGeneratorBase.php:26
ApiQueryRecentChanges\$fld_tags
$fld_tags
Definition: ApiQueryRecentChanges.php:44
ApiQueryRecentChanges\$fld_patrolled
$fld_patrolled
Definition: ApiQueryRecentChanges.php:43
ApiQueryRecentChanges\getHelpUrls
getHelpUrls()
Return links to more detailed help pages about the module.
Definition: ApiQueryRecentChanges.php:777
ApiQueryRecentChanges\getExamplesMessages
getExamplesMessages()
Returns usage examples for this module.
Definition: ApiQueryRecentChanges.php:768
ApiBase\LIMIT_BIG2
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition: ApiBase.php:254
ApiQueryRecentChanges\$fld_loginfo
$fld_loginfo
Definition: ApiQueryRecentChanges.php:43
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:554
RecentChange\parseFromRCType
static parseFromRCType( $rcType)
Parsing RC_* constants to human-readable test.
Definition: RecentChange.php:170
ApiQueryRecentChanges\$fld_timestamp
$fld_timestamp
Definition: ApiQueryRecentChanges.php:42
ApiBase\PARAM_DFLT
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition: ApiBase.php:48
RecentChange\PRC_UNPATROLLED
const PRC_UNPATROLLED
Definition: RecentChange.php:77
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:539
MediaWiki\Storage\NameTableAccessException
Exception representing a failure to look up a row from a name table.
Definition: NameTableAccessException.php:32
ApiBase\PARAM_ISMULTI
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition: ApiBase.php:51
ApiBase\PARAM_MAX2
const PARAM_MAX2
(integer) Max value allowed for the parameter for users with the apihighlimits right,...
Definition: ApiBase.php:96
true
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
Definition: hooks.txt:2036
LogPage\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: LogPage.php:37
ApiQueryBase\addWhere
addWhere( $value)
Add a set of WHERE clauses to the internal array.
Definition: ApiQueryBase.php:227
class
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52
ChangesList\isUnpatrolled
static isUnpatrolled( $rc, User $user)
Definition: ChangesList.php:738
$t
$t
Definition: testCompression.php:69
MediaWikiServices
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
Definition: injection.txt:23
ApiQueryRecentChanges\$token
$token
Definition: ApiQueryRecentChanges.php:44
ApiBase\PARAM_HELP_MSG_PER_VALUE
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
Definition: ApiBase.php:157
CommentStore\getStore
static getStore()
Definition: CommentStore.php:125
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:200
ApiQueryBase\userCanSeeRevDel
userCanSeeRevDel()
Check whether the current user has permission to view revision-deleted fields.
Definition: ApiQueryBase.php:607
ApiBase\dieDebug
static dieDebug( $method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:2167
ApiQueryRecentChanges\getCacheMode
getCacheMode( $params)
Get the cache mode for the data generated by this module.
Definition: ApiQueryRecentChanges.php:653
ApiQueryBase\addWhereIf
addWhereIf( $value, $condition)
Same as addWhere(), but add the WHERE clauses only if a condition is met.
Definition: ApiQueryBase.php:245
ApiQueryBase\addTitleInfo
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
Definition: ApiQueryBase.php:487
$type
$type
Definition: testCompression.php:48
ApiQueryRecentChanges\$fld_sha1
$fld_sha1
Definition: ApiQueryRecentChanges.php:44
ApiQueryRecentChanges\$tokenFunctions
$tokenFunctions
Definition: ApiQueryRecentChanges.php:46