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); }