MediaWiki  1.28.1
ApiQueryWatchlist.php
Go to the documentation of this file.
1 <?php
28 
36 
37  public function __construct( ApiQuery $query, $moduleName ) {
38  parent::__construct( $query, $moduleName, 'wl' );
39  }
40 
41  public function execute() {
42  $this->run();
43  }
44 
45  public function executeGenerator( $resultPageSet ) {
46  $this->run( $resultPageSet );
47  }
48 
49  private $fld_ids = false, $fld_title = false, $fld_patrol = false,
50  $fld_flags = false, $fld_timestamp = false, $fld_user = false,
51  $fld_comment = false, $fld_parsedcomment = false, $fld_sizes = false,
53  $fld_loginfo = false;
54 
59  private function run( $resultPageSet = null ) {
60  $this->selectNamedDB( 'watchlist', DB_REPLICA, 'watchlist' );
61 
62  $params = $this->extractRequestParams();
63 
64  $user = $this->getUser();
65  $wlowner = $this->getWatchlistUser( $params );
66 
67  if ( !is_null( $params['prop'] ) && is_null( $resultPageSet ) ) {
68  $prop = array_flip( $params['prop'] );
69 
70  $this->fld_ids = isset( $prop['ids'] );
71  $this->fld_title = isset( $prop['title'] );
72  $this->fld_flags = isset( $prop['flags'] );
73  $this->fld_user = isset( $prop['user'] );
74  $this->fld_userid = isset( $prop['userid'] );
75  $this->fld_comment = isset( $prop['comment'] );
76  $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
77  $this->fld_timestamp = isset( $prop['timestamp'] );
78  $this->fld_sizes = isset( $prop['sizes'] );
79  $this->fld_patrol = isset( $prop['patrol'] );
80  $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] );
81  $this->fld_loginfo = isset( $prop['loginfo'] );
82 
83  if ( $this->fld_patrol ) {
84  if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
85  $this->dieUsage( 'patrol property is not available', 'patrol' );
86  }
87  }
88  }
89 
90  $options = [
91  'dir' => $params['dir'] === 'older'
94  ];
95 
96  if ( is_null( $resultPageSet ) ) {
97  $options['includeFields'] = $this->getFieldsToInclude();
98  } else {
99  $options['usedInGenerator'] = true;
100  }
101 
102  if ( $params['start'] ) {
103  $options['start'] = $params['start'];
104  }
105  if ( $params['end'] ) {
106  $options['end'] = $params['end'];
107  }
108 
109  if ( !is_null( $params['continue'] ) ) {
110  $cont = explode( '|', $params['continue'] );
111  $this->dieContinueUsageIf( count( $cont ) != 2 );
112  $continueTimestamp = $cont[0];
113  $continueId = (int)$cont[1];
114  $this->dieContinueUsageIf( $continueId != $cont[1] );
115  $options['startFrom'] = [ $continueTimestamp, $continueId ];
116  }
117 
118  if ( $wlowner !== $user ) {
119  $options['watchlistOwner'] = $wlowner;
120  $options['watchlistOwnerToken'] = $params['token'];
121  }
122 
123  if ( !is_null( $params['namespace'] ) ) {
124  $options['namespaceIds'] = $params['namespace'];
125  }
126 
127  if ( $params['allrev'] ) {
128  $options['allRevisions'] = true;
129  }
130 
131  if ( !is_null( $params['show'] ) ) {
132  $show = array_flip( $params['show'] );
133 
134  /* Check for conflicting parameters. */
135  if ( $this->showParamsConflicting( $show ) ) {
136  $this->dieUsageMsg( 'show' );
137  }
138 
139  // Check permissions.
140  if ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
142  ) {
143  if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) {
144  $this->dieUsage(
145  'You need the patrol right to request the patrolled flag',
146  'permissiondenied'
147  );
148  }
149  }
150 
151  $options['filters'] = array_keys( $show );
152  }
153 
154  if ( !is_null( $params['type'] ) ) {
155  try {
156  $options['rcTypes'] = RecentChange::parseToRCType( $params['type'] );
157  } catch ( Exception $e ) {
158  ApiBase::dieDebug( __METHOD__, $e->getMessage() );
159  }
160  }
161 
162  if ( !is_null( $params['user'] ) && !is_null( $params['excludeuser'] ) ) {
163  $this->dieUsage( 'user and excludeuser cannot be used together', 'user-excludeuser' );
164  }
165  if ( !is_null( $params['user'] ) ) {
166  $options['onlyByUser'] = $params['user'];
167  }
168  if ( !is_null( $params['excludeuser'] ) ) {
169  $options['notByUser'] = $params['excludeuser'];
170  }
171 
172  $options['limit'] = $params['limit'] + 1;
173 
174  $ids = [];
175  $count = 0;
176  $watchedItemQuery = MediaWikiServices::getInstance()->getWatchedItemQueryService();
177  $items = $watchedItemQuery->getWatchedItemsWithRecentChangeInfo( $wlowner, $options );
178 
179  foreach ( $items as list ( $watchedItem, $recentChangeInfo ) ) {
181  if ( ++$count > $params['limit'] ) {
182  // We've reached the one extra which shows that there are
183  // additional pages to be had. Stop here...
185  'continue',
186  $recentChangeInfo['rc_timestamp'] . '|' . $recentChangeInfo['rc_id']
187  );
188  break;
189  }
190 
191  if ( is_null( $resultPageSet ) ) {
192  $vals = $this->extractOutputData( $watchedItem, $recentChangeInfo );
193  $fit = $this->getResult()->addValue( [ 'query', $this->getModuleName() ], null, $vals );
194  if ( !$fit ) {
196  'continue',
197  $recentChangeInfo['rc_timestamp'] . '|' . $recentChangeInfo['rc_id']
198  );
199  break;
200  }
201  } else {
202  if ( $params['allrev'] ) {
203  $ids[] = intval( $recentChangeInfo['rc_this_oldid'] );
204  } else {
205  $ids[] = intval( $recentChangeInfo['rc_cur_id'] );
206  }
207  }
208  }
209 
210  if ( is_null( $resultPageSet ) ) {
211  $this->getResult()->addIndexedTagName(
212  [ 'query', $this->getModuleName() ],
213  'item'
214  );
215  } elseif ( $params['allrev'] ) {
216  $resultPageSet->populateFromRevisionIDs( $ids );
217  } else {
218  $resultPageSet->populateFromPageIDs( $ids );
219  }
220  }
221 
222  private function getFieldsToInclude() {
223  $includeFields = [];
224  if ( $this->fld_flags ) {
225  $includeFields[] = WatchedItemQueryService::INCLUDE_FLAGS;
226  }
227  if ( $this->fld_user || $this->fld_userid ) {
228  $includeFields[] = WatchedItemQueryService::INCLUDE_USER_ID;
229  }
230  if ( $this->fld_user ) {
231  $includeFields[] = WatchedItemQueryService::INCLUDE_USER;
232  }
233  if ( $this->fld_comment || $this->fld_parsedcomment ) {
234  $includeFields[] = WatchedItemQueryService::INCLUDE_COMMENT;
235  }
236  if ( $this->fld_patrol ) {
238  }
239  if ( $this->fld_sizes ) {
240  $includeFields[] = WatchedItemQueryService::INCLUDE_SIZES;
241  }
242  if ( $this->fld_loginfo ) {
244  }
245  return $includeFields;
246  }
247 
248  private function showParamsConflicting( array $show ) {
249  return ( isset( $show[WatchedItemQueryService::FILTER_MINOR] )
250  && isset( $show[WatchedItemQueryService::FILTER_NOT_MINOR] ) )
251  || ( isset( $show[WatchedItemQueryService::FILTER_BOT] )
252  && isset( $show[WatchedItemQueryService::FILTER_NOT_BOT] ) )
253  || ( isset( $show[WatchedItemQueryService::FILTER_ANON] )
254  && isset( $show[WatchedItemQueryService::FILTER_NOT_ANON] ) )
255  || ( isset( $show[WatchedItemQueryService::FILTER_PATROLLED] )
257  || ( isset( $show[WatchedItemQueryService::FILTER_UNREAD] )
258  && isset( $show[WatchedItemQueryService::FILTER_NOT_UNREAD] ) );
259  }
260 
261  private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
262  /* Determine the title of the page that has been changed. */
264  $watchedItem->getLinkTarget()->getNamespace(),
265  $watchedItem->getLinkTarget()->getDBkey()
266  );
267  $user = $this->getUser();
268 
269  /* Our output data. */
270  $vals = [];
271  $type = intval( $recentChangeInfo['rc_type'] );
272  $vals['type'] = RecentChange::parseFromRCType( $type );
273  $anyHidden = false;
274 
275  /* Create a new entry in the result for the title. */
276  if ( $this->fld_title || $this->fld_ids ) {
277  // These should already have been filtered out of the query, but just in case.
278  if ( $type === RC_LOG && ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) ) {
279  $vals['actionhidden'] = true;
280  $anyHidden = true;
281  }
282  if ( $type !== RC_LOG ||
284  $recentChangeInfo['rc_deleted'],
285  LogPage::DELETED_ACTION,
286  $user
287  )
288  ) {
289  if ( $this->fld_title ) {
291  }
292  if ( $this->fld_ids ) {
293  $vals['pageid'] = intval( $recentChangeInfo['rc_cur_id'] );
294  $vals['revid'] = intval( $recentChangeInfo['rc_this_oldid'] );
295  $vals['old_revid'] = intval( $recentChangeInfo['rc_last_oldid'] );
296  }
297  }
298  }
299 
300  /* Add user data and 'anon' flag, if user is anonymous. */
301  if ( $this->fld_user || $this->fld_userid ) {
302  if ( $recentChangeInfo['rc_deleted'] & Revision::DELETED_USER ) {
303  $vals['userhidden'] = true;
304  $anyHidden = true;
305  }
307  $recentChangeInfo['rc_deleted'],
308  Revision::DELETED_USER,
309  $user
310  ) ) {
311  if ( $this->fld_userid ) {
312  $vals['userid'] = (int)$recentChangeInfo['rc_user'];
313  // for backwards compatibility
314  $vals['user'] = (int)$recentChangeInfo['rc_user'];
315  }
316 
317  if ( $this->fld_user ) {
318  $vals['user'] = $recentChangeInfo['rc_user_text'];
319  }
320 
321  if ( !$recentChangeInfo['rc_user'] ) {
322  $vals['anon'] = true;
323  }
324  }
325  }
326 
327  /* Add flags, such as new, minor, bot. */
328  if ( $this->fld_flags ) {
329  $vals['bot'] = (bool)$recentChangeInfo['rc_bot'];
330  $vals['new'] = $recentChangeInfo['rc_type'] == RC_NEW;
331  $vals['minor'] = (bool)$recentChangeInfo['rc_minor'];
332  }
333 
334  /* Add sizes of each revision. (Only available on 1.10+) */
335  if ( $this->fld_sizes ) {
336  $vals['oldlen'] = intval( $recentChangeInfo['rc_old_len'] );
337  $vals['newlen'] = intval( $recentChangeInfo['rc_new_len'] );
338  }
339 
340  /* Add the timestamp. */
341  if ( $this->fld_timestamp ) {
342  $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $recentChangeInfo['rc_timestamp'] );
343  }
344 
345  if ( $this->fld_notificationtimestamp ) {
346  $vals['notificationtimestamp'] = ( $watchedItem->getNotificationTimestamp() == null )
347  ? ''
348  : wfTimestamp( TS_ISO_8601, $watchedItem->getNotificationTimestamp() );
349  }
350 
351  /* Add edit summary / log summary. */
352  if ( $this->fld_comment || $this->fld_parsedcomment ) {
353  if ( $recentChangeInfo['rc_deleted'] & Revision::DELETED_COMMENT ) {
354  $vals['commenthidden'] = true;
355  $anyHidden = true;
356  }
358  $recentChangeInfo['rc_deleted'],
359  Revision::DELETED_COMMENT,
360  $user
361  ) ) {
362  if ( $this->fld_comment && isset( $recentChangeInfo['rc_comment'] ) ) {
363  $vals['comment'] = $recentChangeInfo['rc_comment'];
364  }
365 
366  if ( $this->fld_parsedcomment && isset( $recentChangeInfo['rc_comment'] ) ) {
367  $vals['parsedcomment'] = Linker::formatComment( $recentChangeInfo['rc_comment'], $title );
368  }
369  }
370  }
371 
372  /* Add the patrolled flag */
373  if ( $this->fld_patrol ) {
374  $vals['patrolled'] = $recentChangeInfo['rc_patrolled'] == 1;
375  $vals['unpatrolled'] = ChangesList::isUnpatrolled( (object)$recentChangeInfo, $user );
376  }
377 
378  if ( $this->fld_loginfo && $recentChangeInfo['rc_type'] == RC_LOG ) {
379  if ( $recentChangeInfo['rc_deleted'] & LogPage::DELETED_ACTION ) {
380  $vals['actionhidden'] = true;
381  $anyHidden = true;
382  }
384  $recentChangeInfo['rc_deleted'],
385  LogPage::DELETED_ACTION,
386  $user
387  ) ) {
388  $vals['logid'] = intval( $recentChangeInfo['rc_logid'] );
389  $vals['logtype'] = $recentChangeInfo['rc_log_type'];
390  $vals['logaction'] = $recentChangeInfo['rc_log_action'];
391  $vals['logparams'] = LogFormatter::newFromRow( $recentChangeInfo )->formatParametersForApi();
392  }
393  }
394 
395  if ( $anyHidden && ( $recentChangeInfo['rc_deleted'] & Revision::DELETED_RESTRICTED ) ) {
396  $vals['suppressed'] = true;
397  }
398 
399  return $vals;
400  }
401 
402  public function getAllowedParams() {
403  return [
404  'allrev' => false,
405  'start' => [
406  ApiBase::PARAM_TYPE => 'timestamp'
407  ],
408  'end' => [
409  ApiBase::PARAM_TYPE => 'timestamp'
410  ],
411  'namespace' => [
412  ApiBase::PARAM_ISMULTI => true,
413  ApiBase::PARAM_TYPE => 'namespace'
414  ],
415  'user' => [
416  ApiBase::PARAM_TYPE => 'user',
417  ],
418  'excludeuser' => [
419  ApiBase::PARAM_TYPE => 'user',
420  ],
421  'dir' => [
422  ApiBase::PARAM_DFLT => 'older',
424  'newer',
425  'older'
426  ],
427  ApiHelp::PARAM_HELP_MSG => 'api-help-param-direction',
428  ],
429  'limit' => [
430  ApiBase::PARAM_DFLT => 10,
431  ApiBase::PARAM_TYPE => 'limit',
432  ApiBase::PARAM_MIN => 1,
435  ],
436  'prop' => [
437  ApiBase::PARAM_ISMULTI => true,
438  ApiBase::PARAM_DFLT => 'ids|title|flags',
441  'ids',
442  'title',
443  'flags',
444  'user',
445  'userid',
446  'comment',
447  'parsedcomment',
448  'timestamp',
449  'patrol',
450  'sizes',
451  'notificationtimestamp',
452  'loginfo',
453  ]
454  ],
455  'show' => [
456  ApiBase::PARAM_ISMULTI => true,
468  ]
469  ],
470  'type' => [
471  ApiBase::PARAM_DFLT => 'edit|new|log|categorize',
472  ApiBase::PARAM_ISMULTI => true,
475  ],
476  'owner' => [
477  ApiBase::PARAM_TYPE => 'user'
478  ],
479  'token' => [
480  ApiBase::PARAM_TYPE => 'string',
481  ApiBase::PARAM_SENSITIVE => true,
482  ],
483  'continue' => [
484  ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
485  ],
486  ];
487  }
488 
489  protected function getExamplesMessages() {
490  return [
491  'action=query&list=watchlist'
492  => 'apihelp-query+watchlist-example-simple',
493  'action=query&list=watchlist&wlprop=ids|title|timestamp|user|comment'
494  => 'apihelp-query+watchlist-example-props',
495  'action=query&list=watchlist&wlallrev=&wlprop=ids|title|timestamp|user|comment'
496  => 'apihelp-query+watchlist-example-allrev',
497  'action=query&generator=watchlist&prop=info'
498  => 'apihelp-query+watchlist-example-generator',
499  'action=query&generator=watchlist&gwlallrev=&prop=revisions&rvprop=timestamp|user'
500  => 'apihelp-query+watchlist-example-generator-rev',
501  'action=query&list=watchlist&wlowner=Example&wltoken=123ABC'
502  => 'apihelp-query+watchlist-example-wlowner',
503  ];
504  }
505 
506  public function getHelpUrls() {
507  return 'https://www.mediawiki.org/wiki/API:Watchlist';
508  }
509 }
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below...
Definition: ApiBase.php:88
__construct(ApiQuery $query, $moduleName)
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition: ApiBase.php:186
getNotificationTimestamp()
Get the notification timestamp of this entry.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
the array() calling protocol came about after MediaWiki 1.4rc1.
static newFromRow($row)
Handy shortcut for constructing a formatter directly from database row.
null for the local 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:1555
getResult()
Get the result object.
Definition: ApiBase.php:584
static getChangeTypes()
Get an array of all change types.
getWatchlistUser($params)
Gets the user for whom to get the watchlist.
Definition: ApiBase.php:1465
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException'returning false will NOT prevent logging $e
Definition: hooks.txt:2102
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition: ApiBase.php:50
const LIMIT_BIG1
Fast query, standard limit.
Definition: ApiBase.php:184
const PARAM_MAX
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition: ApiBase.php:91
extractRequestParams($parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user...
Definition: ApiBase.php:685
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
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
run($resultPageSet=null)
setContinueEnumParameter($paramName, $paramValue)
Overridden to set the generator param if in generator mode.
const TS_ISO_8601
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.
Definition: defines.php:28
executeGenerator($resultPageSet)
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
showParamsConflicting(array $show)
$params
const DELETED_RESTRICTED
Definition: Revision.php:88
Representation of a pair of user and title for watchlist entries.
Definition: WatchedItem.php:32
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:953
getModuleName()
Get the name of the module being executed by this instance.
Definition: ApiBase.php:464
const PARAM_MAX2
(integer) Max value allowed for the parameter for users with the apihighlimits right, for PARAM_TYPE 'limit'.
Definition: ApiBase.php:97
This is the main query class.
Definition: ApiQuery.php:38
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
dieContinueUsageIf($condition)
Die with the $prefix.
Definition: ApiBase.php:2240
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:1180
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter...
Definition: ApiBase.php:125
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 local account $user
Definition: hooks.txt:242
This query action allows clients to retrieve a list of recently modified pages that are part of the l...
static parseFromRCType($rcType)
Parsing RC_* constants to human-readable test.
const PARAM_SENSITIVE
(boolean) Is the parameter sensitive? Note 'password'-type fields are always sensitive regardless of ...
Definition: ApiBase.php:179
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
const DELETED_USER
Definition: Revision.php:87
static userCanBitfield($bitfield, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row, if it's marked as deleted.
extractOutputData(WatchedItem $watchedItem, array $recentChangeInfo)
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition: ApiBase.php:53
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:1585
$count
const RC_NEW
Definition: Defines.php:137
const DB_REPLICA
Definition: defines.php:22
static userCanBitfield($bitfield, $field, User $user=null, Title $title=null)
Determine if the current user is allowed to view a particular field of this revision, if it's marked as deleted.
Definition: Revision.php:1764
const DELETED_COMMENT
Definition: Revision.php:86
const DELETED_ACTION
Definition: LogPage.php:33
const PARAM_MIN
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition: ApiBase.php:100
static dieDebug($method, $message)
Internal code errors should be reported with this method.
Definition: ApiBase.php:2295
static isUnpatrolled($rc, User $user)
static addTitleInfo(&$arr, $title, $prefix= '')
Add information (title and namespace) about a Title object to a result array.
static parseToRCType($type)
Parsing text to RC_* constants.
getUser()
Get the User object.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
Definition: hooks.txt:2491
static makeTitle($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:511
dieUsageMsg($error)
Output the error message related to a certain array.
Definition: ApiBase.php:2203
const RC_LOG
Definition: Defines.php:138
selectNamedDB($name, $db, $groups)
Selects the query database connection with the given name.