* (bug 11632) Breaking change: Specify the type of a change in the recentchanges list
as 'edit', 'new', 'log' instead of 0, 1, 2, respectively.
* Compatibility fix for PHP 5.0.x.
+* Add rctype parameter to list=recentchanges that filters by type
=== Languages updated in 1.12 ===
*/
public function execute() {
/* Initialize vars */
- $limit = $prop = $namespace = $show = $dir = $start = $end = null;
+ $limit = $prop = $namespace = $show = $type = $dir = $start = $end = null;
/* Get the parameters of the request. */
extract($this->extractRequestParams());
$this->addWhereRange('rc_timestamp', $dir, $start, $end);
$this->addWhereFld('rc_namespace', $namespace);
$this->addWhereFld('rc_deleted', 0);
+ if(!is_null($type))
+ $this->addWhereFld('rc_type', $this->parseRCType($type));
if (!is_null($show)) {
$show = array_flip($show);
return $vals;
}
+
+ private function parseRCType($type)
+ {
+ if(is_array($type))
+ {
+ $retval = array();
+ foreach($type as $t)
+ $retval[] = $this->parseRCType($t);
+ return $retval;
+ }
+ switch($type)
+ {
+ case 'edit': return RC_EDIT;
+ case 'new': return RC_NEW;
+ case 'log': return RC_LOG;
+ }
+ }
protected function getAllowedParams() {
return array (
ApiBase :: PARAM_MIN => 1,
ApiBase :: PARAM_MAX => ApiBase :: LIMIT_BIG1,
ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
+ ),
+ 'type' => array (
+ ApiBase :: PARAM_ISMULTI => true,
+ ApiBase :: PARAM_TYPE => array (
+ 'edit',
+ 'new',
+ 'log'
+ )
)
);
}
'Show only items that meet this criteria.',
'For example, to see only minor edits done by logged-in users, set show=minor|!anon'
),
+ 'type' => 'Which types of changes to show.',
'limit' => 'How many total pages to return.'
);
}