Jyxo\FirePhp::table PHP Method

table() public static method

Sends a table.
public static table ( string $label, array $header, array $data, string $ident = '' ) : boolean
$label string Message label
$header array Table header
$data array Table data
$ident string Unique identifier
return boolean
    public static function table(string $label, array $header, array $data, string $ident = '') : bool
    {
        $output = [['Type' => self::TABLE, 'Label' => $label], array_merge([$header], $data)];
        return self::send($output, $ident);
    }

Usage Example

Beispiel #1
0
 /**
  * Finishes profiling.
  *
  * @param string $type Request type
  * @param string $method Method name
  * @param array $params Method parameters
  * @param mixed $response Server response
  * @return \Jyxo\Rpc\Client
  */
 protected function profileEnd($type, $method, array $params, $response)
 {
     // Profiling has to be turned on
     if ($this->profiler) {
         static $totalTime = 0;
         static $requests = array();
         // Get elapsed time
         $time = \Jyxo\Timer::stop($this->timer);
         $totalTime += $time;
         $requests[] = array(strtoupper($type), (string) $method, $params, $response, sprintf('%0.3f', $time * 1000));
         // Send to FirePHP
         \Jyxo\FirePhp::table(sprintf('Jyxo RPC Profiler (%d requests took %0.3f ms)', count($requests), sprintf('%0.3f', $totalTime * 1000)), array('Type', 'Method', 'Request', 'Response', 'Time'), $requests, 'Rpc');
     }
     return $this;
 }