[FrameworkBundle] fixed absolute paths to the cache directory after running cache:clear (closes #1725)

This commit is contained in:
Fabien Potencier 2011-07-18 17:38:41 +02:00
parent 3104a8ab22
commit e2eb601ebd

View File

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