From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 4 Jun 2015 07:31:04 +0200 Subject: Update to MediaWiki 1.25.1 --- includes/api/ApiQueryUserContributions.php | 92 +++++++++--------------------- 1 file changed, 26 insertions(+), 66 deletions(-) (limited to 'includes/api/ApiQueryUserContributions.php') diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 4b167b8b..e5ec67d0 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -120,7 +120,7 @@ class ApiQueryContributions extends ApiQueryBase { } } - $this->getResult()->setIndexedTagName_internal( + $this->getResult()->addIndexedTagName( array( 'query', $this->getModuleName() ), 'item' ); @@ -335,7 +335,7 @@ class ApiQueryContributions extends ApiQueryBase { $anyHidden = false; if ( $row->rev_deleted & Revision::DELETED_TEXT ) { - $vals['texthidden'] = ''; + $vals['texthidden'] = true; $anyHidden = true; } @@ -343,7 +343,7 @@ class ApiQueryContributions extends ApiQueryBase { $vals['userid'] = $row->rev_user; $vals['user'] = $row->rev_user_text; if ( $row->rev_deleted & Revision::DELETED_USER ) { - $vals['userhidden'] = ''; + $vals['userhidden'] = true; $anyHidden = true; } if ( $this->fld_ids ) { @@ -367,20 +367,14 @@ class ApiQueryContributions extends ApiQueryBase { } if ( $this->fld_flags ) { - if ( $row->rev_parent_id == 0 && !is_null( $row->rev_parent_id ) ) { - $vals['new'] = ''; - } - if ( $row->rev_minor_edit ) { - $vals['minor'] = ''; - } - if ( $row->page_latest == $row->rev_id ) { - $vals['top'] = ''; - } + $vals['new'] = $row->rev_parent_id == 0 && !is_null( $row->rev_parent_id ); + $vals['minor'] = (bool)$row->rev_minor_edit; + $vals['top'] = $row->page_latest == $row->rev_id; } if ( ( $this->fld_comment || $this->fld_parsedcomment ) && isset( $row->rev_comment ) ) { if ( $row->rev_deleted & Revision::DELETED_COMMENT ) { - $vals['commenthidden'] = ''; + $vals['commenthidden'] = true; $anyHidden = true; } @@ -400,8 +394,8 @@ class ApiQueryContributions extends ApiQueryBase { } } - if ( $this->fld_patrolled && $row->rc_patrolled ) { - $vals['patrolled'] = ''; + if ( $this->fld_patrolled ) { + $vals['patrolled'] = (bool)$row->rc_patrolled; } if ( $this->fld_size && !is_null( $row->rev_len ) ) { @@ -421,7 +415,7 @@ class ApiQueryContributions extends ApiQueryBase { if ( $this->fld_tags ) { if ( $row->ts_tags ) { $tags = explode( ',', $row->ts_tags ); - $this->getResult()->setIndexedTagName( $tags, 'tag' ); + ApiResult::setIndexedTagName( $tags, 'tag' ); $vals['tags'] = $tags; } else { $vals['tags'] = array(); @@ -429,7 +423,7 @@ class ApiQueryContributions extends ApiQueryBase { } if ( $anyHidden && $row->rev_deleted & Revision::DELETED_RESTRICTED ) { - $vals['suppressed'] = ''; + $vals['suppressed'] = true; } return $vals; @@ -464,7 +458,9 @@ class ApiQueryContributions extends ApiQueryBase { 'end' => array( ApiBase::PARAM_TYPE => 'timestamp' ), - 'continue' => null, + 'continue' => array( + ApiBase::PARAM_HELP_MSG => 'api-help-param-continue', + ), 'user' => array( ApiBase::PARAM_ISMULTI => true ), @@ -474,7 +470,8 @@ class ApiQueryContributions extends ApiQueryBase { ApiBase::PARAM_TYPE => array( 'newer', 'older' - ) + ), + ApiBase::PARAM_HELP_MSG => 'api-help-param-direction', ), 'namespace' => array( ApiBase::PARAM_ISMULTI => true, @@ -507,7 +504,11 @@ class ApiQueryContributions extends ApiQueryBase { '!top', 'new', '!new', - ) + ), + ApiBase::PARAM_HELP_MSG => array( + 'apihelp-query+usercontribs-param-show', + $this->getConfig()->get( 'RCMaxAge' ) + ), ), 'tag' => null, 'toponly' => array( @@ -517,53 +518,12 @@ class ApiQueryContributions extends ApiQueryBase { ); } - public function getParamDescription() { - $p = $this->getModulePrefix(); - $RCMaxAge = $this->getConfig()->get( 'RCMaxAge' ); - - return array( - 'limit' => 'The maximum number of contributions to return', - 'start' => 'The start timestamp to return from', - 'end' => 'The end timestamp to return to', - 'continue' => 'When more results are available, use this to continue', - 'user' => 'The users to retrieve contributions for', - 'userprefix' => array( - "Retrieve contributions for all users whose names begin with this value.", - "Overrides {$p}user", - ), - 'dir' => $this->getDirectionDescription( $p ), - 'namespace' => 'Only list contributions in these namespaces', - 'prop' => array( - 'Include additional pieces of information', - ' ids - Adds the page ID and revision ID', - ' title - Adds the title and namespace ID of the page', - ' timestamp - Adds the timestamp of the edit', - ' comment - Adds the comment of the edit', - ' parsedcomment - Adds the parsed comment of the edit', - ' size - Adds the new size of the edit', - ' sizediff - Adds the size delta of the edit against its parent', - ' flags - Adds flags of the edit', - ' patrolled - Tags patrolled edits', - ' tags - Lists tags for the edit', - ), - 'show' => array( - "Show only items that meet thse criteria, e.g. non minor edits only: {$p}show=!minor", - "NOTE: If {$p}show=patrolled or {$p}show=!patrolled is set, revisions older than", - "\$wgRCMaxAge ($RCMaxAge) won't be shown", - ), - 'tag' => 'Only list revisions tagged with this tag', - 'toponly' => 'Only list changes which are the latest revision', - ); - } - - public function getDescription() { - return 'Get all edits by a user.'; - } - - public function getExamples() { + protected function getExamplesMessages() { return array( - 'api.php?action=query&list=usercontribs&ucuser=YurikBot', - 'api.php?action=query&list=usercontribs&ucuserprefix=217.121.114.', + 'action=query&list=usercontribs&ucuser=Example' + => 'apihelp-query+usercontribs-example-user', + 'action=query&list=usercontribs&ucuserprefix=192.0.2.' + => 'apihelp-query+usercontribs-example-ipprefix', ); } -- cgit v1.2.3-54-g00ecf