From 3e1b3e9348c3718de0c4191034dce497ad8d4c97 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Tue, 7 Jul 2015 13:46:17 -0400 Subject: [PATCH] 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 --- includes/api/ApiMain.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ) ); -- 2.20.1