Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d1d6900

Browse filesBrowse files
Implement VSIM command
This command is similar to `VADD` in that it's pretty simple but allows for a great many options. In it's most basic form: ```php // To get similarity of a different element $redis->vsim('myvec', 'some-element'); // To get similarity for a vector of scores ``` As seen above the method attempts to infer element or vector from the argument passed to $member`. However, since we do serialize the member when doing `ELE` mode, the user can also specify `ELE` explicitly in the options array to force an `ELE` search sending serialized values. ```php $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); $redis->vsim('myvec', [3.14, 2.71], ['ELE']); ``` See #2543
1 parent 286fa63 commit d1d6900
Copy full SHA for d1d6900

11 files changed

+331-4Lines changed: 331 additions & 4 deletions
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎redis.c‎

Copy file name to clipboardExpand all lines: redis.c
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3058,6 +3058,10 @@ PHP_METHOD(Redis, vadd) {
30583058
REDIS_PROCESS_CMD(vadd, redis_long_response);
30593059
}
30603060

3061+
PHP_METHOD(Redis, vsim) {
3062+
REDIS_PROCESS_CMD(vsim, redis_zrange_response);
3063+
}
3064+
30613065
/*
30623066
* Streams
30633067
*/
Collapse file

‎redis.stub.php‎

Copy file name to clipboardExpand all lines: redis.stub.php
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4208,6 +4208,22 @@ public function xrevrange(string $key, string $end, string $start, int $count =
42084208
*/
42094209
public function vadd(string $key, array $values, mixed $element, array|null $options = null): Redis|int|false;
42104210

4211+
/**
4212+
* Query similarity of a vector by element or scores
4213+
*
4214+
* @param string $key The vector set to query.
4215+
* @param mixed $member Either an element or array of scores. PhpRedis
4216+
* will attempt to infer which it is, but since
4217+
* there can be some ambiguity here due to
4218+
* serialization you can also explicitly specify
4219+
* `ELE`, `VALUES`, or `FP32` in the options
4220+
* array.
4221+
* @param array|null $options An optional options array
4222+
*
4223+
* @return Redis|array|false An array of elements and their similarity scores, or false on failure.
4224+
*/
4225+
public function vsim(string $key, mixed $member, array|null $options = null): Redis|array|false;
4226+
42114227
/**
42124228
* Truncate a STREAM key in various ways.
42134229
*
Collapse file

‎redis_arginfo.h‎

Copy file name to clipboardExpand all lines: redis_arginfo.h
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 63a08eee8fd89efe858ef57963e939e2095296c3 */
2+
* Stub hash: 89e401bc3bc52dbd6d20f0459f5740b3ec855eb2 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
@@ -1068,6 +1068,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_vadd, 0, 3, Redi
10681068
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
10691069
ZEND_END_ARG_INFO()
10701070

1071+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_vsim, 0, 2, Redis, MAY_BE_ARRAY|MAY_BE_FALSE)
1072+
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
1073+
ZEND_ARG_TYPE_INFO(0, member, IS_MIXED, 0)
1074+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
1075+
ZEND_END_ARG_INFO()
1076+
10711077
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_xtrim, 0, 2, Redis, MAY_BE_LONG|MAY_BE_FALSE)
10721078
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
10731079
ZEND_ARG_TYPE_INFO(0, threshold, IS_STRING, 0)
@@ -1479,6 +1485,7 @@ ZEND_METHOD(Redis, xread);
14791485
ZEND_METHOD(Redis, xreadgroup);
14801486
ZEND_METHOD(Redis, xrevrange);
14811487
ZEND_METHOD(Redis, vadd);
1488+
ZEND_METHOD(Redis, vsim);
14821489
ZEND_METHOD(Redis, xtrim);
14831490
ZEND_METHOD(Redis, zAdd);
14841491
ZEND_METHOD(Redis, zCard);
@@ -1755,6 +1762,7 @@ static const zend_function_entry class_Redis_methods[] = {
17551762
ZEND_ME(Redis, xreadgroup, arginfo_class_Redis_xreadgroup, ZEND_ACC_PUBLIC)
17561763
ZEND_ME(Redis, xrevrange, arginfo_class_Redis_xrevrange, ZEND_ACC_PUBLIC)
17571764
ZEND_ME(Redis, vadd, arginfo_class_Redis_vadd, ZEND_ACC_PUBLIC)
1765+
ZEND_ME(Redis, vsim, arginfo_class_Redis_vsim, ZEND_ACC_PUBLIC)
17581766
ZEND_ME(Redis, xtrim, arginfo_class_Redis_xtrim, ZEND_ACC_PUBLIC)
17591767
ZEND_ME(Redis, zAdd, arginfo_class_Redis_zAdd, ZEND_ACC_PUBLIC)
17601768
ZEND_ME(Redis, zCard, arginfo_class_Redis_zCard, ZEND_ACC_PUBLIC)
Collapse file

‎redis_cluster.c‎

Copy file name to clipboardExpand all lines: redis_cluster.c
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3066,6 +3066,10 @@ PHP_METHOD(RedisCluster, vadd) {
30663066
CLUSTER_PROCESS_CMD(vadd, cluster_long_resp, 0);
30673067
}
30683068

3069+
PHP_METHOD(RedisCluster, vsim) {
3070+
CLUSTER_PROCESS_CMD(vsim, cluster_zrange_resp, 1);
3071+
}
3072+
30693073
/* {{{ proto long RedisCluster::xack(string key, string group, array ids) }}} */
30703074
PHP_METHOD(RedisCluster, xack) {
30713075
CLUSTER_PROCESS_CMD(xack, cluster_long_resp, 0);
Collapse file

‎redis_cluster.stub.php‎

Copy file name to clipboardExpand all lines: redis_cluster.stub.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,12 @@ public function watch(string $key, string ...$other_keys): RedisCluster|bool;
10581058
*/
10591059
public function vadd(string $key, array $values, mixed $element, array|null $options = null): RedisCluster|int|false;
10601060

1061+
/**
1062+
* @see Redis::vsim
1063+
*/
1064+
public function vsim(string $key, mixed $member, array|null $options = null): Redis|array|false;
1065+
1066+
10611067
/**
10621068
* @see Redis::xack
10631069
*/
Collapse file

‎redis_cluster_arginfo.h‎

Copy file name to clipboardExpand all lines: redis_cluster_arginfo.h
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: bf0af294cda503416023a575efc55ea054fbb456 */
2+
* Stub hash: a4928c230ba6d599b66087fa831dd26bf1d4c5d7 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster___construct, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1)
@@ -881,6 +881,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_vadd, 0,
881881
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
882882
ZEND_END_ARG_INFO()
883883

884+
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_vsim, 0, 2, Redis, MAY_BE_ARRAY|MAY_BE_FALSE)
885+
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
886+
ZEND_ARG_TYPE_INFO(0, member, IS_MIXED, 0)
887+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null")
888+
ZEND_END_ARG_INFO()
889+
884890
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_xack, 0, 3, RedisCluster, MAY_BE_LONG|MAY_BE_FALSE)
885891
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
886892
ZEND_ARG_TYPE_INFO(0, group, IS_STRING, 0)
@@ -1316,6 +1322,7 @@ ZEND_METHOD(RedisCluster, unlink);
13161322
ZEND_METHOD(RedisCluster, unwatch);
13171323
ZEND_METHOD(RedisCluster, watch);
13181324
ZEND_METHOD(RedisCluster, vadd);
1325+
ZEND_METHOD(RedisCluster, vsim);
13191326
ZEND_METHOD(RedisCluster, xack);
13201327
ZEND_METHOD(RedisCluster, xadd);
13211328
ZEND_METHOD(RedisCluster, xclaim);
@@ -1560,6 +1567,7 @@ static const zend_function_entry class_RedisCluster_methods[] = {
15601567
ZEND_ME(RedisCluster, unwatch, arginfo_class_RedisCluster_unwatch, ZEND_ACC_PUBLIC)
15611568
ZEND_ME(RedisCluster, watch, arginfo_class_RedisCluster_watch, ZEND_ACC_PUBLIC)
15621569
ZEND_ME(RedisCluster, vadd, arginfo_class_RedisCluster_vadd, ZEND_ACC_PUBLIC)
1570+
ZEND_ME(RedisCluster, vsim, arginfo_class_RedisCluster_vsim, ZEND_ACC_PUBLIC)
15631571
ZEND_ME(RedisCluster, xack, arginfo_class_RedisCluster_xack, ZEND_ACC_PUBLIC)
15641572
ZEND_ME(RedisCluster, xadd, arginfo_class_RedisCluster_xadd, ZEND_ACC_PUBLIC)
15651573
ZEND_ME(RedisCluster, xclaim, arginfo_class_RedisCluster_xclaim, ZEND_ACC_PUBLIC)
Collapse file

‎redis_cluster_legacy_arginfo.h‎

Copy file name to clipboardExpand all lines: redis_cluster_legacy_arginfo.h
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: bf0af294cda503416023a575efc55ea054fbb456 */
2+
* Stub hash: a4928c230ba6d599b66087fa831dd26bf1d4c5d7 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster___construct, 0, 0, 1)
55
ZEND_ARG_INFO(0, name)
@@ -747,6 +747,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_vadd, 0, 0, 3)
747747
ZEND_ARG_INFO(0, options)
748748
ZEND_END_ARG_INFO()
749749

750+
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_vsim, 0, 0, 2)
751+
ZEND_ARG_INFO(0, key)
752+
ZEND_ARG_INFO(0, member)
753+
ZEND_ARG_INFO(0, options)
754+
ZEND_END_ARG_INFO()
755+
750756
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_xack, 0, 0, 3)
751757
ZEND_ARG_INFO(0, key)
752758
ZEND_ARG_INFO(0, group)
@@ -1154,6 +1160,7 @@ ZEND_METHOD(RedisCluster, unlink);
11541160
ZEND_METHOD(RedisCluster, unwatch);
11551161
ZEND_METHOD(RedisCluster, watch);
11561162
ZEND_METHOD(RedisCluster, vadd);
1163+
ZEND_METHOD(RedisCluster, vsim);
11571164
ZEND_METHOD(RedisCluster, xack);
11581165
ZEND_METHOD(RedisCluster, xadd);
11591166
ZEND_METHOD(RedisCluster, xclaim);
@@ -1398,6 +1405,7 @@ static const zend_function_entry class_RedisCluster_methods[] = {
13981405
ZEND_ME(RedisCluster, unwatch, arginfo_class_RedisCluster_unwatch, ZEND_ACC_PUBLIC)
13991406
ZEND_ME(RedisCluster, watch, arginfo_class_RedisCluster_watch, ZEND_ACC_PUBLIC)
14001407
ZEND_ME(RedisCluster, vadd, arginfo_class_RedisCluster_vadd, ZEND_ACC_PUBLIC)
1408+
ZEND_ME(RedisCluster, vsim, arginfo_class_RedisCluster_vsim, ZEND_ACC_PUBLIC)
14011409
ZEND_ME(RedisCluster, xack, arginfo_class_RedisCluster_xack, ZEND_ACC_PUBLIC)
14021410
ZEND_ME(RedisCluster, xadd, arginfo_class_RedisCluster_xadd, ZEND_ACC_PUBLIC)
14031411
ZEND_ME(RedisCluster, xclaim, arginfo_class_RedisCluster_xclaim, ZEND_ACC_PUBLIC)
Collapse file

‎redis_commands.c‎

Copy file name to clipboardExpand all lines: redis_commands.c
+181Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6765,6 +6765,187 @@ redis_vadd_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
67656765
return SUCCESS;
67666766
}
67676767

6768+
typedef enum redisVSimMemberType {
6769+
REDIS_VSIM_NONE,
6770+
REDIS_VSIM_FP32,
6771+
REDIS_VSIM_VALUES,
6772+
REDIS_VSIM_ELE,
6773+
} redisVSimMemberType;
6774+
6775+
typedef struct redisVSimOptions {
6776+
redisVSimMemberType type;
6777+
zend_long count;
6778+
zend_long ef;
6779+
zend_string *filter;
6780+
zend_long filter_ef;
6781+
zend_bool truth;
6782+
zend_bool nothread;
6783+
zend_bool withscores;
6784+
} redisVSimOptions;
6785+
6786+
static void free_vsim_options(redisVSimOptions *opts) {
6787+
if (opts->filter != NULL)
6788+
zend_string_release(opts->filter);
6789+
}
6790+
6791+
static void parse_vsim_options(redisVSimOptions *dst, HashTable *ht) {
6792+
zend_string *key;
6793+
zval *zv;
6794+
6795+
*dst = (redisVSimOptions){
6796+
.filter_ef = -1,
6797+
.ef = -1,
6798+
};
6799+
6800+
if (ht == NULL)
6801+
return;
6802+
6803+
ZEND_HASH_FOREACH_STR_KEY_VAL(ht, key, zv) {
6804+
if (key != NULL) {
6805+
if (zend_string_equals_literal_ci(key, "EF")) {
6806+
if (validate_vadd_integer(key, zv, 1))
6807+
dst->ef = Z_LVAL_P(zv);
6808+
} else if (zend_string_equals_literal_ci(key, "FILTER")) {
6809+
dst->filter = zval_get_string(zv);
6810+
} else if (zend_string_equals_literal_ci(key, "FILTER-EF")) {
6811+
if (validate_vadd_integer(key, zv, 1))
6812+
dst->filter_ef = Z_LVAL_P(zv);
6813+
} else if (zend_string_equals_literal_ci(key, "COUNT")) {
6814+
if (validate_vadd_integer(key, zv, 1))
6815+
dst->count = Z_LVAL_P(zv);
6816+
} else if (zend_string_equals_literal_ci(key, "WITHSCORES")) {
6817+
dst->withscores = zval_is_true(zv);
6818+
}
6819+
} else if (Z_TYPE_P(zv) == IS_STRING) {
6820+
if (zend_string_equals_literal_ci(Z_STR_P(zv), "FP32")) {
6821+
dst->type = REDIS_VSIM_FP32;
6822+
} else if (zend_string_equals_literal_ci(Z_STR_P(zv), "VALUES")) {
6823+
dst->type = REDIS_VSIM_VALUES;
6824+
} else if (zend_string_equals_literal_ci(Z_STR_P(zv), "ELE")) {
6825+
dst->type = REDIS_VSIM_ELE;
6826+
} else if (zend_string_equals_literal_ci(Z_STR_P(zv), "NOTHREAD")) {
6827+
dst->nothread = 1;
6828+
} else if (zend_string_equals_literal_ci(Z_STR_P(zv), "TRUTH")) {
6829+
dst->truth = 1;
6830+
} else if (zend_string_equals_literal_ci(Z_STR_P(zv), "WITHSCORES")) {
6831+
dst->withscores = 1;
6832+
}
6833+
}
6834+
} ZEND_HASH_FOREACH_END();
6835+
}
6836+
6837+
static redisVSimMemberType detect_vsim_type(zval *zv) {
6838+
zval *ele;
6839+
6840+
if (Z_TYPE_P(zv) != IS_ARRAY)
6841+
return REDIS_VSIM_ELE;
6842+
6843+
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(zv), ele) {
6844+
if (Z_TYPE_P(ele) != IS_LONG && Z_TYPE_P(ele) != IS_DOUBLE)
6845+
return REDIS_VSIM_ELE;
6846+
} ZEND_HASH_FOREACH_END();
6847+
6848+
return REDIS_VSIM_FP32;
6849+
}
6850+
6851+
int
6852+
redis_vsim_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
6853+
char **cmd, int *cmd_len, short *slot, void **ctx)
6854+
{
6855+
HashTable *options = NULL;
6856+
smart_string cmdstr = {0};
6857+
redisVSimOptions opts;
6858+
zend_string *key;
6859+
zval *member;
6860+
int argc;
6861+
6862+
ZEND_PARSE_PARAMETERS_START(2, 3) {
6863+
Z_PARAM_STR(key)
6864+
Z_PARAM_ZVAL(member)
6865+
Z_PARAM_OPTIONAL
6866+
Z_PARAM_ARRAY_HT_OR_NULL(options)
6867+
} ZEND_PARSE_PARAMETERS_END_EX(return FAILURE);
6868+
6869+
parse_vsim_options(&opts, options);
6870+
6871+
if (opts.type == REDIS_VSIM_NONE)
6872+
opts.type = detect_vsim_type(member);
6873+
6874+
/* Sanity check on the member type */
6875+
if (opts.type != REDIS_VSIM_ELE && Z_TYPE_P(member) != IS_ARRAY) {
6876+
php_error_docref(NULL, E_WARNING,
6877+
"member must be an array when not querying in ELE mode");
6878+
return FAILURE;
6879+
}
6880+
6881+
argc = 1 + (opts.count > 0 ? 2 : 0) + (opts.ef > 0 ? 2 : 0)
6882+
+ (opts.filter != NULL ? 2 : 0) + (opts.filter_ef > 0 ? 2 : 0)
6883+
+ !!opts.truth + !!opts.nothread + !!opts.withscores;
6884+
6885+
if (opts.type == REDIS_VSIM_ELE || opts.type == REDIS_VSIM_FP32) {
6886+
// ELE <element> or FP32 <fp32 blob>
6887+
argc += 2;
6888+
} else if (opts.type == REDIS_VSIM_VALUES) {
6889+
// VALUES <num> <num values>
6890+
argc += 2 + zend_hash_num_elements(Z_ARRVAL_P(member));
6891+
} else {
6892+
zend_error_noreturn(E_ERROR,
6893+
"Internal error. type shouldn't be REDIS_VSIM_NONE!");
6894+
}
6895+
6896+
REDIS_CMD_INIT_SSTR_STATIC(&cmdstr, argc, "VSIM");
6897+
redis_cmd_append_sstr_key_zstr(&cmdstr, key, redis_sock, slot);
6898+
6899+
if (opts.type == REDIS_VSIM_FP32) {
6900+
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "FP32");
6901+
redis_cmd_append_sstr_fp32(&cmdstr, Z_ARRVAL_P(member));
6902+
} else if (opts.type == REDIS_VSIM_VALUES) {
6903+
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "VALUES");
6904+
redis_cmd_append_sstr_long(&cmdstr,
6905+
zend_hash_num_elements(Z_ARRVAL_P(member)));
6906+
redis_cmd_append_sstr_fp32_values(&cmdstr, Z_ARRVAL_P(member));
6907+
} else {
6908+
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "ELE");
6909+
redis_cmd_append_sstr_zval(&cmdstr, member, redis_sock);
6910+
}
6911+
6912+
if (opts.withscores) {
6913+
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "WITHSCORES");
6914+
*ctx = PHPREDIS_CTX_PTR;
6915+
}
6916+
6917+
if (opts.count > 0) {
6918+
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "COUNT");
6919+
redis_cmd_append_sstr_long(&cmdstr, opts.count);
6920+
}
6921+
6922+
if (opts.ef > 0) {
6923+
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "EF");
6924+
redis_cmd_append_sstr_long(&cmdstr, opts.ef);
6925+
}
6926+
6927+
if (opts.filter != NULL) {
6928+
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "FILTER");
6929+
redis_cmd_append_sstr_zstr(&cmdstr, opts.filter);
6930+
}
6931+
6932+
if (opts.filter_ef > 0) {
6933+
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "FILTER-EF");
6934+
redis_cmd_append_sstr_long(&cmdstr, opts.filter_ef);
6935+
}
6936+
6937+
if (opts.truth)
6938+
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "TRUTH");
6939+
if (opts.nothread)
6940+
REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "NOTHREAD");
6941+
6942+
free_vsim_options(&opts);
6943+
6944+
*cmd = cmdstr.c;
6945+
*cmd_len = cmdstr.len;
6946+
6947+
return SUCCESS;
6948+
}
67686949
/*
67696950
* Redis commands that don't deal with the server at all. The RedisSock*
67706951
* pointer is the only thing retrieved differently, so we just take that
Collapse file

‎redis_commands.h‎

Copy file name to clipboardExpand all lines: redis_commands.h
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ int redis_migrate_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
332332
int redis_vadd_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
333333
char **cmd, int *cmd_len, short *slot, void **ctx);
334334

335+
int redis_vsim_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
336+
char **cmd, int *cmd_len, short *slot, void **ctx);
337+
335338
int redis_xadd_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
336339
char **cmd, int *cmd_len, short *slot, void **ctx);
337340

Collapse file

‎redis_legacy_arginfo.h‎

Copy file name to clipboardExpand all lines: redis_legacy_arginfo.h
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 63a08eee8fd89efe858ef57963e939e2095296c3 */
2+
* Stub hash: 89e401bc3bc52dbd6d20f0459f5740b3ec855eb2 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
55
ZEND_ARG_INFO(0, options)
@@ -948,6 +948,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_vadd, 0, 0, 3)
948948
ZEND_ARG_INFO(0, options)
949949
ZEND_END_ARG_INFO()
950950

951+
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_vsim, 0, 0, 2)
952+
ZEND_ARG_INFO(0, key)
953+
ZEND_ARG_INFO(0, member)
954+
ZEND_ARG_INFO(0, options)
955+
ZEND_END_ARG_INFO()
956+
951957
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_xtrim, 0, 0, 2)
952958
ZEND_ARG_INFO(0, key)
953959
ZEND_ARG_INFO(0, threshold)
@@ -1317,6 +1323,7 @@ ZEND_METHOD(Redis, xread);
13171323
ZEND_METHOD(Redis, xreadgroup);
13181324
ZEND_METHOD(Redis, xrevrange);
13191325
ZEND_METHOD(Redis, vadd);
1326+
ZEND_METHOD(Redis, vsim);
13201327
ZEND_METHOD(Redis, xtrim);
13211328
ZEND_METHOD(Redis, zAdd);
13221329
ZEND_METHOD(Redis, zCard);
@@ -1593,6 +1600,7 @@ static const zend_function_entry class_Redis_methods[] = {
15931600
ZEND_ME(Redis, xreadgroup, arginfo_class_Redis_xreadgroup, ZEND_ACC_PUBLIC)
15941601
ZEND_ME(Redis, xrevrange, arginfo_class_Redis_xrevrange, ZEND_ACC_PUBLIC)
15951602
ZEND_ME(Redis, vadd, arginfo_class_Redis_vadd, ZEND_ACC_PUBLIC)
1603+
ZEND_ME(Redis, vsim, arginfo_class_Redis_vsim, ZEND_ACC_PUBLIC)
15961604
ZEND_ME(Redis, xtrim, arginfo_class_Redis_xtrim, ZEND_ACC_PUBLIC)
15971605
ZEND_ME(Redis, zAdd, arginfo_class_Redis_zAdd, ZEND_ACC_PUBLIC)
15981606
ZEND_ME(Redis, zCard, arginfo_class_Redis_zCard, ZEND_ACC_PUBLIC)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.