Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[DI] Fix making the container path-independent when the app is in /app
  • Loading branch information
nicolas-grekas committed Dec 2, 2019
commit b33b9a6ad91703f6ec6997aa16943cc9ffe19851
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ public function dump(array $options = [])
if (!empty($options['file']) && is_dir($dir = \dirname($options['file']))) {
// Build a regexp where the first root dirs are mandatory,
// but every other sub-dir is optional up to the full path in $dir
// Mandate at least 2 root dirs and not more that 5 optional dirs.
// Mandate at least 1 root dir and not more than 5 optional dirs.

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

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

while (--$i >= $lastOptionalDir) {
Expand Down