Explorar o código

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

Daniele Alessandri %!s(int64=13) %!d(string=hai) anos
pai
achega
d160cd9175
Modificáronse 1 ficheiros con 3 adicións e 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;
     }