Closed aschempp closed 7 years ago
Are you sure that this does not result in an incomplete cache?
I'm not… but I had no issues just ignoring it, pretty sure the error happens because of invisible files or something similar that are irrelevant…
cache:clear
of Symfony first renames the cache folder and then deletes it. Shouldn't InstallationController::purgeSymfonyCache
do the same?
It probably should.
Very good idea! Will adjust the PR
PR is updated
New method is surely better :). However it does not solve your original problem, does it? An exception might still occur when removing the old cache dir. (At least I frequently experience that even on the console due to operating system shenanigans.)
Though now it's less likely do occur.
You're right. But I guess in that case we should actually show the message?
Well, you could also ignore it like in your original PR. Because the next time purgeSymfonyCache
is called, the old cache directory will be tried to delete anyway, before the current cache directory is renamed. (Though what if an error occurs then again?)
Thank you @aschempp.
Btw. shouldn't the same be added to the manager-bundle
? Currently, it simply deletes the prod folder: https://github.com/contao/manager-bundle/blob/4.4.2/src/Composer/ScriptHandler.php#L60
That's probably a different thing because the ScriptHandler
does not run within the Symfony application.
Sometimes I got exceptions in the install tool because not all cache files were removed. I think we should ignore that, as it's not gonna be a major issue and breaks the application.