From: Brad Jorsch Date: Tue, 7 Jul 2015 17:46:17 +0000 (-0400) Subject: API: Move stats update for API module execution to when the module is actually executed X-Git-Tag: 1.31.0-rc.0~10866 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=3e1b3e9348c3718de0c4191034dce497ad8d4c97;p=lhc%2Fweb%2Fwiklou.git API: Move stats update for API module execution to when the module is actually executed The place it was before could easily be reached without actually executing (or even constructing) the module. Change-Id: I6f807adc9cbf71c5d7b83c7eec43965dce1d2a16 --- diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index fec750fc1f..46dc7dff9e 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -404,8 +404,6 @@ class ApiMain extends ApiBase { } else { $this->executeActionWithErrorHandling(); } - $this->getContext()->getStats()->increment( - 'api.modules.' . strtr( $this->getModule()->getModulePath(), '+', '.' ) ); } /** @@ -1092,6 +1090,8 @@ class ApiMain extends ApiBase { $this->checkAsserts( $params ); // Execute + $this->getContext()->getStats()->increment( + 'api.modules.' . strtr( $module->getModulePath(), '+', '.' ) ); $module->execute(); Hooks::run( 'APIAfterExecute', array( &$module ) );