Clear doctrine cache in redis on deploy
We keep our doctrine cache in redis, and use capistrano for deployment. Everything works nice until we have to remove a field on entity.
When post install commands in composer are executed we get error like:
[ReflectionException] ** [out Property EntitiesPlayerRecord::$shirtNumber does not exist
$shirtNumber
is the field that we removed. To be able to continue we just need to clear doctrine cache but because it is in redis database, the cache is shared with production.
The question is how can we dynamically change connection setting for redis on each deploy? The only ideas that come to my mind are:
Do you have other ideas or which one is better in you opinion?
So seems i was trying to overcomplicate things because of my own lack of knowledge.
I solved the problem using Doctrine Cache namespaces
I'm using SncRediBundle and the solutions was simply to use this config:
doctrine:
metadata_cache:
client: cache
namespace: "%kernel.root_dir%"
entity_manager: default
链接地址: http://www.djcxy.com/p/24282.html