소스 검색

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

Daniele Alessandri 13 년 전
부모
커밋
1ae30d62db
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  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));
+    }
 }