Download the PHP package sparkcentral/psredis without Composer

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

PSRedis - Sentinel wrapper for PHP redis clients

A PHP client for redis sentinel connections as a wrapper on other redis clients. The name stands for PHP Sentinel client for Redis. I am sure other would be more creative in coming up with a name.

Installation

The easiest way to install is by using composer. The package is available on packagist so installing should be as easy as putting the following in your composer file:

Usage

Basic example

The most basic example makes use of the Predis adapter by default. This is the least amount of code needed to get going with PSRedis, although we are making plans to make the configuration more concise in the future.

Auto failover

You have the option of letting the library handle the failover. That means that in case of connection errors, the library will select the new master or reconnect to the existing ones depending of what the sentinels decide is the proper action. After this reconnection, the command will be re-tried, but only once. No option for backoff exists here.

Customizing the adapter

You can choose what kind of client adapter to use or even write your own. If you write your own you need to make sure you implement the \PSRedis\Client\ClientAdapter interface.

Configuring backoff

When we fail to discover the location of the master, we need to back off and try again. The back off mechanism is configurable and you can implement your own by implementing the \PSRedis\Client\BackoffStrategy

Here is an example using the incremental backoff strategy:

Testing

Note: For testing, we still use PHPUnit 3.7 due to a bug in PhpStorm not allowing us to run unit tests from our IDE. See http://youtrack.jetbrains.com/issue/WI-21666

Unit testing

We use PHPUnit for unit testing and Phake for mocking. Both are installed using composer. Running the unit tests can be done using the following command:

Integration testing

Prerequisites

Make sure you have installed these on your machine before running the tests:

Running the tests

Before running the tests you need to setup the VM to run the tests on. Use the following command to bring the box up:

After that, run the integration tests with

You will see some warnings that need to be fixed, but the tests themselves should all pass. The warnings are a result of the reset of the environment just before every integration test.


All versions of psredis with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
predis/predis Version >=1.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 sparkcentral/psredis contains the following files

Loading the files please wait ....