diff vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 7a779792577d
children c2387f117808
line wrap: on
line diff
--- a/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php	Mon Apr 23 09:46:53 2018 +0100
@@ -67,7 +67,7 @@
         if ($this->stopwatch) {
             $this->stopwatch->start('dump');
         }
-        if ($this->isCollected) {
+        if ($this->isCollected && !$this->dumper) {
             $this->isCollected = false;
         }
 
@@ -164,6 +164,18 @@
         }
     }
 
+    public function reset()
+    {
+        if ($this->stopwatch) {
+            $this->stopwatch->reset();
+        }
+        $this->data = array();
+        $this->dataCount = 0;
+        $this->isCollected = false;
+        $this->clonesCount = 0;
+        $this->clonesIndex = 0;
+    }
+
     public function serialize()
     {
         if ($this->clonesCount !== $this->clonesIndex) {
@@ -238,7 +250,7 @@
                 --$i;
             }
 
-            if ('cli' !== PHP_SAPI && stripos($h[$i], 'html')) {
+            if (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true) && stripos($h[$i], 'html')) {
                 $this->dumper = new HtmlDumper('php://output', $this->charset);
                 $this->dumper->setDisplayOptions(array('fileLinkFormat' => $this->fileLinkFormat));
             } else {