Explorar o código

Returns the SHA1 hash of a Lua script from instances of ServerEval.

Daniele Alessandri %!s(int64=13) %!d(string=hai) anos
pai
achega
1ae30d62db
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      lib/Predis/Commands/ServerEval.php

+ 10 - 0
lib/Predis/Commands/ServerEval.php

@@ -46,4 +46,14 @@ class ServerEval extends Command
     {
         return false;
     }
+
+    /**
+     * Calculates the SHA1 hash of the body of the script.
+     *
+     * @return string SHA1 hash.
+     */
+    public function getScriptHash()
+    {
+        returns sha1($this->getArgument(0));
+    }
 }