2017 © Pedro Peláez
 

symfony-bundle json-rpc-bundle

JSON-RPC 2.0 Server for Symfony

image

neofusion/json-rpc-bundle

JSON-RPC 2.0 Server for Symfony

  • Thursday, June 1, 2017
  • by NeoFusion
  • Repository
  • 2 Watchers
  • 1 Stars
  • 629 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 9 % Grown

The README.md

NeoFusionJsonRpcBundle

JSON-RPC 2.0 Server for Symfony, (*1)

Build Status Scrutinizer Code Quality, (*2)

SensioLabsInsight, (*3)

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*4)

$ composer require neofusion/json-rpc-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*5)

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:, (*6)

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new NeoFusion\JsonRpcBundle\NeoFusionJsonRpcBundle(),
        );

        // ...
    }

    // ...
}

Step 3: Configure API methods

You can easily define methods in your configuration file:, (*7)

neofusion_jsonrpc:
    routing:
        customer:
            path: /customer
            methods:
                comment.create: { service: 'app.api.customer.comment', action: 'create' }
                comment.delete: { service: 'app.api.customer.comment', action: 'delete' }
  • routing - list of routes
  • customer - internal name of a route
  • path - second part of URL after prefix
  • methods - list of methods
  • comment.create - method name
  • service - name of a service, which contains callable methods
  • action - callable method from the service

Step 4: Register the routes

Finally, register this bundle's routes by adding the following to your project's routing file:, (*8)

# app/config/routing.yml
neofusion_jsonrpc:
    resource: "@NeoFusionJsonRpcBundle/Resources/config/routing.yml"
    prefix: /api

The Versions

28/10 2016

v0.1.0

0.1.0.0 https://github.com/NeoFusion/JsonRpcBundle

JSON-RPC 2.0 Server for Symfony

  Sources   Download

MIT

The Requires

 

The Development Requires

by Evgeniy NeoFusion

symfony json-rpc