diff options
Diffstat (limited to 'ext/soap/soap.c')
-rw-r--r-- | ext/soap/soap.c | 65 |
1 files changed, 23 insertions, 42 deletions
diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 57a08eb3d2..b1423bc60a 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -71,7 +71,7 @@ static void delete_hashtable(void *hashtable); static void soap_error_handler(int error_num, const char *error_filename, const uint32_t error_lineno, zend_string *message); #define SOAP_SERVER_BEGIN_CODE() \ - zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\ + bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\ char* _old_error_code = SOAP_GLOBAL(error_code);\ zend_object* _old_error_object = Z_OBJ(SOAP_GLOBAL(error_object));\ int _old_soap_version = SOAP_GLOBAL(soap_version);\ @@ -86,11 +86,11 @@ static void soap_error_handler(int error_num, const char *error_filename, const SOAP_GLOBAL(soap_version) = _old_soap_version; #define SOAP_CLIENT_BEGIN_CODE() \ - zend_bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\ + bool _old_handler = SOAP_GLOBAL(use_soap_error_handler);\ char* _old_error_code = SOAP_GLOBAL(error_code);\ zend_object* _old_error_object = Z_OBJ(SOAP_GLOBAL(error_object));\ int _old_soap_version = SOAP_GLOBAL(soap_version);\ - zend_bool _old_in_compilation = CG(in_compilation); \ + bool _old_in_compilation = CG(in_compilation); \ zend_execute_data *_old_current_execute_data = EG(current_execute_data); \ zval *_old_stack_top = EG(vm_stack_top); \ int _bailout = 0;\ @@ -166,13 +166,6 @@ ZEND_DECLARE_MODULE_GLOBALS(soap) static void (*old_error_handler)(int, const char *, const uint32_t, zend_string *); -#define PHP_SOAP_SERVER_CLASSNAME "SoapServer" -#define PHP_SOAP_CLIENT_CLASSNAME "SoapClient" -#define PHP_SOAP_VAR_CLASSNAME "SoapVar" -#define PHP_SOAP_FAULT_CLASSNAME "SoapFault" -#define PHP_SOAP_PARAM_CLASSNAME "SoapParam" -#define PHP_SOAP_HEADER_CLASSNAME "SoapHeader" - PHP_RINIT_FUNCTION(soap); PHP_MINIT_FUNCTION(soap); PHP_MSHUTDOWN_FUNCTION(soap); @@ -361,39 +354,27 @@ static void delete_hashtable_res(zend_resource *res) PHP_MINIT_FUNCTION(soap) { - zend_class_entry ce; - /* TODO: add ini entry for always use soap errors */ php_soap_prepare_globals(); ZEND_INIT_MODULE_GLOBALS(soap, php_soap_init_globals, NULL); REGISTER_INI_ENTRIES(); /* Register SoapClient class */ - /* BIG NOTE : THIS EMITS AN COMPILATION WARNING UNDER ZE2 - handle_function_call deprecated. - soap_call_function_handler should be of type zend_function, not (*handle_function_call). - */ - { - INIT_CLASS_ENTRY(ce, PHP_SOAP_CLIENT_CLASSNAME, class_SoapClient_methods); - soap_class_entry = zend_register_internal_class(&ce); - } + soap_class_entry = register_class_SoapClient(); + /* Register SoapVar class */ - INIT_CLASS_ENTRY(ce, PHP_SOAP_VAR_CLASSNAME, class_SoapVar_methods); - soap_var_class_entry = zend_register_internal_class(&ce); + soap_var_class_entry = register_class_SoapVar(); /* Register SoapServer class */ - INIT_CLASS_ENTRY(ce, PHP_SOAP_SERVER_CLASSNAME, class_SoapServer_methods); - soap_server_class_entry = zend_register_internal_class(&ce); + soap_server_class_entry = register_class_SoapServer(); /* Register SoapFault class */ - INIT_CLASS_ENTRY(ce, PHP_SOAP_FAULT_CLASSNAME, class_SoapFault_methods); - soap_fault_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception); + soap_fault_class_entry = register_class_SoapFault(zend_ce_exception); /* Register SoapParam class */ - INIT_CLASS_ENTRY(ce, PHP_SOAP_PARAM_CLASSNAME, class_SoapParam_methods); - soap_param_class_entry = zend_register_internal_class(&ce); + soap_param_class_entry = register_class_SoapParam(); - INIT_CLASS_ENTRY(ce, PHP_SOAP_HEADER_CLASSNAME, class_SoapHeader_methods); - soap_header_class_entry = zend_register_internal_class(&ce); + soap_header_class_entry = register_class_SoapHeader(); le_sdl = zend_register_list_destructors_ex(delete_sdl_res, NULL, "SOAP SDL", module_number); le_url = zend_register_list_destructors_ex(delete_url_res, NULL, "SOAP URL", module_number); @@ -544,10 +525,10 @@ PHP_METHOD(SoapHeader, __construct) zval *data = NULL; zend_string *actor_str = NULL; zend_long actor_long; - zend_bool actor_is_null = 1; + bool actor_is_null = 1; char *name, *ns; size_t name_len, ns_len; - zend_bool must_understand = 0; + bool must_understand = 0; zval *this_ptr; ZEND_PARSE_PARAMETERS_START(2, 5) @@ -689,7 +670,7 @@ PHP_METHOD(SoapVar, __construct) { zval *data, *this_ptr; zend_long type; - zend_bool type_is_null = 1; + bool type_is_null = 1; char *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL; size_t stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0; @@ -1294,9 +1275,9 @@ PHP_METHOD(SoapServer, handle) (encoding = zend_hash_str_find(Z_ARRVAL_P(server_vars), "HTTP_CONTENT_ENCODING", sizeof("HTTP_CONTENT_ENCODING")-1)) != NULL && Z_TYPE_P(encoding) == IS_STRING) { - if (strcmp(Z_STRVAL_P(encoding),"gzip") == 0 - || strcmp(Z_STRVAL_P(encoding),"x-gzip") == 0 - || strcmp(Z_STRVAL_P(encoding),"deflate") == 0 + if (zend_string_equals_literal(Z_STR_P(encoding), "gzip") + || zend_string_equals_literal(Z_STR_P(encoding), "x-gzip") + || zend_string_equals_literal(Z_STR_P(encoding), "deflate") ) { zval filter_params; @@ -1823,7 +1804,7 @@ static ZEND_NORETURN void soap_server_fault(char* code, char* string, char *acto static zend_never_inline ZEND_COLD void soap_real_error_handler(int error_num, const char *error_filename, const uint32_t error_lineno, zend_string *message) /* {{{ */ { - zend_bool _old_in_compilation; + bool _old_in_compilation; zend_execute_data *_old_current_execute_data; int _old_http_response_code; char *_old_http_status_line; @@ -1935,7 +1916,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const /* {{{ */ PHP_FUNCTION(use_soap_error_handler) { - zend_bool handler = 1; + bool handler = 1; ZVAL_BOOL(return_value, SOAP_GLOBAL(use_soap_error_handler)); if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &handler) == SUCCESS) { @@ -2188,7 +2169,7 @@ PHP_METHOD(SoapClient, __construct) } /* }}} */ -static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, zend_bool one_way, zval *response) /* {{{ */ +static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, bool one_way, zval *response) /* {{{ */ { int ret = TRUE; char *buf; @@ -2357,7 +2338,7 @@ static void do_soap_call(zend_execute_data *execute_data, fn = get_function(sdl, function); if (fn != NULL) { sdlBindingPtr binding = fn->binding; - zend_bool one_way = 0; + bool one_way = 0; if (fn->responseName == NULL && fn->responseParameters == NULL && @@ -2498,7 +2479,7 @@ static void verify_soap_headers_array(HashTable *ht) /* {{{ */ /* }}} */ /* {{{ Calls a SOAP function */ -void soap_client_call_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_soap_call) +void soap_client_call_impl(INTERNAL_FUNCTION_PARAMETERS, bool is_soap_call) { char *function, *location=NULL, *soap_action = NULL, *uri = NULL; size_t function_len; @@ -2512,7 +2493,7 @@ void soap_client_call_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_soap_call) zval *param; int arg_count; zval *tmp; - zend_bool free_soap_headers = 0; + bool free_soap_headers = 0; zval *this_ptr; if (is_soap_call) { @@ -2755,7 +2736,7 @@ PHP_METHOD(SoapClient, __doRequest) char *location, *action; size_t location_size, action_size; zend_long version; - zend_bool one_way = 0; + bool one_way = 0; zval *this_ptr = ZEND_THIS; if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sssl|b", |