bug #13693 [HttpKernel] Fixed DumpDataCollector: dump.name for Windows file paths (King2500)
This PR was merged into the 2.6 branch.
Discussion
----------
[HttpKernel] Fixed DumpDataCollector: dump.name for Windows file paths
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes?
| Fixed tickets |
| License | MIT
| Doc PR |
When using VarDumper on Windows files, the automatic "dump.name" generated wrong names.
`dump()` call in:
```
F:\HtDocs\demo\src\Acme\Controller\DemoController.php
```
Displayed:
```
dump()
in :\HtDocs\demo\src\Acme\Controller\DemoController.php line 35
```
Expected result is:
```
dump()
in DemoController.php line 35
```
The existing code in line 118 didn't use the variable from the previous line.
Commits
-------
a025dea
Fix dump.name for Windows file paths
This commit is contained in:
commit
42e6540224
@ -115,7 +115,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
|
|||||||
|
|
||||||
if (false === $name) {
|
if (false === $name) {
|
||||||
$name = strtr($file, '\\', '/');
|
$name = strtr($file, '\\', '/');
|
||||||
$name = substr($file, strrpos($file, '/') + 1);
|
$name = substr($name, strrpos($name, '/') + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->data[] = compact('data', 'name', 'file', 'line', 'fileExcerpt');
|
$this->data[] = compact('data', 'name', 'file', 'line', 'fileExcerpt');
|
||||||
|
Reference in New Issue
Block a user