Revert "bug #10937 [HttpKernel] Fix "absolute path" when we look to the cache directory (BenoitLeveque)"
This reverts commit7dc8931969
, reversing changes made to309046a207
.
This commit is contained in:
parent
d1f77c6d0d
commit
55888299be
@ -748,15 +748,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface
|
|||||||
$filesystem = new Filesystem();
|
$filesystem = new Filesystem();
|
||||||
|
|
||||||
return preg_replace_callback("{'([^']*)(".preg_quote($rootDir)."[^']*)'}", function ($match) use ($filesystem, $cacheDir) {
|
return preg_replace_callback("{'([^']*)(".preg_quote($rootDir)."[^']*)'}", function ($match) use ($filesystem, $cacheDir) {
|
||||||
$prefix = isset($match[1]) && $match[1] ? "'$match[1]'.__DIR__" : "__DIR__";
|
$prefix = isset($match[1]) && $match[1] ? "'$match[1]'.__DIR__.'/" : "__DIR__.'/";
|
||||||
|
|
||||||
$relativePath = rtrim($filesystem->makePathRelative($match[2], $cacheDir), '/');
|
return $prefix.rtrim($filesystem->makePathRelative($match[2], $cacheDir), '/')."'";
|
||||||
|
|
||||||
if ($relativePath === '.') {
|
|
||||||
return $prefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $prefix . ".'/" . $relativePath . "'";
|
|
||||||
}, $content);
|
}, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
'ROOT_DIR/app/cache/dev/foo'
|
'ROOT_DIR/app/cache/dev/foo'
|
||||||
'ROOT_DIR/app/cache/foo'
|
'ROOT_DIR/app/cache/foo'
|
||||||
'ROOT_DIR/foo/bar.php'
|
'ROOT_DIR/foo/bar.php'
|
||||||
'ROOT_DIR/app/cache/dev'
|
|
||||||
|
|
||||||
'/some/where/else/foo'
|
'/some/where/else/foo'
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
__DIR__.'/foo'
|
__DIR__.'/foo'
|
||||||
__DIR__.'/../foo'
|
__DIR__.'/../foo'
|
||||||
__DIR__.'/../../../foo/bar.php'
|
__DIR__.'/../../../foo/bar.php'
|
||||||
__DIR__
|
|
||||||
|
|
||||||
'/some/where/else/foo'
|
'/some/where/else/foo'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user