Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit728b04d

Browse files
[DebugBundle] Always collect dumps
1 parent70e6a14 commit728b04d

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

‎src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ public function dump(Data $data)
123123

124124
if ($this->dumper) {
125125
$this->doDump($data,$name,$file,$line);
126-
}else {
127-
$this->data[] =compact('data','name','file','line','fileExcerpt');
128-
++$this->dataCount;
129126
}
130127

128+
$this->data[] =compact('data','name','file','line','fileExcerpt');
129+
++$this->dataCount;
130+
131131
if ($this->stopwatch) {
132132
$this->stopwatch->stop('dump');
133133
}
@@ -136,7 +136,7 @@ public function dump(Data $data)
136136
publicfunctioncollect(Request$request,Response$response,\Exception$exception =null)
137137
{
138138
// Sub-requests and programmatic calls stay in the collected profile.
139-
if (($this->requestStack &&$this->requestStack->getMasterRequest() !==$request) ||$request->isXmlHttpRequest() ||$request->headers->has('Origin')) {
139+
if ($this->dumper ||($this->requestStack &&$this->requestStack->getMasterRequest() !==$request) ||$request->isXmlHttpRequest() ||$request->headers->has('Origin')) {
140140
return;
141141
}
142142

@@ -154,13 +154,9 @@ public function collect(Request $request, Response $response, \Exception $except
154154
$this->dumper =newCliDumper('php://output',$this->charset);
155155
}
156156

157-
foreach ($this->dataas$i =>$dump) {
158-
$this->data[$i] =null;
157+
foreach ($this->dataas$dump) {
159158
$this->doDump($dump['data'],$dump['name'],$dump['file'],$dump['line']);
160159
}
161-
162-
$this->data =array();
163-
$this->dataCount =0;
164160
}
165161
}
166162

@@ -221,7 +217,7 @@ public function getName()
221217

222218
publicfunction__destruct()
223219
{
224-
if (0 ===$this->clonesCount-- && !$this->isCollected &&$this->data) {
220+
if (0 ===$this->clonesCount-- && !$this->isCollected &&$this->data && !$this->dumper) {
225221
$this->clonesCount =0;
226222
$this->isCollected =true;
227223

‎src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public function testCollectDefault()
7272
$output =ob_get_clean();
7373

7474
$this->assertSame("DumpDataCollectorTest.php on line{$line}:\n123\n",$output);
75+
$this->assertSame(1,$collector->getDumpsCount());
7576
}
7677

7778
publicfunctiontestCollectHtml()
@@ -99,6 +100,7 @@ public function testCollectHtml()
99100
$output =preg_replace('/sf-dump-\d+/','sf-dump',$output);
100101

101102
$this->assertSame($xOutput,$output);
103+
$this->assertSame(1,$collector->getDumpsCount());
102104
}
103105

104106
publicfunctiontestFlush()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp