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:
Fabien Potencier 2015-02-17 09:22:34 +01:00
commit 42e6540224
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
if (false === $name) {
$name = strtr($file, '\\', '/');
$name = substr($file, strrpos($file, '/') + 1);
$name = substr($name, strrpos($name, '/') + 1);
}
$this->data[] = compact('data', 'name', 'file', 'line', 'fileExcerpt');