195 Commits

Author SHA1 Message Date
Michael Grunder
a311cc4ec3 Support for Redis 6 ACLs (#1791)
Add support for Redis 6 ACLs in the `Redis`, `RedisCluster`, and `RedisArray` classes.

On a related note, it adds a mechanism for users to customize how we generate persistent connection IDs such that they can be grouped in different ways depending on the specific use case required (e.g. it would allow connections to be grouped by username, or by user-defined persistent_id, or both).
2020-06-24 17:00:01 -07:00
Remi Collet
b9b383f499 fix [-Wformat=] warning on 32-bit (#1750)
Use the portable `ZEND_LONG_FORMAT` family instead of C format specifiers
2020-05-06 09:46:43 -07:00
Pavlo Yatsukhnenko
35372a1f64 Authenticate in redis_sock_server_open 2020-03-30 22:34:12 +03:00
Pavlo Yatsukhnenko
d5dadaf635 Add PHPREDIS_GET_OBJECT and PHPREDIS_ZVAL_GET_OBJECT macros 2020-03-09 13:36:27 +02:00
Tyson Andre
0ef488fca7 Remove "PHP Version 5" section
package.xml has a minimum version of 7.0
PHP 8.0 will probably be out in around a year.
2020-01-13 18:41:03 -05:00
Pavlo Yatsukhnenko
c0db75b5ac Fix coverity scan warnings 2019-10-05 20:23:16 +03:00
Pavlo Yatsukhnenko
fbe0f804bc Issue #1618
This commit fixes regression added in 112c77e3
2019-08-09 15:10:05 +03:00
Remi Collet
d6fc5c7348 use uint32_t for call_user_function 2019-07-18 10:41:41 +02:00
Remi Collet
b4eb158a00 ulong => zend_ulong for 7.4 2019-07-18 10:37:02 +02:00
Remi Collet
943802272a cleanup TSRMLS_* usage 2019-07-09 15:26:44 +02:00
Michael Grunder
60d8b679b3 Handle references in MGET (#1535)
Fixes #1534
2019-03-28 22:02:27 -07:00
michael-grunder
2761c607e2 Merge remote-tracking branch 'cthulhu/issue.1448-require_php7' into issue.1448-require_php7 2019-03-19 11:30:14 -07:00
Pavlo Yatsukhnenko
112c77e3a1 Issue #1508
Wrap all calls of `call_user_function` into `ra_call_user_function`
where AUTH command sended before function call.
2019-03-19 11:28:00 -07:00
Pavlo Yatsukhnenko
5053a9e7e4 RedisArray auth.
Issue #1508
2019-03-19 11:10:08 -07:00
Pavlo Yatsukhnenko
0d2dd169fa Use zend_string for storing key hashing algorithm 2019-03-19 11:09:26 -07:00
michael-grunder
fa130a4bd4 PHP 7 exception and compiler warning fixes
PHP 7 removed TSRMLS_CC from zend_throw_exception* routines.
Additionally this commit creates two simple wrapper macros for throwing
Redis or RedisCluster exceptions so we don't duplicate as much code.

Additionally there were a couple of minor compiler warnings printf type
correctness fixed in this commit.
2019-02-08 21:31:47 -08:00
michael-grunder
f9928642b5 PHP 5 is dead, long live PHP 7
This commit removes support for PHP 5 by getting rid of all of our Zend
compatibility layer methods, as well as any call checking against
PHP_MAJOR_VERSION or ZEND_MODULE_API_NO.

Unit tests are all passing for Redis, RedisCluster, and RedisArray but
this should still be considered a work in progress until more testing
can be done.

Addresses issue #1448
2019-01-26 20:57:16 -08:00
Pavlo Yatsukhnenko
850027ffd3 Different key hashing algorithms from hash extension. 2019-01-03 16:17:20 +02:00
Pavlo Yatsukhnenko
71922bf1dd Add RedisArray::_continuum method 2018-12-22 15:31:51 +02:00
Pavlo Yatsukhnenko
bb32e6f3a0 Implement consistent hashing algorithm for RedisArray 2018-12-22 15:31:51 +02:00
Pavlo Yatsukhnenko
602740d35a Use zend_string for storing RedisArray hosts 2018-12-19 10:16:54 +02:00
Michael Grunder
2c9e057236 Streams (#1413)
Streams API
2018-09-29 11:59:01 -07:00
Pavlo Yatsukhnenko
742cdd0594 Issue #1302
Handle async parameter for RedisCluster::flushDb and RedisCluster::flushAll
2018-04-22 22:26:13 +03:00
Pavlo Yatsukhnenko
acd10409bc Issue #1302
Handle async parameter for RedisArray::flushDb and RedisArray::flushAll
TODO: implementation for RedisCluster and unit-tests
2018-04-22 22:26:13 +03:00
Pavlo Yatsukhnenko
1689318021 Refactor RedisArray
Add `multihost_distribute_call` function for iterating over RA hosts
and store results of functions into `return_value` array.
2018-04-11 00:03:34 +03:00
michael-grunder
a4afe91909 Some style normalization 2018-02-17 09:47:28 -08:00
Pavlo Yatsukhnenko
9cd059117a Refactor RedisArray
Change type of returning value from `char *` to `zend_string *` for
`ra_extract_key` and `ra_call_extractor` functions.
Store keys as `zend_string *` in RedisArray::mset.
2018-01-29 22:37:36 +02:00
michael-grunder
04f62acbc8 Syntax fixes and prototype consolidation
Fix PHP_METHOD syntax fail for unlink
Move redis_unlink_cmd by redis_del_cmd as they're the same
2018-01-17 10:34:08 -08:00
michael-grunder
9e65c42931 Implement UNLINK command
This commit implements UNLINK for Redis, RedisCluster, and RedisArray.
To a client library UNLINK behaves identically to DEL so we can use the
same handlers for both.
2018-01-17 09:36:38 -08:00
Pavlo Yatsukhnenko
9d15f07adb Issue #1224 2017-10-20 16:46:05 +03:00
Pavlo Yatsukhnenko
0115666e59 Add PHPREDIS_GET_OBJECT macros 2017-10-05 15:27:18 +03:00
michael-grunder
345fc7fc9f Destroy all tabs :-) 2017-09-28 15:44:18 -07:00
Pavlo Yatsukhnenko
6a53cb99ba Revert "Fix RA memory leak"
This reverts commit 5241bcb883.
2017-09-28 22:33:31 +03:00
Pavlo Yatsukhnenko
5241bcb883 Fix RA memory leak 2017-09-28 16:53:12 +03:00
Pavlo Yatsukhnenko
3ec05496f2 Sort arginfos alphabetically 2017-09-27 10:03:32 +03:00
Pavlo Yatsukhnenko
4a0a46b4cb Check number of elements in incoming array-argument 2017-08-28 16:17:05 +03:00
Pavlo Yatsukhnenko
e5660be4c6 More arginfo for RedisCluster + remove duplicates 2017-08-28 13:36:37 +03:00
Pavlo Yatsukhnenko
6c2c6faa1b More arginfo for RedisArray 2017-08-23 09:26:12 +03:00
Pavlo Yatsukhnenko
212e323f5b More arginfo for RedisArray 2017-08-22 17:23:19 +03:00
Pavlo Yatsukhnenko
e23be2c830 Add arginfo for RedisArray 2017-08-22 17:11:06 +03:00
Pavlo Yatsukhnenko
42f1c9779b Fix static analyzer warnings 2017-08-15 15:24:06 +03:00
Pavlo Yatsukhnenko
e672f40bda Duplicate incoming params via ZVAL_ZVAL in ra_forward_call 2017-08-12 00:01:48 +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
a56ed7f9f9 Change type of RedisArray pure_cmds to HashTable 2017-08-04 13:56:48 +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
faac8b0600 CID 158616 2017-07-28 14:50:41 +03:00
Pavlo Yatsukhnenko
47d3722dec Remove ra_find_key + use return_value instead of stack allocated z_tmp inra_forward_call 2017-04-27 17:46:49 +03:00
Pavlo Yatsukhnenko
b56dc49eec Processing read_timeout parameter + update docs 2017-04-11 15:22:46 +03:00
michael-grunder
8978b3aaf2 Tabs are evil 2017-04-03 12:29:42 -07:00
Pavlo Yatsukhnenko
f81694e69c Use crc32 table from PHP distro (#1144)
* Use crc32 table from PHP distro

* Remove rcrc32 function
2017-04-03 21:55:05 +03:00