* Get an array mapping token names to their handler functions.
* The prototype for a token function is func($pageid, $title, $rc)
* it should return a token or false (permission denied)
- * @return array array(tokenname => function)
+ * @return array Array(tokenname => function)
*/
protected function getTokenFunctions() {
// Don't call the hooks twice
/**
* Sets internal state to include the desired properties in the output.
- * @param array $prop associative array of properties, only keys are used here
+ * @param array $prop Associative array of properties, only keys are used here
*/
public function initProperties( $prop ) {
$this->fld_comment = isset( $prop['comment'] );
);
}
- public function getResultProperties() {
- $props = array(
- '' => array(
- 'type' => array(
- ApiBase::PROP_TYPE => array(
- 'edit',
- 'new',
- 'move',
- 'log',
- 'move over redirect'
- )
- )
- ),
- 'title' => array(
- 'ns' => 'namespace',
- 'title' => 'string',
- 'new_ns' => array(
- ApiBase::PROP_TYPE => 'namespace',
- ApiBase::PROP_NULLABLE => true
- ),
- 'new_title' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- )
- ),
- 'ids' => array(
- 'rcid' => 'integer',
- 'pageid' => 'integer',
- 'revid' => 'integer',
- 'old_revid' => 'integer'
- ),
- 'user' => array(
- 'user' => 'string',
- 'anon' => 'boolean'
- ),
- 'userid' => array(
- 'userid' => 'integer',
- 'anon' => 'boolean'
- ),
- 'flags' => array(
- 'bot' => 'boolean',
- 'new' => 'boolean',
- 'minor' => 'boolean'
- ),
- 'sizes' => array(
- 'oldlen' => 'integer',
- 'newlen' => 'integer'
- ),
- 'timestamp' => array(
- 'timestamp' => 'timestamp'
- ),
- 'comment' => array(
- 'comment' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- )
- ),
- 'parsedcomment' => array(
- 'parsedcomment' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- )
- ),
- 'redirect' => array(
- 'redirect' => 'boolean'
- ),
- 'patrolled' => array(
- 'patrolled' => 'boolean',
- 'unpatrolled' => 'boolean'
- ),
- 'loginfo' => array(
- 'logid' => array(
- ApiBase::PROP_TYPE => 'integer',
- ApiBase::PROP_NULLABLE => true
- ),
- 'logtype' => array(
- ApiBase::PROP_TYPE => $this->getConfig()->get( 'LogTypes' ),
- ApiBase::PROP_NULLABLE => true
- ),
- 'logaction' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- )
- ),
- 'sha1' => array(
- 'sha1' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'sha1hidden' => array(
- ApiBase::PROP_TYPE => 'boolean',
- ApiBase::PROP_NULLABLE => true
- ),
- ),
- );
-
- self::addTokenProperties( $props, $this->getTokenFunctions() );
-
- return $props;
- }
-
public function getDescription() {
return 'Enumerate recent changes.';
}
- public function getPossibleErrors() {
- return array_merge( parent::getPossibleErrors(), array(
- array( 'show' ),
- array(
- 'code' => 'permissiondenied',
- 'info' => 'You need the patrol right to request the patrolled flag'
- ),
- array( 'code' => 'user-excludeuser', 'info' => 'user and excludeuser cannot be used together' ),
- ) );
- }
-
public function getExamples() {
return array(
'api.php?action=query&list=recentchanges'