Download the PHP package nathan-muir/json-rpc-2 without Composer
On this page you can find all versions of the php package nathan-muir/json-rpc-2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nathan-muir/json-rpc-2
More information about nathan-muir/json-rpc-2
Files in nathan-muir/json-rpc-2
Package json-rpc-2
Short Description JSON-RPC 2.0 Client & Server Implementation
License MIT
Homepage http://github.com/nathan-muir/json-rpc-2
Informations about the package json-rpc-2
json-rpc-2
This library is a highly flexible implementation of the JSON-RPC 2.0 specification written for PHP 5.3+, adhering to the PSR standards [where applicable].
It has been designed to allow for many of the mechanisms to be changed without editing core files. It is possible to run different transports, authentication schemes, method authorisation systems, argument type validation & data sanitizing schemes, proxy system, and method list caching/parsing systems without modifying the library.
Admittedly, it's currently missing the necessary unit tests that will allow you to check the behaviour of some of your components.
If you have written any modules that could be included, or would like to discuss the library- please do!
How to Use Client - Basic
How To Use Server - Basic
How To Use Server - Advanced
Todo
Documentation:
- Client Documentation
Testing:
-
Unit Test
- Core\ResponseParser
- Server\Server [mock the 'receive' function, or wrap the combination of TransportInterface & RequestParser]
- Client\Client [mock the 'send' function, or wrap the combination of TransportInterface & ResponseParser]
- Client\BatchClient
- Server\Transport\HttpTransport
- Un-implemented Classes / Transports
Implementation / Functionality:
- OAuth & Basic Auth Client Wrapper using HttpTransport
- More comprehensive Dispatch system implementations (Caching, Docblock Parsing, Type Checking)
Server Structure / Work-flow
Transport Lifecycle:
- Reads the transport layer / source - provides string/text only
- Receives a text reply to render
Server Lifecycle:
- Obtains Requests text from Transport via 'receive'.
- Uses \JsonRpc\RequestParser->parse() to parse in to objects
- Iterates through each requests, obtaining the result through Dispatch->invoke. Exceptions are caught and turned into ResponseError.
- Passes the result, back to the Transport to be rendered.
Dispatch Lifecycle:
- Is passed a method-alias and arguments, and must return a result or throw an exception.