Commit Graph

141 Commits

Author SHA1 Message Date
Pavlo Yatsukhnenko 8cb2d5bd94 Issue #1048
This commit is adding support of data compression.
LZF was choosen because it small and fast and Redis server uses it.
Since [pecl package](https://pecl.php.net/package/lzf) doesn't provide
lzf.h file after installing, LZF library was added as submodule.
Another algorythms may be easely added by analogy with serializers.
TODO: unit-tests for different data types.
2017-10-17 17:08:42 +03:00
Pavlo Yatsukhnenko 9019463e70 fix arginfo for directed node commands 2017-10-13 13:33:45 +03:00
Pavlo Yatsukhnenko 0115666e59 Add PHPREDIS_GET_OBJECT macros 2017-10-05 15:27:18 +03:00
Pavlo Yatsukhnenko cb003239a6 Issue #1245
Move building `script` command logic to `redis_build_script_cmd`
and use it in Redis and RedisCluster objects.
Fix arginfo for `RedisCluster::script`.
Fix memory leak in `cluster_raw_cmd` when `cluster_cmd_get_slot` fails.
2017-10-05 10:03:30 +03:00
Pavlo Yatsukhnenko 81a03035ca More arginfo for RedisCluster
This commit finally fixes issue #1055
2017-08-29 10:43:45 +03:00
Pavlo Yatsukhnenko d5609fc58b More arginfo for RedisCluster 2017-08-29 09:40:09 +03:00
Pavlo Yatsukhnenko e5660be4c6 More arginfo for RedisCluster + remove duplicates 2017-08-28 13:36:37 +03:00
Pavlo Yatsukhnenko e23be2c830 Add arginfo for RedisArray 2017-08-22 17:11:06 +03:00
Pavlo Yatsukhnenko 2bf7b2f714 Use zend_string to store strings in RedisSock
Following fields were changed: err, prefix, persistent_id, auth and host
2017-08-16 16:58:10 +03:00
Pavlo Yatsukhnenko 42f1c9779b Fix static analyzer warnings 2017-08-15 15:24:06 +03:00
Pavlo Yatsukhnenko 658ee37410 ZEND_HASH_FOREACH_PTR 2017-08-15 13:38:39 +03:00
Pavlo Yatsukhnenko 142b51ded9 refactoring
Small change php5 implementation of ZEND_HASH_FOREACH_* macroses.
Use ZEND_HASH_FOREACH_VAL in ra_get_key_type.
Allocate array via MAKE_STD_ZVAL in HANDLE_MULTI_EXEC macro.
2017-08-11 16:20:40 +03:00
Pavlo Yatsukhnenko 5874b0775b Allow mixing multi and pipeline modes 2017-08-08 23:17:49 +03:00
Pavlo Yatsukhnenko 4e32254ec2 Use ZSTR_VAL and ZSTR_LEN macroses to access zend_string fields 2017-08-02 13:20:30 +03:00
Pavlo Yatsukhnenko 1ab89e1320 Fix valgrind warnings
Duplicate (MAKE_STD_ZVAL + ZVAL_ZVAL) params in php7 compatible
implementation of call_user_function.
2017-08-01 14:47:03 +03:00
Pavlo Yatsukhnenko 37f5693bb7 Init gc value for php5 zval_get_string 2017-07-28 11:07:59 +03:00
Pavlo Yatsukhnenko ad45964150 Using ZVAL_DEREF macros for dereference input variables.
This PR fixes issues #946 and #1166.
2017-05-09 23:17:20 +03:00
Pavlo Yatsukhnenko a44b7c654d Merge branch 'issue.1156' into develop 2017-04-21 00:33:35 +03:00
Pavlo Yatsukhnenko 43e1e0faff refactoring (#1155)
Fix memory leak in `redis_long_response` when LONG_MAX overflow.
Add return -1 in `redis_read_reply_type` when `php_stream_getc` returns EOF.
Code formatting in `PHP_METHOD(Redis, exec)`.
2017-04-21 00:30:37 +03:00
Pavlo Yatsukhnenko 4e56ba804c Fix #1156 2017-04-20 23:43:29 +03:00
Pavlo Yatsukhnenko e372398344 Modifying redis_error_throw to throw exception for all non recoverable errors. 2017-04-12 00:03:21 +03:00
Pavlo Yatsukhnenko 434bb5ad5c Remove REDIS_SOCK_STATUS_UNKNOWN because no way to reach it. 2017-03-29 23:28:56 +03:00
Pavlo Yatsukhnenko 8324a46b17 remove unused constants 2017-03-29 23:19:24 +03:00
Pavlo Yatsukhnenko fb88e1df5f remove unused struct request_item + add redis_hstrlen_cmd proto 2017-03-14 17:12:01 +02:00
Pavlo Yatsukhnenko a070a43fcb refactoring
In pipeline mode all commands are now stored in the buffer
the memory for which is allocated with emalloc.
There is no need to use a linked list.
2017-03-10 07:24:34 +02:00
Pavlo Yatsukhnenko 542fc30d1e free_reply_callbacks 2017-03-03 16:42:11 +02:00
Pavlo Yatsukhnenko 65e579821b REDIS_PROCESS_RESPONSE_CLOSURE 2017-03-03 15:17:51 +02:00
Pavlo Yatsukhnenko fc2453c8b6 refactoring
Modify redis_response_enqueued function.
Wrap macros into do/while blocks.
2017-03-01 23:27:28 +02:00
Pavlo Yatsukhnenko c4b11a9368 put macros in order 2017-02-27 16:41:16 +02:00
Pavlo Yatsukhnenko 88d870e0d9 refactoring
redis_sock_get and redis_array_get return pointer to RedisSock/RedisArray
structure instead of assign by pointer pointer
2017-02-10 23:30:39 +02:00
Pavlo Yatsukhnenko 8fa85afa7a redis_object 2017-02-10 17:41:03 +02:00
michael-grunder 61a7e48392 Use correct legacy definition for ZEND_MOD_END 2016-12-21 22:08:13 -08:00
Pavlo Yatsukhnenko 8ed844e2ea fix 'this decimal constant is unsigned only in ISO C90' warning 2016-12-20 17:29:47 +02:00
Pavlo Yatsukhnenko 5ee32baee6 PHP_FE_END + ZEND_MOD_END 2016-12-20 11:06:59 +02:00
michael-grunder d0b8011a9a Fix compiler warnings.
Changed zend hash function overrides to extern in the header, and
then defined them in library.c

Created a simple macro to suppress "set but not used" warnings,
which differ depending on build environment (php 5 vs php 7).
2016-12-18 21:06:38 -08:00
Pavlo Yatsukhnenko a23e36f208 zval_get_string
Added gc attribute to zend_string (for zend_string_release).
Added function zval_get_string and replace convert_to_string with it.
2016-12-02 16:04:59 +02:00
Pavlo Yatsukhnenko 71c9f7c84c Issue #760 2016-11-28 18:00:01 +02:00
Pavlo Yatsukhnenko af8e9a3f46 php7 compatibility
Define strlen_t (int for php5 and size_t for php7) and use it
as the length argument of the 's' specifier for zend_parse_method_parameters
2016-11-13 21:12:14 +02:00
Pavlo Yatsukhnenko 19f5f708c2 WIP: php7 compatibility 2016-11-11 23:04:27 +02:00
Pavlo Yatsukhnenko 04a7327af8 WIP: php7 compatibility 2016-11-08 20:11:51 +02:00
Pavlo Yatsukhnenko 5de84b3d01 WIP: php7 compatibility 2016-11-07 20:18:57 +02:00
Pavlo Yatsukhnenko f5024a59de WIP: php7 compatibility
Try to not use MAKE_STD_ZVAL
2016-11-05 21:43:52 +02:00
Pavlo Yatsukhnenko 6cccbd1309 WIP: php7 compatibility
Redefine add_assoc_long + add_assoc_double
2016-11-02 18:13:33 +02:00
Pavlo Yatsukhnenko 88301fa1f7 WIP: php7 compatibility
Redefine zend_hash_get_current_key + wrap zend_hash_get_current_key_ex
2016-11-01 16:05:07 +02:00
Pavlo Yatsukhnenko 19306d43b1 WIP: php7 compatibility
php_var_serialize + php_var_unserialize
2016-10-29 23:52:52 +03:00
Pavlo Yatsukhnenko ea2b533683 add_assoc_bool 2016-10-28 17:13:16 +03:00
Pavlo Yatsukhnenko 56abe19721 WIP: php7 compatibility
Wrap zend_hash_init destructor.
Add implementation of zend_hash_str_exists, zend_hash_str_update_ptr,
zend_hash_index_update_ptr and zval_get_long functions.
2016-10-28 14:53:58 +03:00
Pavlo Yatsukhnenko 8cfebfd98b WIP: php7 compatibility
zend_list_insert + add_assoc_string + add_assoc_zval
2016-10-27 20:35:47 +03:00
Pavlo Yatsukhnenko 90d64687ae REDIS_DOUBLE_TO_STRING 2016-10-26 23:14:27 +03:00
Pavlo Yatsukhnenko a1e698873a WIP: php7 compatibility
Redefine add_next_index_string.
Fix zend_fcall_info retval and params.
2016-10-26 18:12:07 +03:00