-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] fix cache:clear command #12999
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
Conversation
@@ -74,6 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output) | |||
} else { | |||
// the warmup cache dir name must have the same length than the real one | |||
// to avoid the many problems in serialized resources files | |||
$realCacheDir = realpath($realCacheDir); |
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 $realCacheDir
does not exists, realpath file returns false
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.
The path exists because we checked it a few lines above with is_writable()
@nicolas-grekas great catch. It works great, but this way Here are my results: public function getCacheDir()
{
return '/tmp/sf/'.$this->getEnvironment();
} The partial diff of cache:warmup vs cache:clear 'kernel.root_dir' => '/home/egabor/dev/OSS/symfony-standard/app',
'kernel.environment' => 'dev',
'kernel.debug' => true,
- 'kernel.name' => 'app',
+ 'kernel.name' => 'ap_',
'kernel.cache_dir' => __DIR__,
'kernel.logs_dir' => '/home/egabor/dev/OSS/symfony-standard/app/logs',
'kernel.bundles' => array( public function getCacheDir()
{
return __DIR__.'/../../../../../../../tmp/sf/'.$this->getEnvironment();
} The partial diff of cache:warmup vs cache:clear 'kernel.root_dir' => '/home/egabor/dev/OSS/symfony-standard/app',
'kernel.environment' => 'dev',
'kernel.debug' => true,
- 'kernel.name' => 'app',
- 'kernel.cache_dir' => ('/home/egabor/dev/OSS/symfony-standard/app/../../../../../../..'.__DIR__),
+ 'kernel.name' => 'ap_',
+ 'kernel.cache_dir' => __DIR__,
'kernel.logs_dir' => '/home/egabor/dev/OSS/symfony-standard/app/logs',
'kernel.bundles' => array( |
bb5153c
to
a14153a
Compare
I added a |
Thank you @nicolas-grekas. |
This PR was merged into the 2.3 branch. Discussion ---------- [FrameworkBundle] fix cache:clear command | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #12893 | License | MIT | Doc PR | - Reading comment on #12893 stating that using absolute paths works around the pb, I tried using realpath(), and it works! Pending work on #12955 can be done quietly now. Commits ------- a14153a [FrameworkBundle] fix cache:clear command
Reading comment on #12893 stating that using absolute paths works around the pb, I tried using realpath(),
and it works!
Pending work on #12955 can be done quietly now.