mirror of
https://github.com/phpredis/phpredis.git
synced 2026-06-19 07:35:31 +00:00
ce5b0facc2
* Rework HMGET and implement HGETEX Instead of using a bespoke NULL terminated `zval**` array for the context array we can use a `HashTable`. This might be a tiny bit more expensive but Zend hashtables are quite efficient and this should also be less error prone. * Rework our `HashTable` context array to store keys Instead of sending an array of values we can instead add the fields as keys to our context array. That way when we combine the keys with the Redis provided values we can do it in-place and then just give the HashTable to the user to then do with what they want. * Implement HGETDEL command. * Fix edge cases to abide by legacy behavior. Previously we coerced integer strings into integer keys when zipping `HMGET` responses. This commit adds logic so we continue to do this and do not change semantics. * Implement `HGETDEL` and `HGETEX` for `RedisCluster`. This commit implements the new commands and reworks the `HMGET` reply handler to use the new context `HashTable`. * Fix an edge case where we get zero multiblk elements * Tests for `HGETEX` and `HGETDEL` * Minor logic improvement We don't need to check if `c->reply_len > 0` in the last else block since we have already determined it must be. * Implement `HSETEX` for `Redis` and `RedisCluster` * Use `zval_get_tmp_string` ro populating non-long keys