From 55888299be3a4f8155de37e5ada1000119a4d88f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 26 May 2014 18:42:01 +0200 Subject: [PATCH] Revert "bug #10937 [HttpKernel] Fix "absolute path" when we look to the cache directory (BenoitLeveque)" This reverts commit 7dc8931969cdf55820c40757a1da9906b9fb013d, reversing changes made to 309046a2072efe83d2f3cf7da87d6b76d33429a4. --- src/Symfony/Component/HttpKernel/Kernel.php | 10 ++-------- .../app/cache/dev/withAbsolutePaths.php | 1 - .../app/cache/dev/withoutAbsolutePaths.php | 1 - 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 9067c8ccef..002c34b99d 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -748,15 +748,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface $filesystem = new Filesystem(); 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), '/'); - - if ($relativePath === '.') { - return $prefix; - } - - return $prefix . ".'/" . $relativePath . "'"; + return $prefix.rtrim($filesystem->makePathRelative($match[2], $cacheDir), '/')."'"; }, $content); } diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/DumpedContainers/app/cache/dev/withAbsolutePaths.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/DumpedContainers/app/cache/dev/withAbsolutePaths.php index b8644ecb9f..54e0dedc4b 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fixtures/DumpedContainers/app/cache/dev/withAbsolutePaths.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/DumpedContainers/app/cache/dev/withAbsolutePaths.php @@ -1,7 +1,6 @@ 'ROOT_DIR/app/cache/dev/foo' 'ROOT_DIR/app/cache/foo' 'ROOT_DIR/foo/bar.php' -'ROOT_DIR/app/cache/dev' '/some/where/else/foo' diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/DumpedContainers/app/cache/dev/withoutAbsolutePaths.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/DumpedContainers/app/cache/dev/withoutAbsolutePaths.php index 36823dfc16..09ce8b5683 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fixtures/DumpedContainers/app/cache/dev/withoutAbsolutePaths.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/DumpedContainers/app/cache/dev/withoutAbsolutePaths.php @@ -1,7 +1,6 @@ __DIR__.'/foo' __DIR__.'/../foo' __DIR__.'/../../../foo/bar.php' -__DIR__ '/some/where/else/foo'