Download the PHP package pkg6/easy-rpc without Composer
On this page you can find all versions of the php package pkg6/easy-rpc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download pkg6/easy-rpc
More information about pkg6/easy-rpc
Files in pkg6/easy-rpc
Download pkg6/easy-rpc
More information about pkg6/easy-rpc
Files in pkg6/easy-rpc
Please rate this library. Is it a good library?
Informations about the package easy-rpc
Installation
composer require pkg6/easy-rpc
initialization
Server
$s = new Server();
$s->addCallback('add', function ($a, $b) {
return $a + $b;
});
$s->start();
Client
$client = new Client();
$client->withURL("http://127.0.0.1:8000");
$add = $client->add(1,2);
addObjectClass refer to:https://github.com/pkg6/easy-rpc/blob/main/tests/objects.php
Interfaces
Server Interface
interface Server
{
/**
* Callback binding:
* @param $method
* @param Closure $callback
* @return $this
*/
public function addCallback($method, Closure $callback);
/**
* Class/Method binding:
* @param $objectOrClass
* @return $this
*/
public function addObjectClass($objectOrClass);
/**
* List of users to allow
* @param array $authentications
* @return $this
*/
public function withAuthentications(array $authentications);
/**
* IP client restrictions
* @param array $hosts
* @return $this
*/
public function allowHosts(array $hosts);
/**
* @return mixed
*/
public function start();
}
Client Interface
interface Client
{
/**
* @param $url
* @return $this
*/
public function withURL($url);
/**
* @param $timeout
* @return $this
*/
public function withTimeout($timeout);
/**
* @return $this
*/
public function withDebug();
/**
* @param $username
* @param $password
* @return $this
*/
public function withAuthentication($username, $password);
}
All versions of easy-rpc with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4
The package pkg6/easy-rpc contains the following files
Loading the files please wait ....