Selaa lähdekoodia

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

Fabien Potencier 14 vuotta sitten
vanhempi
commit
e2eb601ebd

+ 4 - 0
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);
         }