Download the PHP package tourze/json-rpc-core without Composer
On this page you can find all versions of the php package tourze/json-rpc-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package json-rpc-core
JSON-RPC Core
This library provides core components compliant with the JSON-RPC 2.0 specification for building JSON-RPC servers and clients in PHP.
Installation
Features
- Fully compliant with JSON-RPC 2.0 specification
- Supports all JSON-RPC request types: single, batch, and notification
- Robust error handling for all standard JSON-RPC error types
- Flexible method resolution interfaces
- Clean object-oriented API
Components
Models
JsonRpcRequest
- Represents a JSON-RPC requestJsonRpcResponse
- Represents a JSON-RPC responseJsonRpcParams
- Wraps request parametersJsonRpcCallRequest
- Handles batch requestsJsonRpcCallResponse
- Handles batch responses
Domain Interfaces
JsonRpcMethodInterface
- Defines the interface for JSON-RPC methodsJsonRpcMethodResolverInterface
- Resolves method names to implementationsJsonRpcMethodParamsValidatorInterface
- Validates method parametersMethodWithValidatedParamsInterface
- Methods with parameter validationMethodWithResultDocInterface
- Methods with result documentation
Exceptions
JsonRpcException
- Base JSON-RPC exceptionJsonRpcParseErrorException
- Parse error exceptionJsonRpcInvalidRequestException
- Invalid request exceptionJsonRpcMethodNotFoundException
- Method not found exceptionJsonRpcInvalidParamsException
- Invalid params exceptionJsonRpcInternalErrorException
- Internal error exception
Usage Example
Creating a JSON-RPC Method
处理 JSON-RPC 请求
批量请求
通过 JsonRpcCallRequest
和 JsonRpcCallResponse
处理批量请求。详见单元测试中的示例。
测试
All versions of json-rpc-core with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
nesbot/carbon Version ^2.72 || ^3
psr/log Version ^3|^2|^1
symfony/dependency-injection Version ^6.4
symfony/event-dispatcher-contracts Version ^2.5 | ^3
symfony/http-foundation Version ^6.4
symfony/property-access Version ^6.4
symfony/service-contracts Version ^3.5
symfony/validator Version ^6.4
tourze/arrayable Version 0.0.*
tourze/backtrace-helper Version 0.1.*
nesbot/carbon Version ^2.72 || ^3
psr/log Version ^3|^2|^1
symfony/dependency-injection Version ^6.4
symfony/event-dispatcher-contracts Version ^2.5 | ^3
symfony/http-foundation Version ^6.4
symfony/property-access Version ^6.4
symfony/service-contracts Version ^3.5
symfony/validator Version ^6.4
tourze/arrayable Version 0.0.*
tourze/backtrace-helper Version 0.1.*
The package tourze/json-rpc-core contains the following files
Loading the files please wait ....