\BaseJsonRpcServer
JSON RPC Server for Eaze
Reads $_GET['rawRequest'] or php://input for Request Data
- Author: Sergeyfast
Synopsis
class BaseJsonRpcServer
{
- // constants
- const ParseError = 32700;
- // members
- protected array $instances = ;
- protected object|array $request;
- protected array $calls = ;
- protected array $response = ;
- protected bool $hasCalls = false;
- private bool $isBatchCall = false;
- protected array $hiddenMethods = ;
- public string $ContentType = 'application/json';
- public bool $IsXDR = true;
- public integer $MaxBatchCalls = 10;
- protected array $errorMessages = ;
- private array $reflectionMethods = ;
- // methods
- private int getRequest()
- private array getError()
- private array|null validateCall()
- private array|null processCall()
- public void __construct()
- public $this RegisterInstance()
- public void Execute()
- private string|null getDocDescription()
- private array getServiceMap()
- private void resetVars()
Constants
Name | Value |
---|---|
ParseError | 32700 |
Members
private
- $isBatchCall
—
bool
Is Batch Call in using - $reflectionMethods
—
array
Cached Reflection Methods
protected
- $calls
—
array
Array of Received Calls - $errorMessages
—
array
Error Messages - $hasCalls
—
bool
Has Calls Flag (not notifications) - $instances
—
array
Exposed Instances - $request
—
object|array
Decoded Json Request - $response
—
array
Array of Responses for Calls
public
- $ContentType
—
string
Content Type - $IsXDR
—
bool
Allow Cross-Domain Requests - $MaxBatchCalls
—
int
Max Batch Calls
Methods
private
- getDocDescription() — Get Doc Comment
- getError() — Get Error Response
- getRequest() — Validate Request
- getServiceMap() — Get Service Map Maybe not so good realization of auto-discover via doc blocks
- processCall() — Process Call
- resetVars() — Reset Local Class Vars after Execute
- validateCall() — Check for jsonrpc version and correct method
public
- __construct() — Create new Instance
- Execute() — Handle Requests
- RegisterInstance() — Register Instance