fix: client import issue (#3)

This commit is contained in:
Victor Westerlund 2023-05-26 10:07:05 +02:00 committed by GitHub
parent c819bc3da2
commit a2587624e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

8
client
View file

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

View file

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