jenkins-bot has submitted this change and it was merged.
Change subject: Fix CodeSniffer errors and warnings on a number of ApiQuery
classes
......................................................................
Fix CodeSniffer errors and warnings on a number of ApiQuery classes
Change-Id: I763f79c66cd8ed2ca19586323d5b3ee8b60ffd18
---
M includes/api/ApiQueryAllUsers.php
M includes/api/ApiQueryBacklinks.php
M includes/api/ApiQueryBase.php
M includes/api/ApiQueryBlocks.php
M includes/api/ApiQueryCategories.php
M includes/api/ApiQueryCategoryInfo.php
M includes/api/ApiQueryCategoryMembers.php
M includes/api/ApiQueryDeletedrevs.php
8 files changed, 174 insertions(+), 62 deletions(-)
Approvals:
Chad: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/api/ApiQueryAllUsers.php
b/includes/api/ApiQueryAllUsers.php
index 68f2487..748dbaf 100644
--- a/includes/api/ApiQueryAllUsers.php
+++ b/includes/api/ApiQueryAllUsers.php
@@ -58,7 +58,8 @@
$fld_registration = isset( $prop['registration'] );
$fld_implicitgroups = isset( $prop['implicitgroups'] );
} else {
- $fld_blockinfo = $fld_editcount = $fld_groups =
$fld_registration = $fld_rights = $fld_implicitgroups = false;
+ $fld_blockinfo = $fld_editcount = $fld_groups =
$fld_registration =
+ $fld_rights = $fld_implicitgroups = false;
}
$limit = $params['limit'];
@@ -123,7 +124,10 @@
if ( count( $params['excludegroup'] ) == 1 ) {
$exclude = array( 'ug1.ug_group' =>
$params['excludegroup'][0] );
} else {
- $exclude = array( $db->makeList( array(
'ug1.ug_group' => $params['excludegroup'] ), LIST_OR ) );
+ $exclude = array( $db->makeList(
+ array( 'ug1.ug_group' =>
$params['excludegroup'] ),
+ LIST_OR
+ ) );
}
$this->addJoinConds( array( 'ug1' => array( 'LEFT OUTER
JOIN',
array_merge( array( 'ug1.ug_user=user_id' ),
$exclude )
@@ -187,12 +191,12 @@
$lastUser = false;
$result = $this->getResult();
- //
- // This loop keeps track of the last entry.
- // For each new row, if the new row is for different user then
the last, the last entry is added to results.
- // Otherwise, the group of the new row is appended to the last
entry.
- // The setContinue... is more complex because of this, and
takes into account the higher sql limit
- // to make sure all rows that belong to the same user are
received.
+ // This loop keeps track of the last entry. For each new row,
if the
+ // new row is for different user then the last, the last entry
is added
+ // to results. Otherwise, the group of the new row is appended
to the
+ // last entry. The setContinue... is more complex because of
this, and
+ // takes into account the higher sql limit to make sure all
rows that
+ // belong to the same user are received.
foreach ( $res as $row ) {
$count++;
@@ -212,7 +216,8 @@
}
if ( $count > $limit ) {
- // We've reached the one extra which
shows that there are additional pages to be had. Stop here...
+ // We've reached the one extra which
shows that there are
+ // additional pages to be had. Stop
here...
$this->setContinueEnumParameter(
'from', $row->user_name );
break;
}
@@ -246,10 +251,13 @@
}
if ( $sqlLimit == $count ) {
- // BUG! database contains group name that
User::getAllGroups() does not return
- // TODO: should handle this more gracefully
- ApiBase::dieDebug( __METHOD__,
- 'MediaWiki configuration error: the
database contains more user groups than known to User::getAllGroups() function'
);
+ // @todo BUG! database contains group name
that User::getAllGroups() does not return
+ // Should handle this more gracefully
+ ApiBase::dieDebug(
+ __METHOD__,
+ 'MediaWiki configuration error: The
database contains more ' .
+ 'user groups than known to
User::getAllGroups() function'
+ );
}
$lastUserObj = User::newFromId( $row->user_id );
@@ -369,11 +377,13 @@
'dir' => 'Direction to sort in',
'group' => 'Limit users to given group name(s)',
'excludegroup' => 'Exclude users in given group
name(s)',
- 'rights' => 'Limit users to given right(s) (does not
include rights granted by implicit or auto-promoted groups like *, user, or
autoconfirmed)',
+ 'rights' => 'Limit users to given right(s) (does not
include rights ' .
+ 'granted by implicit or auto-promoted groups
like *, user, or autoconfirmed)',
'prop' => array(
'What pieces of information to include.',
' blockinfo - Adds the information about a
current block on the user',
- ' groups - Lists groups that the user
is in. This uses more server resources and may return fewer results than the
limit',
+ ' groups - Lists groups that the user
is in. This uses ' .
+ 'more server resources and may return
fewer results than the limit',
' implicitgroups - Lists all the groups the
user is automatically in',
' rights - Lists rights that the user
has',
' editcount - Adds the edit count of the
user',
@@ -433,7 +443,10 @@
public function getPossibleErrors() {
return array_merge( parent::getPossibleErrors(), array(
- array( 'code' => 'group-excludegroup', 'info' => 'group
and excludegroup cannot be used together' ),
+ array(
+ 'code' => 'group-excludegroup',
+ 'info' => 'group and excludegroup cannot be
used together'
+ ),
) );
}
diff --git a/includes/api/ApiQueryBacklinks.php
b/includes/api/ApiQueryBacklinks.php
index 238c8e8..bda1e03 100644
--- a/includes/api/ApiQueryBacklinks.php
+++ b/includes/api/ApiQueryBacklinks.php
@@ -149,7 +149,8 @@
if ( $this->params['filterredir'] == 'redirects' ) {
$this->addWhereFld( 'page_is_redirect', 1 );
} elseif ( $this->params['filterredir'] == 'nonredirects' &&
!$this->redirect ) {
- // bug 22245 - Check for !redirect, as filtering
nonredirects, when getting what links to them is contradictory
+ // bug 22245 - Check for !redirect, as filtering
nonredirects, when
+ // getting what links to them is contradictory
$this->addWhereFld( 'page_is_redirect', 0 );
}
@@ -269,7 +270,8 @@
foreach ( $res as $row ) {
if ( ++$count > $this->params['limit'] ) {
- // We've reached the one extra which shows that
there are additional pages to be had. Stop here...
+ // We've reached the one extra which shows that
there are
+ // additional pages to be had. Stop here...
// Continue string preserved in case the
redirect query doesn't pass the limit
$this->continueStr = $this->getContinueStr(
$row->page_id );
break;
@@ -294,7 +296,8 @@
$count = 0;
foreach ( $res as $row ) {
if ( ++$count > $this->params['limit'] ) {
- // We've reached the one extra which
shows that there are additional pages to be had. Stop here...
+ // We've reached the one extra which
shows that there are
+ // additional pages to be had. Stop
here...
// We need to keep the parent page of
this redir in
if ( $this->hasNS ) {
$parentID =
$this->pageMap[$row->{$this->bl_ns}][$row->{$this->bl_title}];
@@ -384,7 +387,10 @@
$parentID = $this->pageMap[$ns][$row->{$this->bl_title}];
// Put all the results in an array first
$this->resultArr[$parentID]['redirlinks'][] = $a;
- $this->getResult()->setIndexedTagName(
$this->resultArr[$parentID]['redirlinks'], $this->bl_code );
+ $this->getResult()->setIndexedTagName(
+ $this->resultArr[$parentID]['redirlinks'],
+ $this->bl_code
+ );
}
protected function processContinue() {
@@ -396,7 +402,10 @@
// only image titles are allowed for the root in imageinfo mode
if ( !$this->hasNS && $this->rootTitle->getNamespace() !==
NS_FILE ) {
- $this->dieUsage( "The title for
{$this->getModuleName()} query must be an image", 'bad_image_title' );
+ $this->dieUsage(
+ "The title for {$this->getModuleName()} query
must be an image",
+ 'bad_image_title'
+ );
}
}
@@ -494,9 +503,14 @@
);
if ( $this->getModuleName() != 'embeddedin' ) {
return array_merge( $retval, array(
- 'redirect' => 'If linking page is a redirect,
find all pages that link to that redirect as well. Maximum limit is halved.',
- 'filterredir' => "How to filter for redirects.
If set to nonredirects when {$this->bl_code}redirect is enabled, this is only
applied to the second level",
- 'limit' => "How many total pages to return. If
{$this->bl_code}redirect is enabled, limit applies to each level separately
(which means you may get up to 2 * limit results)."
+ 'redirect' => 'If linking page is a redirect,
find all pages ' .
+ 'that link to that redirect as well.
Maximum limit is halved.',
+ 'filterredir' => 'How to filter for redirects.
If set to ' .
+ "nonredirects when
{$this->bl_code}redirect is enabled, " .
+ 'this is only applied to the second
level',
+ 'limit' => 'How many total pages to return. If
' .
+ "{$this->bl_code}redirect is enabled,
limit applies to each " .
+ 'level separately (which means you may
get up to 2 * limit results).'
) );
}
@@ -534,7 +548,10 @@
return array_merge( parent::getPossibleErrors(),
$this->getTitleOrPageIdErrorMessage(),
array(
- array( 'code' => 'bad_image_title', 'info' =>
"The title for {$this->getModuleName()} query must be an image" ),
+ array(
+ 'code' => 'bad_image_title',
+ 'info' => "The title for
{$this->getModuleName()} query must be an image"
+ ),
)
);
}
diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php
index c620a8f..cfc2244 100644
--- a/includes/api/ApiQueryBase.php
+++ b/includes/api/ApiQueryBase.php
@@ -219,7 +219,9 @@
if ( $sort ) {
$order = $field . ( $isDirNewer ? '' : ' DESC' );
// Append ORDER BY
- $optionOrderBy = isset( $this->options['ORDER BY'] ) ?
(array)$this->options['ORDER BY'] : array();
+ $optionOrderBy = isset( $this->options['ORDER BY'] )
+ ? (array)$this->options['ORDER BY']
+ : array();
$optionOrderBy[] = $order;
$this->addOption( 'ORDER BY', $optionOrderBy );
}
@@ -260,16 +262,37 @@
* @param string $method Function the query should be attributed to.
* You should usually use __METHOD__ here
* @param array $extraQuery Query data to add but not store in the
object
- * Format is array( 'tables' => ..., 'fields' => ..., 'where' => ...,
'options' => ..., 'join_conds' => ... )
+ * Format is array(
+ * 'tables' => ...,
+ * 'fields' => ...,
+ * 'where' => ...,
+ * 'options' => ...,
+ * 'join_conds' => ...
+ * )
* @return ResultWrapper
*/
protected function select( $method, $extraQuery = array() ) {
- $tables = array_merge( $this->tables, isset(
$extraQuery['tables'] ) ? (array)$extraQuery['tables'] : array() );
- $fields = array_merge( $this->fields, isset(
$extraQuery['fields'] ) ? (array)$extraQuery['fields'] : array() );
- $where = array_merge( $this->where, isset( $extraQuery['where']
) ? (array)$extraQuery['where'] : array() );
- $options = array_merge( $this->options, isset(
$extraQuery['options'] ) ? (array)$extraQuery['options'] : array() );
- $join_conds = array_merge( $this->join_conds, isset(
$extraQuery['join_conds'] ) ? (array)$extraQuery['join_conds'] : array() );
+ $tables = array_merge(
+ $this->tables,
+ isset( $extraQuery['tables'] ) ?
(array)$extraQuery['tables'] : array()
+ );
+ $fields = array_merge(
+ $this->fields,
+ isset( $extraQuery['fields'] ) ?
(array)$extraQuery['fields'] : array()
+ );
+ $where = array_merge(
+ $this->where,
+ isset( $extraQuery['where'] ) ?
(array)$extraQuery['where'] : array()
+ );
+ $options = array_merge(
+ $this->options,
+ isset( $extraQuery['options'] ) ?
(array)$extraQuery['options'] : array()
+ );
+ $join_conds = array_merge(
+ $this->join_conds,
+ isset( $extraQuery['join_conds'] ) ?
(array)$extraQuery['join_conds'] : array()
+ );
// getDB has its own profileDBIn/Out calls
$db = $this->getDB();
@@ -289,7 +312,13 @@
protected function checkRowCount() {
$db = $this->getDB();
$this->profileDBIn();
- $rowcount = $db->estimateRowCount( $this->tables,
$this->fields, $this->where, __METHOD__, $this->options );
+ $rowcount = $db->estimateRowCount(
+ $this->tables,
+ $this->fields,
+ $this->where,
+ __METHOD__,
+ $this->options
+ );
$this->profileDBOut();
global $wgAPIMaxDBRows;
diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php
index 8dad635..57f76bc 100644
--- a/includes/api/ApiQueryBlocks.php
+++ b/includes/api/ApiQueryBlocks.php
@@ -76,7 +76,12 @@
$fld_flags );
$this->addOption( 'LIMIT', $params['limit'] + 1 );
- $this->addTimestampWhereRange( 'ipb_timestamp', $params['dir'],
$params['start'], $params['end'] );
+ $this->addTimestampWhereRange(
+ 'ipb_timestamp',
+ $params['dir'],
+ $params['start'],
+ $params['end']
+ );
$db = $this->getDB();
@@ -107,7 +112,10 @@
# Check range validity, if it's a CIDR
list( $ip, $range ) = IP::parseCIDR( $params['ip'] );
if ( $ip !== false && $range !== false && $range <
$cidrLimit ) {
- $this->dieUsage( "$type CIDR ranges broader
than /$cidrLimit are not accepted", 'cidrtoobroad' );
+ $this->dieUsage(
+ "$type CIDR ranges broader than
/$cidrLimit are not accepted",
+ 'cidrtoobroad'
+ );
}
# Let IP::parseRange handle calculating $upper, instead
of duplicating the logic here.
@@ -145,8 +153,10 @@
$this->addWhereIf( 'ipb_user != 0', isset(
$show['account'] ) );
$this->addWhereIf( 'ipb_user != 0 OR ipb_range_end >
ipb_range_start', isset( $show['!ip'] ) );
$this->addWhereIf( 'ipb_user = 0 AND ipb_range_end =
ipb_range_start', isset( $show['ip'] ) );
- $this->addWhereIf( 'ipb_expiry = ' . $db->addQuotes(
$db->getInfinity() ), isset( $show['!temp'] ) );
- $this->addWhereIf( 'ipb_expiry != ' . $db->addQuotes(
$db->getInfinity() ), isset( $show['temp'] ) );
+ $this->addWhereIf( 'ipb_expiry = ' .
+ $db->addQuotes( $db->getInfinity() ), isset(
$show['!temp'] ) );
+ $this->addWhereIf( 'ipb_expiry != ' .
+ $db->addQuotes( $db->getInfinity() ), isset(
$show['temp'] ) );
$this->addWhereIf( 'ipb_range_end = ipb_range_start',
isset( $show['!range'] ) );
$this->addWhereIf( 'ipb_range_end > ipb_range_start',
isset( $show['range'] ) );
}
diff --git a/includes/api/ApiQueryCategories.php
b/includes/api/ApiQueryCategories.php
index e62305a..c5b12b3 100644
--- a/includes/api/ApiQueryCategories.php
+++ b/includes/api/ApiQueryCategories.php
@@ -220,14 +220,16 @@
return array(
'prop' => array(
'Which additional properties to get for each
category',
- ' sortkey - Adds the sortkey (hexadecimal
string) and sortkey prefix (human-readable part) for the category',
+ ' sortkey - Adds the sortkey (hexadecimal
string) and sortkey prefix',
+ ' (human-readable part) for the
category',
' timestamp - Adds timestamp of when the
category was added',
' hidden - Tags categories that are hidden
with __HIDDENCAT__',
),
'limit' => 'How many categories to return',
'show' => 'Which kind of categories to show',
'continue' => 'When more results are available, use
this to continue',
- 'categories' => 'Only list these categories. Useful for
checking whether a certain page is in a certain category',
+ 'categories' => 'Only list these categories. Useful for
checking ' .
+ 'whether a certain page is in a certain
category',
'dir' => 'The direction in which to list',
);
}
@@ -263,8 +265,10 @@
public function getExamples() {
return array(
-
'api.php?action=query&prop=categories&titles=Albert%20Einstein' => 'Get a list
of categories [[Albert Einstein]] belongs to',
-
'api.php?action=query&generator=categories&titles=Albert%20Einstein&prop=info'
=> 'Get information about all categories used in the [[Albert Einstein]]',
+
'api.php?action=query&prop=categories&titles=Albert%20Einstein'
+ => 'Get a list of categories [[Albert
Einstein]] belongs to',
+
'api.php?action=query&generator=categories&titles=Albert%20Einstein&prop=info'
+ => 'Get information about all categories used
in the [[Albert Einstein]]',
);
}
diff --git a/includes/api/ApiQueryCategoryInfo.php
b/includes/api/ApiQueryCategoryInfo.php
index 4e78f02..574ef6e 100644
--- a/includes/api/ApiQueryCategoryInfo.php
+++ b/includes/api/ApiQueryCategoryInfo.php
@@ -63,7 +63,13 @@
'pp_propname' => 'hiddencat' ) ),
) );
- $this->addFields( array( 'cat_title', 'cat_pages',
'cat_subcats', 'cat_files', 'cat_hidden' => 'pp_propname' ) );
+ $this->addFields( array(
+ 'cat_title',
+ 'cat_pages',
+ 'cat_subcats',
+ 'cat_files',
+ 'cat_hidden' => 'pp_propname'
+ ) );
$this->addWhere( array( 'cat_title' => $cattitles ) );
if ( !is_null( $params['continue'] ) ) {
diff --git a/includes/api/ApiQueryCategoryMembers.php
b/includes/api/ApiQueryCategoryMembers.php
index 9dc7a32..271558b 100644
--- a/includes/api/ApiQueryCategoryMembers.php
+++ b/includes/api/ApiQueryCategoryMembers.php
@@ -181,8 +181,10 @@
$count = 0;
foreach ( $rows as $row ) {
if ( ++$count > $limit ) {
- // We've reached the one extra which shows that
there are additional pages to be had. Stop here...
- // TODO: Security issue - if the user has no
right to view next title, it will still be shown
+ // We've reached the one extra which shows that
there are
+ // additional pages to be had. Stop here...
+ // @todo Security issue - if the user has no
right to view next
+ // title, it will still be shown
if ( $params['sort'] == 'timestamp' ) {
$this->setContinueEnumParameter(
'start', wfTimestamp( TS_ISO_8601, $row->cl_timestamp ) );
} else {
@@ -324,14 +326,16 @@
global $wgMiserMode;
$p = $this->getModulePrefix();
$desc = array(
- 'title' => "Which category to enumerate (required).
Must include Category: prefix. Cannot be used together with {$p}pageid",
+ 'title' => "Which category to enumerate (required).
Must include ' .
+ 'Category: prefix. Cannot be used together with
{$p}pageid",
'pageid' => "Page ID of the category to enumerate.
Cannot be used together with {$p}title",
'prop' => array(
'What pieces of information to include',
' ids - Adds the page ID',
' title - Adds the title and namespace
ID of the page',
' sortkey - Adds the sortkey used for
sorting in the category (hexadecimal string)',
- ' sortkeyprefix - Adds the sortkey prefix used
for sorting in the category (human-readable part of the sortkey)',
+ ' sortkeyprefix - Adds the sortkey prefix used
for sorting in the ' .
+ 'category (human-readable part of the
sortkey)',
' type - Adds the type that the page
has been categorised as (page, subcat or file)',
' timestamp - Adds the timestamp of when
the page was included',
),
@@ -341,10 +345,15 @@
'dir' => 'In which direction to sort',
'start' => "Timestamp to start listing from. Can only
be used with {$p}sort=timestamp",
'end' => "Timestamp to end listing at. Can only be used
with {$p}sort=timestamp",
- 'startsortkey' => "Sortkey to start listing from. Must
be given in binary format. Can only be used with {$p}sort=sortkey",
- 'endsortkey' => "Sortkey to end listing at. Must be
given in binary format. Can only be used with {$p}sort=sortkey",
- 'startsortkeyprefix' => "Sortkey prefix to start
listing from. Can only be used with {$p}sort=sortkey. Overrides
{$p}startsortkey",
- 'endsortkeyprefix' => "Sortkey prefix to end listing
BEFORE (not at, if this value occurs it will not be included!). Can only be
used with {$p}sort=sortkey. Overrides {$p}endsortkey",
+ 'startsortkey' => "Sortkey to start listing from. Must
be given in ' .
+ 'binary format. Can only be used with
{$p}sort=sortkey",
+ 'endsortkey' => "Sortkey to end listing at. Must be
given in binary ' .
+ 'format. Can only be used with
{$p}sort=sortkey",
+ 'startsortkeyprefix' => "Sortkey prefix to start
listing from. Can ' .
+ 'only be used with {$p}sort=sortkey. Overrides
{$p}startsortkey",
+ 'endsortkeyprefix' => "Sortkey prefix to end listing
BEFORE (not at, ' .
+ 'if this value occurs it will not be
included!). Can only be used with ' .
+ '{$p}sort=sortkey. Overrides {$p}endsortkey",
'continue' => 'For large categories, give the value
returned from previous query',
'limit' => 'The maximum number of pages to return.',
);
@@ -406,8 +415,10 @@
public function getExamples() {
return array(
-
'api.php?action=query&list=categorymembers&cmtitle=Category:Physics' => 'Get
first 10 pages in [[Category:Physics]]',
-
'api.php?action=query&generator=categorymembers&gcmtitle=Category:Physics&prop=info'
=> 'Get page info about first 10 pages in [[Category:Physics]]',
+
'api.php?action=query&list=categorymembers&cmtitle=Category:Physics'
+ => 'Get first 10 pages in [[Category:Physics]]',
+
'api.php?action=query&generator=categorymembers&gcmtitle=Category:Physics&prop=info'
+ => 'Get page info about first 10 pages in
[[Category:Physics]]',
);
}
diff --git a/includes/api/ApiQueryDeletedrevs.php
b/includes/api/ApiQueryDeletedrevs.php
index 0eb1ec7..35e78ac 100644
--- a/includes/api/ApiQueryDeletedrevs.php
+++ b/includes/api/ApiQueryDeletedrevs.php
@@ -39,7 +39,10 @@
$user = $this->getUser();
// Before doing anything at all, let's check permissions
if ( !$user->isAllowed( 'deletedhistory' ) ) {
- $this->dieUsage( 'You don\'t have permission to view
deleted revision information', 'permissiondenied' );
+ $this->dieUsage(
+ 'You don\'t have permission to view deleted
revision information',
+ 'permissiondenied'
+ );
}
$db = $this->getDB();
@@ -116,7 +119,10 @@
// This also means stricter restrictions
if ( !$user->isAllowed( 'undelete' ) ) {
- $this->dieUsage( 'You don\'t have permission to
view deleted revision content', 'permissiondenied' );
+ $this->dieUsage(
+ 'You don\'t have permission to view
deleted revision content',
+ 'permissiondenied'
+ );
}
}
// Check limits
@@ -152,7 +158,8 @@
$this->addWhereRange( 'ar_title', $dir, $from, $to );
if ( isset( $params['prefix'] ) ) {
- $this->addWhere( 'ar_title' . $db->buildLike(
$this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
+ $this->addWhere( 'ar_title' .
+ $db->buildLike( $this->titlePartToKey(
$params['prefix'] ), $db->anyString() ) );
}
}
@@ -179,7 +186,10 @@
}
$this->addOption( 'LIMIT', $limit + 1 );
- $this->addOption( 'USE INDEX', array( 'archive' => ( $mode ==
'user' ? 'usertext_timestamp' : 'name_title_timestamp' ) ) );
+ $this->addOption(
+ 'USE INDEX',
+ array( 'archive' => ( $mode == 'user' ?
'usertext_timestamp' : 'name_title_timestamp' ) )
+ );
if ( $mode == 'all' ) {
if ( $params['unique'] ) {
$this->addOption( 'GROUP BY', 'ar_title' );
@@ -391,7 +401,8 @@
'Operates in three modes:',
' 1) List deleted revisions for the given title(s),
sorted by timestamp',
' 2) List deleted contributions for the given user,
sorted by timestamp (no titles specified)',
- " 3) List all deleted revisions in the given namespace,
sorted by title and timestamp (no titles specified, {$p}user not set)",
+ " 3) List all deleted revisions in the given namespace,
sorted by title and timestamp',
+ ' (no titles specified, {$p}user not set)",
'Certain parameters only apply to some modes and are
ignored in others.',
'For instance, a parameter marked (1) only applies to
mode 1 and is ignored in modes 2 and 3',
);
@@ -399,12 +410,22 @@
public function getPossibleErrors() {
return array_merge( parent::getPossibleErrors(), array(
- array( 'code' => 'permissiondenied', 'info' => 'You
don\'t have permission to view deleted revision information' ),
- array( 'code' => 'badparams', 'info' => 'user and
excludeuser cannot be used together' ),
- array( 'code' => 'permissiondenied', 'info' => 'You
don\'t have permission to view deleted revision content' ),
+ array(
+ 'code' => 'permissiondenied',
+ 'info' => 'You don\'t have permission to view
deleted revision information'
+ ),
+ array( 'code' => 'badparams', 'info' => 'user and
excludeuser cannot be used together'
+ ),
+ array(
+ 'code' => 'permissiondenied',
+ 'info' => 'You don\'t have permission to view
deleted revision content'
+ ),
array( 'code' => 'badparams', 'info' => "The 'from'
parameter cannot be used in modes 1 or 2" ),
array( 'code' => 'badparams', 'info' => "The 'to'
parameter cannot be used in modes 1 or 2" ),
- array( 'code' => 'badparams', 'info' => "The 'prefix'
parameter cannot be used in modes 1 or 2" ),
+ array(
+ 'code' => 'badparams',
+ 'info' => "The 'prefix' parameter cannot be
used in modes 1 or 2"
+ ),
array( 'code' => 'badparams', 'info' => "The 'start'
parameter cannot be used in mode 3" ),
array( 'code' => 'badparams', 'info' => "The 'end'
parameter cannot be used in mode 3" ),
) );
@@ -412,7 +433,8 @@
public function getExamples() {
return array(
-
'api.php?action=query&list=deletedrevs&titles=Main%20Page|Talk:Main%20Page&drprop=user|comment|content'
+
'api.php?action=query&list=deletedrevs&titles=Main%20Page|Talk:Main%20Page&' .
+ 'drprop=user|comment|content'
=> 'List the last deleted revisions of Main
Page and Talk:Main Page, with content (mode 1)',
'api.php?action=query&list=deletedrevs&druser=Bob&drlimit=50'
=> 'List the last 50 deleted contributions by
Bob (mode 2)',
--
To view, visit https://gerrit.wikimedia.org/r/95455
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I763f79c66cd8ed2ca19586323d5b3ee8b60ffd18
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits