8000 [FrameworkBundle] fix cache:clear command · symfony/symfony@bb5153c · GitHub
[go: up one dir, main page]

Skip to content

Commit bb5153c

Browse files
[FrameworkBundle] fix cache:clear command
1 parent 206ebc7 commit bb5153c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7474
} else {
7575
// the warmup cache dir name must have the same length than the real one
7676
// to avoid the many problems in serialized resources files
77+
$realCacheDir = realpath($realCacheDir);
7778
$warmupDir = substr($realCacheDir, 0, -1).'_';
7879

7980
if ($filesystem->exists($warmupDir)) {
@@ -165,12 +166,14 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
165166
*/
166167
protected function getTempKernel(KernelInterface $parent, $namespace, $parentClass, $warmupDir)
167168
{
168-
$rootDir = $parent->getRootDir();
169+
$cacheDir = var_export($warmupDir, true);
170+
$rootDir = var_export(realpath($parent->getRootDir()), true);
171+
$logDir = var_export(realpath($parent->getLogDir()), true);
169172
// the temp kernel class name must have the same length than the real one
170173
// to avoid the many problems in serialized resources files
171174
$class = substr($parentClass, 0, -1).'_';
172175
// the temp kernel name must be changed too
173-
$name = substr($parent->getName(), 0, -1).'_';
176+
$name = var_export(substr($parent->getName(), 0, -1).'_', true);
174177
$code = <<<EOF
175178
<?php
176179
@@ -180,17 +183,22 @@ class $class extends $parentClass
180183
{
181184
public function getCacheDir()
182185
{
183-
return '$warmupDir';
186+
return $cacheDir;
184187
}
185188
186189
public function getName()
187190
{
188-
return '$name';
191+
return $name;
189192
}
190193
191194
public function getRootDir()
192195
{
193-
return '$rootDir';
196+
return $rootDir;
197+
}
198+
199+
public function getLogDir()
200+
{
201+
return $logDir;
194202
}
195203
196204
protected function buildContainer()

0 commit comments

Comments
 (0)
0