diff --git a/redis_sentinel.c b/redis_sentinel.c index 55851f1..2d506bd 100644 --- a/redis_sentinel.c +++ b/redis_sentinel.c @@ -47,12 +47,12 @@ PHP_METHOD(RedisSentinel, __construct) zend_long port = 26379, retry_interval = 0; redis_sentinel_object *obj; zend_string *host; - zval *auth = NULL, *zv = NULL; + zval *auth = NULL, *context = NULL, *zv = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ldz!ldz", + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ldz!ldza", &host, &port, &timeout, &zv, &retry_interval, &read_timeout, - &auth) == FAILURE) { + &auth, &context) == FAILURE) { RETURN_FALSE; } @@ -92,6 +92,9 @@ PHP_METHOD(RedisSentinel, __construct) if (auth) { redis_sock_set_auth_zval(obj->sock, auth); } + if (context) { + redis_sock_set_stream_context(obj->sock, context); + } obj->sock->sentinel = 1; } diff --git a/redis_sentinel.stub.php b/redis_sentinel.stub.php index c3fc5a9..304cd41 100644 --- a/redis_sentinel.stub.php +++ b/redis_sentinel.stub.php @@ -8,7 +8,7 @@ class RedisSentinel { - public function __construct(string $host, int $port = 26379, float $timeout = 0, mixed $persistent = NULL, int $retry_interval = 0, float $read_timeout = 0, #[\SensitiveParameter] mixed $auth = NULL); + public function __construct(string $host, int $port = 26379, float $timeout = 0, mixed $persistent = null, int $retry_interval = 0, float $read_timeout = 0, #[\SensitiveParameter] mixed $auth = null, array $context = null); /** @return bool|RedisSentinel */ public function ckquorum(string $master); diff --git a/redis_sentinel_arginfo.h b/redis_sentinel_arginfo.h index 58a5bc4..7059560 100644 --- a/redis_sentinel_arginfo.h +++ b/redis_sentinel_arginfo.h @@ -1,14 +1,15 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 946942bc5a7612650fc0416902778452f6860d13 */ + * Stub hash: 4055ace9f1cf20bef89bdb5d3219470b4c8915e6 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisSentinel___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "26379") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_DOUBLE, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, persistent, IS_MIXED, 0, "NULL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, persistent, IS_MIXED, 0, "null") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, retry_interval, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, read_timeout, IS_DOUBLE, 0, "0") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auth, IS_MIXED, 0, "NULL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, auth, IS_MIXED, 0, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisSentinel_ckquorum, 0, 0, 1) diff --git a/redis_sentinel_legacy_arginfo.h b/redis_sentinel_legacy_arginfo.h index 30b58df..16af15b 100644 --- a/redis_sentinel_legacy_arginfo.h +++ b/redis_sentinel_legacy_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 946942bc5a7612650fc0416902778452f6860d13 */ + * Stub hash: 4055ace9f1cf20bef89bdb5d3219470b4c8915e6 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisSentinel___construct, 0, 0, 1) ZEND_ARG_INFO(0, host) @@ -9,6 +9,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisSentinel___construct, 0, 0, 1) ZEND_ARG_INFO(0, retry_interval) ZEND_ARG_INFO(0, read_timeout) ZEND_ARG_INFO(0, auth) + ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RedisSentinel_ckquorum, 0, 0, 1)