Download the PHP package mops1k/json-rpc-bundle without Composer

On this page you can find all versions of the php package mops1k/json-rpc-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package json-rpc-bundle

JSON-RPC Server bundle

This bundle provide an easy way to implement json-rpc server with fully specification supporting. Bundle supports multiple procedure calls in one request as described in specification.

JSON-RPC specification is fully compatible with CQRS architecture

Install

Import route declaration in your routes:

Or add your own paths by template:

Usage

To create method you have to create invokable class with attribute \JsonRpcBundle\Attribute\AsRpcMethod, where methodName constructor parameter must contain method name. Example:

Contract request DTO

Bundle provide possibility to provide params to your DTO class. For these feature you have to add attribute \JsonRpcBundle\Attribute\RpcMethodContract. DTO passed supports validation through symfony/validator. Example:

Validation for method params without contract

If you don't want to use DTO, you still able to validate method parameters and set its groups. In this case you need to implement your method class from \JsonRpcBundle\MethodResolver\ValidateMethodParametersInterface. Example:

Notification

Json rpc supports notification requests what does not return any response. To make your method as notification, just add void in __invoke return type hint. Example:

Namespace

Bundle supports method namespacing. To set method namespace, use \JsonRpcBundle\Attribute\AsRpcMethod::$namespace attribute parameter. Example:

To fetch namespaced method you can call it by method name (namespace.methodName) or call to path /rpc/{namespace} and use regular method name. Examples:

  1. Call to /rpc:

  2. Call to /rpc/user:

This feature also supports bath requests.

API Documentation

Bundle supports documentation semi-auto generation thru nelmio/api-doc-bundle. By default documentation generate params from method parameters, method contract. If you need more specific params documentation, just use OA\Property attribute. If you need specific response result, then use \JsonRpcBundle\ApiDoc\Attribute\Result attribute (set array of OA\Property inside $properties parameter). Object responses auto-generated to documentation by it's describing inside class.


All versions of json-rpc-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
symfony/framework-bundle Version ^6.4 || ^7.0
symfony/property-access Version ^6.4 || ^7.0
symfony/serializer Version ^6.4 || ^7.0
symfony/validator Version ^6.4 || ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mops1k/json-rpc-bundle contains the following files

Loading the files please wait ....