Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / api / ApiMain.php
index 63b79ac..07642c4 100644 (file)
@@ -397,7 +397,13 @@ class ApiMain extends ApiBase {
                if ( $this->mInternalMode ) {
                        $this->executeAction();
                } else {
+                       $start = microtime( true );
                        $this->executeActionWithErrorHandling();
+                       if ( $this->isWriteMode() && $this->getRequest()->wasPosted() ) {
+                               $timeMs = 1000 * max( 0, microtime( true ) - $start );
+                               $this->getStats()->timing(
+                                       'api.' . $this->getModuleName() . '.executeTiming', $timeMs );
+                       }
                }
        }
 
@@ -871,7 +877,7 @@ class ApiMain extends ApiBase {
 
                        $errMessage = [
                                'code' => 'internal_api_error_' . get_class( $e ),
-                               'info' => '[' . MWExceptionHandler::getLogId( $e ) . '] ' . $info,
+                               'info' => '[' . WebRequest::getRequestId() . '] ' . $info,
                        ];
                }
                return $errMessage;
@@ -1750,8 +1756,8 @@ class ApiMain extends ApiBase {
                // Use parent to make default message for the main module
                $msg = parent::makeHelpMsg();
 
-               $astriks = str_repeat( '*** ', 14 );
-               $msg .= "\n\n$astriks Modules  $astriks\n\n";
+               $asterisks = str_repeat( '*** ', 14 );
+               $msg .= "\n\n$asterisks Modules  $asterisks\n\n";
 
                foreach ( $this->mModuleMgr->getNames( 'action' ) as $name ) {
                        $module = $this->mModuleMgr->getModule( $name );
@@ -1764,7 +1770,7 @@ class ApiMain extends ApiBase {
                        $msg .= "\n";
                }
 
-               $msg .= "\n$astriks Permissions $astriks\n\n";
+               $msg .= "\n$asterisks Permissions $asterisks\n\n";
                foreach ( self::$mRights as $right => $rightMsg ) {
                        $rightsMsg = $this->msg( $rightMsg['msg'], $rightMsg['params'] )
                                ->useDatabase( false )
@@ -1775,7 +1781,7 @@ class ApiMain extends ApiBase {
                                "\nGranted to:\n  " . str_replace( '*', 'all', implode( ', ', $groups ) ) . "\n\n";
                }
 
-               $msg .= "\n$astriks Formats  $astriks\n\n";
+               $msg .= "\n$asterisks Formats  $asterisks\n\n";
                foreach ( $this->mModuleMgr->getNames( 'format' ) as $name ) {
                        $module = $this->mModuleMgr->getModule( $name );
                        $msg .= self::makeHelpMsgHeader( $module, 'format' );
@@ -1810,53 +1816,6 @@ class ApiMain extends ApiBase {
                return "* $paramName={$module->getModuleName()} $modulePrefix*";
        }
 
-       /**
-        * Check whether the user wants us to show version information in the API help
-        * @return bool
-        * @deprecated since 1.21, always returns false
-        */
-       public function getShowVersions() {
-               wfDeprecated( __METHOD__, '1.21' );
-
-               return false;
-       }
-
-       /**
-        * Add or overwrite a module in this ApiMain instance. Intended for use by extending
-        * classes who wish to add their own modules to their lexicon or override the
-        * behavior of inherent ones.
-        *
-        * @deprecated since 1.21, Use getModuleManager()->addModule() instead.
-        * @param string $name The identifier for this module.
-        * @param ApiBase $class The class where this module is implemented.
-        */
-       protected function addModule( $name, $class ) {
-               $this->getModuleManager()->addModule( $name, 'action', $class );
-       }
-
-       /**
-        * Add or overwrite an output format for this ApiMain. Intended for use by extending
-        * classes who wish to add to or modify current formatters.
-        *
-        * @deprecated since 1.21, Use getModuleManager()->addModule() instead.
-        * @param string $name The identifier for this format.
-        * @param ApiFormatBase $class The class implementing this format.
-        */
-       protected function addFormat( $name, $class ) {
-               $this->getModuleManager()->addModule( $name, 'format', $class );
-       }
-
-       /**
-        * Returns the list of supported formats in form ( 'format' => 'ClassName' )
-        *
-        * @since 1.18
-        * @deprecated since 1.21, Use getModuleManager()'s methods instead.
-        * @return array
-        */
-       public function getFormats() {
-               return $this->getModuleManager()->getNamesWithClasses( 'format' );
-       }
-
        /**@}*/
 
 }