Skip to content

Commit 8aa2a5a

Browse files
committed
remove version checking
1 parent babc77e commit 8aa2a5a

File tree

3 files changed

+0
-36
lines changed

3 files changed

+0
-36
lines changed

library.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
#define SCORE_DECODE_DOUBLE 2
3232

3333
#ifdef PHP_WIN32
34-
# if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION <= 4
35-
/* This proto is available from 5.5 on only */
36-
PHPAPI int usleep(unsigned int useconds);
37-
# endif
3834
#include "win32/time.h"
3935
#endif
4036

@@ -1965,11 +1961,7 @@ PHP_REDIS_API int
19651961
redis_serialize(RedisSock *redis_sock, zval *z, zend_string **val
19661962
TSRMLS_DC)
19671963
{
1968-
#if ZEND_MODULE_API_NO >= 20100000
19691964
php_serialize_data_t ht;
1970-
#else
1971-
HashTable ht;
1972-
#endif
19731965
smart_str sstr = {0};
19741966
zval z_copy;
19751967
#ifdef HAVE_REDIS_IGBINARY
@@ -2004,19 +1996,11 @@ redis_serialize(RedisSock *redis_sock, zval *z, zend_string **val
20041996

20051997
case REDIS_SERIALIZER_PHP:
20061998

2007-
#if ZEND_MODULE_API_NO >= 20100000
20081999
PHP_VAR_SERIALIZE_INIT(ht);
2009-
#else
2010-
zend_hash_init(&ht, 10, NULL, NULL, 0);
2011-
#endif
20122000
php_var_serialize(&sstr, z, &ht TSRMLS_CC);
20132001
//*val = STR_DUP(sstr.s, 0);
20142002
*val = zend_string_init(sstr.s,(*val)->len, 0);
2015-
#if ZEND_MODULE_API_NO >= 20100000
20162003
PHP_VAR_SERIALIZE_DESTROY(ht);
2017-
#else
2018-
zend_hash_destroy(&ht);
2019-
#endif
20202004

20212005
return 1;
20222006

@@ -2049,22 +2033,14 @@ redis_unserialize(RedisSock* redis_sock, const char *val, int val_len,
20492033
if(!*return_value) {
20502034
*return_value = &tmp_value;
20512035
}
2052-
#if ZEND_MODULE_API_NO >= 20100000
20532036
PHP_VAR_UNSERIALIZE_INIT(var_hash);
2054-
#else
2055-
memset(&var_hash, 0, sizeof(var_hash));
2056-
#endif
20572037
if(!php_var_unserialize(*return_value, (const unsigned char**)&val,
20582038
(const unsigned char*)val + val_len, &var_hash TSRMLS_CC)) {
20592039
ret = 0;
20602040
} else {
20612041
ret = 1;
20622042
}
2063-
#if ZEND_MODULE_API_NO >= 20100000
20642043
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
2065-
#else
2066-
var_destroy(&var_hash);
2067-
#endif
20682044

20692045
return ret;
20702046

redis.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,19 +337,15 @@ static zend_function_entry redis_functions[] = {
337337
};
338338

339339
zend_module_entry redis_module_entry = {
340-
#if ZEND_MODULE_API_NO >= 20010901
341340
STANDARD_MODULE_HEADER,
342-
#endif
343341
"redis",
344342
NULL,
345343
PHP_MINIT(redis),
346344
PHP_MSHUTDOWN(redis),
347345
PHP_RINIT(redis),
348346
PHP_RSHUTDOWN(redis),
349347
PHP_MINFO(redis),
350-
#if ZEND_MODULE_API_NO >= 20010901
351348
PHP_REDIS_VERSION,
352-
#endif
353349
STANDARD_MODULE_PROPERTIES
354350
};
355351

@@ -374,11 +370,7 @@ PHP_REDIS_API zend_class_entry *redis_get_exception_base(int root TSRMLS_DC)
374370
}
375371
}
376372
#endif
377-
#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 2)
378-
return zend_exception_get_default();
379-
#else
380373
return zend_exception_get_default(TSRMLS_C);
381-
#endif
382374
}
383375

384376
/* Send a static DISCARD in case we're in MULTI mode. */

redis_cluster.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,7 @@ PHP_REDIS_API zend_class_entry *rediscluster_get_exception_base(int root TSRMLS_
248248
}
249249
}
250250
#endif
251-
#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 2)
252-
return zend_exception_get_default();
253-
#else
254251
return zend_exception_get_default(TSRMLS_C);
255-
#endif
256252
}
257253

258254
/* Create redisCluster context */

0 commit comments

Comments
 (0)