*
* Created on Sep 25, 2006
*
- * Copyright © 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
+ * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- // Eclipse helper - will be ignored in production
- require_once( 'ApiQueryBase.php' );
-}
-
/**
* This query action allows clients to retrieve a list of recently modified pages
* that are part of the logged-in user's watchlist.
'rc_last_oldid',
) );
- $this->addFieldsIf( array( 'rc_new', 'rc_minor', 'rc_bot' ), $this->fld_flags );
+ $this->addFieldsIf( array( 'rc_type', 'rc_minor', 'rc_bot' ), $this->fld_flags );
$this->addFieldsIf( 'rc_user', $this->fld_user || $this->fld_userid );
$this->addFieldsIf( 'rc_user_text', $this->fld_user );
$this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment );
$db = $this->getDB();
- $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'],
+ $this->addTimestampWhereRange( 'rc_timestamp', $params['dir'],
$params['start'], $params['end'] );
$this->addWhereFld( 'wl_namespace', $params['namespace'] );
}
if ( $this->fld_flags ) {
- if ( $row->rc_new ) {
+ if ( $row->rc_type == RC_NEW ) {
$vals['new'] = '';
}
if ( $row->rc_minor ) {
$vals['logid'] = intval( $row->rc_logid );
$vals['logtype'] = $row->rc_log_type;
$vals['logaction'] = $row->rc_log_action;
+ $logEntry = DatabaseLogEntry::newFromRow( (array)$row );
ApiQueryLogEvents::addLogParams(
$this->getResult(),
$vals,
- $row->rc_params,
- $row->rc_log_type,
- $row->rc_log_action,
- $row->rc_timestamp
+ $logEntry->getParameters(),
+ $logEntry->getType(),
+ $logEntry->getSubtype(),
+ $logEntry->getTimestamp()
);
}
);
}
+ public function getResultProperties() {
+ global $wgLogTypes;
+ return array(
+ 'ids' => array(
+ 'pageid' => 'integer',
+ 'revid' => 'integer',
+ 'old_revid' => 'integer'
+ ),
+ 'title' => array(
+ 'ns' => 'namespace',
+ 'title' => 'string'
+ ),
+ 'user' => array(
+ 'user' => 'string',
+ 'anon' => 'boolean'
+ ),
+ 'userid' => array(
+ 'userid' => 'integer',
+ 'anon' => 'boolean'
+ ),
+ 'flags' => array(
+ 'new' => 'boolean',
+ 'minor' => 'boolean',
+ 'bot' => 'boolean'
+ ),
+ 'patrol' => array(
+ 'patrolled' => 'boolean'
+ ),
+ 'timestamp' => array(
+ 'timestamp' => 'timestamp'
+ ),
+ 'sizes' => array(
+ 'oldlen' => 'integer',
+ 'newlen' => 'integer'
+ ),
+ 'notificationtimestamp' => array(
+ 'notificationtimestamp' => array(
+ ApiBase::PROP_TYPE => 'timestamp',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'comment' => array(
+ 'comment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'parsedcomment' => array(
+ 'parsedcomment' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ ),
+ 'loginfo' => array(
+ 'logid' => array(
+ ApiBase::PROP_TYPE => 'integer',
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'logtype' => array(
+ ApiBase::PROP_TYPE => $wgLogTypes,
+ ApiBase::PROP_NULLABLE => true
+ ),
+ 'logaction' => array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ )
+ )
+ );
+ }
+
public function getDescription() {
return "Get all recent changes to pages in the logged in user's watchlist";
}
}
public function getHelpUrls() {
- return 'http://www.mediawiki.org/wiki/API:Watchlist';
+ return 'https://www.mediawiki.org/wiki/API:Watchlist';
}
public function getVersion() {