Correct documentation for "maxlag" API parameter
[lhc/web/wiklou.git] / includes / api / ApiMain.php
index 87a287b..97f5ecd 100644 (file)
@@ -105,6 +105,7 @@ class ApiMain extends ApiBase {
                'dbgfm' => 'ApiFormatDbg',
                'dump' => 'ApiFormatDump',
                'dumpfm' => 'ApiFormatDump',
+               'none' => 'ApiFormatNone',
        );
 
        /**
@@ -118,7 +119,7 @@ class ApiMain extends ApiBase {
                        'msg' => 'Use of the write API',
                        'params' => array()
                ),
-               'apihighlimits' => array(
+               'apihighlimits' => array(
                        'msg' => 'Use higher limits in API queries (Slow queries: $1 results; Fast queries: $2 results). The limits for slow queries also apply to multivalue parameters.',
                        'params' => array( ApiBase::LIMIT_SML2, ApiBase::LIMIT_BIG2 )
                )
@@ -375,7 +376,12 @@ class ApiMain extends ApiBase {
 
                        // Log it
                        if ( !( $e instanceof UsageException ) ) {
-                               wfDebugLog( 'exception', $e->getLogMessage() );
+                               global $wgLogExceptionBacktrace;
+                               if ( $wgLogExceptionBacktrace ) {
+                                       wfDebugLog( 'exception', $e->getLogMessage() . "\n" . $e->getTraceAsString() . "\n" );
+                               } else {
+                                       wfDebugLog( 'exception', $e->getLogMessage() );
+                               }
                        }
 
                        // Handle any kind of exception by outputing properly formatted error message.
@@ -839,7 +845,7 @@ class ApiMain extends ApiBase {
        protected function logRequest( $time ) {
                $request = $this->getRequest();
                $milliseconds = $time === null ? '?' : round( $time * 1000 );
-               $s = 'API' . 
+               $s = 'API' .
                        ' ' . $request->getMethod() .
                        ' ' . wfUrlencode( str_replace( ' ', '_', $this->getUser()->getName() ) ) .
                        ' ' . $request->getIP() .
@@ -896,7 +902,7 @@ class ApiMain extends ApiBase {
         */
        public function getCheck( $name ) {
                $this->mParamsUsed[$name] = true;
-               return $this->getRequest()->getCheck( $name );          
+               return $this->getRequest()->getCheck( $name );
        }
 
        /**
@@ -993,7 +999,7 @@ class ApiMain extends ApiBase {
                                'Maximum lag can be used when MediaWiki is installed on a database replicated cluster.',
                                'To save actions causing any more site replication lag, this parameter can make the client',
                                'wait until the replication lag is less than the specified value.',
-                               'In case of a replag error, a HTTP 503 error is returned, with the message like',
+                               'In case of a replag error, error code "maxlag" is returned, with the message like',
                                '"Waiting for $host: $lag seconds lagged\n".',
                                'See https://www.mediawiki.org/wiki/Manual:Maxlag_parameter for more information',
                        ),