diff options
author | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2011-06-26 02:09:09 +0400 |
---|---|---|
committer | Nicolas Favre-Felix <n.favrefelix@gmail.com> | 2011-06-26 02:09:09 +0400 |
commit | 73d99c3ec85d7b4da6e0b187e5a396335db72d35 (patch) | |
tree | da5d47e8f1710756caeb52a086a04c2fee9ae1da | |
parent | 956e3e445b8450f737a7efbfdb8c4db2fd0aae4d (diff) |
Added configure flag to disable sessions.
-rwxr-xr-x | config.m4 | 9 | ||||
-rwxr-xr-x | redis.c | 6 | ||||
-rw-r--r-- | redis_session.c | 2 | ||||
-rw-r--r-- | redis_session.h | 3 |
4 files changed, 19 insertions, 1 deletions
@@ -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 @@ -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 |