Add command, query, stable server with argument parsing
This commit is contained in:
15
query
Executable file
15
query
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/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);
|
||||
Reference in New Issue
Block a user