mirror of
https://github.com/phpredis/phpredis.git
synced 2026-06-19 07:35:31 +00:00
Implement MSETEX and refactor SET.
* Implement the new `MSETEX` Redis command. * Refactor parsing of extended `SET` arguments into unified helper functions, deduplicating logic. * Add new `SET` arguments `IFNE`, `IFDEQ`, and `IFDNE`. We already support Valkey's existing `IFEQ` argument, which Redis has added. Fixes #2742
This commit is contained in:
committed by
Michael Grunder
parent
730dec06b6
commit
86eabb86eb
@@ -2902,6 +2902,19 @@ class Redis {
|
||||
*/
|
||||
public function mset(array $key_values): Redis|bool;
|
||||
|
||||
/**
|
||||
* Set one or more keys and values with optional expiry information.
|
||||
*
|
||||
* @param array $key_vals An array of keys with their values.
|
||||
* @param int|float|array|null $expiry An optional array with expiry information.
|
||||
* @return Redis|int|false 1 if all keys were set, 0 if none were.
|
||||
*
|
||||
* @see https://redis.io/commands/msetex
|
||||
*
|
||||
* @example $redis->msetex(['foo' => 'bar', 'baz' => 'bop'], ['EX' => 60]);
|
||||
*/
|
||||
public function msetex(array $key_vals, int|float|array|null $expiry = null): Redis|int|false;
|
||||
|
||||
/**
|
||||
* Set one or more string keys but only if none of the key exist.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user