diff --git a/examples/CommandPipeline.php b/examples/CommandPipeline.php index 1edc4d48..76f25cf0 100644 --- a/examples/CommandPipeline.php +++ b/examples/CommandPipeline.php @@ -1,10 +1,10 @@ pipeline(function($pipe) { $pipe->ping(); @@ -35,4 +35,4 @@ Array ) */ -?> \ No newline at end of file +?> diff --git a/examples/CustomDistributionStrategy.php b/examples/CustomDistributionStrategy.php index 27a1c07b..957f4297 100644 --- a/examples/CustomDistributionStrategy.php +++ b/examples/CustomDistributionStrategy.php @@ -1,5 +1,5 @@ new NaiveDistributionStrategy(), ); -$redis = new Predis\Client($servers, $options); +$redis = new Predis\Client($multiple_servers, $options); for ($i = 0; $i < 100; $i++) { $redis->set("key:$i", str_pad($i, 4, '0', 0)); @@ -60,6 +55,6 @@ $server1 = $redis->getClientFor('first')->info(); $server2 = $redis->getClientFor('second')->info(); printf("Server '%s' has %d keys while server '%s' has %d keys.\n", - 'first', $server1['db0']['keys'], 'second', $server2['db0']['keys'] + 'first', $server1['db15']['keys'], 'second', $server2['db15']['keys'] ); ?> diff --git a/examples/MultipleSetAndGet.php b/examples/MultipleSetAndGet.php index 1c5c8f86..16f37ca5 100644 --- a/examples/MultipleSetAndGet.php +++ b/examples/MultipleSetAndGet.php @@ -11,7 +11,7 @@ $mkv = array( 'usr:0003' => 'Third user' ); -$redis = Predis\Client::create($configurations); +$redis = new Predis\Client($single_server); $redis->mset($mkv); $retval = $redis->mget(array_keys($mkv)); @@ -26,4 +26,4 @@ Array [2] => Third user ) */ -?> \ No newline at end of file +?> diff --git a/examples/PubSubContext.php b/examples/PubSubContext.php index a78f86fa..41a598ee 100644 --- a/examples/PubSubContext.php +++ b/examples/PubSubContext.php @@ -1,11 +1,11 @@ -1)); // Initialize a new pubsub context $pubsub = $redis->pubSubContext(); diff --git a/examples/SharedConfigurations.php b/examples/SharedConfigurations.php index 8f96e62b..03a5cb0a 100644 --- a/examples/SharedConfigurations.php +++ b/examples/SharedConfigurations.php @@ -1,9 +1,24 @@ '127.0.0.1', 'port' => 6379, 'database' => 15 ); -?> \ No newline at end of file + +$multiple_servers = array( + array( + 'host' => '127.0.0.1', + 'port' => 6379, + 'database' => 15, + 'alias' => 'first', + ), + array( + 'host' => '127.0.0.1', + 'port' => 6380, + 'database' => 15, + 'alias' => 'second', + ), +); +?> diff --git a/examples/SimpleSetAndGet.php b/examples/SimpleSetAndGet.php index d6e34327..9a39f447 100644 --- a/examples/SimpleSetAndGet.php +++ b/examples/SimpleSetAndGet.php @@ -3,7 +3,7 @@ require_once 'SharedConfigurations.php'; // simple set and get scenario -$redis = Predis\Client::create($configurations); +$redis = new Predis\Client($single_server); $redis->set('library', 'predis'); $retval = $redis->get('library'); @@ -13,4 +13,4 @@ print_r($retval); /* OUTPUT predis */ -?> \ No newline at end of file +?>