Download the PHP package rubix/client without Composer

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

Rubix Client

The PHP client SDK for Rubix ML Server.

Installation

Install Rubix Client SDK using Composer:

Requirements

Documentation

The latest documentation can be found below.

Table of Contents


Clients

Clients allow you to communicate directly with a model server using a friendly object-oriented interface inside your PHP applications. Under the hood, clients handle all the networking communication and content negotiation for you so you can write programs as if the model was directly accessible in your applications.

Return the predictions from the model:

Calculate the joint probabilities of each sample in a dataset:

Calculate the anomaly scores of each sample in a dataset:

Async Clients

Clients that implement the Async Client interface have asynchronous versions of all the standard client methods. All asynchronous methods return a Promises/A+ object that resolves to the return value of the response. Promises allow you to perform other work while the request is processing or to execute multiple requests in parallel. Calling the wait() method on the promise will block until the promise is resolved and return the value.

Return a promise for the probabilities predicted by the model:

Return a promise for the anomaly scores predicted by the model:

REST Client

The REST Client communicates with the HTTP Server through the JSON REST API it exposes.

Interfaces: AsyncClient

Parameters

# Param Default Type Description
1 host '127.0.0.1' string The IP address or hostname of the server.
2 port 8000 int The network port that the HTTP server is running on.
3 secure false bool Should we use an encrypted HTTP channel (HTTPS)?
4 middlewares array The stack of client middleware to run on each request/response.
5 timeout float The number of seconds to wait before giving up on the request.
6 verify certificate true bool Should we try to verify the server's TLS certificate?

Example

Client Middleware

Similarly to Server middleware, client middlewares are functions that hook into the request/response cycle but from the client end. Some of the server middlewares have accompanying client middleware such as Shared Token Authenticator.

Backoff and Retry

The Backoff and Retry middleware handles Too Many Requests (429) and Service Unavailable (503) responses by retrying the request after waiting for a period of time to avoid overloading the server even further. An acceptable backoff period is gradually achieved by multiplicatively increasing the delay between retries.

Parameters

# Param Default Type Description
1 max retries 3 int The maximum number of times to retry the request before giving up.
2 initial delay 0.5 float The number of seconds to delay between retries before exponential backoff is applied.

Example

Basic Authenticator (Client Side)

Adds the necessary authorization headers to the request using the Basic scheme.

Parameters

# Param Default Type Description
1 username string The user's name.
2 password string The user's password.

Example

Compress Request Body

Apply the Gzip compression algorithm to the request body.

Parameters

# Param Default Type Description
1 level 5 int The compression level between 0 and 9 with 0 meaning no compression.
2 threshold 65535 int The minimum size of the request body in bytes in order to be compressed.

Example

Shared Token Authenticator (Client Side)

Adds the necessary authorization headers to the request using the Bearer scheme.

Parameters

# Param Default Type Description
1 token string The shared token to authenticate the request.

Example

License

The code is licensed CC BY-NC 4.0.


All versions of client with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
guzzlehttp/guzzle Version ^7.2
guzzlehttp/psr7 Version ^1.7
psr/http-message Version ^1.0
rubix/ml Version ^2.0
symfony/polyfill-php80 Version ^1.17
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 rubix/client contains the following files

Loading the files please wait ....