Permalink
Browse files

Added check in config.m4 whether to enable session handler support or…

… not
  • Loading branch information...
mkoppanen
mkoppanen committed Jun 15, 2009
1 parent 1f07477 commit 3d4635d250672aef134f0f5d2e3ace7bda98046f
Showing with 22 additions and 10 deletions.
  1. +14 −4 config.m4
  2. +6 −2 php_tokyo_tyrant.h
  3. +0 −1 php_tokyo_tyrant_session.h
  4. +2 −0 tokyo_tyrant.c
  5. +0 −1 tokyo_tyrant_hash.c
  6. +0 −2 tokyo_tyrant_session.c
View
@@ -1,5 +1,8 @@
-PHP_ARG_WITH(tokyo-tyrant, whether to enable tokyo tyrant handler support,
-[ --with-tokyo-tyrant[=DIR] Enable tokyo tyrant handler support], yes)
+PHP_ARG_WITH(tokyo-tyrant, whether to enable tokyo tyrant support,
+[ --with-tokyo-tyrant[=DIR] Enable tokyo tyrant support], yes)
+
+PHP_ARG_ENABLE(tokyo-tyrant-session, whether to enable tokyo tyrant session handler support,
+[ --disable-tokyo-tyrant-session Disables tokyo tyrant session handler support], yes, no)
if test "$PHP_TOKYO_TYRANT" != "no"; then
@@ -25,9 +28,16 @@ if test "$PHP_TOKYO_TYRANT" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH(tokyocabinet, $TYRANT_PREFIX/lib, TOKYO_TYRANT_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(tokyotyrant, $TYRANT_PREFIX/lib, TOKYO_TYRANT_SHARED_LIBADD)
-
PHP_SUBST(TOKYO_TYRANT_SHARED_LIBADD)
- PHP_NEW_EXTENSION(tokyo_tyrant, tokyo_tyrant.c tokyo_tyrant_hash.c tokyo_tyrant_funcs.c tokyo_tyrant_session.c tokyo_tyrant_session_funcs.c, $ext_shared)
+
+ TOKYO_EXT_FILES="tokyo_tyrant.c tokyo_tyrant_hash.c tokyo_tyrant_funcs.c"
+
+ if test "$PHP_TOKYO_TYRANT_SESSION" != "no"; then
+ AC_DEFINE(HAVE_PHP_TOKYO_TYRANT_SESSION,1,[ ])
+ TOKYO_EXT_FILES="${TOKYO_EXT_FILES} tokyo_tyrant_session.c tokyo_tyrant_session_funcs.c"
+ fi
+
+ PHP_NEW_EXTENSION(tokyo_tyrant, $TOKYO_EXT_FILES, $ext_shared)
AC_DEFINE(HAVE_PHP_TOKYO_TYRANT,1,[ ])
fi
View
@@ -18,7 +18,7 @@
#ifndef _PHP_TOKYO_TYRANT_H_
# define _PHP_TOKYO_TYRANT_H_
-#define PHP_TOKYO_TYRANT_EXTVER "0.0.4-dev"
+#define PHP_TOKYO_TYRANT_EXTVER "0.0.5-dev"
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -29,13 +29,17 @@
#endif
#include "php.h"
-#include "ext/session/php_session.h"
extern zend_module_entry tokyo_tyrant_module_entry;
#define phpext_tokyo_tyrant_ptr &tokyo_tyrant_module_entry
+#ifdef HAVE_PHP_TOKYO_TYRANT_SESSION
+#include "ext/session/php_session.h"
+
extern ps_module ps_mod_tokyo_tyrant;
#define ps_tokyo_tyrant_ptr &ps_mod_tokyo_tyrant
+
PS_FUNCS(tokyo_tyrant);
+#endif
#endif /* _PHP_TOKYO_TYRANT_H_ */
@@ -42,4 +42,3 @@ int (*php_tokyo_hash_func)(php_tokyo_tyrant_session *session, char *key);
#endif
-
View
@@ -1517,8 +1517,10 @@ PHP_MINIT_FUNCTION(tokyo_tyrant)
#undef TOKYO_REGISTER_CONST_LONG
+#ifdef HAVE_PHP_TOKYO_TYRANT_SESSION
php_session_register_module(ps_tokyo_tyrant_ptr);
php_tokyo_hash_func = php_tokyo_tyrant_simple_hash;
+#endif
return SUCCESS;
}
View
@@ -58,4 +58,3 @@ int php_tokyo_tyrant_simple_hash(php_tokyo_tyrant_session *session, char *key)
-
View
@@ -252,5 +252,3 @@ PS_CLOSE_FUNC(tokyo_tyrant)
PS_SET_MOD_DATA(NULL);
return SUCCESS;
}
-
-

0 comments on commit 3d4635d

Please sign in to comment.