Просмотр исходного кода

Update the server-side scripting example to use the current Redis unstable.

Daniele Alessandri 13 лет назад
Родитель
Сommit
d160cd9175
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      examples/ServerSideScripting.php

+ 3 - 2
examples/ServerSideScripting.php

@@ -29,8 +29,9 @@ class IncrementExistingKey extends ScriptedCommand
     {
         return
 <<<LUA
-    if redis('exists', KEYS[1]) == 1 then
-        return redis('incr', KEYS[1])
+    local cmd = redis.call
+    if cmd('exists', KEYS[1]) == 1 then
+        return cmd('incr', KEYS[1])
     end
 LUA;
     }