dmitry Thu Apr 1 05:47:45 2004 EDT
Modified files:
/php-src/ext/soap php_encoding.c php_http.c php_packet_soap.c
php_sdl.c php_soap.dsp soap.c
Log:
Some small improvments, support for new style constructors, support for exceptions
other then SoapFault
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.66&r2=1.67&ty=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.66 php-src/ext/soap/php_encoding.c:1.67
--- php-src/ext/soap/php_encoding.c:1.66 Wed Mar 17 21:16:35 2004
+++ php-src/ext/soap/php_encoding.c Thu Apr 1 05:47:43 2004
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_encoding.c,v 1.66 2004/03/18 02:16:35 iliaa Exp $ */
+/* $Id: php_encoding.c,v 1.67 2004/04/01 10:47:43 dmitry Exp $ */
#include <time.h>
@@ -1561,8 +1561,10 @@
dims[0] = i;
el = &data;
for (i = 1; i < dimension; i++) {
- if (el != NULL && Z_TYPE_PP(el) == IS_ARRAY &&
Z_ARRVAL_PP(el)->pListHead) {
- el = (zval**)Z_ARRVAL_PP(el)->pListHead->pData;
+ if (el != NULL && Z_TYPE_PP(el) == IS_ARRAY &&
+ zend_hash_num_elements(Z_ARRVAL_PP(el)) > 0) {
+ zend_hash_internal_pointer_reset(Z_ARRVAL_PP(el));
+ zend_hash_get_current_data(Z_ARRVAL_PP(el),
(void**)&el);
if (Z_TYPE_PP(el) == IS_ARRAY) {
dims[i] =
zend_hash_num_elements(Z_ARRVAL_PP(el));
} else {
@@ -1627,7 +1629,9 @@
if (sdl_type && sdl_type->elements &&
zend_hash_num_elements(sdl_type->elements) == 1 &&
- (elementType =
*(sdlTypePtr*)sdl_type->elements->pListHead->pData) != NULL &&
+ (zend_hash_internal_pointer_reset(sdl_type->elements),
+ zend_hash_get_current_data(sdl_type->elements,
(void**)&elementType) == SUCCESS) &&
+ (elementType = *(sdlTypePtr*)elementType) !=
NULL &&
elementType->encode &&
elementType->encode->details.type_str) {
element_type = elementType;
enc = elementType->encode;
@@ -1638,7 +1642,9 @@
}
} else if (sdl_type && sdl_type->elements &&
zend_hash_num_elements(sdl_type->elements) == 1 &&
- (elementType =
*(sdlTypePtr*)sdl_type->elements->pListHead->pData) != NULL &&
+ (zend_hash_internal_pointer_reset(sdl_type->elements),
+ zend_hash_get_current_data(sdl_type->elements,
(void**)&elementType) == SUCCESS) &&
+ (elementType = *(sdlTypePtr*)elementType) != NULL &&
elementType->encode &&
elementType->encode->details.type_str) {
element_type = elementType;
@@ -1817,13 +1823,17 @@
dims = get_position_12(dimension, (*ext)->val);
if (type->sdl_type && type->sdl_type->elements &&
zend_hash_num_elements(type->sdl_type->elements) == 1 &&
- (elementType =
*(sdlTypePtr*)type->sdl_type->elements->pListHead->pData) != NULL &&
+ (zend_hash_internal_pointer_reset(type->sdl_type->elements),
+ zend_hash_get_current_data(type->sdl_type->elements,
(void**)&elementType) == SUCCESS) &&
+ (elementType = *(sdlTypePtr*)elementType) != NULL &&
elementType->encode) {
enc = elementType->encode;
}
} else if (type->sdl_type && type->sdl_type->elements &&
zend_hash_num_elements(type->sdl_type->elements) == 1 &&
- (elementType =
*(sdlTypePtr*)type->sdl_type->elements->pListHead->pData) != NULL &&
+ (zend_hash_internal_pointer_reset(type->sdl_type->elements),
+ zend_hash_get_current_data(type->sdl_type->elements,
(void**)&elementType) == SUCCESS) &&
+ (elementType = *(sdlTypePtr*)elementType) != NULL &&
elementType->encode) {
enc = elementType->encode;
}
http://cvs.php.net/diff.php/php-src/ext/soap/php_http.c?r1=1.46&r2=1.47&ty=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.46 php-src/ext/soap/php_http.c:1.47
--- php-src/ext/soap/php_http.c:1.46 Wed Feb 25 09:04:41 2004
+++ php-src/ext/soap/php_http.c Thu Apr 1 05:47:43 2004
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_http.c,v 1.46 2004/02/25 14:04:41 dmitry Exp $ */
+/* $Id: php_http.c,v 1.47 2004/04/01 10:47:43 dmitry Exp $ */
#include "php_soap.h"
#include "ext/standard/base64.h"
@@ -573,7 +573,7 @@
cmplen = strlen(content_type);
}
if (strncmp(content_type, "text/xml", cmplen) == 0 ||
- strncmp(content_type, "application/soap+xml", cmplen == 0)) {
+ strncmp(content_type, "application/soap+xml", cmplen) == 0) {
/*
if (strncmp(http_body, "<?xml", 5)) {
zval *err;
http://cvs.php.net/diff.php/php-src/ext/soap/php_packet_soap.c?r1=1.33&r2=1.34&ty=u
Index: php-src/ext/soap/php_packet_soap.c
diff -u php-src/ext/soap/php_packet_soap.c:1.33 php-src/ext/soap/php_packet_soap.c:1.34
--- php-src/ext/soap/php_packet_soap.c:1.33 Tue Feb 10 08:41:21 2004
+++ php-src/ext/soap/php_packet_soap.c Thu Apr 1 05:47:43 2004
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_packet_soap.c,v 1.33 2004/02/10 13:41:21 dmitry Exp $ */
+/* $Id: php_packet_soap.c,v 1.34 2004/04/01 10:47:43 dmitry Exp $ */
#include "php_soap.h"
@@ -332,11 +332,14 @@
zval_dtor(return_value);
ZVAL_NULL(return_value);
} else if (param_count == 1) {
- zval *tmp =
*(zval**)Z_ARRVAL_P(return_value)->pListHead->pData;
- tmp->refcount++;
+ zval **tmp;
+
+ zend_hash_internal_pointer_reset(Z_ARRVAL_P(return_value));
+ zend_hash_get_current_data(Z_ARRVAL_P(return_value),
(void**)&tmp);
+ (*tmp)->refcount++;
zval_dtor(return_value);
- *return_value = *tmp;
- FREE_ZVAL(tmp);
+ *return_value = **tmp;
+ FREE_ZVAL(*tmp);
}
}
http://cvs.php.net/diff.php/php-src/ext/soap/php_sdl.c?r1=1.66&r2=1.67&ty=u
Index: php-src/ext/soap/php_sdl.c
diff -u php-src/ext/soap/php_sdl.c:1.66 php-src/ext/soap/php_sdl.c:1.67
--- php-src/ext/soap/php_sdl.c:1.66 Tue Feb 24 10:06:41 2004
+++ php-src/ext/soap/php_sdl.c Thu Apr 1 05:47:43 2004
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_sdl.c,v 1.66 2004/02/24 15:06:41 dmitry Exp $ */
+/* $Id: php_sdl.c,v 1.67 2004/04/01 10:47:43 dmitry Exp $ */
#include "php_soap.h"
#include "libxml/uri.h"
@@ -1178,7 +1178,7 @@
WSDL_CACHE_GET_INT(i, in);
if (i > 0) {
- elements = do_alloca((i+1) * sizeof(sdlTypePtr));
+ elements = emalloc((i+1) * sizeof(sdlTypePtr));
elements[0] = NULL;
type->elements = emalloc(sizeof(HashTable));
zend_hash_init(type->elements, i, NULL, delete_type, 0);
@@ -1212,7 +1212,7 @@
WSDL_CACHE_SKIP(1, in);
}
if (elements != NULL) {
- free_alloca(elements);
+ efree(elements);
}
}
@@ -1335,17 +1335,17 @@
close(f);
return NULL;
}
- buf = in = do_alloca(st.st_size);
+ buf = in = emalloc(st.st_size);
if (read(f, in, st.st_size) != st.st_size) {
close(f);
- free_alloca(in);
+ efree(in);
return NULL;
}
close(f);
if (strncmp(in,"wsdl",4) != 0 || in[4] != WSDL_CACHE_VERSION || in[5] != '\0')
{
unlink(fn);
- free_alloca(buf);
+ efree(buf);
return NULL;
}
in += 6;
@@ -1353,14 +1353,14 @@
WSDL_CACHE_GET(old_t, time_t, &in);
if (old_t < t) {
unlink(fn);
- free_alloca(buf);
+ efree(buf);
return NULL;
}
WSDL_CACHE_GET_INT(i, &in);
if (i == 0 && strncmp(in, uri, i) != 0) {
unlink(fn);
- free_alloca(buf);
+ efree(buf);
return NULL;
}
WSDL_CACHE_SKIP(i, &in);
@@ -1377,7 +1377,7 @@
WSDL_CACHE_GET_INT(num_encoders, &in);
i = num_groups+num_types+num_elements;
- types = do_alloca((i+1)*sizeof(sdlTypePtr));
+ types = emalloc((i+1)*sizeof(sdlTypePtr));
types[0] = NULL;
while (i > 0) {
types[i] = emalloc(sizeof(sdlType));
@@ -1390,7 +1390,7 @@
while (enc->details.type != END_KNOWN_TYPES) {
i++; enc++;
}
- encoders = do_alloca((i+1)*sizeof(encodePtr));
+ encoders = emalloc((i+1)*sizeof(encodePtr));
i = num_encoders;
encoders[0] = NULL;
while (i > 0) {
@@ -1448,7 +1448,7 @@
/* deserialize bindings */
WSDL_CACHE_GET_INT(num_bindings, &in);
- bindings = do_alloca(num_bindings*sizeof(sdlBindingPtr));
+ bindings = emalloc(num_bindings*sizeof(sdlBindingPtr));
if (num_bindings > 0) {
sdl->bindings = emalloc(sizeof(HashTable));
zend_hash_init(sdl->bindings, num_bindings, NULL, delete_binding, 0);
@@ -1475,7 +1475,7 @@
/* deserialize functions */
WSDL_CACHE_GET_INT(num_func, &in);
zend_hash_init(&sdl->functions, num_func, NULL, delete_function, 0);
- functions = do_alloca(num_func*sizeof(sdlFunctionPtr));
+ functions = emalloc(num_func*sizeof(sdlFunctionPtr));
for (i = 0; i < num_func; i++) {
int binding_num, num_faults;
sdlFunctionPtr func = emalloc(sizeof(sdlFunction));
@@ -1555,11 +1555,11 @@
}
}
- free_alloca(functions);
- free_alloca(bindings);
- free_alloca(encoders);
- free_alloca(types);
- free_alloca(buf);
+ efree(functions);
+ efree(bindings);
+ efree(encoders);
+ efree(types);
+ efree(buf);
return sdl;
}
http://cvs.php.net/diff.php/php-src/ext/soap/php_soap.dsp?r1=1.2&r2=1.3&ty=u
Index: php-src/ext/soap/php_soap.dsp
diff -u php-src/ext/soap/php_soap.dsp:1.2 php-src/ext/soap/php_soap.dsp:1.3
--- php-src/ext/soap/php_soap.dsp:1.2 Tue Aug 6 23:03:09 2002
+++ php-src/ext/soap/php_soap.dsp Thu Apr 1 05:47:44 2004
@@ -4,7 +4,7 @@
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-CFG=php_soap - Win32 Debug
+CFG=php_soap - Win32 Debug_TS
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
@@ -13,12 +13,12 @@
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
-!MESSAGE NMAKE /f "php_soap.mak" CFG="php_soap - Win32 Debug"
+!MESSAGE NMAKE /f "php_soap.mak" CFG="php_soap - Win32 Debug_TS"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
-!MESSAGE "php_soap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php_soap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "php_soap - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "php_soap - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
@@ -29,17 +29,17 @@
MTL=midl.exe
RSC=rc.exe
-!IF "$(CFG)" == "php_soap - Win32 Release"
+!IF "$(CFG)" == "php_soap - Win32 Release_TS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Output_Dir "Release_TS"
+# PROP BASE Intermediate_Dir "Release_TS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
+# PROP Output_Dir "Release_TS"
+# PROP Intermediate_Dir "Release_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D
"_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /YX /FD /c
@@ -53,23 +53,23 @@
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
/nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib
libxml2.lib wsock32.lib resolv.lib /nologo /dll /machine:I386
/out:"..\..\Release_TS\php_soap.dll" /libpath:"..\..\\"
/libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Release_TS"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts.lib
libxml2.lib wsock32.lib resolv.lib /nologo /dll /machine:I386
/out:"..\..\Release_TS\php_soap.dll" /libpath:"..\..\\"
/libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Release_TS"
-!ELSEIF "$(CFG)" == "php_soap - Win32 Debug"
+!ELSEIF "$(CFG)" == "php_soap - Win32 Debug_TS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Output_Dir "Debug_TS"
+# PROP BASE Intermediate_Dir "Debug_TS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
+# PROP Output_Dir "Debug_TS"
+# PROP Intermediate_Dir "Debug_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS"
/D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM"
/I "..\..\main" /I "..\..\..\libxml2-2.4.12\include" /I "..\..\bind" /D "WS" /D
"_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "ZTS" /D
ZEND_DEBUG=1 /D "COMPILE_DL_SOAP" /FR"Release_TS/" /Fp"Release_TS/gd.pch" /YX
/Fo"Release_TS/" /Fd"Release_TS/" /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM"
/I "..\..\main" /I "..\..\..\libxml2-2.4.12\include" /I "..\..\bind" /D "WS" /D
"_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32"
/D "ZTS" /D ZEND_DEBUG=1 /D "COMPILE_DL_SOAP" /FR"Debug_TS/" /Fp"Debug_TS/soap.pch"
/YX /Fo"Debug_TS/" /Fd"Debug_TS/" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
@@ -79,15 +79,15 @@
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
/nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib
libxml2.lib wsock32.lib resolv.lib /nologo /dll /debug /machine:I386
/out:"..\..\Debug_TS\php_soap.dll" /implib:"Release_TS/php_gd.lib" /pdbtype:sept
/libpath:"..\..\\" /libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Debug_TS"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib
libxml2.lib wsock32.lib resolv.lib /nologo /dll /debug /machine:I386
/out:"..\..\Debug_TS\php_soap.dll" /pdbtype:sept /libpath:"..\..\\"
/libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Debug_TS"
# SUBTRACT LINK32 /pdb:none /incremental:no
!ENDIF
# Begin Target
-# Name "php_soap - Win32 Release"
-# Name "php_soap - Win32 Debug"
+# Name "php_soap - Win32 Release_TS"
+# Name "php_soap - Win32 Debug_TS"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.97&r2=1.98&ty=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.97 php-src/ext/soap/soap.c:1.98
--- php-src/ext/soap/soap.c:1.97 Tue Mar 30 04:08:23 2004
+++ php-src/ext/soap/soap.c Thu Apr 1 05:47:44 2004
@@ -17,7 +17,7 @@
| Dmitry Stogov <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: soap.c,v 1.97 2004/03/30 09:08:23 dmitry Exp $ */
+/* $Id: soap.c,v 1.98 2004/04/01 10:47:44 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -609,7 +609,6 @@
}
if (zend_hash_index_find(Z_OBJPROP_P(dom), 1, (void **)&addr) == FAILURE) {
- OAP_HEADER_CLASS
}
node = (xmlNodePtr)Z_LVAL_PP(addr);
@@ -1200,8 +1199,7 @@
zval **req_method, **query_string;
if (zend_hash_find(Z_ARRVAL_PP(server_vars), "REQUEST_METHOD",
sizeof("REQUEST_METHOD"), (void **)&req_method) == SUCCESS) {
if (!strcmp(Z_STRVAL_PP(req_method), "GET") &&
zend_hash_find(Z_ARRVAL_PP(server_vars), "QUERY_STRING", sizeof("QUERY_STRING"), (void
**)&query_string) == SUCCESS) {
- if (strstr(Z_STRVAL_PP(query_string), "wsdl") != NULL
||
- strstr(Z_STRVAL_PP(query_string), "WSDL") != NULL) {
+ if (stricmp(Z_STRVAL_PP(query_string), "wsdl") == 0) {
if (service->sdl) {
/*
char *hdr = emalloc(sizeof("Location:
")+strlen(service->sdl->source));
@@ -1345,7 +1343,9 @@
}
/* Find the soap object and assign */
- if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)),
"_bogus_session_name", sizeof("_bogus_session_name"), (void **) &tmp_soap) == SUCCESS)
{
+ if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)),
"_bogus_session_name", sizeof("_bogus_session_name"), (void **) &tmp_soap) == SUCCESS
&&
+ Z_TYPE_PP(tmp_soap) == IS_OBJECT &&
+ Z_OBJCE_PP(tmp_soap) == service->soap_class.ce) {
soap_obj = *tmp_soap;
}
}
@@ -1353,37 +1353,65 @@
/* If new session or something wierd happned */
if (soap_obj == NULL) {
zval *tmp_soap;
- char *class_name;
- int class_name_len;
MAKE_STD_ZVAL(tmp_soap);
object_init_ex(tmp_soap, service->soap_class.ce);
/* Call constructor */
- class_name_len = strlen(service->soap_class.ce->name);
- class_name = emalloc(class_name_len+1);
- memcpy(class_name,
service->soap_class.ce->name,class_name_len+1);
- if (zend_hash_exists(&Z_OBJCE_P(tmp_soap)->function_table,
php_strtolower(class_name, class_name_len), class_name_len+1)) {
+#ifdef ZEND_ENGINE_2
+ if (zend_hash_exists(&Z_OBJCE_P(tmp_soap)->function_table,
ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
zval c_ret, constructor;
INIT_ZVAL(c_ret);
INIT_ZVAL(constructor);
- ZVAL_STRING(&constructor,
service->soap_class.ce->name, 1);
+ ZVAL_STRING(&constructor, ZEND_CONSTRUCTOR_FUNC_NAME,
1);
if (call_user_function(NULL, &tmp_soap, &constructor,
&c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) {
php_error(E_ERROR, "Error calling
constructor");
}
-#ifdef ZEND_ENGINE_2
- if (EG(exception) &&
- Z_TYPE_P(EG(exception)) == IS_OBJECT &&
- Z_OBJCE_P(EG(exception)) ==
soap_fault_class_entry) {
- soap_server_fault_ex(function, EG(exception),
NULL TSRMLS_CC);
+ if (EG(exception)) {
+ if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
+ Z_OBJCE_P(EG(exception)) ==
soap_fault_class_entry) {
+ soap_server_fault_ex(function,
EG(exception), NULL TSRMLS_CC);
+ } else {
+ zend_exception_error(EG(exception)
TSRMLS_CC);
+ }
}
-#endif
zval_dtor(&constructor);
zval_dtor(&c_ret);
+ } else {
+#else
+ {
+#endif
+ int class_name_len =
strlen(service->soap_class.ce->name);
+ char *class_name = emalloc(class_name_len+1);
+
+ memcpy(class_name,
service->soap_class.ce->name,class_name_len+1);
+ if
(zend_hash_exists(&Z_OBJCE_P(tmp_soap)->function_table, php_strtolower(class_name,
class_name_len), class_name_len+1)) {
+ zval c_ret, constructor;
+
+ INIT_ZVAL(c_ret);
+ INIT_ZVAL(constructor);
+
+ ZVAL_STRING(&constructor,
service->soap_class.ce->name, 1);
+ if (call_user_function(NULL, &tmp_soap,
&constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) ==
FAILURE) {
+ php_error(E_ERROR, "Error calling
constructor");
+ }
+#ifdef ZEND_ENGINE_2
+ if (EG(exception)) {
+ if (Z_TYPE_P(EG(exception)) ==
IS_OBJECT &&
+ Z_OBJCE_P(EG(exception)) ==
soap_fault_class_entry) {
+ soap_server_fault_ex(function,
EG(exception), NULL TSRMLS_CC);
+ } else {
+
zend_exception_error(EG(exception) TSRMLS_CC);
+ }
+ }
+#endif
+ zval_dtor(&constructor);
+ zval_dtor(&c_ret);
+ }
+ efree(class_name);
}
- efree(class_name);
#if HAVE_PHP_SESSION
/* If session then update session hash with new object */
if (service->soap_class.persistance ==
SOAP_PERSISTENCE_SESSION) {
@@ -1446,16 +1474,19 @@
}
soap_server_fault_ex(function, &h->retval, h
TSRMLS_CC);
#ifdef ZEND_ENGINE_2
- } else if (EG(exception) &&
- Z_TYPE_P(EG(exception)) == IS_OBJECT &&
- Z_OBJCE_P(EG(exception)) ==
soap_fault_class_entry) {
- zval *headerfault = NULL, **tmp;
-
- if (zend_hash_find(Z_OBJPROP_P(EG(exception)),
"headerfault", sizeof("headerfault"), (void**)&tmp) == SUCCESS &&
- Z_TYPE_PP(tmp) != IS_NULL) {
- headerfault = *tmp;
- }
- soap_server_fault_ex(function, EG(exception),
h TSRMLS_CC);
+ } else if (EG(exception)) {
+ if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
+ Z_OBJCE_P(EG(exception)) ==
soap_fault_class_entry) {
+ zval *headerfault = NULL, **tmp;
+
+ if
(zend_hash_find(Z_OBJPROP_P(EG(exception)), "headerfault", sizeof("headerfault"),
(void**)&tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) != IS_NULL) {
+ headerfault = *tmp;
+ }
+ soap_server_fault_ex(function,
EG(exception), h TSRMLS_CC);
+ } else {
+ zend_exception_error(EG(exception) TSRMLS_CC);
+ }
#endif
}
} else if (h->mustUnderstand) {
@@ -1469,9 +1500,11 @@
if (zend_hash_exists(function_table, php_strtolower(fn_name,
Z_STRLEN(function_name)), Z_STRLEN(function_name) + 1)) {
if (service->type == SOAP_CLASS) {
call_status = call_user_function(NULL, &soap_obj,
&function_name, &retval, num_params, params TSRMLS_CC);
+#if HAVE_PHP_SESSION
if (service->soap_class.persistance !=
SOAP_PERSISTENCE_SESSION) {
zval_ptr_dtor(&soap_obj);
}
+#endif
} else {
call_status = call_user_function(EG(function_table), NULL,
&function_name, &retval, num_params, params TSRMLS_CC);
}
@@ -1481,10 +1514,13 @@
efree(fn_name);
#ifdef ZEND_ENGINE_2
- if (EG(exception) &&
- Z_TYPE_P(EG(exception)) == IS_OBJECT &&
- Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) {
- soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC);
+ if (EG(exception)) {
+ if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
+ Z_OBJCE_P(EG(exception)) == soap_fault_class_entry) {
+ soap_server_fault_ex(function, EG(exception), NULL TSRMLS_CC);
+ } else {
+ zend_exception_error(EG(exception) TSRMLS_CC);
+ }
}
#endif
if (call_status == SUCCESS) {
@@ -2836,7 +2872,9 @@
} else if (function && function->faults &&
zend_hash_num_elements(function->faults) == 1) {
- fault = *(sdlFaultPtr*)function->faults->pListHead->pData;
+ zend_hash_internal_pointer_reset(function->faults);
+ zend_hash_get_current_data(function->faults, (void**)&fault);
+ fault = *(sdlFaultPtr*)fault;
if (function->binding &&
function->binding->bindingType == BINDING_SOAP &&
fault->bindingAttributes) {
@@ -2903,7 +2941,9 @@
node = xmlNewNode(NULL, detail_name);
xmlAddChild(param, node);
- sparam = *(sdlParamPtr*)fault->details->pListHead->pData;
+ zend_hash_internal_pointer_reset(fault->details);
+ zend_hash_get_current_data(fault->details, (void**)&sparam);
+ sparam = *(sdlParamPtr*)sparam;
x = serialize_parameter(sparam, detail, 1, NULL, use, node
TSRMLS_CC);
if (function &&
@@ -3410,7 +3450,8 @@
if (function->responseParameters &&
zend_hash_num_elements(function->responseParameters) > 0) {
if (zend_hash_num_elements(function->responseParameters) == 1) {
- param = function->responseParameters->pListHead->pData;
+ zend_hash_internal_pointer_reset(function->responseParameters);
+ zend_hash_get_current_data(function->responseParameters,
(void**)¶m);
if ((*param)->encode && (*param)->encode->details.type_str) {
smart_str_appendl(buf,
(*param)->encode->details.type_str, strlen((*param)->encode->details.type_str));
smart_str_appendc(buf, ' ');
@@ -3553,7 +3594,9 @@
smart_str_appendc(buf, ' ');
} else if (type->elements &&
zend_hash_num_elements(type->elements) == 1 &&
- (elementType =
*(sdlTypePtr*)type->elements->pListHead->pData) != NULL &&
+
(zend_hash_internal_pointer_reset(type->elements),
+
zend_hash_get_current_data(type->elements, (void**)&elementType) == SUCCESS) &&
+ (elementType =
*(sdlTypePtr*)elementType) != NULL &&
elementType->encode &&
elementType->encode->details.type_str) {
smart_str_appends(buf,
elementType->encode->details.type_str);
smart_str_appendc(buf, ' ');
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php