skipifconnect.inc 396 B

123456789101112131415161718192021
  1. <?php
  2. if (getenv("SKIP_ONLINE_TESTS")) die("skip online test");
  3. require_once('connect.inc');
  4. $sock = @fsockopen($host, $port);
  5. if ($sock === false) {
  6. die("skip unable to connect");
  7. }
  8. $command = "getpid\n";
  9. if (fwrite($sock, $command) !== strlen($command)) {
  10. die("skip unable to write getpid");
  11. }
  12. if (fread($sock, 8) === false) {
  13. die("skip unable to read pid");
  14. }
  15. fclose($sock);