/**
  * Difference from base class: do not obey php.ini but eZ config instead
  */
 static function flush($script_name = null)
 {
     $struct = static::get_packet_info($script_name);
     $message = prtbfr::encode($struct, self::$message_proto);
     $server = eZPerfLoggerINI::variable('pinbaSettings', 'Server');
     $port = 30002;
     if (count($parts = explode(':', $server)) > 1) {
         $port = $server[1];
         $server = $server[0];
     }
     $fp = fsockopen("udp://{$server}", $port, $errno, $errstr);
     if ($fp) {
         fwrite($fp, $message);
         fclose($fp);
     }
 }
Пример #2
0
 /**
 Useful when you need to send request data to the server immediately (for long running scripts).
 You can use optional argument script_name to set custom script name.
 
 @param string $script_name
 
 @todo add IPv6 support (see http://pinba.org/wiki/Manual:PHP_extension)
 */
 static function flush($script_name = null)
 {
     if (ini_get('pinba.enabled')) {
         $struct = static::get_packet_info($script_name);
         $message = prtbfr::encode($struct, self::$message_proto);
         $server = ini_get('pinba.server');
         $port = 30002;
         if (count($parts = explode(':', $server)) > 1) {
             $port = $server[1];
             $server = $server[0];
         }
         $fp = fsockopen("udp://{$server}", $port, $errno, $errstr);
         if ($fp) {
             fwrite($fp, $message);
             fclose($fp);
         }
     }
 }
Пример #3
0
 protected static function isBigEndian()
 {
     if (self::$_endianness === NULL) {
         list(, $result) = unpack('L', pack('V', 1));
         if ($result === 1) {
             self::$_endianness = self::LITTLE_ENDIAN;
         } else {
             self::$_endianness = self::BIG_ENDIAN;
         }
     }
     return self::$_endianness === self::BIG_ENDIAN;
 }