2017 © Pedro Peláez
 

contao-module tivoka

The universal JSON-RPC client/server library. JSON-RPC done right! Contao version

image

bugbuster/tivoka

The universal JSON-RPC client/server library. JSON-RPC done right! Contao version

  • Monday, December 26, 2016
  • by BugBuster
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,733 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 8 Versions
  • 11 % Grown

The README.md

Contao Tivoka Build Status

JSON-RPC client and server for PHP 5.3+, (*1)

Based on tivoka in version 3.4.0, (*2)

  • JSON-RPC client/server library for PHP (supports v1.0 and v2.0 specs)
  • Easily switch between the v1.0 and v2.0 specs
  • HTTP, TCP and Websocket transports available
  • New: CurlHTTP available, used if HTTP not allowed (allow_url_fopen)

Examples

These are just some quick examples. Check out the docs in /doc/., (*3)

Do a request through HTTP..., (*4)

<?php
$connection = BugBuster\Tivoka\Client::connect('http://example.com/api')
$request = $connection->sendRequest('substract', array(51, 9));
print $request->result;// 42
?>

...or plain TCP, (*5)

<?php
$connection = BugBuster\Tivoka\Client::connect(array('host' => 'example.com', 'port' => 1234))
$request = $connection->sendRequest('substract', array(51, 9));
print $request->result;// 42
?>

...or WebSocket, (*6)

<?php
$connection = BugBuster\Tivoka\Client::connect('ws://example.com/api')
$request = $connection->sendRequest('substract', array(51, 9));
print $request->result;// 42
?>

Create a server, (*7)

<?php
$methods = array(
    'substract' => function($params) {
        list($num1, $num2) = $params
        return $num1 - $num2;
    }
);
BugBuster\Tivoka\Server::provide($methods)->dispatch();
?>

Installation

Install composer package

  1. Set up composer.json in your project directory:
{
  "require":{"bugbuster/tivoka":"*"}
}
  1. Run composer:
$ php composer.phar install

Now, include 'vendor/autoload.php', (*8)

License

Copyright 2011-2012 by Marcel Klehr, MIT License., (*9)

Copyright (c) 2014-2016 Glen Langer (Contao Version), MIT License., (*10)

The Versions

26/12 2016

dev-master

9999999-dev http://contao.ninja

The universal JSON-RPC client/server library. JSON-RPC done right! Contao version

  Sources   Download

MIT

The Requires

 

by Marcel Klehr (original)

api json json-rpc contao xml-rpc rpc

26/12 2016

1.1.1

1.1.1.0 http://contao.ninja

The universal JSON-RPC client/server library. JSON-RPC done right! Contao version

  Sources   Download

MIT

The Requires

 

by Marcel Klehr (original)

api json json-rpc contao xml-rpc rpc

26/12 2016

dev-contao-dev

dev-contao-dev http://contao.ninja

The universal JSON-RPC client/server library. JSON-RPC done right! Contao version

  Sources   Download

MIT

The Requires

 

by Marcel Klehr (original)

api json json-rpc contao xml-rpc rpc

05/03 2016

1.1.0

1.1.0.0 http://www.contao.glen-langer.de

The universal JSON-RPC client/server library. JSON-RPC done right! Contao version

  Sources   Download

MIT

The Requires

 

by Marcel Klehr (original)

api json json-rpc contao xml-rpc rpc

02/02 2015

1.0.2

1.0.2.0 http://www.contao.glen-langer.de

The universal JSON-RPC client/server library. JSON-RPC done right! Contao version

  Sources   Download

MIT

The Requires

 

by Marcel Klehr (original)

api json json-rpc contao xml-rpc rpc

25/01 2015

1.0.1

1.0.1.0 http://www.contao.glen-langer.de

The universal JSON-RPC client/server library. JSON-RPC done right! Contao version

  Sources   Download

MIT

The Requires

 

by Marcel Klehr (original)

api json json-rpc contao xml-rpc rpc

24/01 2015

1.0.0

1.0.0.0 http://www.contao.glen-langer.de

The universal JSON-RPC client/server library. JSON-RPC done right! Contao version

  Sources   Download

MIT

The Requires

 

by Marcel Klehr (original)

api json json-rpc contao xml-rpc rpc

15/12 2014

0.1.0-alpha1

0.1.0.0-alpha1 http://www.contao.glen-langer.de

The universal JSON-RPC client/server library. JSON-RPC done right! Contao version

  Sources   Download

MIT

The Requires

 

by Marcel Klehr (original)

api json json-rpc contao xml-rpc rpc