mirror of
https://github.com/predis/predis.git
synced 2026-08-24 14:29:35 +00:00
Update examples.
This commit is contained in:
@@ -32,8 +32,7 @@ class IncrementExistingKeysBy extends ScriptCommand
|
||||
|
||||
public function getScript()
|
||||
{
|
||||
return
|
||||
<<<LUA
|
||||
return <<<LUA
|
||||
local cmd, insert = redis.call, table.insert
|
||||
local increment, results = ARGV[1], { }
|
||||
|
||||
@@ -50,9 +49,14 @@ LUA;
|
||||
}
|
||||
}
|
||||
|
||||
$client = new Predis\Client($single_server);
|
||||
$client = new Predis\Client($single_server, array(
|
||||
'profile' => function ($options) {
|
||||
$profile = $options->getDefault('profile');
|
||||
$profile->defineCommand('increxby', 'IncrementExistingKeysBy');
|
||||
|
||||
$client->getProfile()->defineCommand('increxby', 'IncrementExistingKeysBy');
|
||||
return $profile;
|
||||
}
|
||||
));
|
||||
|
||||
$client->mset('foo', 10, 'foobar', 100);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user