2017 © Pedro Peláez
 

package speech

JSON-RPC 2.0 for PHP. With Symfony 2.0 to 3.0 support.

image

zored/speech

JSON-RPC 2.0 for PHP. With Symfony 2.0 to 3.0 support.

  • Friday, April 14, 2017
  • by zored
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Speech

JSON-RPC 2.0 for PHP

Build Status Latest Stable Version, (*1)

Bundle for JSON-RPC 2.0. You can use as standalone library. Or with Symfony., (*2)

Features

Use

Symfony

  • Install package: composer require zored/speech.
  • Add bundle new Zored\SpeechBundle\ZoredSpeechBundle() to your Symfony kernel app/AppKernel.php.
  • Add route to default endpoint: routing.yml: yaml json_rpc: defaults: { _controller: ZoredSpeechBundle:Default:jsonRpc } methods: [POST] # Or GET for Zored RPC. path: /json-rpc
  • Add service with your JSON-RPC methods in services.yml: yaml services: your.service: # Replace with your own class: class: 'Zored\SpeechBundle\Test\JsonRpc\Greeter'
  • Allow this service to run in default controller via parameters.yml: yaml parameters: zored.speech.controller.context.service_ids: ['your.service']
  • Clear caches.
  • Test: bash curl http://example.com/json-rpc/ \ --data '{"id":"1", "method":"your.service:greet", "params":{"person":{"name":"bob","age":19}},"jsonrpc":"2.0"}'

Standalone library

  • See example in web/index.php
  • Run there server with php -S 127.0.0.1:8080
  • Test: bash curl http://127.0.0.1:8080 \ --data '{"id":"1", "method":"your.service:greet", "params":{"person":{"name":"bob","age":19}},"jsonrpc":"2.0"}'

What's next?

Inside

  • Your request JSON string goes to endpoint which handles it and returns Symfony response.
  • Endpoint chooses which request passer can pass JSON string to request handler.
    • There are single for {} and batch for [{},{}] passers enabled by default.
  • Request passer also deserializes JSON to object and validates it.
  • Request passer passes request object to request handler that pushes request somewhere to get response.
  • Request then passed back and serialized to array.

Events

You can see available events here., (*3)

The Versions

14/04 2017

dev-master

9999999-dev http://github.com/zored/speech

JSON-RPC 2.0 for PHP. With Symfony 2.0 to 3.0 support.

  Sources   Download

MIT

The Requires

 

The Development Requires

json json-rpc jsonrpc rpc symfony2bundle symfony3bundle

14/04 2017

1.1

1.1.0.0 http://github.com/zored/speech

JSON-RPC 2.0 for PHP. With Symfony 2.0 to 3.0 support.

  Sources   Download

MIT

The Requires

 

The Development Requires

json json-rpc jsonrpc rpc symfony2bundle symfony3bundle

14/04 2017

dev-develop

dev-develop http://github.com/zored/speech

JSON-RPC 2.0. With Symfony 2.0 to 3.0 support.

  Sources   Download

MIT

The Requires

 

The Development Requires

json json-rpc jsonrpc rpc symfony2bundle symfony3bundle

14/04 2017

1.0.1

1.0.1.0 http://github.com/zored/speech

JSON-RPC 2.0 for PHP. With Symfony 2.0 to 3.0 support.

  Sources   Download

MIT

The Requires

 

The Development Requires

json json-rpc jsonrpc rpc symfony2bundle symfony3bundle

14/04 2017

0.2

0.2.0.0 http://github.com/zored/speech

JSON-RPC 2.0 for PHP. With Symfony 2.0 to 3.0 support.

  Sources   Download

MIT

The Requires

 

The Development Requires

json json-rpc jsonrpc rpc symfony2bundle symfony3bundle

14/04 2017

1.0

1.0.0.0 http://github.com/zored/speech

JSON-RPC 2.0 for PHP. With Symfony 2.0 to 3.0 support.

  Sources   Download

MIT

The Requires

 

The Development Requires

json json-rpc jsonrpc rpc symfony2bundle symfony3bundle

14/04 2017

0.1

0.1.0.0 http://github.com/zored/speech

JSON-RPC 2.0. With Symfony 2.0 to 3.0 support.

  Sources   Download

MIT

The Requires

 

The Development Requires

json json-rpc jsonrpc rpc symfony2bundle symfony3bundle