mirror of
https://github.com/php-win-ext/phpredis.git
synced 2026-03-24 00:52:16 +01:00
cleanup code for unsupported versions
This commit is contained in:
committed by
Michael Grunder
parent
8b51942357
commit
37cebdd70b
@@ -6,12 +6,6 @@
|
||||
#include <ext/random/php_random.h>
|
||||
#endif
|
||||
|
||||
#if PHP_VERSION_ID < 70100
|
||||
static zend_long php_mt_rand_range(zend_long min, zend_long max) {
|
||||
return min + php_rand() % (max - min + 1)
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "backoff.h"
|
||||
|
||||
static zend_ulong random_range(zend_ulong min, zend_ulong max) {
|
||||
|
||||
@@ -100,15 +100,7 @@ static int redis_mbulk_reply_zipped_raw_variant(RedisSock *redis_sock, zval *zre
|
||||
|
||||
/* Register a persistent resource in a a way that works for every PHP 7 version. */
|
||||
void redis_register_persistent_resource(zend_string *id, void *ptr, int le_id) {
|
||||
#if PHP_VERSION_ID < 70300
|
||||
zend_resource res;
|
||||
res.type = le_id;
|
||||
res.ptr = ptr;
|
||||
|
||||
zend_hash_str_update_mem(&EG(persistent_list), ZSTR_VAL(id), ZSTR_LEN(id), &res, sizeof(res));
|
||||
#else
|
||||
zend_register_persistent_resource(ZSTR_VAL(id), ZSTR_LEN(id), ptr, le_id);
|
||||
#endif
|
||||
}
|
||||
|
||||
static ConnectionPool *
|
||||
|
||||
@@ -413,11 +413,7 @@ static void lock_release(RedisSock *redis_sock, redis_session_lock_status *lock_
|
||||
}
|
||||
}
|
||||
|
||||
#if PHP_VERSION_ID < 70300
|
||||
#define REDIS_URL_STR(umem) umem
|
||||
#else
|
||||
#define REDIS_URL_STR(umem) ZSTR_VAL(umem)
|
||||
#endif
|
||||
|
||||
/* {{{ PS_OPEN_FUNC
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user