Explorar el Código

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

Daniele Alessandri hace 13 años
padre
commit
d160cd9175
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  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;
     }