mirror of
https://codeberg.org/reflect/reflect-client-php.git
synced 2025-09-13 17:43:42 +02:00
fix: client import issue
This commit is contained in:
parent
c819bc3da2
commit
c3acff16a8
2 changed files with 7 additions and 3 deletions
8
client
8
client
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue