]> granicus.if.org Git - php/commitdiff
PHP5 and WIN32 support was improved
authorDmitry Stogov <dmitry@php.net>
Fri, 6 Feb 2004 08:01:35 +0000 (08:01 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 6 Feb 2004 08:01:35 +0000 (08:01 +0000)
ext/soap/config-php4.m4 [new file with mode: 0644]
ext/soap/config.m4
ext/soap/config.w32
ext/soap/php_encoding.c
ext/soap/php_xml.c
ext/soap/php_xml.h
ext/soap/readme.html
ext/soap/soap.c

diff --git a/ext/soap/config-php4.m4 b/ext/soap/config-php4.m4
new file mode 100644 (file)
index 0000000..332acac
--- /dev/null
@@ -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
index 0b27165bcbe29818414ff9f54708a9228086ee4d..5d719a7caace4ec6c6bd1f6193ba426ac7eb5199 100644 (file)
@@ -1,33 +1,20 @@
 dnl $Id$
 dnl config.m4 for extension soap
 
-PHP_ARG_ENABLE(soap, whether to enable soap support,
-[  --enable-soap[=DIR]      Enable soap support.  DIR is libxml2
-                           library directory.])
+PHP_ARG_WITH(soap, whether to enable soap support,
+[  --with-soap            Include SOAP support.])
 
-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])
+if test -z "$PHP_LIBXML_DIR"; then
+  PHP_ARG_WITH(libxml-dir, libxml2 install dir,
+  [  --with-libxml-dir=DIR     XML: libxml2 install prefix], no, no)
+fi
 
-  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)
+if test "$PHP_SOAP" != "no" && test "$PHP_LIBXML" != "no"; then
+  PHP_SETUP_LIBXML(SOAP_SHARED_LIBADD, [
+    AC_DEFINE(HAVE_SOAP,1,[ ])
+         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)
+  ], [
+    AC_MSG_ERROR([xml2-config not found. Please check your libxml2 installation.])
+  ])
 fi
index f579f32a04b8ce8f62912056723b6bfb03552e7a..c156921cae72ee615b5a7ddfdb79d205a98028b7 100644 (file)
@@ -1,14 +1,15 @@
 // $Id$
 // 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');
-       AC_DEFINE('HAVE_PHP_SOAP', 1);
+       AC_DEFINE('HAVE_PHP_SOAP', 1, "SOAP support");
 
        if (!PHP_SOAP_SHARED) {
                ADD_FLAG('CFLAGS_SOAP', "/D LIBXML_STATIC ");
        }
+       ADD_EXTENSION_DEP('soap', 'libxml');
 }
 
index 2978990c027abb335a7cbb6b1b00423ebb8eedf1..f4341eccb9029a2c450b567b32e1578b1ac6cf8a 100644 (file)
@@ -1992,10 +1992,14 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
                }
 
                /* 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 ));
 #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));
+# endif
 #endif
                if (strcmp(tzbuf,"+0000") == 0) {
                  strcpy(tzbuf,"Z");
index 6912be670cb15b51b9490427c9e4274a83c54836..6fc82ec44e5854f270a387ce129033b289bf5443 100644 (file)
@@ -162,6 +162,7 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t buf_size)
        return ret;
 }
 
+#ifndef ZEND_ENGINE_2
 int php_stream_xmlIO_match_wrapper(const char *filename)
 {
        TSRMLS_FETCH();
@@ -185,6 +186,7 @@ int php_stream_xmlIO_close(void *context)
        TSRMLS_FETCH();
        return php_stream_close((php_stream*)context);
 }
+#endif
 
 xmlNsPtr attr_find_ns(xmlAttrPtr node)
 {
index 4ec1600b441d53498521226ee2f9b55e2df02af4..dfb31ffad24a9d9684a9ba6c17074cf6144657ea 100644 (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);
 int parse_namespace(const char *inval,char **value,char **namespace);
 
+#ifndef ZEND_ENGINE_2
 int php_stream_xmlIO_match_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_close(void *context);
+#endif
 
 #define FOREACHATTRNODE(n,c,i)      FOREACHATTRNODEEX(n,c,NULL,i)
 #define FOREACHATTRNODEEX(n,c,ns,i) \
index e636cb09e204db2fbee4f731fb05ae6ca54d6611..4675337ec9a566ca54bfcd5712b70e44fa6da05c 100644 (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.
 <HR>
 <H2>Installation</H2>
-<I>FIXME</I>
+This extension is only available if PHP was configured with --with-soap.
 <HR>
 <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.
index 7e8cf86f0c7fc6dbca7c706ffdc137e51d6dbaf5..55082571b00d200919b516748c5631f83df71b4a 100644 (file)
@@ -356,10 +356,12 @@ PHP_MINIT_FUNCTION(soap)
        /* TODO: add ini entry for always use soap errors */
        ZEND_INIT_MODULE_GLOBALS(soap, php_soap_init_globals, NULL);
 
+#ifndef ZEND_ENGINE_2
        /* Enable php stream/wrapper support for libxml */
        xmlRegisterDefaultInputCallbacks();
        xmlRegisterInputCallbacks(php_stream_xmlIO_match_wrapper, php_stream_xmlIO_open_wrapper,
                        php_stream_xmlIO_read, php_stream_xmlIO_close);
+#endif
 
        /* Register SoapClient class */
        /* 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_row(2, "Soap Client", "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();
 }