2017 © Pedro PelĂĄez
 

library json-rpc

Fully unit-tested JSON-RPC 2.0 for PHP

image

datto/json-rpc

Fully unit-tested JSON-RPC 2.0 for PHP

  • Thursday, May 17, 2018
  • by smortensen
  • Repository
  • 7 Watchers
  • 57 Stars
  • 26,998 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 13 Versions
  • 13 % Grown

The README.md

JSON-RPC for PHP

Overview

This package allows you to create and evaluate JSON-RPC messages, using your own PHP code to evaluate the requests., (*1)

This package allows you to create and evaluate any JSON-RPC message. It implements the JSON-RPC specifications, but does not provide a transport layer—which you'll also need if you want to send or receive messages over a distance! One of the beautiful features of JSON-RPC is that you can use any transport layer to carry your messages: This package gives you that option., (*2)

If you're looking for an end-to-end solution, with the transport layer included, then you should use one of these alternative packages instead: * To send messages over HTTP(S), use the php-json-rpc-http package. * To send messages over SSH, use the php-json-rpc-ssh package., (*3)

Features

  • Correct: fully compliant with the JSON-RPC 2.0 specifications (100% unit-test coverage)
  • Flexible: you can use your own code to evaluate the JSON-RPC method strings
  • Minimalistic: extremely lightweight
  • Ready to use, with working examples

Examples

Client

$client = new Client();

$client->query(1, 'add', array(1, 2));

$message = $client->encode();

// message: {"jsonrpc":"2.0","method":"add","params":[1,2],"id":1}

Server

$api = new Api();

$server = new Server($api);

$reply = $server->reply($message);

// reply: {"jsonrpc":"2.0","result":3,"id":1}

See the examples folder for full working examples., (*4)

Requirements

  • PHP >= 7.0

License

This package is released under an open-source license: LGPL-3.0, (*5)

Installation

If you're using Composer, you can include this library (datto/json-rpc) like this:, (*6)

composer require "datto/json-rpc"

Getting started

  1. Try the examples. You can run the examples from the project directory like this:, (*7)

    php examples/client.php
    php examples/server.php
    
  2. Take a look at the code "examples/src"—then replace it with your own!, (*8)

Unit tests

You can run the suite of unit tests from the project directory like this:, (*9)

./vendor/bin/phpunit

Changelog

See what has changed: Changelog, (*10)

Author

Spencer Mortensen, (*11)

The Versions

17/05 2018

dev-master

9999999-dev http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0+ LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

17/05 2018

5.0.0

5.0.0.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

07/09 2017

4.0.4

4.0.4.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

08/06 2017

4.0.3

4.0.3.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

29/02 2016

4.0.2

4.0.2.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

12/01 2016

4.0.1

4.0.1.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

12/01 2016

4.0.0

4.0.0.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

18/08 2015

3.0.0

3.0.0.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

27/07 2015

2.0.2

2.0.2.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

25/07 2015

2.0.1

2.0.1.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

25/07 2015

2.0.0

2.0.0.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

22/05 2015

1.0.1

1.0.1.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc

22/05 2015

1.0.0

1.0.0.0 http://datto.com

Fully unit-tested JSON-RPC 2.0 for PHP

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3.0

 

The Development Requires

php json json-rpc jsonrpc rpc php-json-rpc