From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- includes/profiler/ProfilerSimpleUDP.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'includes/profiler/ProfilerSimpleUDP.php') diff --git a/includes/profiler/ProfilerSimpleUDP.php b/includes/profiler/ProfilerSimpleUDP.php index abefa811..0a1f3b10 100644 --- a/includes/profiler/ProfilerSimpleUDP.php +++ b/includes/profiler/ProfilerSimpleUDP.php @@ -32,7 +32,7 @@ class ProfilerSimpleUDP extends ProfilerSimple { } public function logData() { - global $wgUDPProfilerHost, $wgUDPProfilerPort; + global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgUDPProfilerFormatString; $this->close(); @@ -41,24 +41,24 @@ class ProfilerSimpleUDP extends ProfilerSimple { return; } - if ( !MWInit::functionExists( 'socket_create' ) ) { + if ( !function_exists( 'socket_create' ) ) { # Sockets are not enabled return; } - $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); + $sock = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); $plength = 0; $packet = ""; foreach ( $this->mCollated as $entry => $pfdata ) { - if( !isset( $pfdata['count'] ) + if ( !isset( $pfdata['count'] ) || !isset( $pfdata['cpu'] ) || !isset( $pfdata['cpu_sq'] ) || !isset( $pfdata['real'] ) || !isset( $pfdata['real_sq'] ) ) { continue; } - $pfline = sprintf( "%s %s %d %f %f %f %f %s\n", $this->getProfileID(), "-", $pfdata['count'], - $pfdata['cpu'], $pfdata['cpu_sq'], $pfdata['real'], $pfdata['real_sq'], $entry); + $pfline = sprintf( $wgUDPProfilerFormatString, $this->getProfileID(), $pfdata['count'], + $pfdata['cpu'], $pfdata['cpu_sq'], $pfdata['real'], $pfdata['real_sq'], $entry ); $length = strlen( $pfline ); /* printf(""); */ if ( $length + $plength > 1400 ) { -- cgit v1.2.2