comparison 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
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
65 public function dump(Data $data) 65 public function dump(Data $data)
66 { 66 {
67 if ($this->stopwatch) { 67 if ($this->stopwatch) {
68 $this->stopwatch->start('dump'); 68 $this->stopwatch->start('dump');
69 } 69 }
70 if ($this->isCollected) { 70 if ($this->isCollected && !$this->dumper) {
71 $this->isCollected = false; 71 $this->isCollected = false;
72 } 72 }
73 73
74 $trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS, 7); 74 $trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS, 7);
75 75
162 $this->doDump($dump['data'], $dump['name'], $dump['file'], $dump['line']); 162 $this->doDump($dump['data'], $dump['name'], $dump['file'], $dump['line']);
163 } 163 }
164 } 164 }
165 } 165 }
166 166
167 public function reset()
168 {
169 if ($this->stopwatch) {
170 $this->stopwatch->reset();
171 }
172 $this->data = array();
173 $this->dataCount = 0;
174 $this->isCollected = false;
175 $this->clonesCount = 0;
176 $this->clonesIndex = 0;
177 }
178
167 public function serialize() 179 public function serialize()
168 { 180 {
169 if ($this->clonesCount !== $this->clonesIndex) { 181 if ($this->clonesCount !== $this->clonesIndex) {
170 return 'a:0:{}'; 182 return 'a:0:{}';
171 } 183 }
236 array_unshift($h, 'Content-Type: '.ini_get('default_mimetype')); 248 array_unshift($h, 'Content-Type: '.ini_get('default_mimetype'));
237 while (0 !== stripos($h[$i], 'Content-Type:')) { 249 while (0 !== stripos($h[$i], 'Content-Type:')) {
238 --$i; 250 --$i;
239 } 251 }
240 252
241 if ('cli' !== PHP_SAPI && stripos($h[$i], 'html')) { 253 if (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true) && stripos($h[$i], 'html')) {
242 $this->dumper = new HtmlDumper('php://output', $this->charset); 254 $this->dumper = new HtmlDumper('php://output', $this->charset);
243 $this->dumper->setDisplayOptions(array('fileLinkFormat' => $this->fileLinkFormat)); 255 $this->dumper->setDisplayOptions(array('fileLinkFormat' => $this->fileLinkFormat));
244 } else { 256 } else {
245 $this->dumper = new CliDumper('php://output', $this->charset); 257 $this->dumper = new CliDumper('php://output', $this->charset);
246 } 258 }