Symfony2 application, vagrant & ant: stty: standard input: invalid argument

I am trying to migrate my development environment (symfony2 application) from my localhost window 7 to a virtual machine using the firewall and the standard ubuntu 10.04 64-bit machine. Everything is set up and it almost works, but one thing bothers me:

When I run ant and it runs phpunit, I get the following error while doing my self-busy bootstrap:

stty: standard input: Invalid argument 

I could narrow the problem down to the next line of code that does symfony caching: the warmup command:

 executeCommand($application, "cache:warmup"); 

Runs the following command:

 php app/console -e test -q cache:warmup 

Running phpunit without ant works fine , so ant works without the executeCommand line.

I read this error a bit and looked at ~/.bashrc , ~./profile , /etc/bash.bashrc , /etc/profile , as well as /root/.bashrc and /root/.profile without finding anything like tty or stty . I do not know what I can remove to make it work.

I’m a little stuck, because I need a cache overheat and I can’t understand what is going wrong.

+8
php symfony phpunit ant stty
source share
1 answer

It took some time to understand, but now I got it.

For some reason, the parameters passed to the symfony2 application object cause the problem only when ant is launched. I have no understanding of what causes it, but changing the command to this fixes the problem:

 php app/console --env=test --quiet cache:warmup 

Since this is only a long form and does not change anything, I am very happy. My whole executeCommand function looks like this:

 function executeCommand($application, $command, Array $options = array()) { $options["--env"] = "test"; $options["--quiet"] = true; $options = array_merge($options, array('command' => $command)); $application->run(new ArrayInput($options)); } 

The only line changes are 2 and 3, where the key for the array was changed with -e and -q . I hope this helps those who are struggling with such a problem!

+1
source share

All Articles