Эх сурвалжийг харах

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

Daniele Alessandri 13 жил өмнө
parent
commit
d160cd9175

+ 3 - 2
examples/ServerSideScripting.php

@@ -29,8 +29,9 @@ class IncrementExistingKey extends ScriptedCommand
     {
     {
         return
         return
 <<<LUA
 <<<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
     end
 LUA;
 LUA;
     }
     }