Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / http-kernel / DataCollector / DumpDataCollector.php
index b50386cb961c9cdb7acf83b2ac8e15d106ef4d8e..27a9a825243a2b810223673cda989587e676586d 100644 (file)
@@ -67,7 +67,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
         if ($this->stopwatch) {
             $this->stopwatch->start('dump');
         }
-        if ($this->isCollected) {
+        if ($this->isCollected && !$this->dumper) {
             $this->isCollected = false;
         }
 
@@ -164,6 +164,18 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
         }
     }
 
+    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 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
                 --$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 {