summaryrefslogtreecommitdiff
path: root/php-src/tests/client.php
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-05-31 15:19:54 +0300
committerWolfy-J <[email protected]>2018-05-31 15:19:54 +0300
commit91a081e3ec43302ca1df8d436e48c2a14d7c76b9 (patch)
tree7c644b8bccf04f1a8dd5c07314665152dbea6d63 /php-src/tests/client.php
parent48f4f7a39a2336be24cc74b4116c02cc941dbd9a (diff)
psr7 support
Diffstat (limited to 'php-src/tests/client.php')
-rw-r--r--php-src/tests/client.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/php-src/tests/client.php b/php-src/tests/client.php
new file mode 100644
index 00000000..fd5d60be
--- /dev/null
+++ b/php-src/tests/client.php
@@ -0,0 +1,35 @@
+<?php
+
+use Spiral\Goridge;
+
+ini_set('display_errors', 'stderr');
+require dirname(__DIR__) . "/../vendor/autoload.php";
+
+if (count($argv) < 3) {
+ die("need 2 arguments");
+}
+
+list($test, $goridge) = [$argv[1], $argv[2]];
+
+switch ($goridge) {
+ case "pipes":
+ $relay = new Goridge\StreamRelay(STDIN, STDOUT);
+ break;
+
+ case "tcp":
+ $relay = new Goridge\SocketRelay("localhost", 9007);
+ break;
+
+ case "unix":
+ $relay = new Goridge\SocketRelay(
+ "sock.unix",
+ null,
+ Goridge\SocketRelay::SOCK_UNIX
+ );
+ break;
+
+ default:
+ die("invalid protocol selection");
+}
+
+require_once sprintf("%s/%s.php", __DIR__, $test);