Symfony2 allows developers to create their own command line commands. They can be executed from the command line, but also from the controller. According to the official Symfony2 documentation, this can be done as follows:
protected function execute(InputInterface $input, OutputInterface $output) { $command = $this->getApplication()->find('demo:greet'); $arguments = array( ... ); $input = new ArrayInput($arguments); $returnCode = $command->run($input, $output); }
But in this situation, we expect the command to complete execution and return a return code.
How can I, from the controller , execute a command, deploying it to the background, without waiting for the completion of its execution?
In other words, that would be equivalent
$ nohup php app/console demo:greet &
malloc4k
source share