* 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)
+ * @deprecated since 1.24
* @return array Array(tokenname => function)
*/
protected function getTokenFunctions() {
}
/**
+ * @deprecated since 1.24
* @param int $pageid
* @param Title $title
* @param RecentChange|null $rc
ApiBase::PARAM_TYPE => array(
'newer',
'older'
- )
+ ),
+ ApiBase::PARAM_HELP_MSG => 'api-help-param-direction',
),
'namespace' => array(
ApiBase::PARAM_ISMULTI => true,
)
),
'token' => array(
+ ApiBase::PARAM_DEPRECATED => true,
ApiBase::PARAM_TYPE => array_keys( $this->getTokenFunctions() ),
ApiBase::PARAM_ISMULTI => true
),
)
),
'toponly' => false,
- 'continue' => null,
- );
- }
-
- public function getParamDescription() {
- $p = $this->getModulePrefix();
-
- return array(
- 'start' => 'The timestamp to start enumerating from',
- 'end' => 'The timestamp to end enumerating',
- 'dir' => $this->getDirectionDescription( $p ),
- 'namespace' => 'Filter log entries to only this namespace(s)',
- 'user' => 'Only list changes by this user',
- 'excludeuser' => 'Don\'t list changes by this user',
- 'prop' => array(
- 'Include additional pieces of information',
- ' user - Adds the user responsible for the edit and tags if they are an IP',
- ' userid - Adds the user id responsible for the edit',
- ' comment - Adds the comment for the edit',
- ' parsedcomment - Adds the parsed comment for the edit',
- ' flags - Adds flags for the edit',
- ' timestamp - Adds timestamp of the edit',
- ' title - Adds the page title of the edit',
- ' ids - Adds the page ID, recent changes ID and the new and old revision ID',
- ' sizes - Adds the new and old page length in bytes',
- ' redirect - Tags edit if page is a redirect',
- ' patrolled - Tags patrollable edits as being patrolled or unpatrolled',
- ' loginfo - Adds log information (logid, logtype, etc) to log entries',
- ' tags - Lists tags for the entry',
- ' sha1 - Adds the content checksum for entries associated with a revision',
- ),
- 'token' => 'Which tokens to obtain for each change',
- 'show' => array(
- 'Show only items that meet this criteria.',
- "For example, to see only minor edits done by logged-in users, set {$p}show=minor|!anon"
- ),
- 'type' => 'Which types of changes to show',
- 'limit' => 'How many total changes to return',
- 'tag' => 'Only list changes tagged with this tag',
- 'toponly' => 'Only list changes which are the latest revision',
- 'continue' => 'When more results are available, use this to continue',
- );
- }
-
- 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
- ),
+ 'continue' => array(
+ ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
),
);
-
- 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() {
+ public function getExamplesMessages() {
return array(
- 'api.php?action=query&list=recentchanges'
+ 'action=query&list=recentchanges'
+ => 'apihelp-query+recentchanges-example-simple',
+ 'action=query&generator=recentchanges&grcshow=!patrolled&prop=info'
+ => 'apihelp-query+recentchanges-example-generator',
);
}