Download the PHP package endisha/resilient-client without Composer

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

Resilient Client

Latest Stable Version Total Downloads

Resilient Client is a PHP package designed to implement a circuit breaker pattern to enhance stability and prevent cascading failure requests.

What is circuit breaker pattern?

The Circuit Breaker is a design pattern used in software development. It is used to detect and prevent cascading request failures due to slow network connectivity, timeouts, unavailability, or unexpected system difficulties.

Requirements

Installation

You can install the package via Composer by running the following command:

Usage

To use the package in your project, include the Composer autoload file:

Implementing the circuit breaker pattern:

The CircuitBreaker constructor also allows setting a custom key as the second parameter; the default value is default

Adapters

The package supports two types of adapters, each serving as a method of state storage for the circuit breaker pattern:

File Storage Adapter

To use the File Storage Adapter and save circuit states to files use FileStorageAdapter and follow these steps:

Database (PDO) Adapter

To use the Database (PDO) Adapter and work with PDO to save states in the circuit_breaker table, you need to create the custom table first:

Create an instance of PDODatabaseAdapter class

How it Works

Example

Guzzle Integration

The package supports integration with Guzzle through the CircuitBreakerGuzzleMiddleware middleware. This middleware is automatically implemented when ConnectException exceptions are thrown due to problems connecting to remote servers or establishing connections. To implement it, follow these steps:

Additionally, you can specify certain HTTP status codes as failure requests. For example, you might want to treat errors like 301 (Moved Permanently) and 302 (Found) as failure responses:

Handling Exceptions

When the circuit breaker is in an open state, it throws the ResilientClient\CircuitBreaker\Exceptions\CircuitBreakerException exception class. This exception serves as a signal that the circuit is currently open and requests to the service are not allowed. You can catch this exception to implement custom handling logic in your application when the circuit is open.

Example usage:

Tests

License

The Resilient Client package is open-source software licensed under the MIT License.


All versions of resilient-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 endisha/resilient-client contains the following files

Loading the files please wait ....