Skip to content

Commit 86ea15f

Browse files
committed
Revert "bug #10937 [HttpKernel] Fix "absolute path" when we look to the cache directory (BenoitLeveque)"
This reverts commit 7dc8931, reversing changes made to 309046a.
1 parent 51ecc78 commit 86ea15f

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

Kernel.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -748,15 +748,9 @@ private function removeAbsolutePathsFromContainer($content)
748748
$filesystem = new Filesystem();
749749

750750
return preg_replace_callback("{'([^']*)(".preg_quote($rootDir)."[^']*)'}", function ($match) use ($filesystem, $cacheDir) {
751-
$prefix = isset($match[1]) && $match[1] ? "'$match[1]'.__DIR__" : "__DIR__";
751+
$prefix = isset($match[1]) && $match[1] ? "'$match[1]'.__DIR__.'/" : "__DIR__.'/";
752752

753-
$relativePath = rtrim($filesystem->makePathRelative($match[2], $cacheDir), '/');
754-
755-
if ($relativePath === '.') {
756-
return $prefix;
757-
}
758-
759-
return $prefix . ".'/" . $relativePath . "'";
753+
return $prefix.rtrim($filesystem->makePathRelative($match[2], $cacheDir), '/')."'";
760754
}, $content);
761755
}
762756

Tests/Fixtures/DumpedContainers/app/cache/dev/withAbsolutePaths.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'ROOT_DIR/app/cache/dev/foo'
22
'ROOT_DIR/app/cache/foo'
33
'ROOT_DIR/foo/bar.php'
4-
'ROOT_DIR/app/cache/dev'
54

65
'/some/where/else/foo'
76

Tests/Fixtures/DumpedContainers/app/cache/dev/withoutAbsolutePaths.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
__DIR__.'/foo'
22
__DIR__.'/../foo'
33
__DIR__.'/../../../foo/bar.php'
4-
__DIR__
54

65
'/some/where/else/foo'
76

0 commit comments

Comments
 (0)