Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function dumpLine($depth, $endOfValue = false)
 {
     if (-1 === $this->lastDepth && isset($_SERVER['REQUEST_TIME_FLOAT'])) {
         if ($this->colors) {
             echo sprintf("[%sm%s", $this->styles['ref'], $this->prefix());
         } else {
             echo $this->prefix();
         }
         echo "\n";
     }
     $this->lastDepth = $depth;
     parent::dumpLine($depth, $endOfValue);
 }
Ejemplo n.º 2
0
 /**
  *
  * {@inheritdoc}
  *
  */
 protected function dumpLine($depth, $endOfValue = false)
 {
     if ($endOfValue && 0 < $depth) {
         $this->line .= ',';
     }
     $this->line = $this->formatter->format($this->line);
     parent::dumpLine($depth, $endOfValue);
 }
Ejemplo n.º 3
0
    /**
     * {@inheritdoc}
     */
    protected function dumpLine($depth)
    {
        if (-1 === $this->lastDepth) {
            $this->line = sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad).$this->line;
        }
        if (!$this->headerIsDumped) {
            $this->line = $this->getDumpHeader().$this->line;
        }

        if (-1 === $depth) {
            $this->line .= sprintf($this->dumpSuffix, $this->dumpId);
        }
        $this->lastDepth = $depth;

        // Replaces non-ASCII UTF-8 chars by numeric HTML entities
        $this->line = preg_replace_callback(
            '/[\x80-\xFF]+/',
            function ($m) {
                $m = unpack('C*', $m[0]);
                $i = 1;
                $entities = '';

                while (isset($m[$i])) {
                    if (0xF0 <= $m[$i]) {
                        $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80;
                    } elseif (0xE0 <= $m[$i]) {
                        $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++]  - 0x80;
                    } else {
                        $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80;
                    }

                    $entities .= '&#'.$c.';';
                }

                return $entities;
            },
            $this->line
        );

        if (-1 === $depth) {
            parent::dumpLine(0);
        }
        parent::dumpLine($depth);
    }