I want to execute this command
php app/console doctrine:schema:update
from the controles without use exec php function,
Any comment will be use full to me.
Thanks!!!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are looking here, on the bottom there is an example of how to execute a command from within symfony code.
Please also mind the note on the end saying that it might not be a good idea to use a command within your code.
As said, the following code should be used with care. I wouldn’t use it for the reasons statet in the symfony doc, but it works.
When using the following code within your controller, you are able to execute a command:
If you need the output, you have to either use an existing class implementing OutputInterface or create your own depending on your needs.