cvs: pecl /memcache config.m4 config9.m4 memcache.c memcache_session.c php_memcache.h

From: Date: Wed, 15 Nov 2006 21:05:03 +0000
Subject: cvs: pecl /memcache config.m4 config9.m4 memcache.c memcache_session.c php_memcache.h
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-6638@lists.php.net to get a copy of this message
tony2001 Wed Nov 15 21:05:03 2006 UTC Added files: /pecl/memcache config9.m4 Modified files: /pecl/memcache config.m4 memcache.c memcache_session.c php_memcache.h Log: improve session support by using PHP_ADD_EXTENSION_DEP() macro, when possible. this makes it possible to disable session support and also memcache's ./configure will fail gracefully if you enable it, but ext/session is missing.

http://cvs.php.net/viewvc.cgi/pecl/memcache/config.m4?r1=1.10&r2=1.11&diff_format=u Index: pecl/memcache/config.m4 diff -u pecl/memcache/config.m4:1.10 pecl/memcache/config.m4:1.11 --- pecl/memcache/config.m4:1.10 Fri Oct 27 10:13:03 2006 +++ pecl/memcache/config.m4 Wed Nov 15 21:05:03 2006 @@ -1,71 +1,4 @@ -dnl -dnl $Id: config.m4,v 1.10 2006/10/27 10:13:03 mikl Exp $ -dnl +dnl $Id: config.m4,v 1.11 2006/11/15 21:05:03 tony2001 Exp $ +dnl this file is required by phpize -PHP_ARG_ENABLE(memcache, whether to enable memcache support, -[ --enable-memcache Enable memcache support]) - -if test -z "$PHP_ZLIB_DIR"; then -PHP_ARG_WITH(zlib-dir, for the location of ZLIB, -[ --with-zlib-dir[=DIR] memcache: Set the path to ZLIB install prefix.], no, no) -fi - -if test -z "$PHP_DEBUG"; then - AC_ARG_ENABLE(debug, - [ --enable-debug compile with debugging symbols],[ - PHP_DEBUG=$enableval - ],[ - PHP_DEBUG=no - ]) -fi - -if test "$PHP_MEMCACHE" != "no"; then - - if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then - if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then - PHP_ZLIB_DIR="$PHP_ZLIB_DIR" - PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib" - elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then - PHP_ZLIB_DIR="$PHP_ZLIB_DIR" - PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include" - else - AC_MSG_ERROR([Can't find ZLIB headers under "$PHP_ZLIB_DIR"]) - fi - else - for i in /usr/local /usr; do - if test -f "$i/include/zlib/zlib.h"; then - PHP_ZLIB_DIR="$i" - PHP_ZLIB_INCDIR="$i/include/zlib" - elif test -f "$i/include/zlib.h"; then - PHP_ZLIB_DIR="$i" - PHP_ZLIB_INCDIR="$i/include" - fi - done - fi - - dnl # zlib - AC_MSG_CHECKING([for the location of zlib]) - if test "$PHP_ZLIB_DIR" = "no"; then - AC_MSG_ERROR([memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located]) - else - AC_MSG_RESULT([$PHP_ZLIB_DIR]) - PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, MEMCACHE_SHARED_LIBADD) - PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR) - fi - - dnl # optional session support - CPPFLAGS="$CPPFLAGS $INCLUDES" - AC_CHECK_HEADERS(php.h ext/session/php_session.h,,, - [[ - #if HAVE_PHP_H - #include "php.h" - #endif - ]]) - - if test "$PHP_DEBUG" = "yes"; then - CFLAGS="$CFLAGS -Wall" - fi - - AC_DEFINE(HAVE_MEMCACHE,1,[Whether you want memcache support]) - PHP_NEW_EXTENSION(memcache, memcache.c memcache_session.c, $ext_shared) -fi +sinclude(config9.m4) http://cvs.php.net/viewvc.cgi/pecl/memcache/memcache.c?r1=1.68&r2=1.69&diff_format=u Index: pecl/memcache/memcache.c diff -u pecl/memcache/memcache.c:1.68 pecl/memcache/memcache.c:1.69 --- pecl/memcache/memcache.c:1.68 Fri Oct 27 10:49:18 2006 +++ pecl/memcache/memcache.c Wed Nov 15 21:05:03 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: memcache.c,v 1.68 2006/10/27 10:49:18 mikl Exp $ */ +/* $Id: memcache.c,v 1.69 2006/11/15 21:05:03 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -43,10 +43,6 @@ #include "php_network.h" #include "php_memcache.h" -#if HAVE_EXT_SESSION_PHP_SESSION_H -#include "ext/session/php_session.h" -#endif - #ifndef ZEND_ENGINE_2 #define OnUpdateLong OnUpdateInt #endif @@ -249,7 +245,7 @@ REGISTER_LONG_CONSTANT("MEMCACHE_COMPRESSED", MMC_COMPRESSED, CONST_CS | CONST_PERSISTENT); REGISTER_INI_ENTRIES(); -#if HAVE_EXT_SESSION_PHP_SESSION_H +#if HAVE_MEMCACHE_SESSION REGISTER_LONG_CONSTANT("MEMCACHE_HAVE_SESSION", 1, CONST_CS | CONST_PERSISTENT); php_session_register_module(ps_memcache_ptr); #else @@ -289,7 +285,7 @@ php_info_print_table_start(); php_info_print_table_header(2, "memcache support", "enabled"); php_info_print_table_row(2, "Active persistent connections", buf); - php_info_print_table_row(2, "Revision", "$Revision: 1.68 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.69 $"); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); http://cvs.php.net/viewvc.cgi/pecl/memcache/memcache_session.c?r1=1.1&r2=1.2&diff_format=u Index: pecl/memcache/memcache_session.c diff -u pecl/memcache/memcache_session.c:1.1 pecl/memcache/memcache_session.c:1.2 --- pecl/memcache/memcache_session.c:1.1 Fri Oct 27 10:13:03 2006 +++ pecl/memcache/memcache_session.c Wed Nov 15 21:05:03 2006 @@ -17,24 +17,23 @@ +----------------------------------------------------------------------+ */ -/* $Id: memcache_session.c,v 1.1 2006/10/27 10:13:03 mikl Exp $ */ +/* $Id: memcache_session.c,v 1.2 2006/11/15 21:05:03 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#if HAVE_MEMCACHE && HAVE_EXT_SESSION_PHP_SESSION_H - #include <ctype.h> #include "php.h" #include "php_ini.h" #include "php_variables.h" #include "SAPI.h" -#include "ext/session/php_session.h" #include "ext/standard/url.h" #include "php_memcache.h" +#if HAVE_MEMCACHE_SESSION + ps_module ps_mod_memcache = { PS_MOD(memcache) }; @@ -214,7 +213,7 @@ } /* }}} */ -#endif /* HAVE_MEMCACHE && HAVE_EXT_SESSION_PHP_SESSION_H */ +#endif /* HAVE_MEMCACHE_SESSION */ /* * Local variables: * tab-width: 4 http://cvs.php.net/viewvc.cgi/pecl/memcache/php_memcache.h?r1=1.21&r2=1.22&diff_format=u Index: pecl/memcache/php_memcache.h diff -u pecl/memcache/php_memcache.h:1.21 pecl/memcache/php_memcache.h:1.22 --- pecl/memcache/php_memcache.h:1.21 Fri Oct 27 10:13:03 2006 +++ pecl/memcache/php_memcache.h Wed Nov 15 21:05:03 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_memcache.h,v 1.21 2006/10/27 10:13:03 mikl Exp $ */ +/* $Id: php_memcache.h,v 1.22 2006/11/15 21:05:03 tony2001 Exp $ */ #ifndef PHP_MEMCACHE_H #define PHP_MEMCACHE_H @@ -126,7 +126,7 @@ int mmc_delete(mmc_t *, const char *, int, int TSRMLS_DC); /* session handler struct */ -#if HAVE_EXT_SESSION_PHP_SESSION_H +#if HAVE_MEMCACHE_SESSION #include "ext/session/php_session.h" extern ps_module ps_mod_memcache; http://cvs.php.net/viewvc.cgi/pecl/memcache/config9.m4?view=markup&rev=1.1 Index: pecl/memcache/config9.m4 +++ pecl/memcache/config9.m4 dnl dnl $Id: config9.m4,v 1.1 2006/11/15 21:05:03 tony2001 Exp $ dnl PHP_ARG_ENABLE(memcache, whether to enable memcache support, [ --enable-memcache Enable memcache support]) PHP_ARG_ENABLE(memcache-session, whether to enable memcache session handler support, [ --disable-memcache-session Disable memcache session handler support], yes) if test -z "$PHP_ZLIB_DIR"; then PHP_ARG_WITH(zlib-dir, for the location of ZLIB, [ --with-zlib-dir[=DIR] memcache: Set the path to ZLIB install prefix.], no, no) fi if test -z "$PHP_DEBUG"; then AC_ARG_ENABLE(debug, [ --enable-debug compile with debugging symbols],[ PHP_DEBUG=$enableval ],[ PHP_DEBUG=no ]) fi if test "$PHP_MEMCACHE" != "no"; then if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then PHP_ZLIB_DIR="$PHP_ZLIB_DIR" PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include/zlib" elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then PHP_ZLIB_DIR="$PHP_ZLIB_DIR" PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include" else AC_MSG_ERROR([Can't find ZLIB headers under "$PHP_ZLIB_DIR"]) fi else for i in /usr/local /usr; do if test -f "$i/include/zlib/zlib.h"; then PHP_ZLIB_DIR="$i" PHP_ZLIB_INCDIR="$i/include/zlib" elif test -f "$i/include/zlib.h"; then PHP_ZLIB_DIR="$i" PHP_ZLIB_INCDIR="$i/include" fi done fi dnl # zlib AC_MSG_CHECKING([for the location of zlib]) if test "$PHP_ZLIB_DIR" = "no"; then AC_MSG_ERROR([memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located]) else AC_MSG_RESULT([$PHP_ZLIB_DIR]) PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, MEMCACHE_SHARED_LIBADD) PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR) fi if test "$PHP_MEMCACHE_SESSION" != "no"; then AC_MSG_CHECKING([for session includes]) if test -f $abs_srcdir/include/php/ext/session/php_session.h; then session_inc_path=$abs_srcdir/include/php elif test -f $abs_srcdir/ext/session/php_session.h; then session_inc_path=$abs_srcdir elif test -f $prefix/include/php/ext/session/php_session.h; then session_inc_path=$prefix/include/php else session_inc_path="" fi if test "$session_inc_path" = ""; then AC_MSG_ERROR([Cannot find php_session.h]) else AC_MSG_RESULT([$session_inc_path]) fi fi AC_MSG_CHECKING([for memcache session support]) if test "$PHP_MEMCACHE_SESSION" != "no"; then AC_MSG_RESULT([enabled]) AC_DEFINE(HAVE_MEMCACHE_SESSION,1,[Whether memcache session handler is enabled]) AC_DEFINE(HAVE_MEMCACHE,1,[Whether you want memcache support]) PHP_NEW_EXTENSION(memcache, memcache.c memcache_session.c, $ext_shared,,-I$session_inc_path) ifdef([PHP_ADD_EXTENSION_DEP], [ PHP_ADD_EXTENSION_DEP(memcache, session) ]) else AC_MSG_RESULT([disabled]) AC_DEFINE(HAVE_MEMCACHE,1,[Whether you want memcache support]) PHP_NEW_EXTENSION(memcache, memcache.c, $ext_shared) fi dnl this is needed to build the extension with phpize and -Wall if test "$PHP_DEBUG" = "yes"; then CFLAGS="$CFLAGS -Wall" fi fi
« previous php.pecl.cvs (#6638) next »