Thanks,
exec did not do exactly what I needed since I need live feedback with the ability to respond to prompts.
I did manage to solve it with popen.
If anyone else needs this, here is how I resolved it.
On Wednesday, September 10, 2014 3:33:23 PM UTC+2, José Lorenzo wrote:
-- exec did not do exactly what I needed since I need live feedback with the ability to respond to prompts.
I did manage to solve it with popen.
If anyone else needs this, here is how I resolved it.
$cwd = ROOT;
$cmds = [ "cd $cwd", "grunt update" ]; //Array of commands to execute
$cmd = implode(' && ', $cmds);
while (@ ob_end_flush());
$proc = popen($cmd, 'r');
while (!feof($proc)){
echo fread($proc, 4096);
@ flush();
}
On Wednesday, September 10, 2014 3:33:23 PM UTC+2, José Lorenzo wrote:
you can use the php exec() function.
On Wednesday, September 10, 2014 10:59:44 AM UTC+2, Dieter Gribnitz wrote:Here is a simple scenario.
I have a shell script in the App\Shell namespace.
When I run the task I would like to have some console commands such as `grunt update` triggered.
Is it possible to run these types of commands from the ConsoleShell?
Some of these tasks may require user input thus it cannot be run without feedback from the user.
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment