Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// WARNING: right now, support for redis-cluster is experimental,
// unoptimized and in its very early stages of development. To
// play with it you must have a correct setup of redis-cluster
// running (oh hai mr. obvious) and Predis v0.7-dev fetched from
// the redis_cluster branch of the Git repository.
require 'autoload.php';
$servers = array(
// Developers can specify which kind of cluster strategy the
// client should use with the recently added 'cluster' option
// and the following values:
// - predis : good old client-side sharding (default)
// - redis : redis-cluster
$client = new Predis\Client($servers, array('cluster' => 'redis'));
$client->set("foo", "bar");
$foo = $client->get("foo");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment