Skip to content

Commit a243cc7

Browse files
author
Christoph Singer
committed
Prepare new version 0.6.1 with support for Symfony 4
1 parent 69ca0b7 commit a243cc7

File tree

6 files changed

+33
-17
lines changed

6 files changed

+33
-17
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ script: vendor/bin/phpunit
1919

2020
matrix:
2121
allow_failures:
22-
- env: SYMFONY_VERSION=^4
2322
- env: SYMFONY_VERSION=dev-master
2423
exclude:
2524
- env: SYMFONY_VERSION=dev-master

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### v0.6.1 2018-03-10 ###
2+
- compatibility with Symfony 4, thanks to @shreypuranik
3+
- make unit tests compatible with newer phpunit versions
14

25
### v0.6.0 2017-02-09 ###
36
- added compatibility with Symfony 3, thanks to @JasonMiesionczek

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2013-2017 Christoph Singer, Web-Agentur 72
1+
Copyright (c) 2013-2018 Christoph Singer, Web-Agentur 72
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
JsonRpcBundle
22
=============
33

4-
[![Build Status](https://secure.travis-ci.org/wasinger/jsonrpc-bundle.png?branch=master)](http://travis-ci.org/wasinger/jsonrpc-bundle)
4+
[![Build Status](https://secure.travis-ci.org/wasinger/jsonrpc-bundle.svg?branch=master)](http://travis-ci.org/wasinger/jsonrpc-bundle)
55
[![Latest Version](http://img.shields.io/packagist/v/wa72/jsonrpc-bundle.svg)](https://packagist.org/packages/wa72/jsonrpc-bundle)
66
[![Downloads from Packagist](http://img.shields.io/packagist/dt/wa72/jsonrpc-bundle.svg)](https://packagist.org/packages/wa72/jsonrpc-bundle)
77

88

9-
JsonRpcBundle is a bundle for Symfony 2 and 3 that allows to easily build a JSON-RPC server for web services using [JSON-RPC 2.0] (http://www.jsonrpc.org/specification).
9+
JsonRpcBundle is a bundle for Symfony that allows to easily build a JSON-RPC server for web services using
10+
[JSON-RPC 2.0](http://www.jsonrpc.org/specification).
1011

11-
*Currently it does not work yet with Symfony 4.*
12-
13-
The bundle contains a controller that is able to expose methods of any service registered in the Symfony service container as a JSON-RPC web service.
12+
The bundle contains a controller that is able to expose methods of any public service registered in the Symfony service
13+
container as a JSON-RPC web service.
1414

1515
Documentation
1616
-------------
1717

1818
Documentation is found in [Resources/doc/index.rst](Resources/doc/index.rst).
1919

2020

21-
© 2013-2017 Christoph Singer, Web-Agentur 72. Licensed under the MIT license.
21+
© 2013-2018 Christoph Singer, Web-Agentur 72. Licensed under the MIT license.

Resources/doc/index.rst

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
=============
12
JsonRpcBundle
23
=============
34

45
JsonRpcBundle is a bundle for Symfony 2.7 and up that allows to easily build a JSON-RPC server for web services using `JSON-RPC 2.0`_.
56

6-
The bundle contains a controller that is able to expose methods of any service registered in the Symfony service container as a JSON-RPC web service. The return value of the service method is converted to JSON using `jms\_serializer`_.
7+
The bundle contains a controller that is able to expose methods of any public service registered in the Symfony service container as a JSON-RPC web service. The return value of the service method is converted to JSON using `jms\_serializer`_.
78

89
Of course, it doesn't simply expose all your services' methods to the public, but only those explicitely mentioned in the configuration. And service methods cannot be called by it's original name but by an alias to be defined in the configuration.
910

1011

1112
Installation
12-
------------
13+
============
1314

1415
1. Add "wa72/jsonrpc-bundle" as requirement to your composer.json
1516

@@ -27,9 +28,13 @@ Installation
2728
Your JSON-RPC web service will then be available in your project calling the /jsonrpc/ URL.
2829

2930
Configuration
30-
-------------
31+
=============
3132

3233
You must configure which functions of the services registered in the Service Container will be available as web services.
34+
There are two methods how to do this:
35+
36+
Method 1: Expose single methods from any service via yaml configuration
37+
-----------------------------------------------------------------------
3338

3439
Configuration is done under the "wa72\_json\_rpc" key of your configuration (usually defined in your app/config/config.yml).
3540
To enable a Symfony2 service method to be called as a JSON-RPC web service, add it to the "functions" array of the configuration.
@@ -66,10 +71,18 @@ If you use `jms\_serializer`_ you can also configure exclusion strategies (group
6671
version: "1"
6772
max_depth_checks: true
6873
74+
75+
Method 2: tag a sercive to make all it's public methods callable by JSON-RPC
76+
----------------------------------------------------------------------------
77+
6978
Starting with v0.4.0, it is also possible to fully expose all methods of a service by tagging it with ``wa72\_jsonrpc.exposable``.
7079
All public methods of services tagged with 'wa72\_jsonrpc.exposable' can be called via JSON-RPC. The method name
7180
to be used in the RPC call is "service\:method", i.e. the name of the service and the method separated by colon.
7281

82+
83+
Notes
84+
=====
85+
7386
**New in Version 0.5.0**: It is now possible to call methods that require objects as parameters (in previous versions
7487
only methods with scalar and array parameters could be called).
7588
That's why *JMSSerializerBundle is now a required dependency*.
@@ -78,10 +91,11 @@ For this to work, the following conditions must be met:
7891
- The method parameters must be correctly type hinted
7992
- The classes used as parameters must contain `jms\_serializer @Type annotations for their properties <http://jmsyst.com/libs/serializer/master/reference/annotations#type>`_
8093

94+
8195
Testing
82-
-------
96+
=======
8397

84-
The bundle comes with a test service. If you have imported the bundle's routing to ``/jsonrpc`` (see above)
98+
The bundle comes with a simple test service. If you have imported the bundle's routing to ``/jsonrpc`` (see above)
8599
register the test service in your DI container:
86100

87101
.. code-block:: yaml
@@ -105,10 +119,10 @@ and you should get the following answer:
105119
106120
{"jsonrpc":"2.0","result":"Hello Joe!","id":"foo"}
107121
108-
There are also unit tests for phpunit. Just install the required dependencies using ``composer install`` and run
109-
``phpunit`` in the root directory of the project.
122+
There are also unit tests for phpunit. Just install the required development dependencies using ``composer install`` and run
123+
``vendor/bin/phpunit`` in the root directory of the project.
110124

111-
© 2013-2017 Christoph Singer, Web-Agentur 72. Licensed under the MIT license.
125+
© 2013-2018 Christoph Singer, Web-Agentur 72. Licensed under the MIT license.
112126

113127

114128
.. _`JSON-RPC 2.0`: http://www.jsonrpc.org/specification

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name":"wa72/jsonrpc-bundle",
33
"description":"JSON-RPC server for Symfony: exposes services registered in the service container as JSON-RPC webservices",
4-
"keywords":["json", "rpc", "jsonrpc", "json-rpc", "webservice", "symfony4bundle" ],
4+
"keywords":["json", "rpc", "jsonrpc", "json-rpc", "webservice", "symfony", "symfony-bundle" ],
55
"homepage":"http://github.com/wasinger/jsonrpc-bundle",
66
"license":"MIT",
77
"type": "symfony-bundle",

0 commit comments

Comments
 (0)