30
30
31
31
32
32
static int le_sdl = 0 ;
33
- int le_url = 0 ;
34
33
static int le_typemap = 0 ;
35
34
36
35
typedef struct _soapHeader {
@@ -65,7 +64,6 @@ static xmlNodePtr serialize_parameter(sdlParamPtr param,zval *param_val,int inde
65
64
static xmlNodePtr serialize_zval (zval * val , sdlParamPtr param , char * paramName , int style , xmlNodePtr parent );
66
65
67
66
static void delete_service (void * service );
68
- static void delete_url (void * handle );
69
67
static void delete_hashtable (void * hashtable );
70
68
71
69
static void soap_error_handler (int error_num , zend_string * error_filename , const uint32_t error_lineno , zend_string * message );
@@ -178,8 +176,10 @@ static zend_class_entry* soap_fault_class_entry;
178
176
static zend_class_entry * soap_header_class_entry ;
179
177
static zend_class_entry * soap_param_class_entry ;
180
178
zend_class_entry * soap_var_class_entry ;
179
+ zend_class_entry * soap_url_class_entry ;
181
180
182
181
static zend_object_handlers soap_server_object_handlers ;
182
+ static zend_object_handlers soap_url_object_handlers ;
183
183
184
184
typedef struct {
185
185
soapServicePtr service ;
@@ -206,6 +206,34 @@ static void soap_server_object_free(zend_object *obj) {
206
206
zend_object_std_dtor (obj );
207
207
}
208
208
209
+ static zend_object * soap_url_object_create (zend_class_entry * ce )
210
+ {
211
+ soap_url_object * url_obj = zend_object_alloc (sizeof (soap_url_object ), ce );
212
+
213
+ zend_object_std_init (& url_obj -> std , ce );
214
+ object_properties_init (& url_obj -> std , ce );
215
+
216
+ return & url_obj -> std ;
217
+ }
218
+
219
+ static void soap_url_object_free (zend_object * obj )
220
+ {
221
+ soap_url_object * url_obj = soap_url_object_fetch (obj );
222
+
223
+ if (url_obj -> url ) {
224
+ php_url_free (url_obj -> url );
225
+ url_obj -> url = NULL ;
226
+ }
227
+
228
+ zend_object_std_dtor (& url_obj -> std );
229
+ }
230
+
231
+ static zend_function * soap_url_object_get_constructor (zend_object * object )
232
+ {
233
+ zend_throw_error (NULL , "Cannot directly construct Soap\\Url" );
234
+
235
+ return NULL ;
236
+ }
209
237
ZEND_DECLARE_MODULE_GLOBALS (soap )
210
238
211
239
static void (* old_error_handler )(int , zend_string * , const uint32_t , zend_string * );
@@ -395,11 +423,6 @@ static void delete_sdl_res(zend_resource *res)
395
423
delete_sdl (res -> ptr );
396
424
}
397
425
398
- static void delete_url_res (zend_resource * res )
399
- {
400
- delete_url (res -> ptr );
401
- }
402
-
403
426
static void delete_hashtable_res (zend_resource * res )
404
427
{
405
428
delete_hashtable (res -> ptr );
@@ -436,9 +459,19 @@ PHP_MINIT_FUNCTION(soap)
436
459
soap_header_class_entry = register_class_SoapHeader ();
437
460
438
461
le_sdl = zend_register_list_destructors_ex (delete_sdl_res , NULL , "SOAP SDL" , module_number );
439
- le_url = zend_register_list_destructors_ex (delete_url_res , NULL , "SOAP URL" , module_number );
440
462
le_typemap = zend_register_list_destructors_ex (delete_hashtable_res , NULL , "SOAP table" , module_number );
441
463
464
+ soap_url_class_entry = register_class_Soap_Url ();
465
+ soap_url_class_entry -> create_object = soap_url_object_create ;
466
+ soap_url_class_entry -> default_object_handlers = & soap_url_object_handlers ;
467
+
468
+ memcpy (& soap_url_object_handlers , & std_object_handlers , sizeof (zend_object_handlers ));
469
+ soap_url_object_handlers .offset = XtOffsetOf (soap_url_object , std );
470
+ soap_url_object_handlers .free_obj = soap_url_object_free ;
471
+ soap_url_object_handlers .get_constructor = soap_url_object_get_constructor ;
472
+ soap_url_object_handlers .clone_obj = NULL ;
473
+ soap_url_object_handlers .compare = zend_objects_not_comparable ;
474
+
442
475
register_soap_symbols (module_number );
443
476
444
477
old_error_handler = zend_error_cb ;
@@ -4355,12 +4388,6 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) /* {{{ */
4355
4388
}
4356
4389
/* }}} */
4357
4390
4358
- static void delete_url (void * handle ) /* {{{ */
4359
- {
4360
- php_url_free ((php_url * )handle );
4361
- }
4362
- /* }}} */
4363
-
4364
4391
static void delete_service (void * data ) /* {{{ */
4365
4392
{
4366
4393
soapServicePtr service = (soapServicePtr )data ;
0 commit comments