Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Favre-Felix <n.favrefelix@gmail.com>2011-11-28 00:01:20 +0400
committerNicolas Favre-Felix <n.favrefelix@gmail.com>2011-11-28 00:01:20 +0400
commitd4ad907ef63035f48902bf56d22e6bcc67cc42d1 (patch)
tree9682a32063dd3f2083d9871debbb426335bc58d5 /redis_array.c
parent7781557bb1c09584d47b9132015688810da1514d (diff)
Added missing autorehash option.
Fixes GitHub issue #85.
Diffstat (limited to 'redis_array.c')
-rw-r--r--redis_array.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/redis_array.c b/redis_array.c
index e1955735..c6794b8b 100644
--- a/redis_array.c
+++ b/redis_array.c
@@ -182,7 +182,7 @@ PHP_METHOD(RedisArray, __construct)
char *name = NULL;
int id;
RedisArray *ra = NULL;
- zend_bool b_index = 0;
+ zend_bool b_index = 0, b_autorehash = 0;
HashTable *hPrev = NULL, *hOpts = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &z0, &z_opts) == FAILURE) {
@@ -212,6 +212,11 @@ PHP_METHOD(RedisArray, __construct)
if(FAILURE != zend_hash_find(hOpts, "index", sizeof("index"), (void**)&zpData) && Z_TYPE_PP(zpData) == IS_BOOL) {
b_index = Z_BVAL_PP(zpData);
}
+
+ /* extract autorehash option. */
+ if(FAILURE != zend_hash_find(hOpts, "autorehash", sizeof("autorehash"), (void**)&zpData) && Z_TYPE_PP(zpData) == IS_BOOL) {
+ b_autorehash = Z_BVAL_PP(zpData);
+ }
}
/* extract either name of list of hosts from z0 */
@@ -230,6 +235,7 @@ PHP_METHOD(RedisArray, __construct)
}
if(ra) {
+ ra->auto_rehash = b_autorehash;
id = zend_list_insert(ra, le_redis_array);
add_property_resource(getThis(), "socket", id);
}