Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. function run($command)
  2. {
  3. $descriptorspec = array(
  4. 0 => array("pipe","r"),
  5. 1 => array("pipe","w"),
  6. 2 => array("file","./error.log","a")
  7. );
  8. $process = proc_open($command, $descriptorspec, $pipes);
  9. if (is_resource($process))
  10. {
  11. while ($s = fgets($pipes[1]))
  12. {
  13. print $s;
  14. flush();
  15. }
  16. fclose($pipes[1]);
  17. proc_close($process);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement