Merge "Add method parameter type documentation"
[lhc/web/wiklou.git] / includes / profiler / ProfilerSimpleUDP.php
index 83bdf71..0a1f3b1 100644 (file)
@@ -32,7 +32,7 @@ class ProfilerSimpleUDP extends ProfilerSimple {
        }
 
        public function logData() {
-               global $wgUDPProfilerHost, $wgUDPProfilerPort;
+               global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgUDPProfilerFormatString;
 
                $this->close();
 
@@ -41,12 +41,12 @@ 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 ) {
@@ -57,7 +57,7 @@ class ProfilerSimpleUDP extends ProfilerSimple {
                                || !isset( $pfdata['real_sq'] ) ) {
                                continue;
                        }
-                       $pfline = sprintf( "%s %s %d %f %f %f %f %s\n", $this->getProfileID(), "-", $pfdata['count'],
+                       $pfline = sprintf( $wgUDPProfilerFormatString, $this->getProfileID(), $pfdata['count'],
                                $pfdata['cpu'], $pfdata['cpu_sq'], $pfdata['real'], $pfdata['real_sq'], $entry );
                        $length = strlen( $pfline );
                        /* printf("<!-- $pfline -->"); */