2017 © Pedro Peláez
 

library jsonrpc

A general JSON RPC client.

image

fritz-payment/jsonrpc

A general JSON RPC client.

  • Monday, May 27, 2013
  • by fritz-payment
  • Repository
  • 3 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

jsonrpc

A general JSON RPC implementation for PHP., (*1)

  • Support for different transports (currently a cURL implementation exists).
  • Different JSON RPC Codecs (currently JSON RPC Version 1.0 as defined by http://json-rpc.org/wiki/specification is implemented; JSON RPC 2.0 http://www.jsonrpc.org/specification will be supported soon).
  • Clean API.

Project Wiki

GitHub Project Wiki, (*2)

What's new

Version 0.2.0

  • Implementation of JSON RPC 2.0 Codec.

Version 0.1.0

  • Finished basic implementations.

Getting started

Installation

You can use Composer (http://www.getcomposer.org) to install the JSON RPC library., (*3)

{
    "require": {
        "fritz-payment/jsonrpc": "dev-master"
    }
}

Usage

This example calls a JSON RPC 1.0 method "test.echo" on the URL http://www.example.com using cURL., (*4)

<?php
use \FritzPayment\JsonRpc\Rpc\Codec\JsonRpc10;
use \FritzPayment\JsonRpc\Client\Transport\Curl;

// initialize JSON RPC 1.0 Codec
$codec = new JsonRpc10();
// initialize cURL transport
$transport = new Curl();

// initialize client
$client = new \FritzPayment\JsonRpc\Client('http://www.example.com', $codec, $transport);

// create a new request
/* @var $request \FritzPayment\JsonRpc\Rpc\Codec\JsonRpc10\Request */
$request = $client->newRequest();
$request->setMethod('test.echo')
    ->setId('1');
$request->setParams(array('test message'));

// send request
$response = $client->exec($request);
if ($response === false) {
    // failed
} else {
    if ($response->isError()) {
        // JSON RPC error
        echo $response->getError()->error();
    } else {
        var_dump($response->getResult());
    }
}

Extending the library

It is possible to create your own implementations of Transports and Codecs., (*5)

The abstract Transport and Codec classes and the existing implementations should give you an idea of how to do that., (*6)

The Versions

27/05 2013

0.2.0.x-dev

0.2.0.9999999-dev https://github.com/fritz-payment/jsonrpc

A general JSON RPC client.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Christian Ruffer
by Seong-Min Kang

curl json client jsonrpc rpc

27/05 2013

dev-master

9999999-dev https://github.com/fritz-payment/jsonrpc

A general JSON RPC client.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Christian Ruffer
by Seong-Min Kang

curl json client jsonrpc rpc

17/05 2013

0.1.0

0.1.0.0 https://github.com/fritz-payment/jsonrpc

A general JSON RPC client.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Christian Ruffer
by Seong-Min Kang

curl json client jsonrpc rpc

14/05 2013

0.1.0-RC1

0.1.0.0-RC1 https://github.com/fritz-payment/jsonrpc

A general JSON RPC implementation

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Christian Ruffer
by Seong-Min Kang

curl json client jsonrpc rpc