mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
- cleanup ze1/ze2
This commit is contained in:
parent
ed58636f00
commit
5a7bd45c1a
5 changed files with 15 additions and 236 deletions
|
@ -1195,9 +1195,7 @@ static void set_zval_property(zval* object, char* name, zval* val TSRMLS_DC)
|
|||
|
||||
old_scope = EG(scope);
|
||||
EG(scope) = Z_OBJCE_P(object);
|
||||
#ifdef ZEND_ENGINE_2
|
||||
Z_DELREF_P(val);
|
||||
#endif
|
||||
add_property_zval(object, name, val);
|
||||
EG(scope) = old_scope;
|
||||
}
|
||||
|
@ -2928,9 +2926,7 @@ static zval *guess_zval_convert(encodeTypePtr type, xmlNodePtr data TSRMLS_DC)
|
|||
MAKE_STD_ZVAL(soapvar);
|
||||
object_init_ex(soapvar, soap_var_class_entry);
|
||||
add_property_long(soapvar, "enc_type", enc->details.type);
|
||||
#ifdef ZEND_ENGINE_2
|
||||
Z_DELREF_P(ret);
|
||||
#endif
|
||||
add_property_zval(soapvar, "enc_value", ret);
|
||||
parse_namespace(type_name, &cptype, &ns);
|
||||
nsptr = xmlSearchNs(data->doc, data, BAD_CAST(ns));
|
||||
|
|
|
@ -239,11 +239,9 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
|
|||
if (faultactor) {
|
||||
efree(faultactor);
|
||||
}
|
||||
#ifdef ZEND_ENGINE_2
|
||||
if (details) {
|
||||
Z_DELREF_P(details);
|
||||
}
|
||||
#endif
|
||||
xmlFreeDoc(response);
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -169,32 +169,6 @@ 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();
|
||||
return php_stream_locate_url_wrapper(filename, NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) ? 1 : 0;
|
||||
}
|
||||
|
||||
void *php_stream_xmlIO_open_wrapper(const char *filename)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
return php_stream_open_wrapper((char*)filename, "rb", REPORT_ERRORS, NULL);
|
||||
}
|
||||
|
||||
int php_stream_xmlIO_read(void *context, char *buffer, int len)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
return php_stream_read((php_stream*)context, buffer, len);
|
||||
}
|
||||
|
||||
int php_stream_xmlIO_close(void *context)
|
||||
{
|
||||
TSRMLS_FETCH();
|
||||
return php_stream_close((php_stream*)context);
|
||||
}
|
||||
#endif
|
||||
|
||||
xmlNsPtr attr_find_ns(xmlAttrPtr node)
|
||||
{
|
||||
if (node->ns) {
|
||||
|
|
|
@ -44,13 +44,6 @@ 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 xmlChar *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) \
|
||||
do { \
|
||||
|
|
212
ext/soap/soap.c
212
ext/soap/soap.c
|
@ -26,9 +26,8 @@
|
|||
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
|
||||
#include "ext/session/php_session.h"
|
||||
#endif
|
||||
#ifdef ZEND_ENGINE_2
|
||||
# include "zend_exceptions.h"
|
||||
#endif
|
||||
#include "zend_exceptions.h"
|
||||
|
||||
|
||||
static int le_sdl = 0;
|
||||
int le_url = 0;
|
||||
|
@ -69,10 +68,6 @@ static void delete_service(void *service);
|
|||
static void delete_url(void *handle);
|
||||
static void delete_hashtable(void *hashtable);
|
||||
|
||||
#ifndef ZEND_ENGINE_2
|
||||
static void soap_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
|
||||
#endif
|
||||
|
||||
static void soap_error_handler(int error_num, const char *error_filename, const uint error_lineno, const char *format, va_list args);
|
||||
|
||||
#define SOAP_SERVER_BEGIN_CODE() \
|
||||
|
@ -90,7 +85,6 @@ static void soap_error_handler(int error_num, const char *error_filename, const
|
|||
SOAP_GLOBAL(error_object) = _old_error_object;\
|
||||
SOAP_GLOBAL(soap_version) = _old_soap_version;
|
||||
|
||||
#ifdef ZEND_ENGINE_2
|
||||
#define SOAP_CLIENT_BEGIN_CODE() \
|
||||
zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\
|
||||
char* _old_error_code = SOAP_GLOBAL(error_code);\
|
||||
|
@ -123,22 +117,6 @@ static void soap_error_handler(int error_num, const char *error_filename, const
|
|||
if (_bailout) {\
|
||||
zend_bailout();\
|
||||
}
|
||||
#else
|
||||
#define SOAP_CLIENT_BEGIN_CODE() \
|
||||
zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\
|
||||
char* _old_error_code = SOAP_GLOBAL(error_code);\
|
||||
zval* _old_error_object = SOAP_GLOBAL(error_object);\
|
||||
int _old_soap_version = SOAP_GLOBAL(soap_version);\
|
||||
SOAP_GLOBAL(use_soap_error_handler) = 1;\
|
||||
SOAP_GLOBAL(error_code) = "Client";\
|
||||
SOAP_GLOBAL(error_object) = this_ptr;
|
||||
|
||||
#define SOAP_CLIENT_END_CODE() \
|
||||
SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\
|
||||
SOAP_GLOBAL(error_code) = _old_error_code;\
|
||||
SOAP_GLOBAL(error_object) = _old_error_object;\
|
||||
SOAP_GLOBAL(soap_version) = _old_soap_version;
|
||||
#endif
|
||||
|
||||
#define FETCH_THIS_SDL(ss) \
|
||||
{ \
|
||||
|
@ -204,27 +182,6 @@ PHP_MINIT_FUNCTION(soap);
|
|||
PHP_MSHUTDOWN_FUNCTION(soap);
|
||||
PHP_MINFO_FUNCTION(soap);
|
||||
|
||||
#ifndef ZEND_ENGINE_2
|
||||
# ifndef PHP_METHOD
|
||||
# define PHP_METHOD(classname, name) ZEND_NAMED_FUNCTION(ZEND_FN(classname##_##name))
|
||||
# define PHP_ME(classname, name, arg_info, flags) ZEND_NAMED_FE(name, ZEND_FN(classname##_##name), arg_info)
|
||||
# endif
|
||||
|
||||
static char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length)
|
||||
{
|
||||
register unsigned char *str = (unsigned char*)source;
|
||||
register unsigned char *result = (unsigned char*)dest;
|
||||
register unsigned char *end = str + length;
|
||||
|
||||
while (str < end) {
|
||||
*result++ = tolower((int)*str++);
|
||||
}
|
||||
*result = *end;
|
||||
|
||||
return dest;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
Registry Functions
|
||||
TODO: this!
|
||||
|
@ -265,9 +222,7 @@ PHP_METHOD(SoapVar, SoapVar);
|
|||
|
||||
/* SoapFault Functions */
|
||||
PHP_METHOD(SoapFault, SoapFault);
|
||||
#ifdef ZEND_ENGINE_2
|
||||
PHP_METHOD(SoapFault, __toString);
|
||||
#endif
|
||||
|
||||
/* SoapParam Functions */
|
||||
PHP_METHOD(SoapParam, SoapParam);
|
||||
|
@ -278,7 +233,6 @@ PHP_METHOD(SoapHeader, SoapHeader);
|
|||
#define SOAP_CTOR(class_name, func_name, arginfo, flags) PHP_ME(class_name, func_name, arginfo, flags)
|
||||
|
||||
/* {{{ arginfo */
|
||||
#ifdef ZEND_ENGINE_2
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_soapparam_soapparam, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, data)
|
||||
ZEND_ARG_INFO(0, name)
|
||||
|
@ -415,43 +369,6 @@ ZEND_END_ARG_INFO()
|
|||
ZEND_BEGIN_ARG_INFO_EX(arginfo_soap_is_soap_fault, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, object)
|
||||
ZEND_END_ARG_INFO()
|
||||
#else
|
||||
unsigned char arginfo_soapclient___call[] = { 2, BYREF_NONE, BYREF_NONE };
|
||||
unsigned char arginfo_soapclient___soapcall[] = { 5, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
|
||||
# define arginfo_soapclient_soapclient NULL
|
||||
# define arginfo_soapclient___getlastrequest NULL
|
||||
# define arginfo_soapclient___getlastresponse NULL
|
||||
# define arginfo_soapclient___getlastrequestheaders NULL
|
||||
# define arginfo_soapclient___getlastresponseheaders NULL
|
||||
# define arginfo_soapclient___getfunctions NULL
|
||||
# define arginfo_soapclient___gettypes NULL
|
||||
# define arginfo_soapclient___dorequest NULL
|
||||
# define arginfo_soapclient___setcookie NULL
|
||||
# define arginfo_soapclient___setlocation NULL
|
||||
# define arginfo_soapclient___setsoapheaders NULL
|
||||
|
||||
# define arginfo_soapserver_soapserver NULL
|
||||
# define arginfo_soapserver_setpersistence NULL
|
||||
# define arginfo_soapserver_setclass NULL
|
||||
# define arginfo_soapserver_setobject NULL
|
||||
# define arginfo_soapserver_addfunction NULL
|
||||
# define arginfo_soapserver_getfunctions NULL
|
||||
# defina arginfo_soapserver_handle NULL
|
||||
# define arginfo_soapserver_fault NULL
|
||||
# define arginfo_soapserver_addsoapheader NULL
|
||||
|
||||
# define arginfo_soapvar_soapvar NULL
|
||||
|
||||
# define arginfo_soapfault_soapfault NULL
|
||||
|
||||
# define arginfo_soapheader_soapheader NULL
|
||||
|
||||
# define arginfo_soapparam_soapparam NULL
|
||||
|
||||
# define arginfo_soap_use_soap_error_handler NULL
|
||||
|
||||
# define arginfo_soap_is_soap_fault NULL
|
||||
#endif
|
||||
/* }}} */
|
||||
|
||||
static const zend_function_entry soap_functions[] = {
|
||||
|
@ -462,9 +379,7 @@ static const zend_function_entry soap_functions[] = {
|
|||
|
||||
static const zend_function_entry soap_fault_functions[] = {
|
||||
SOAP_CTOR(SoapFault, SoapFault, arginfo_soapfault_soapfault, 0)
|
||||
#ifdef ZEND_ENGINE_2
|
||||
PHP_ME(SoapFault, __toString, NULL, 0)
|
||||
#endif
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
|
@ -534,10 +449,6 @@ zend_module_entry soap_module_entry = {
|
|||
ZEND_GET_MODULE(soap)
|
||||
#endif
|
||||
|
||||
#ifndef ZEND_ENGINE_2
|
||||
# define OnUpdateLong OnUpdateInt
|
||||
#endif
|
||||
|
||||
ZEND_INI_MH(OnUpdateCacheEnabled)
|
||||
{
|
||||
if (OnUpdateBool(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
|
||||
|
@ -680,18 +591,10 @@ PHP_MINIT_FUNCTION(soap)
|
|||
ZEND_INIT_MODULE_GLOBALS(soap, php_soap_init_globals, NULL);
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
#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.
|
||||
soap_call_function_handler should be of type struct _zend_function, not (*handle_function_call).
|
||||
*/
|
||||
#ifdef ZEND_ENGINE_2
|
||||
{
|
||||
zend_internal_function fe;
|
||||
|
||||
|
@ -708,11 +611,6 @@ PHP_MINIT_FUNCTION(soap)
|
|||
(zend_function *)&fe, NULL, NULL);
|
||||
soap_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
}
|
||||
#else
|
||||
INIT_OVERLOADED_CLASS_ENTRY(ce, PHP_SOAP_CLIENT_CLASSNAME, soap_client_functions, soap_call_function_handler, NULL, NULL);
|
||||
soap_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
#endif
|
||||
|
||||
/* Register SoapVar class */
|
||||
INIT_CLASS_ENTRY(ce, PHP_SOAP_VAR_CLASSNAME, soap_var_functions);
|
||||
soap_var_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
|
@ -723,11 +621,7 @@ PHP_MINIT_FUNCTION(soap)
|
|||
|
||||
/* Register SoapFault class */
|
||||
INIT_CLASS_ENTRY(ce, PHP_SOAP_FAULT_CLASSNAME, soap_fault_functions);
|
||||
#ifdef ZEND_ENGINE_2
|
||||
soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC);
|
||||
#else
|
||||
soap_fault_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
#endif
|
||||
|
||||
/* Register SoapParam class */
|
||||
INIT_CLASS_ENTRY(ce, PHP_SOAP_PARAM_CLASSNAME, soap_param_functions);
|
||||
|
@ -865,9 +759,6 @@ PHP_METHOD(SoapParam, SoapParam)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifndef ZEND_ENGINE_2
|
||||
zval_add_ref(&data);
|
||||
#endif
|
||||
add_property_stringl(this_ptr, "param_name", name, name_length, 1);
|
||||
add_property_zval(this_ptr, "param_data", data);
|
||||
}
|
||||
|
@ -898,9 +789,6 @@ PHP_METHOD(SoapHeader, SoapHeader)
|
|||
add_property_stringl(this_ptr, "namespace", ns, ns_len, 1);
|
||||
add_property_stringl(this_ptr, "name", name, name_len, 1);
|
||||
if (data) {
|
||||
#ifndef ZEND_ENGINE_2
|
||||
zval_add_ref(&data);
|
||||
#endif
|
||||
add_property_zval(this_ptr, "data", data);
|
||||
}
|
||||
add_property_bool(this_ptr, "mustUnderstand", must_understand);
|
||||
|
@ -972,7 +860,6 @@ PHP_METHOD(SoapFault, SoapFault)
|
|||
/* }}} */
|
||||
|
||||
|
||||
#ifdef ZEND_ENGINE_2
|
||||
/* {{{ proto object SoapFault::SoapFault ( string faultcode, string faultstring [, string faultactor [, mixed detail [, string faultname [, mixed headerfault]]]])
|
||||
SoapFault constructor */
|
||||
PHP_METHOD(SoapFault, __toString)
|
||||
|
@ -1015,7 +902,6 @@ PHP_METHOD(SoapFault, __toString)
|
|||
RETURN_STRINGL(str, len, 0);
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
/* {{{ proto object SoapVar::SoapVar ( mixed data, int encoding [, string type_name [, string type_namespace [, string node_name [, string node_namespace]]]])
|
||||
SoapVar constructor */
|
||||
|
@ -1041,9 +927,6 @@ PHP_METHOD(SoapVar, SoapVar)
|
|||
}
|
||||
|
||||
if (data) {
|
||||
#ifndef ZEND_ENGINE_2
|
||||
zval_add_ref(&data);
|
||||
#endif
|
||||
add_property_zval(this_ptr, "enc_value", data);
|
||||
}
|
||||
|
||||
|
@ -1343,11 +1226,8 @@ PHP_METHOD(SoapServer, setClass)
|
|||
{
|
||||
soapServicePtr service;
|
||||
char *classname;
|
||||
#ifdef ZEND_ENGINE_2
|
||||
zend_class_entry **ce;
|
||||
#else
|
||||
zend_class_entry *ce;
|
||||
#endif
|
||||
|
||||
int classname_len, found, num_args = 0;
|
||||
zval ***argv = NULL;
|
||||
|
||||
|
@ -1359,20 +1239,12 @@ PHP_METHOD(SoapServer, setClass)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef ZEND_ENGINE_2
|
||||
found = zend_lookup_class(classname, classname_len, &ce TSRMLS_CC);
|
||||
#else
|
||||
char *class_name = estrdup(classname);
|
||||
found = zend_hash_find(EG(class_table), php_strtolower(class_name, classname_len), classname_len + 1, (void **)&ce);
|
||||
efree(class_name);
|
||||
#endif
|
||||
|
||||
if (found != FAILURE) {
|
||||
service->type = SOAP_CLASS;
|
||||
#ifdef ZEND_ENGINE_2
|
||||
service->soap_class.ce = *ce;
|
||||
#else
|
||||
service->soap_class.ce = ce;
|
||||
#endif
|
||||
|
||||
service->soap_class.persistance = SOAP_PERSISTENCE_REQUEST;
|
||||
service->soap_class.argc = num_args;
|
||||
if (service->soap_class.argc > 0) {
|
||||
|
@ -1734,8 +1606,7 @@ PHP_METHOD(SoapServer, handle)
|
|||
old_soap_version = SOAP_GLOBAL(soap_version);
|
||||
function = deserialize_function_call(service->sdl, doc_request, service->actor, &function_name, &num_params, ¶ms, &soap_version, &soap_headers TSRMLS_CC);
|
||||
xmlFreeDoc(doc_request);
|
||||
|
||||
#ifdef ZEND_ENGINE_2
|
||||
|
||||
if (EG(exception)) {
|
||||
php_output_discard(TSRMLS_C);
|
||||
if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
|
||||
|
@ -1744,7 +1615,6 @@ PHP_METHOD(SoapServer, handle)
|
|||
}
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
service->soap_headers_ptr = &soap_headers;
|
||||
|
||||
|
@ -1779,7 +1649,6 @@ PHP_METHOD(SoapServer, handle)
|
|||
object_init_ex(tmp_soap, service->soap_class.ce);
|
||||
|
||||
/* Call constructor */
|
||||
#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;
|
||||
|
||||
|
@ -1804,9 +1673,6 @@ PHP_METHOD(SoapServer, handle)
|
|||
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);
|
||||
|
||||
|
@ -1821,7 +1687,7 @@ PHP_METHOD(SoapServer, handle)
|
|||
if (call_user_function(NULL, &tmp_soap, &constructor, &c_ret, service->soap_class.argc, service->soap_class.argv TSRMLS_CC) == FAILURE) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Error calling constructor");
|
||||
}
|
||||
#ifdef ZEND_ENGINE_2
|
||||
|
||||
if (EG(exception)) {
|
||||
php_output_discard(TSRMLS_C);
|
||||
if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
|
||||
|
@ -1834,7 +1700,7 @@ PHP_METHOD(SoapServer, handle)
|
|||
zval_ptr_dtor(&tmp_soap);
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
zval_dtor(&constructor);
|
||||
zval_dtor(&c_ret);
|
||||
}
|
||||
|
@ -1908,7 +1774,6 @@ PHP_METHOD(SoapServer, handle)
|
|||
efree(fn_name);
|
||||
if (service->type == SOAP_CLASS && soap_obj) {zval_ptr_dtor(&soap_obj);}
|
||||
goto fail;
|
||||
#ifdef ZEND_ENGINE_2
|
||||
} else if (EG(exception)) {
|
||||
php_output_discard(TSRMLS_C);
|
||||
if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
|
||||
|
@ -1924,7 +1789,6 @@ PHP_METHOD(SoapServer, handle)
|
|||
efree(fn_name);
|
||||
if (service->type == SOAP_CLASS && soap_obj) {zval_ptr_dtor(&soap_obj);}
|
||||
goto fail;
|
||||
#endif
|
||||
}
|
||||
} else if (h->mustUnderstand) {
|
||||
soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL TSRMLS_CC);
|
||||
|
@ -1958,7 +1822,6 @@ PHP_METHOD(SoapServer, handle)
|
|||
}
|
||||
efree(fn_name);
|
||||
|
||||
#ifdef ZEND_ENGINE_2
|
||||
if (EG(exception)) {
|
||||
php_output_discard(TSRMLS_C);
|
||||
if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
|
||||
|
@ -1976,7 +1839,7 @@ PHP_METHOD(SoapServer, handle)
|
|||
}
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (call_status == SUCCESS) {
|
||||
char *response_name;
|
||||
|
||||
|
@ -2001,7 +1864,6 @@ PHP_METHOD(SoapServer, handle)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef ZEND_ENGINE_2
|
||||
if (EG(exception)) {
|
||||
php_output_discard(TSRMLS_C);
|
||||
if (Z_TYPE_P(EG(exception)) == IS_OBJECT &&
|
||||
|
@ -2019,7 +1881,6 @@ PHP_METHOD(SoapServer, handle)
|
|||
}
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Flush buffer */
|
||||
php_output_discard(TSRMLS_C);
|
||||
|
@ -2239,7 +2100,6 @@ static void soap_error_handler(int error_num, const char *error_filename, const
|
|||
if (SOAP_GLOBAL(error_object) &&
|
||||
Z_TYPE_P(SOAP_GLOBAL(error_object)) == IS_OBJECT &&
|
||||
instanceof_function(Z_OBJCE_P(SOAP_GLOBAL(error_object)), soap_class_entry TSRMLS_CC)) {
|
||||
#ifdef ZEND_ENGINE_2
|
||||
zval **tmp;
|
||||
int use_exceptions = 0;
|
||||
|
||||
|
@ -2312,9 +2172,6 @@ static void soap_error_handler(int error_num, const char *error_filename, const
|
|||
/* Ignore libxml warnings during WSDL parsing */
|
||||
call_old_error_handler(error_num, error_filename, error_lineno, format, args);
|
||||
}
|
||||
#else
|
||||
call_old_error_handler(error_num, error_filename, error_lineno, format, args);
|
||||
#endif
|
||||
} else {
|
||||
int old = PG(display_errors);
|
||||
int fault = 0;
|
||||
|
@ -2537,13 +2394,13 @@ PHP_METHOD(SoapClient, SoapClient)
|
|||
Z_LVAL_PP(tmp) == 1) {
|
||||
add_property_long(this_ptr, "trace", 1);
|
||||
}
|
||||
#ifdef ZEND_ENGINE_2
|
||||
|
||||
if (zend_hash_find(ht, "exceptions", sizeof("exceptions"), (void**)&tmp) == SUCCESS &&
|
||||
(Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) &&
|
||||
Z_LVAL_PP(tmp) == 0) {
|
||||
add_property_bool(this_ptr, "_exceptions", 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (zend_hash_find(ht, "compression", sizeof("compression"), (void**)&tmp) == SUCCESS &&
|
||||
Z_TYPE_PP(tmp) == IS_LONG &&
|
||||
zend_hash_exists(EG(function_table), "gzinflate", sizeof("gzinflate")) &&
|
||||
|
@ -2571,9 +2428,8 @@ PHP_METHOD(SoapClient, SoapClient)
|
|||
|
||||
MAKE_STD_ZVAL(class_map);
|
||||
MAKE_COPY_ZVAL(tmp, class_map);
|
||||
#ifdef ZEND_ENGINE_2
|
||||
Z_DELREF_P(class_map);
|
||||
#endif
|
||||
|
||||
add_property_zval(this_ptr, "_classmap", class_map);
|
||||
}
|
||||
|
||||
|
@ -2891,7 +2747,7 @@ static void do_soap_call(zval* this_ptr,
|
|||
zval_copy_ctor(return_value);
|
||||
}
|
||||
}
|
||||
#ifdef ZEND_ENGINE_2
|
||||
|
||||
if (!EG(exception) &&
|
||||
Z_TYPE_P(return_value) == IS_OBJECT &&
|
||||
instanceof_function(Z_OBJCE_P(return_value), soap_fault_class_entry TSRMLS_CC) &&
|
||||
|
@ -2903,7 +2759,7 @@ static void do_soap_call(zval* this_ptr,
|
|||
MAKE_COPY_ZVAL(&return_value, exception);
|
||||
zend_throw_exception_object(exception TSRMLS_CC);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (SOAP_GLOBAL(encoding) != NULL) {
|
||||
xmlCharEncCloseFunc(SOAP_GLOBAL(encoding));
|
||||
}
|
||||
|
@ -3312,41 +3168,6 @@ PHP_METHOD(SoapClient, __setLocation)
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
#ifndef ZEND_ENGINE_2
|
||||
static void soap_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference)
|
||||
{
|
||||
zval *object = property_reference->object;
|
||||
zend_overloaded_element *function_name = (zend_overloaded_element *)property_reference->elements_list->tail->data;
|
||||
char *function = Z_STRVAL(function_name->element);
|
||||
zend_function *builtin_function;
|
||||
|
||||
/*
|
||||
Find if the function being called is already defined...
|
||||
( IMHO: zend should handle this functionality )
|
||||
*/
|
||||
if (zend_hash_find(&Z_OBJCE_P(this_ptr)->function_table, function, Z_STRLEN(function_name->element) + 1, (void **) &builtin_function) == SUCCESS) {
|
||||
builtin_function->internal_function.handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
|
||||
} else {
|
||||
int arg_count = ZEND_NUM_ARGS();
|
||||
zval **arguments = (zval **) safe_emalloc(sizeof(zval *), arg_count, 0);
|
||||
zval **soap_headers_p
|
||||
HashTable *soap_headers;
|
||||
|
||||
zend_get_parameters_array(ht, arg_count, arguments);
|
||||
|
||||
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_properties"), (void **) soap_headers_p)==SUCCESS
|
||||
&& Z_TYPE_P(soap_headers_p)==IS_ARRAY) {
|
||||
soap_headers = Z_ARRVAL_P(soap_headers_p);
|
||||
} else {
|
||||
soap_headers = NULL;
|
||||
}
|
||||
do_soap_call(this_ptr, function, Z_STRLEN(function_name->element) + 1, arg_count, arguments, return_value, NULL, NULL, NULL, soap_headers, NULL TSRMLS_CC);
|
||||
efree(arguments);
|
||||
}
|
||||
zval_dtor(&function_name->element);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void clear_soap_fault(zval *obj TSRMLS_DC)
|
||||
{
|
||||
if (obj != NULL && obj->type == IS_OBJECT) {
|
||||
|
@ -3359,9 +3180,8 @@ zval* add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *faul
|
|||
zval *fault;
|
||||
ALLOC_INIT_ZVAL(fault);
|
||||
set_soap_fault(fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL TSRMLS_CC);
|
||||
#ifdef ZEND_ENGINE_2
|
||||
Z_DELREF_P(fault);
|
||||
#endif
|
||||
|
||||
add_property_zval(obj, "__soap_fault", fault);
|
||||
return fault;
|
||||
}
|
||||
|
@ -3373,9 +3193,7 @@ static void set_soap_fault(zval *obj, char *fault_code_ns, char *fault_code, cha
|
|||
}
|
||||
|
||||
add_property_string(obj, "faultstring", fault_string ? fault_string : "", 1);
|
||||
#ifdef ZEND_ENGINE_2
|
||||
zend_update_property_string(zend_exception_get_default(TSRMLS_C), obj, "message", sizeof("message")-1, (fault_string ? fault_string : "") TSRMLS_CC);
|
||||
#endif
|
||||
|
||||
if (fault_code != NULL) {
|
||||
int soap_version = SOAP_GLOBAL(soap_version);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue