Download the PHP package mihasicehcek/php_json_rpc_2_server without Composer

On this page you can find all versions of the php package mihasicehcek/php_json_rpc_2_server. 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 php_json_rpc_2_server

PHP JsonRPC2 Server

Description

Latest Stable Version Total Downloads License

It is php implementation of the JSON-RPC 2.0 server

Working principle is very simple

  1. Create an instance of the class \PhpJsonRpc2\JsonRpcServer
  2. In method setRequest pass instance or array of \PhpJsonRpc2\Request
  3. Using method getResponse getting instance or array of instances \PhpJsonRpc2\Response

There is also a \PhpJsonRpc2\ICallStrategy interface that can configure \PhpJsonRpc2\JsonRpcServer for changing strategy of calling procedure. By default \PhpJsonRpc2\JsonRpcServer is configured by strategy \PhpJsonRpc2\ClassMethodCallStrategy, that divide request parameter "method"(for example Calculator.sum) by dot and create "Calculator" instance and call its method "sum".

Installation using composer

Examples

Simple Example

Expamle with pre-conversion json string into object

You can convert json into instance or instances array before passing it into server object. That can be implemented using static method\PhpJsonRpc2\Request::requestFactory($json). But in this case you need to look after handling \PhpJsonRpc2\ParseErrorException, that can be throwed in case of invalid json parsing

Notification

Notification if passed, the response is returned null.

Batch

See Batch

Custom strategy call

You can define your own methods strategy call For example we want to provide "method" not as class.method, but invoke some simple functions

Exceptions

All exceptions is subtype of base \PhpJsonRpc2\BaseJsonRpcException. Exceptions not throwing, but its instance returned in response.

If you want to throw an exception in procedures, you need to throw instance of \PhpJsonRpc2\InternalException or its subtype


All versions of php_json_rpc_2_server with dependencies

PHP Build Version
Package Version
Requires mihasicehcek/json_parser Version 1.*
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 mihasicehcek/php_json_rpc_2_server contains the following files

Loading the files please wait ....