Skip to content

Navigation Menu

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

Appearance settings

Commit b33b9a6

Browse filesBrowse files
[DI] Fix making the container path-independent when the app is in /app
1 parent 7a13ea3 commit b33b9a6
Copy full SHA for b33b9a6

File tree

1 file changed

+3
-3
lines changed
Filter options

1 file changed

+3
-3
lines changed

‎src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,14 @@ public function dump(array $options = [])
173173
if (!empty($options['file']) && is_dir($dir = \dirname($options['file']))) {
174174
// Build a regexp where the first root dirs are mandatory,
175175
// but every other sub-dir is optional up to the full path in $dir
176-
// Mandate at least 2 root dirs and not more that 5 optional dirs.
176+
// Mandate at least 1 root dir and not more than 5 optional dirs.
177177

178178
$dir = explode(\DIRECTORY_SEPARATOR, realpath($dir));
179179
$i = \count($dir);
180180

181-
if (3 <= $i) {
181+
if (2 + (int) ('\\' === \DIRECTORY_SEPARATOR) <= $i) {
182182
$regex = '';
183-
$lastOptionalDir = $i > 8 ? $i - 5 : 3;
183+
$lastOptionalDir = $i > 8 ? $i - 5 : (2 + (int) ('\\' === \DIRECTORY_SEPARATOR));
184184
$this->targetDirMaxMatches = $i - $lastOptionalDir;
185185

186186
while (--$i >= $lastOptionalDir) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.