I have my symfony project on my dev box开发者_Go百科 machine and also on a hosted environment where i have only FTP and HTTP access (i have a phpmyadmin access to my prod DB). This hosted version is an alpha release that should be initialized with fixtures.
Problem is : to do that, i have to write/update .yml fixtures in local, insert them in local DB with the symfony task, go on my local PMA, generate a data export, go on prod PMA and import the data...
Is there any way to generate a .sql file from my local fixtures so that i can insert them directly through my prod PMA ?
Thanks
The easiest is probably for you to look at this website:
http://brentertainment.com/2010/02/15/run-a-symfony-task-from-your-model-or-action/
You may run tasks from the web, you might make it a bit smarter and allow to run tasks from the web. Also clearing the cache might be a useful thing to extend to your admin interface for example.
I think you can't "out of the box" in symfony.
BUT you may be able to use the Doctrine Profiler to log all the SQL requests done by the sfDoctrineDataLoadTask task class into a file.
Are you using the symfony doctrine:build --all
command? When I do that, a schema.sql file is created within the data/sql directory.
精彩评论