Download the PHP package rambler-digital-solutions/php-json-rpc without Composer

On this page you can find all versions of the php package rambler-digital-solutions/php-json-rpc. 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

JsonRPC PHP Client and Server

A simple Json-RPC client/server that just works. Forked from fguillot/JsonRPC while trying to keep it slim and speedy.

Build Status

Features

Author

Frédéric Guillot

Installation with Composer

Examples

Server

Callback binding:

Class/Method binding:

Before callback:

Before each procedure execution, a custom method can be called.

This method receive the following arguments: $username, $password, $class, $method.

You can use this method to implements a custom authentication system or anything else. If you would like to reject the authentication, you can throw the exception JsonRPC\AuthenticationFailure.

Client

Example with positional parameters:

Example with named arguments:

Arguments are called in the right order.

Examples with shortcut methods:

The example above use positional arguments for the request and this one use named arguments:

Client batch requests

Call several procedures in a single HTTP request:

All results are stored at the same position of the call.

Client exceptions

Client exceptions are normally thrown when an error is returned by the server. You can change this behaviour by using the 'suppress_errors' option which causes exceptions to be returned. This can be extremely useful when executing the batch request.

Enable client debugging

You can enable the debug to see the JSON request and response:

The debug output is sent to the PHP's system logger. You can configure the log destination in your php.ini.

Output example:

IP based client restrictions

The server can allow only some IP adresses:

If the client is blocked, you got a 403 Forbidden HTTP response.

HTTP Basic Authentication

If you use HTTPS, you can allow client by using a username/password.

On the client, set credentials like that:

If the authentication failed, the client throw a RuntimeException.

Using an alternative authentication header:

The example above will use the HTTP header X-Authentication instead of the standard Authorization: Basic [BASE64_CREDENTIALS]. The username/password values need be encoded in base64: base64_encode('username:password').

Exceptions

If you want to send an error to the client you can throw an exception. You should configure which exceptions should be relayed to the client first:

Then you can throw that exception inside your procedure:

To relay all exceptions regardless of type, leave out the exception class name:


All versions of php-json-rpc with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
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 rambler-digital-solutions/php-json-rpc contains the following files

Loading the files please wait ....