Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DumpDataCollector.php

function DumpDataCollector::__destruct

File

vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php, line 223

Class

DumpDataCollector
@author Nicolas Grekas <p@tchwork.com>

Namespace

Symfony\Component\HttpKernel\DataCollector

Code

public function __destruct() {
    if (0 === $this->clonesCount-- && !$this->isCollected && $this->dataCount) {
        $this->clonesCount = 0;
        $this->isCollected = true;
        $h = headers_list();
        $i = \count($h);
        array_unshift($h, 'Content-Type: ' . \ini_get('default_mimetype'));
        while (0 !== stripos($h[$i], 'Content-Type:')) {
            --$i;
        }
        if ($this->webMode) {
            $dumper = new HtmlDumper('php://output', $this->charset);
        }
        else {
            $dumper = new CliDumper('php://output', $this->charset);
        }
        $dumper->setDisplayOptions([
            'fileLinkFormat' => $this->fileLinkFormat,
        ]);
        foreach ($this->data as $i => $dump) {
            $this->data[$i] = null;
            $this->doDump($dumper, $dump['data'], $dump['name'], $dump['file'], $dump['line'], $dump['label'] ?? '');
        }
        $this->data = [];
        $this->dataCount = 0;
    }
}
RSS feed
Powered by Drupal