PHP5 and WIN32 support was improved

This commit is contained in:
Dmitry Stogov 2004-02-06 08:01:35 +00:00
parent dfde3095e4
commit c22d7cf883
8 changed files with 64 additions and 36 deletions

33
ext/soap/config-php4.m4 Normal file
View File

@ -0,0 +1,33 @@
dnl $Id$
dnl config.m4 for extension soap
PHP_ARG_WITH(soap, whether to enable soap support,
[ --with-soap[=DIR] Include SOAP support. DIR is libxml2
library directory.])
if test "$PHP_SOAP" != "no"; then
if test "$PHP_SOAP" = "yes"; then
for i in /usr/local /usr; do
if test -d "$i/include/libxml2/libxml"; then
XML2_INCDIR=$i/include/libxml2
XML2_LIBDIR=$i/lib
fi
done
else
if test -d "$PHP_SOAP/include/libxml2/libxml"; then
XML2_INCDIR=$PHP_SOAP/include/libxml2
XML2_LIBDIR=$PHP_SOAP/lib
fi
fi
if test -z "$XML2_INCDIR"; then
AC_MSG_ERROR(Cannot find libxml2 header. Please specify correct libxml2 installation path)
fi
AC_DEFINE(HAVE_PHP_SOAP,1,[Whether you have soap module])
PHP_ADD_INCLUDE($XML2_INCDIR)
PHP_ADD_LIBRARY_WITH_PATH(xml2,$XML2_LIBDIR,SOAP_SHARED_LIBADD)
PHP_NEW_EXTENSION(soap, soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c, $ext_shared)
PHP_SUBST(SOAP_SHARED_LIBADD)
fi

View File

@ -1,33 +1,20 @@
dnl $Id$ dnl $Id$
dnl config.m4 for extension soap dnl config.m4 for extension soap
PHP_ARG_ENABLE(soap, whether to enable soap support, PHP_ARG_WITH(soap, whether to enable soap support,
[ --enable-soap[=DIR] Enable soap support. DIR is libxml2 [ --with-soap Include SOAP support.])
library directory.])
if test "$PHP_SOAP" != "no"; then if test -z "$PHP_LIBXML_DIR"; then
if test "$PHP_SOAP" = "yes"; then PHP_ARG_WITH(libxml-dir, libxml2 install dir,
for i in /usr/local /usr; do [ --with-libxml-dir=DIR XML: libxml2 install prefix], no, no)
if test -d "$i/include/libxml2/libxml"; then fi
XML2_INCDIR=$i/include/libxml2
XML2_LIBDIR=$i/lib if test "$PHP_SOAP" != "no" && test "$PHP_LIBXML" != "no"; then
fi PHP_SETUP_LIBXML(SOAP_SHARED_LIBADD, [
done AC_DEFINE(HAVE_SOAP,1,[ ])
else PHP_NEW_EXTENSION(soap, soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c, $ext_shared)
if test -d "$PHP_SOAP/include/libxml2/libxml"; then PHP_SUBST(SOAP_SHARED_LIBADD)
XML2_INCDIR=$PHP_SOAP/include/libxml2 ], [
XML2_LIBDIR=$PHP_SOAP/lib AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
fi ])
fi
if test -z "$XML2_INCDIR"; then
AC_MSG_ERROR(Cannot find libxml2 header. Please specify correct libxml2 installation path)
fi
AC_DEFINE(HAVE_PHP_SOAP,1,[Whether you have soap module])
PHP_ADD_INCLUDE($XML2_INCDIR)
PHP_ADD_LIBRARY_WITH_PATH(xml2,$XML2_LIBDIR,SOAP_SHARED_LIBADD)
PHP_NEW_EXTENSION(soap, soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c, $ext_shared)
PHP_SUBST(SOAP_SHARED_LIBADD)
fi fi

View File

@ -1,14 +1,15 @@
// $Id$ // $Id$
// vim:ft=javascript // vim:ft=javascript
ARG_ENABLE("soap", "SOAP support", "no"); ARG_WITH("soap", "SOAP support", "no");
if (PHP_SOAP != "no" && PHP_LIBXML == "yes") { if (PHP_SOAP == "yes" && PHP_LIBXML == "yes") {
EXTENSION('soap', 'soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c'); EXTENSION('soap', 'soap.c php_encoding.c php_http.c php_packet_soap.c php_schema.c php_sdl.c php_xml.c');
AC_DEFINE('HAVE_PHP_SOAP', 1); AC_DEFINE('HAVE_PHP_SOAP', 1, "SOAP support");
if (!PHP_SOAP_SHARED) { if (!PHP_SOAP_SHARED) {
ADD_FLAG('CFLAGS_SOAP', "/D LIBXML_STATIC "); ADD_FLAG('CFLAGS_SOAP', "/D LIBXML_STATIC ");
} }
ADD_EXTENSION_DEP('soap', 'libxml');
} }

View File

@ -1992,10 +1992,14 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
} }
/* Time zone support */ /* Time zone support */
#if HAVE_TM_GMTOFF #ifdef HAVE_TM_GMTOFF
sprintf(tzbuf, "%c%02d%02d", (ta->tm_gmtoff < 0) ? '-' : '+', abs(ta->tm_gmtoff / 3600), abs( (ta->tm_gmtoff % 3600) / 60 )); sprintf(tzbuf, "%c%02d%02d", (ta->tm_gmtoff < 0) ? '-' : '+', abs(ta->tm_gmtoff / 3600), abs( (ta->tm_gmtoff % 3600) / 60 ));
#else #else
# ifdef ZEND_WIN32
sprintf(tzbuf, "%c%02d%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs(((ta->tm_isdst ? timezone - 3600 : timezone) % 3600) / 60));
# else
sprintf(tzbuf, "%c%02d%02d", ((ta->tm_isdst ? tzone - 3600:tzone)>0)?'-':'+', abs((ta->tm_isdst ? tzone - 3600 : tzone) / 3600), abs(((ta->tm_isdst ? tzone - 3600 : tzone) % 3600) / 60)); sprintf(tzbuf, "%c%02d%02d", ((ta->tm_isdst ? tzone - 3600:tzone)>0)?'-':'+', abs((ta->tm_isdst ? tzone - 3600 : tzone) / 3600), abs(((ta->tm_isdst ? tzone - 3600 : tzone) % 3600) / 60));
# endif
#endif #endif
if (strcmp(tzbuf,"+0000") == 0) { if (strcmp(tzbuf,"+0000") == 0) {
strcpy(tzbuf,"Z"); strcpy(tzbuf,"Z");

View File

@ -162,6 +162,7 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
return ret; return ret;
} }
#ifndef ZEND_ENGINE_2
int php_stream_xmlIO_match_wrapper(const char *filename) int php_stream_xmlIO_match_wrapper(const char *filename)
{ {
TSRMLS_FETCH(); TSRMLS_FETCH();
@ -185,6 +186,7 @@ int php_stream_xmlIO_close(void *context)
TSRMLS_FETCH(); TSRMLS_FETCH();
return php_stream_close((php_stream*)context); return php_stream_close((php_stream*)context);
} }
#endif
xmlNsPtr attr_find_ns(xmlAttrPtr node) xmlNsPtr attr_find_ns(xmlAttrPtr node)
{ {

View File

@ -44,10 +44,12 @@ xmlNodePtr get_node_with_attribute_ex(xmlNodePtr node, char *name, char *name_ns
xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns); xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns);
int parse_namespace(const char *inval,char **value,char **namespace); int parse_namespace(const char *inval,char **value,char **namespace);
#ifndef ZEND_ENGINE_2
int php_stream_xmlIO_match_wrapper(const char *filename); int php_stream_xmlIO_match_wrapper(const char *filename);
void *php_stream_xmlIO_open_wrapper(const char *filename); void *php_stream_xmlIO_open_wrapper(const char *filename);
int php_stream_xmlIO_read(void *context, char *buffer, int len); int php_stream_xmlIO_read(void *context, char *buffer, int len);
int php_stream_xmlIO_close(void *context); int php_stream_xmlIO_close(void *context);
#endif
#define FOREACHATTRNODE(n,c,i) FOREACHATTRNODEEX(n,c,NULL,i) #define FOREACHATTRNODE(n,c,i) FOREACHATTRNODEEX(n,c,NULL,i)
#define FOREACHATTRNODEEX(n,c,ns,i) \ #define FOREACHATTRNODEEX(n,c,ns,i) \

View File

@ -28,7 +28,7 @@ TD:{
This extension makes use of the <A HREF="http://www.xmlsoft.org" TARGET="_top">GNOME XML library</A>. Download and install this library. You will need at least libxml-2.5.4. This extension makes use of the <A HREF="http://www.xmlsoft.org" TARGET="_top">GNOME XML library</A>. Download and install this library. You will need at least libxml-2.5.4.
<HR> <HR>
<H2>Installation</H2> <H2>Installation</H2>
<I>FIXME</I> This extension is only available if PHP was configured with --with-soap.
<HR> <HR>
<H2>Predefined Constants</H2> <H2>Predefined Constants</H2>
The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.

View File

@ -356,10 +356,12 @@ PHP_MINIT_FUNCTION(soap)
/* TODO: add ini entry for always use soap errors */ /* TODO: add ini entry for always use soap errors */
ZEND_INIT_MODULE_GLOBALS(soap, php_soap_init_globals, NULL); ZEND_INIT_MODULE_GLOBALS(soap, php_soap_init_globals, NULL);
#ifndef ZEND_ENGINE_2
/* Enable php stream/wrapper support for libxml */ /* Enable php stream/wrapper support for libxml */
xmlRegisterDefaultInputCallbacks(); xmlRegisterDefaultInputCallbacks();
xmlRegisterInputCallbacks(php_stream_xmlIO_match_wrapper, php_stream_xmlIO_open_wrapper, xmlRegisterInputCallbacks(php_stream_xmlIO_match_wrapper, php_stream_xmlIO_open_wrapper,
php_stream_xmlIO_read, php_stream_xmlIO_close); php_stream_xmlIO_read, php_stream_xmlIO_close);
#endif
/* Register SoapClient class */ /* Register SoapClient class */
/* BIG NOTE : THIS EMITS AN COMPILATION WARNING UNDER ZE2 - handle_function_call deprecated. /* BIG NOTE : THIS EMITS AN COMPILATION WARNING UNDER ZE2 - handle_function_call deprecated.
@ -495,9 +497,6 @@ PHP_MINFO_FUNCTION(soap)
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "Soap Client", "enabled"); php_info_print_table_row(2, "Soap Client", "enabled");
php_info_print_table_row(2, "Soap Server", "enabled"); php_info_print_table_row(2, "Soap Server", "enabled");
#if HAVE_PHP_SESSION
php_info_print_table_row(2, "Soap Serializer", "enabled");
#endif
php_info_print_table_end(); php_info_print_table_end();
} }