i have this console command :
php app/console jms-job-queue:run
I want to run this command when i click a button on my website. So i don't niet a command prompt to do this.
Is this possible in symfony 2 ?
i have this console command :
php app/console jms-job-queue:run
I want to run this command when i click a button on my website. So i don't niet a command prompt to do this.
Is this possible in symfony 2 ?
A good idea would be to created a helper class to do this for you, because the commands will look different foreach dev and prod environment. You can add also methods to check if there are any processes running, or to kill one.
Not sure, but I guess you need full path to your command:
[%kernel.root_dir%] / console jms-job-queue:run
Your could try creating a service that defines the behavior you want, then have both your console command and your controller action call that service. This promotes code reuse and allows you to call that function anywhere you want.
You can also look at this question that had been answered before: How can I run symfony 2 run command from controller