Commit Graph

177 Commits

Author SHA1 Message Date
Rory
3c64b33ffe Fix SIGABRT in PHP 8.4 with RedisArray
Same fix as 6e5360d1, with PHP switching from `ZEND_ASSUME` to `ZEND_ASSERT` in zend_hash_str_update_ptr.

Fixes #2648
2025-04-08 09:38:45 -07:00
michael-grunder
085d61ecfb Create a strncmp wrapper
On some glibc implementations strncmp is a macro. This commit simply creates a
`redis_strncmp` static inline wrapper function so we can `ZEND_STRL` instead of
manually counting the length or using `sizeof(s)-1` each time.

Fixes #2565
2024-10-15 10:40:15 -07:00
Michael Grunder
7050c98909 Play around with more ZEND_STRL usage (#2505)
* Play around with more ZEND_STRL usage

* strncasecmp is a macro on Windows
2024-06-15 14:48:30 -07:00
michael-grunder
f8c762e70b Use ZEND_STRL where appropriate.
Use the `ZEND_STRL` macro in several places rather than manually sending
a static string and its length as a constant.
2024-06-01 13:41:26 -07:00
Remi Collet
21cce7844d cleanup unneeded cast 2021-03-25 09:16:27 +01:00
Remi Collet
c93eba4a4f Fix #1956 bad type usage on 32-bit 2021-03-25 08:54:15 +01:00
defender-11
c61396c489 Fixed#1895 2021-01-23 00:52:55 +08:00
Pavlo Yatsukhnenko
2634350ea9 Use zend_string in ra_find_node_by_name 2020-10-30 15:52:34 +02:00
Pavlo Yatsukhnenko
a7662da792 Don't use zend_fcall_info.no_separation 2020-07-09 13:01:34 +03:00
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
Pavlo Yatsukhnenko
e41e19a834 Don't call Redis::__constructor while initilizing RedisArray (#1777) 2020-06-02 15:40:08 -07:00
Pavlo Yatsukhnenko
35372a1f64 Authenticate in redis_sock_server_open 2020-03-30 22:34:12 +03:00
Pavlo Yatsukhnenko
9ee94ca4f6 fix usage php_hash_fetch_ops with PHP 8 2020-03-09 14:00:07 +02: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
Tyson Andre
f52bd8a853 Fix typos detected by codespell 2020-01-06 09:08:36 -05: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
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
0f38afa2e2 Fix RedisArray authentication 2019-03-19 11:11:04 -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
Pavel Yatsukhnenko
e9e4783456 Fix build warning 2019-01-21 11:56:15 +02:00
Pavlo Yatsukhnenko
850027ffd3 Different key hashing algorithms from hash extension. 2019-01-03 16:17:20 +02:00
Pavlo Yatsukhnenko
bb32e6f3a0 Implement consistent hashing algorithm for RedisArray 2018-12-22 15:31:51 +02:00
Pavlo Yatsukhnenko
3e7e1c833d Fix regression added in 602740d3 2018-12-22 15:30:46 +02:00
Pavlo Yatsukhnenko
602740d35a Use zend_string for storing RedisArray hosts 2018-12-19 10:16:54 +02:00
Pavlo Yatsukhnenko
c0793e8be4 Remove unused parameter lazy_connect from redis_sock_create 2018-11-21 13:39:50 +02:00
Pavlo Yatsukhnenko
6f7ddd275a Fix coverity scan warnings 2018-11-07 14:03:35 +02: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
Pavlo Yatsukhnenko
837dee471c Issue #1292
Revert broken in c9df77d RA hashing impl.
2018-01-02 13:35:08 +02:00
Pavlo Yatsukhnenko
75e7c81dad Revert "Refactor ra_extract_key"
This reverts commit 621afa6c6d.
2017-10-19 16:46:32 +03:00
Pavlo Yatsukhnenko
621afa6c6d Refactor ra_extract_key
We don't need to copy extracted key part since we don't change it.
2017-10-19 16:11:31 +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
4a0a46b4cb Check number of elements in incoming array-argument 2017-08-28 16:17:05 +03:00
Pavlo Yatsukhnenko
c9df77db57 ra_call_distributor returns position or -1 in case of error 2017-08-23 15:31:01 +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
2c8de47f78 Use ZEND_HASH_FOREACH_VAL in ra_load_hosts. 2017-08-09 16:32:57 +03:00
Pavlo Yatsukhnenko
a56ed7f9f9 Change type of RedisArray pure_cmds to HashTable 2017-08-04 13:56:48 +03:00
Pavlo Yatsukhnenko
577a919099 Remove ra_rehash_scan 2017-08-04 09:57:47 +03:00
Pavlo Yatsukhnenko
471ce0724d Fix valgrind warnings 2017-08-02 17:42:34 +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
735025d700 Fix some static analyzer warnings
Two types of warnings were fixed in this commit:
1. The left operand of '<=' is a garbage value
2. Function call argument is an uninitialized value
2017-07-19 15:13:33 +03:00
Pavlo Yatsukhnenko
d0b9c5fd4e Refactor ra_init_function_table
Remove re-adding HGET element.
Reorder commands alphabetically.
Replace tabs with spaces.
2017-06-09 23:22:23 +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