fix: client import issue

This commit is contained in:
Victor Westerlund 2023-05-26 10:05:44 +02:00
parent c819bc3da2
commit c3acff16a8
2 changed files with 7 additions and 3 deletions

8
client
View file

@ -1,10 +1,14 @@
<?php
use \Reflect\Client;
use \Reflect\Method;
use \Reflect\Connection;
if (php_sapi_name() !== "cli") {
die("Must be run from command line\n");
}
require_once __DIR__ . "/src/Client.php";
require_once __DIR__ . "/src/Reflect/Client.php";
// Require 3 to 4 arguments
if ($argc < 4 || $argc > 4) {
@ -13,7 +17,7 @@
}
// Connect to the socket server
$client = new Client($argv[1], ConType::AF_UNIX);
$client = new Client($argv[1], null, Connection::AF_UNIX);
// Get endpoint, method, and optional payload
$args = $argv;

View file

@ -120,7 +120,7 @@
// Call endpoint over UNIX socket
if ($this->_con === Connection::AF_UNIX) {
return json_decode($this->_socket_txn(json_encode([
return json_decode($this->socket_txn(json_encode([
$endpoint,
$method->value,
$payload