Skip to content

Commit 90a7cf4

Browse files
Updates to fix rebase issues
1 parent 70cc124 commit 90a7cf4

File tree

4 files changed

+18
-46
lines changed

4 files changed

+18
-46
lines changed

library.c

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -130,28 +130,6 @@ static void redis_error_throw(char *err, size_t err_len TSRMLS_DC) {
130130
}
131131
}
132132

133-
PHPAPI void redis_stream_close(RedisSock *redis_sock TSRMLS_DC) {
134-
if (!redis_sock->persistent) {
135-
php_stream_close(redis_sock->stream);
136-
} else {
137-
php_stream_pclose(redis_sock->stream);
138-
}
139-
140-
efree(cmd);
141-
142-
if ((response = redis_sock_read(redis_sock, &response_len TSRMLS_CC)) == NULL) {
143-
return -1;
144-
}
145-
146-
if (strncmp(response, "+OK", 3)) {
147-
efree(response);
148-
return -1;
149-
}
150-
151-
efree(response);
152-
return 0;
153-
}
154-
155133
PHP_REDIS_API void redis_stream_close(RedisSock *redis_sock TSRMLS_DC) {
156134
if (!redis_sock->persistent) {
157135
php_stream_close(redis_sock->stream);
@@ -160,7 +138,7 @@ PHP_REDIS_API void redis_stream_close(RedisSock *redis_sock TSRMLS_DC) {
160138
}
161139
}
162140

163-
PHP_REDIS_API int redis_check_eof(RedisSock *redis_sock TSRMLS_DC)
141+
PHP_REDIS_API int redis_check_eof(RedisSock *redis_sock, int no_throw TSRMLS_DC)
164142
{
165143
int eof;
166144
int count = 0;
@@ -1406,14 +1384,6 @@ PHPAPI int redis_mbulk_reply_zipped_vals(INTERNAL_FUNCTION_PARAMETERS, RedisSock
14061384
z_tab, UNSERIALIZE_VALS, SCORE_DECODE_NONE);
14071385
}
14081386

1409-
PHPAPI void redis_1_response(INTERNAL_FUNCTION_PARAMETERS,
1410-
RedisSock *redis_sock, zval *z_tab, void *ctx)
1411-
{
1412-
return redis_mbulk_reply_zipped(INTERNAL_FUNCTION_PARAM_PASSTHRU, redis_sock,
1413-
z_tab, UNSERIALIZE_VALS, SCORE_DECODE_NONE);
1414-
}
1415-
1416-
14171387
PHPAPI void redis_1_response(INTERNAL_FUNCTION_PARAMETERS,
14181388
RedisSock *redis_sock, zval *z_tab, void *ctx)
14191389
{
@@ -1875,7 +1845,7 @@ PHPAPI int redis_sock_read_multibulk_reply(INTERNAL_FUNCTION_PARAMETERS,
18751845
PHPAPI int redis_mbulk_reply_raw(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock, zval *z_tab, void *ctx)
18761846
{
18771847
char inbuf[1024];
1878-
int numElems;
1848+
int numElems, err_len;
18791849
zval *z_multi_result;
18801850

18811851
if(-1 == redis_check_eof(redis_sock, 0 TSRMLS_CC)) {
@@ -1953,7 +1923,6 @@ redis_mbulk_reply_loop(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock,
19531923
count--;
19541924
}
19551925
}
1956-
*/
19571926

19581927
/* Specialized multibulk processing for HMGET where we need to pair requested
19591928
* keys with their returned values */

library.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,13 @@ PHP_REDIS_API int
6363
redis_serialize(RedisSock *redis_sock, zval *z, char **val, int *val_len TSRMLS_DC);
6464
PHP_REDIS_API int
6565
redis_key_prefix(RedisSock *redis_sock, char **key, int *key_len);
66-
6766
PHP_REDIS_API int
6867
redis_unserialize(RedisSock *redis_sock, const char *val, int val_len, zval **return_value TSRMLS_DC);
6968

70-
PHP_REDIS_API int redis_sock_write(RedisSock *redis_sock, char *cmd, size_t sz TSRMLS_DC);
71-
PHP_REDIS_API void redis_stream_close(RedisSock *redis_sock TSRMLS_DC);
72-
PHP_REDIS_API int redis_check_eof(RedisSock *redis_sock TSRMLS_DC);
73-
/* PHP_REDIS_API int redis_sock_get(zval *id, RedisSock **redis_sock TSRMLS_DC); */
7469
PHP_REDIS_API void redis_free_socket(RedisSock *redis_sock);
7570
PHP_REDIS_API void redis_send_discard(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_sock);
7671
PHP_REDIS_API int redis_sock_set_err(RedisSock *redis_sock, const char *msg, int msg_len);
7772

78-
PHP_REDIS_API int redis_serialize(int serializer, zval *z, char **val, int *val_len TSRMLS_DC);
79-
PHP_REDIS_API int redis_unserialize(int serializer, const char *val, int val_len, zval **return_value TSRMLS_DC);
80-
PHP_REDIS_API int redis_key_prefix(RedisSock *redis_sock, char **key, int *key_len TSRMLS_DC);
81-
8273

8374
/*
8475
* Variant Read methods, mostly to implement eval

redis.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ static zend_function_entry redis_functions[] = {
266266
PHP_ME(Redis, _unserialize, NULL, ZEND_ACC_PUBLIC)
267267

268268
PHP_ME(Redis, client, NULL, ZEND_ACC_PUBLIC)
269-
PHP_ME(Redis, rawcommand, NULL, ZEND_ACC_PUBLIC)
270269

271270
/* SCAN and friends */
272271
PHP_ME(Redis, scan, arginfo_scan, ZEND_ACC_PUBLIC)
@@ -290,7 +289,7 @@ static zend_function_entry redis_functions[] = {
290289
PHP_ME(Redis, slowlog, NULL, ZEND_ACC_PUBLIC)
291290

292291
/* Send a raw command and read raw results */
293-
PHP_ME(Redis, rawCommand, NULL, ZEND_ACC_PUBLIC)
292+
PHP_ME(Redis, rawcommand, NULL, ZEND_ACC_PUBLIC)
294293

295294
/* introspection */
296295
PHP_ME(Redis, getHost, NULL, ZEND_ACC_PUBLIC)
@@ -3336,12 +3335,20 @@ PHP_METHOD(Redis, script) {
33363335
PHP_METHOD(Redis, dump) {
33373336
REDIS_PROCESS_KW_CMD("DUMP", redis_key_cmd, redis_ping_response);
33383337
}
3338+
/* }}} */
33393339

33403340
/* {{{ proto Redis::restore(ttl, key, value) */
33413341
PHP_METHOD(Redis, restore) {
33423342
REDIS_PROCESS_KW_CMD("RESTORE", redis_key_long_val_cmd,
33433343
redis_boolean_response);
33443344
}
3345+
/* }}} */
3346+
3347+
/* {{{ proto Redis::debug(string key) */
3348+
PHP_METHOD(Redis, debug) {
3349+
REDIS_PROCESS_KW_CMD("DEBUG", redis_key_cmd, redis_string_response);
3350+
}
3351+
/* }}} */
33453352

33463353
/* {{{ proto Redis::migrate(host port key dest-db timeout [bool copy,
33473354
* bool replace]) */
@@ -3483,7 +3490,13 @@ PHP_METHOD(Redis, clearLastError) {
34833490
RETURN_FALSE;
34843491
}
34853492

3486-
RETVAL_LONG(redis_sock->mode);
3493+
/* Clear error message if we have one */
3494+
if (redis_sock->err) {
3495+
efree(redis_sock->err);
3496+
redis_sock->err = NULL;
3497+
}
3498+
3499+
RETURN_TRUE;
34873500
}
34883501

34893502
/*

redis_array_impl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ ra_index_keys(zval *z_pairs, zval *z_redis TSRMLS_DC) {
567567
zval *z_keys, **z_entry_pp;
568568
HashPosition pos;
569569
MAKE_STD_ZVAL(z_keys);
570-
HashPosition pos;
571570
#if PHP_VERSION_ID > 50300
572571
array_init_size(z_keys, zend_hash_num_elements(Z_ARRVAL_P(z_pairs)));
573572
#else

0 commit comments

Comments
 (0)