[DI] Fix making the container path-independent when the app is in /app
This commit is contained in:
parent
7a13ea3efb
commit
b33b9a6ad9
@ -173,14 +173,14 @@ class PhpDumper extends Dumper
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user