diff --git a/redis.stub.php b/redis.stub.php index 20fa031f..6d301440 100644 --- a/redis.stub.php +++ b/redis.stub.php @@ -5276,7 +5276,7 @@ class Redis { * @param int $maxBurst * @param int $requestsPerPeriod * @param int $period - * @param int $numRequests = 0 + * @param int $tokens = 0 * @return Redis|array|false * * @see https://redis.io/docs/latest/commands/gcra/ @@ -5285,7 +5285,7 @@ class Redis { * $redis->gcra('user:123', 10, 100, 3600); */ public function gcra(string $key, int $maxBurst, int $requestsPerPeriod, - int $period, int $numRequests = 0): Redis|array|false; + int $period, int $tokens = 0): Redis|array|false; /** diff --git a/redis_arginfo.h b/redis_arginfo.h index 68dc2004..73acd29d 100644 --- a/redis_arginfo.h +++ b/redis_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 190c8ed87be2064ed4cb1c7305576576af10afc6 */ + * Stub hash: 3ee3118802fef67d6bd7176f2a72f0568d962c8b */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 1, "null") @@ -1153,7 +1153,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_gcra, 0, 4, Redi ZEND_ARG_TYPE_INFO(0, maxBurst, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, requestsPerPeriod, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, period, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, numRequests, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, tokens, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_Redis_xtrim, 0, 2, Redis, MAY_BE_LONG|MAY_BE_FALSE) diff --git a/redis_cluster.stub.php b/redis_cluster.stub.php index 513fc4f6..7f7d93fb 100644 --- a/redis_cluster.stub.php +++ b/redis_cluster.stub.php @@ -1185,7 +1185,7 @@ class RedisCluster { * @see \Redis::gcra() */ public function gcra(string $key, int $maxBurst, int $requestsPerPeriod, - int $period, int $numRequests = 0): RedisCluster|array|false; + int $period, int $tokens = 0): RedisCluster|array|false; /** diff --git a/redis_cluster_arginfo.h b/redis_cluster_arginfo.h index 2f39d862..6d255712 100644 --- a/redis_cluster_arginfo.h +++ b/redis_cluster_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: d0720357eca4c563bbd5211bbfbfc6f5a00c4b72 */ + * Stub hash: 6c7a87611b3bc9039650a3cf2e3c4d4f916611b0 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) @@ -969,7 +969,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_gcra, 0, ZEND_ARG_TYPE_INFO(0, maxBurst, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, requestsPerPeriod, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, period, IS_LONG, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, numRequests, IS_LONG, 0, "0") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, tokens, IS_LONG, 0, "0") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_RedisCluster_xack, 0, 3, RedisCluster, MAY_BE_LONG|MAY_BE_FALSE) diff --git a/redis_cluster_legacy_arginfo.h b/redis_cluster_legacy_arginfo.h index 588ce4c6..3fd44e31 100644 --- a/redis_cluster_legacy_arginfo.h +++ b/redis_cluster_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: d0720357eca4c563bbd5211bbfbfc6f5a00c4b72 */ + * Stub hash: 6c7a87611b3bc9039650a3cf2e3c4d4f916611b0 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster___construct, 0, 0, 1) ZEND_ARG_INFO(0, name) @@ -820,7 +820,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_gcra, 0, 0, 4) ZEND_ARG_INFO(0, maxBurst) ZEND_ARG_INFO(0, requestsPerPeriod) ZEND_ARG_INFO(0, period) - ZEND_ARG_INFO(0, numRequests) + ZEND_ARG_INFO(0, tokens) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisCluster_xack, 0, 0, 3) diff --git a/redis_commands.c b/redis_commands.c index 02ceb8c5..a044b611 100644 --- a/redis_commands.c +++ b/redis_commands.c @@ -7500,7 +7500,7 @@ redis_vsetattr_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, int redis_gcra_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, char **cmd, int *cmd_len, short *slot, void **ctx) { - zend_long max_burst, req_per_period, period, count = 0; + zend_long max_burst, req_per_period, period, tokens = 0; smart_string cmdstr = {0}; zend_string *key; @@ -7510,18 +7510,18 @@ int redis_gcra_cmd(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, Z_PARAM_LONG(req_per_period) Z_PARAM_LONG(period) Z_PARAM_OPTIONAL - Z_PARAM_LONG(count) + Z_PARAM_LONG(tokens) ZEND_PARSE_PARAMETERS_END_EX(return FAILURE); - REDIS_CMD_INIT_SSTR_STATIC(&cmdstr, 4 + (count > 0 ? 2 : 0), "GCRA"); + REDIS_CMD_INIT_SSTR_STATIC(&cmdstr, 4 + (tokens > 0 ? 2 : 0), "GCRA"); redis_cmd_append_sstr_key_zstr(&cmdstr, key, redis_sock, slot); redis_cmd_append_sstr_long(&cmdstr, max_burst); redis_cmd_append_sstr_long(&cmdstr, req_per_period); redis_cmd_append_sstr_long(&cmdstr, period); - if (count > 0) { - REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "NUM_REQUESTS"); - redis_cmd_append_sstr_long(&cmdstr, count); + if (tokens > 0) { + REDIS_CMD_APPEND_SSTR_STATIC(&cmdstr, "TOKENS"); + redis_cmd_append_sstr_long(&cmdstr, tokens); } *cmd = cmdstr.c; diff --git a/redis_legacy_arginfo.h b/redis_legacy_arginfo.h index 844b5494..e74e2d6c 100644 --- a/redis_legacy_arginfo.h +++ b/redis_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 190c8ed87be2064ed4cb1c7305576576af10afc6 */ + * Stub hash: 3ee3118802fef67d6bd7176f2a72f0568d962c8b */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) @@ -1021,7 +1021,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_gcra, 0, 0, 4) ZEND_ARG_INFO(0, maxBurst) ZEND_ARG_INFO(0, requestsPerPeriod) ZEND_ARG_INFO(0, period) - ZEND_ARG_INFO(0, numRequests) + ZEND_ARG_INFO(0, tokens) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis_xtrim, 0, 0, 2)