mirror of
https://github.com/php-win-ext/phpredis.git
synced 2026-03-24 00:52:16 +01:00
Added RedisArray and RedisCluster to config.w32 and more win32 fixes
Manually picked from: 6c377eee18
This commit is contained in:
55
config.w32
55
config.w32
@@ -1,28 +1,27 @@
|
||||
// vim: ft=javascript:
|
||||
|
||||
ARG_ENABLE("redis", "whether to enable redis support", "yes");
|
||||
ARG_ENABLE("redis-session", "whether to enable sessions", "yes");
|
||||
ARG_ENABLE("redis-igbinary", "whether to enable igbinary serializer support", "no");
|
||||
|
||||
if (PHP_REDIS != "no") {
|
||||
var sources = "redis.c library.c redis_array.c redis_array_impl.c";
|
||||
if (PHP_REDIS_SESSION != "no") {
|
||||
ADD_SOURCES(configure_module_dirname, "redis_session.c", "redis");
|
||||
ADD_EXTENSION_DEP("redis", "session");
|
||||
ADD_FLAG("CFLAGS_REDIS", ' /D PHP_SESSION=1 ');
|
||||
AC_DEFINE("HAVE_REDIS_SESSION", 1);
|
||||
}
|
||||
|
||||
if (PHP_REDIS_IGBINARY != "no") {
|
||||
if (CHECK_HEADER_ADD_INCLUDE("igbinary.h", "CFLAGS_REDIS", configure_module_dirname + "\\..\\igbinary")) {
|
||||
|
||||
ADD_EXTENSION_DEP("redis", "igbinary");
|
||||
AC_DEFINE("HAVE_REDIS_IGBINARY", 1);
|
||||
} else {
|
||||
WARNING("redis igbinary support not enabled");
|
||||
}
|
||||
}
|
||||
|
||||
EXTENSION("redis", sources);
|
||||
}
|
||||
|
||||
// vim: ft=javascript:
|
||||
|
||||
ARG_ENABLE("redis", "whether to enable redis support", "yes");
|
||||
ARG_ENABLE("redis-session", "whether to enable sessions", "yes");
|
||||
ARG_ENABLE("redis-igbinary", "whether to enable igbinary serializer support", "no");
|
||||
|
||||
if (PHP_REDIS != "no") {
|
||||
var sources = "redis.c library.c redis_array.c redis_array_impl.c";
|
||||
if (PHP_REDIS_SESSION != "no") {
|
||||
ADD_SOURCES(configure_module_dirname, "redis_session.c", "redis");
|
||||
ADD_EXTENSION_DEP("redis", "session");
|
||||
ADD_FLAG("CFLAGS_REDIS", ' /D PHP_SESSION=1 ');
|
||||
AC_DEFINE("HAVE_REDIS_SESSION", 1);
|
||||
}
|
||||
|
||||
if (PHP_REDIS_IGBINARY != "no") {
|
||||
if (CHECK_HEADER_ADD_INCLUDE("igbinary.h", "CFLAGS_REDIS", configure_module_dirname + "\\..\\igbinary")) {
|
||||
|
||||
ADD_EXTENSION_DEP("redis", "igbinary");
|
||||
AC_DEFINE("HAVE_REDIS_IGBINARY", 1);
|
||||
} else {
|
||||
WARNING("redis igbinary support not enabled");
|
||||
}
|
||||
}
|
||||
|
||||
EXTENSION("redis", sources);
|
||||
}
|
||||
@@ -463,12 +463,14 @@ ra_find_node(RedisArray *ra, const char *key, int key_len, int *out_pos TSRMLS_D
|
||||
}
|
||||
efree(out);
|
||||
} else {
|
||||
uint64_t h64;
|
||||
|
||||
/* hash */
|
||||
hash = rcrc32(out, out_len);
|
||||
efree(out);
|
||||
|
||||
/* get position on ring */
|
||||
uint64_t h64 = hash;
|
||||
h64 = hash;
|
||||
h64 *= ra->count;
|
||||
h64 /= 0xffffffff;
|
||||
pos = (int)h64;
|
||||
@@ -565,6 +567,7 @@ ra_index_keys(zval *z_pairs, zval *z_redis TSRMLS_DC) {
|
||||
zval *z_keys, **z_entry_pp;
|
||||
HashPosition pos;
|
||||
MAKE_STD_ZVAL(z_keys);
|
||||
HashPosition pos;
|
||||
#if PHP_VERSION_ID > 50300
|
||||
array_init_size(z_keys, zend_hash_num_elements(Z_ARRVAL_P(z_pairs)));
|
||||
#else
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
#define REDIS_ARRAY_IMPL_H
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#include "win32/php_stdint.h"
|
||||
#include <win32/php_stdint.h>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
#include "redis_array.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user