I’m working in Symfony2 and I’d like to get access to the Kernel so that I can call getRootDir(. I need to do this from a Doctrine2 Migration. Doctrine2 migrations extend AbstractMigration and aren’t container aware so I guess I would need to add this in. What is the best way to do this, I can implement the interface but im not sure how to get it working? Can anyone provide a solution/example?
Cheers
I found a bundle for you:
https://github.com/kbond/ZenstruckMigrationsBundle
To make use of container aware data migrations your migrations must extend: