Use wfWikiID() instead of $wgDBname in wfIncrStats()
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Fri, 21 Dec 2012 08:26:18 +0000 (09:26 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 21 Dec 2012 18:17:30 +0000 (18:17 +0000)
This allows to have distinct stat groups for people using database table prefix and
it makes wfIncrStats() consistent with ProfilerSimpleUDP that already uses wfWikiID().

Change-Id: Iecef9f490df8c5685a4887cc81dcb4a7e4d3172c

includes/GlobalFunctions.php

index d0a2042..9779cb8 100644 (file)
@@ -1242,10 +1242,10 @@ function wfIncrStats( $key, $count = 1 ) {
        $count = intval( $count );
 
        if( $wgStatsMethod == 'udp' ) {
-               global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgDBname, $wgAggregateStatsID;
+               global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgAggregateStatsID;
                static $socket;
 
-               $id = $wgAggregateStatsID !== false ? $wgAggregateStatsID : $wgDBname;
+               $id = $wgAggregateStatsID !== false ? $wgAggregateStatsID : wfWikiID();
 
                if ( !$socket ) {
                        $socket = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );