zmq-fileserver/query

16 lines
367 B
Plaintext
Raw Normal View History

#!/usr/bin/env php
<?php
array_shift($argv);
if (count($argv) === 0) {
print('Query needs at least one argument' . PHP_EOL);
die(1);
}
$context = new ZMQContext();
$socket = new ZMQSocket($context, ZMQ::SOCKET_REQ);
$socket->connect('ipc:///tmp/storage_server_query.ipc');
$socket->sendmulti($argv);
print(implode(PHP_EOL, $socket->recvMulti()));
print(PHP_EOL);