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