File: skipifconnect.inc

package info (click to toggle)
php-gearman 2.1.0%2B1.1.2-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,000 kB
  • sloc: ansic: 6,240; php: 1,022; xml: 668; sh: 32; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 396 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

if (getenv("SKIP_ONLINE_TESTS")) die("skip online test");

require_once('connect.inc');

$sock = @fsockopen($host, $port);
if ($sock === false) {
    die("skip unable to connect");
}

$command = "getpid\n";
if (fwrite($sock, $command) !== strlen($command)) {
    die("skip unable to write getpid");
}

if (fread($sock, 8) === false) {
    die("skip unable to read pid");
}

fclose($sock);