Permalink
Browse files

Added configure flag to disable sessions.

  • Loading branch information...
1 parent 956e3e4 commit 73d99c3ec85d7b4da6e0b187e5a396335db72d35 @nicolasff nicolasff committed Jun 25, 2011
Showing with 19 additions and 1 deletion.
  1. +9 −0 config.m4
  2. +6 −0 redis.c
  3. +2 −0 redis_session.c
  4. +2 −1 redis_session.h
View
@@ -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
View
@@ -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;
}
View
@@ -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: */
View
@@ -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

0 comments on commit 73d99c3

Please sign in to comment.