-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FrameworkBundle] Bugfixes in buildDir in the CacheClear command #38548
[FrameworkBundle] Bugfixes in buildDir in the CacheClear command #38548
Conversation
@@ -141,7 +141,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int | |||
} | |||
|
|||
if (!$fs->exists($warmupDir.'/'.$containerDir)) { | |||
$fs->rename($realCacheDir.'/'.$containerDir, $warmupDir.'/'.$containerDir); | |||
$fs->rename($realBuildDir.'/'.$containerDir, $warmupDir.'/'.$containerDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we have a separate buildDir and warming the cache. The container will never be located in $warmupDir. It will always be in $readBuildDir
.
If we dont have a separate buildDir. Then $readBuildDir === $readCacheDir`
} else { | ||
$fs->remove($realCacheDir); | ||
|
||
if ($oldBuildDir !== $oldCacheDir) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not try to rename or remove $realCacheDir
again.
|
||
if ($realCacheDir !== $realBuildDir) { | ||
// Copy the content of the warmed cache in the build dir | ||
$fs->mirror($realCacheDir, $realBuildDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just a typo: copy()
is for files, mirror()
is for directories.
Funny, you submitted at the same time as #38549 :) |
src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php
Outdated
Show resolved
Hide resolved
ace1aa9
to
2cad6bb
Compare
Thank you @Nyholm. |
Thank you @BoShurik and @nicolas-grekas |
Making sure one can clear cache with and without a buildDir