8000 Merge branch 'master' into pecl. · jrtkcoder/phpredis@4e99a4d · GitHub
[go: up one dir, main page]

Skip to content

Commit 4e99a4d

Browse files
committed
Merge branch 'master' into pecl.
2 parents 9b6af7b + 73d99c3 commit 4e99a4d

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

config.m4

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ dnl Make sure that the comment is aligned:
88
PHP_ARG_ENABLE(redis-igbinary, whether to enable igbinary serializer support,
99
[ --enable-redis-igbinary Enable igbinary serializer support], no, no)
1010

11+
PHP_ARG_ENABLE(redis-session, whether to enable sessions,
12+
[ --disable-redis-session Disable session support], yes, no)
13+
14+
1115
if test "$PHP_REDIS" != "no"; then
1216
if test "$PHP_REDIS_IGBINARY" != "no"; then
1317
AC_MSG_CHECKING([for igbinary includes])
@@ -48,6 +52,10 @@ if test "$PHP_REDIS" != "no"; then
4852
AC_MSG_RESULT([disabled])
4953
fi
5054

55+
if test "$PHP_REDIS_SESSION" != "no"; then
56+
AC_DEFINE(PHP_SESSION,1,[redis sessions])
57+
fi
58+
5159
dnl # --with-redis -> check with-path
5260
dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
5361
dnl SEARCH_FOR="/include/redis.h" # you most likely want to change this

redis.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
#include "php_redis.h"
2929
#include <zend_exceptions.h>
3030

31+
#ifdef PHP_SESSION
3132
#include "ext/session/php_session.h"
33+
#endif
3234

3335
#include "library.h"
3436

@@ -37,7 +39,9 @@
3739

3840
static int le_redis_sock;
3941

42+
#ifdef PHP_SESSION
4043
extern ps_module ps_mod_redis;
44+
#endif
4145

4246
zend_class_entry *redis_ce;
4347
zend_class_entry *redis_exception_ce;
@@ -334,8 +338,10 @@ PHP_MINIT_FUNCTION(redis)
334338
zend_declare_class_constant_stringl(redis_ce, "AFTER", 5, "after", 5 TSRMLS_CC);
335339
zend_declare_class_constant_stringl(redis_ce, "BEFORE", 6, "before", 6 TSRMLS_CC);
336340

341+
#ifdef PHP_SESSION
337342
/* declare session handler */
338343
php_session_register_module(&ps_mod_redis);
344+
#endif
339345

340346
return SUCCESS;
341347
}

redis_session.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "config.h"
2424
#endif
2525

26+
#ifdef PHP_SESSION
2627
#include "common.h"
2728
#include "ext/standard/info.h"
2829
#include "php_redis.h"
@@ -426,5 +427,6 @@ PS_GC_FUNC(redis)
426427
}
427428
/* }}} */
428429

430+
#endif
429431
/* vim: set tabstop=4 expandtab: */
430432

redis_session.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef REDIS_SESSION_H
22
#define REDIS_SESSION_H
3-
3+
#ifdef PHP_SESSION
44
#include "ext/session/php_session.h"
55

66
PS_OPEN_FUNC(redis);
@@ -12,4 +12,5 @@ PS_GC_FUNC(redis);
1212

1313

1414
#endif
15+
#endif
1516

0 commit comments

Comments
 (0)
0