zmq-fileserver/bin/command

14 lines
333 B
Plaintext
Raw Permalink Normal View History

2020-06-20 19:04:10 +02:00
#!/usr/bin/env php
<?php
array_shift($argv);
if (count($argv) === 0) {
print('command needs at least one argument' . PHP_EOL);
die(1);
}
$ini = parse_ini_file(__DIR__ . '/../config/config.ini', true)['command'];
$socket = new ZMQSocket(new ZMQContext, ZMQ::SOCKET_PUSH);
$socket->connect($ini['dsn']);
$socket->sendmulti($argv);