Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/160223

Change subject: API: Change default continuation format for action=query
......................................................................

API: Change default continuation format for action=query

The new format is much easier to use correctly, and should therefore be
the default. The old format is maintained for clients that need the
additional flexibility.

Change-Id: I984e63581f4ef23ccada916b6d45131d1fb5e001
---
M includes/api/ApiQuery.php
1 file changed, 6 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/160223/1

diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php
index a5cd5e5..0fc3679 100644
--- a/includes/api/ApiQuery.php
+++ b/includes/api/ApiQuery.php
@@ -244,16 +244,6 @@
        public function execute() {
                $this->mParams = $this->extractRequestParams();
 
-               if ( $this->mParams['continue'] === null && 
!$this->mParams['rawcontinue'] ) {
-                       $this->logFeatureUsage( 
'action=query&!rawcontinue&!continue' );
-                       $this->setWarning(
-                               'Formatting of continuation data will be 
changing soon. ' .
-                               'To continue using the current formatting, use 
the \'rawcontinue\' parameter. ' .
-                               'To begin using the new format, pass an empty 
string for \'continue\' ' .
-                               'in the initial query.'
-                       );
-               }
-
                // Instantiate requested modules
                $allModules = array();
                $this->instantiateModules( $allModules, 'prop' );
@@ -299,7 +289,7 @@
 
                // Write the continuation data into the result
                $this->getResult()->endContinuation(
-                       $this->mParams['continue'] === null ? 'raw' : 'standard'
+                       $this->mParams['rawcontinue'] ? 'raw' : 'standard'
                );
        }
 
@@ -470,7 +460,7 @@
        public function setGeneratorContinue( $module, $paramName, $paramValue 
) {
                wfDeprecated( __METHOD__, '1.24' );
                $this->getResult()->setGeneratorContinueParam( $module, 
$paramName, $paramValue );
-               return $this->getParameter( 'continue' ) !== null;
+               return !$this->getParameter( 'rawcontinue' );
        }
 
        /**
@@ -612,15 +602,8 @@
                        'exportnowrap' => 'Return the export XML without 
wrapping it in an ' .
                                'XML result (same format as Special:Export). 
Can only be used with export',
                        'iwurl' => 'Whether to get the full URL if the title is 
an interwiki link',
-                       'continue' => array(
-                               'When present, formats query-continue as 
key-value pairs that ' .
-                                       'should simply be merged into the 
original request.',
-                               'This parameter must be set to an empty string 
in the initial query.',
-                               'This parameter is recommended for all new 
development, and ' .
-                                       'will be made default in the next API 
version.'
-                       ),
-                       'rawcontinue' => 'Currently ignored. In the future, 
\'continue=\' will become the ' .
-                               'default and this will be needed to receive the 
raw query-continue data.',
+                       'continue' => 'When more results are available, use 
this to continue',
+                       'rawcontinue' => 'Return raw query-continue data for 
continuation',
                );
        }
 
@@ -637,8 +620,8 @@
        public function getExamples() {
                return array(
                        'api.php?action=query&prop=revisions&meta=siteinfo&' .
-                               
'titles=Main%20Page&rvprop=user|comment&continue=',
-                       
'api.php?action=query&generator=allpages&gapprefix=API/&prop=revisions&continue=',
+                               'titles=Main%20Page&rvprop=user|comment',
+                       
'api.php?action=query&generator=allpages&gapprefix=API/&prop=revisions',
                );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/160223
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I984e63581f4ef23ccada916b6d45131d1fb5e001
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to