From e2eb601ebded411fa08b1990959411c3786343ea Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 18 Jul 2011 17:38:41 +0200 Subject: [PATCH] [FrameworkBundle] fixed absolute paths to the cache directory after running cache:clear (closes #1725) --- .../Bundle/FrameworkBundle/Command/CacheClearCommand.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php index aa1295540b..5f1ab37074 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php @@ -100,6 +100,10 @@ EOF foreach ($finder->files()->name(get_class($kernel->getContainer()).'*')->in($warmupDir) as $file) { $content = file_get_contents($file); $content = preg_replace($regex, '', $content); + + // fix absolute paths to the cache directory + $content = preg_replace('/'.preg_quote($warmupDir,'/').'/', preg_replace('/_new$/', '', $warmupDir), $content); + file_put_contents(preg_replace($regex, '', $file), $content); unlink($file); }