Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfig.m49
-rwxr-xr-xredis.c6
-rw-r--r--redis_session.c2
-rw-r--r--redis_session.h3
4 files changed, 19 insertions, 1 deletions
diff --git a/config.m4 b/config.m4
index d4391cbf..8ebc9e73 100755
--- a/config.m4
+++ b/config.m4
@@ -5,8 +5,17 @@ PHP_ARG_ENABLE(redis, whether to enable redis support,
dnl Make sure that the comment is aligned:
[ --enable-redis Enable redis support])
+PHP_ARG_ENABLE(redis-session, whether to enable sessions,
+[ --disable-redis-session Disable session support], yes, no)
+
+
+
if test "$PHP_REDIS" != "no"; then
+ if test "$PHP_REDIS_SESSION" != "no"; then
+ AC_DEFINE(PHP_SESSION,1,[redis sessions])
+ fi
+
dnl # --with-redis -> check with-path
dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
dnl SEARCH_FOR="/include/redis.h" # you most likely want to change this
diff --git a/redis.c b/redis.c
index c48f9dac..7e54fd5d 100755
--- a/redis.c
+++ b/redis.c
@@ -28,7 +28,9 @@
#include "php_redis.h"
#include <zend_exceptions.h>
+#ifdef PHP_SESSION
#include "ext/session/php_session.h"
+#endif
#include "library.h"
@@ -37,7 +39,9 @@
static int le_redis_sock;
+#ifdef PHP_SESSION
extern ps_module ps_mod_redis;
+#endif
zend_class_entry *redis_ce;
zend_class_entry *redis_exception_ce;
@@ -332,8 +336,10 @@ PHP_MINIT_FUNCTION(redis)
zend_declare_class_constant_stringl(redis_ce, "AFTER", 5, "after", 5 TSRMLS_CC);
zend_declare_class_constant_stringl(redis_ce, "BEFORE", 6, "before", 6 TSRMLS_CC);
+#ifdef PHP_SESSION
/* declare session handler */
php_session_register_module(&ps_mod_redis);
+#endif
return SUCCESS;
}
diff --git a/redis_session.c b/redis_session.c
index 4ff4955d..43d2e354 100644
--- a/redis_session.c
+++ b/redis_session.c
@@ -23,6 +23,7 @@
#include "config.h"
#endif
+#ifdef PHP_SESSION
#include "common.h"
#include "ext/standard/info.h"
#include "php_redis.h"
@@ -426,5 +427,6 @@ PS_GC_FUNC(redis)
}
/* }}} */
+#endif
/* vim: set tabstop=4 expandtab: */
diff --git a/redis_session.h b/redis_session.h
index 9f12db2c..ce74e23f 100644
--- a/redis_session.h
+++ b/redis_session.h
@@ -1,6 +1,6 @@
#ifndef REDIS_SESSION_H
#define REDIS_SESSION_H
-
+#ifdef PHP_SESSION
#include "ext/session/php_session.h"
PS_OPEN_FUNC(redis);
@@ -12,4 +12,5 @@ PS_GC_FUNC(redis);
#endif
+#endif