From d05a62e82cd43809e043ea02f7c33725bc6260a4 Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Fri, 4 Dec 2009 22:10:54 +0100 Subject: [PATCH] Updated the examples to match the PHP 5.2 version. --- examples/CommandPipeline.php | 20 ++++++++++---------- examples/MultipleSetAndGet.php | 2 +- examples/SimpleSetAndGet.php | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/CommandPipeline.php b/examples/CommandPipeline.php index 1edc4d48..aae31dc9 100644 --- a/examples/CommandPipeline.php +++ b/examples/CommandPipeline.php @@ -4,17 +4,17 @@ require_once 'SharedConfigurations.php'; // when you have a whole set of consecutive commands to send to // a redis server, you can use a pipeline to improve performances. -$redis = Predis\Client::create($configurations); +$redis = Predis_Client::create($configurations); -$replies = $redis->pipeline(function($pipe) { - $pipe->ping(); - $pipe->flushdb(); - $pipe->incrby('counter', 10); - $pipe->incrby('counter', 30); - $pipe->exists('counter'); - $pipe->get('counter'); - $pipe->mget('does_not_exist', 'counter'); -}); +$pipe = $redis->pipeline(); +$pipe->ping(); +$pipe->flushdb(); +$pipe->incrby('counter', 10); +$pipe->incrby('counter', 30); +$pipe->exists('counter'); +$pipe->get('counter'); +$pipe->mget('does_not_exist', 'counter'); +$replies = $pipe->execute(); print_r($replies); diff --git a/examples/MultipleSetAndGet.php b/examples/MultipleSetAndGet.php index 1c5c8f86..52e62bae 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 = Predis_Client::create($configurations); $redis->mset($mkv); $retval = $redis->mget(array_keys($mkv)); diff --git a/examples/SimpleSetAndGet.php b/examples/SimpleSetAndGet.php index d6e34327..fc9836c5 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 = Predis_Client::create($configurations); $redis->set('library', 'predis'); $retval = $redis->get('library');