PageRenderTime 24ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/framework/experimental/pherver/proc_open_child_child.php

http://zoop.googlecode.com/
PHP | 30 lines | 14 code | 6 blank | 10 comment | 0 complexity | 663e7c28ca9263c5b11ba00feaee9e65 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
  1. #!/usr/bin/env php
  2. <?php
  3. define('zoop_dir', dirname(__file__) . '/../../framework');
  4. define('app_dir', dirname(__file__));
  5. include(zoop_dir . '/Zoop.php');
  6. Zoop::loadLib('app');
  7. // echo "I am the child\n";
  8. $stdin = STDIN;
  9. // $stdin = fopen('php://stdin','rb');
  10. // $stdout = fopen('php://stdout','wb');
  11. while(true)
  12. {
  13. // $command = stream_get_contents($stdin);
  14. // fwrite ($stdout , "the command is $command");
  15. // echo "the command is $command";
  16. $message = trim(fgets($stdin, 4096));
  17. static $i = 1;
  18. echo "$message : child $i\n";
  19. // flush();
  20. $i += 1;
  21. }
  22. // fclose($stdin);
  23. // fclose($stdout);
  24. exit(0);