Skip to content

Commit

Permalink
Merge pull request #76 from sevrugin/master
Browse files Browse the repository at this point in the history
Added scripting commands (#eval, #evalsha)
  • Loading branch information
omansour authored Apr 23, 2019
2 parents f4c6f55 + d263838 commit eeb961c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ Redis command | Description


It mocks **MULTI**, **DISCARD** and **EXEC** commands but without any transaction behaviors, they just make the interface fluent and return each command results.
**PIPELINE** and **EXECUTE** pseudo commands (client pipelining) are also mocked.
**PIPELINE** and **EXECUTE** pseudo commands (client pipelining) are also mocked.
**EVAL** and **EVALSHA** are just stubs—they won't execute anything

## Usage

Expand Down
26 changes: 26 additions & 0 deletions src/M6Web/Component/RedisMock/RedisMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -1196,4 +1196,30 @@ public function rpoplpush(string $sourceList, string $destinationList)
// return the rpop value;
return $rpopValue;
}

/**
* Evaluate a LUA script serverside, from the SHA1 hash of the script instead of the script itself.
*
* @param string $script
* @param int $numkeys
* @param mixed $arguments
* @return mixed
*/
public function evalsha($script, $numkeys, ...$arguments)
{
return;
}

/**
* Evaluate a script and return its result.
*
* @param string $script
* @param int $numberOfKeys
* @param dynamic $arguments
* @return mixed
*/
public function eval($script, $numberOfKeys, ...$arguments)
{
return;
}
}

0 comments on commit eeb961c

Please sign in to comment.