3333zend_class_entry * uri_interface_ce ;
3434zend_class_entry * rfc3986_uri_ce ;
3535zend_object_handlers rfc3986_uri_object_handlers ;
36- zend_class_entry * whatwg_uri_ce ;
36+ zend_class_entry * whatwg_url_ce ;
3737zend_object_handlers whatwg_uri_object_handlers ;
3838zend_class_entry * uri_exception_ce ;
3939zend_class_entry * uninitialized_uri_exception_ce ;
@@ -243,13 +243,11 @@ PHPAPI void php_uri_instantiate_uri(
243243static void create_rfc3986_uri (INTERNAL_FUNCTION_PARAMETERS , bool is_constructor )
244244{
245245 zend_string * uri_str , * base_url_str = NULL ;
246- zval * errors ;
247246
248247 ZEND_PARSE_PARAMETERS_START (1 , 2 )
249248 Z_PARAM_PATH_STR (uri_str )
250249 Z_PARAM_OPTIONAL
251250 Z_PARAM_PATH_STR_OR_NULL (base_url_str )
252- Z_PARAM_ZVAL (errors )
253251 ZEND_PARSE_PARAMETERS_END ();
254252
255253 if (ZSTR_LEN (uri_str ) == 0 ) {
@@ -265,12 +263,12 @@ static void create_rfc3986_uri(INTERNAL_FUNCTION_PARAMETERS, bool is_constructor
265263 php_uri_instantiate_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , & uriparser_uri_handler , uri_str , base_url_str , is_constructor , NULL );
266264}
267265
268- PHP_METHOD (Uri_Rfc3986Uri , parse )
266+ PHP_METHOD (Uri_Rfc3986_Uri , parse )
269267{
270268 create_rfc3986_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , false);
271269}
272270
273- PHP_METHOD (Uri_Rfc3986Uri , __construct )
271+ PHP_METHOD (Uri_Rfc3986_Uri , __construct )
274272{
275273 create_rfc3986_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , true);
276274}
@@ -300,97 +298,97 @@ static void create_whatwg_uri(INTERNAL_FUNCTION_PARAMETERS, bool is_constructor)
300298 php_uri_instantiate_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , & lexbor_uri_handler , uri_str , base_url_str , is_constructor , errors );
301299}
302300
303- PHP_METHOD (Uri_WhatWgUri , parse )
301+ PHP_METHOD (Uri_WhatWg_Url , parse )
304302{
305303 create_whatwg_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , false);
306304}
307305
308- PHP_METHOD (Uri_WhatWgUri , __construct )
306+ PHP_METHOD (Uri_WhatWg_Url , __construct )
309307{
310308 create_whatwg_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , true);
311309}
312310
313- PHP_METHOD (Uri_Rfc3986Uri , getScheme )
311+ PHP_METHOD (Uri_Rfc3986_Uri , getScheme )
314312{
315313 URI_GETTER (ZSTR_KNOWN (ZEND_STR_SCHEME ));
316314}
317315
318- PHP_METHOD (Uri_Rfc3986Uri , withScheme )
316+ PHP_METHOD (Uri_Rfc3986_Uri , withScheme )
319317{
320318 URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_SCHEME ));
321319}
322320
323- PHP_METHOD (Uri_Rfc3986Uri , getUser )
321+ PHP_METHOD (Uri_Rfc3986_Uri , getUser )
324322{
325323 URI_GETTER (ZSTR_KNOWN (ZEND_STR_USER ));
326324}
327325
328- PHP_METHOD (Uri_Rfc3986Uri , withUser )
326+ PHP_METHOD (Uri_Rfc3986_Uri , withUser )
329327{
330328 URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_USER ));
331329}
332330
333- PHP_METHOD (Uri_Rfc3986Uri , getPassword )
331+ PHP_METHOD (Uri_Rfc3986_Uri , getPassword )
334332{
335333 URI_GETTER (ZSTR_KNOWN (ZEND_STR_PASSWORD ));
336334}
337335
338- PHP_METHOD (Uri_Rfc3986Uri , withPassword )
336+ PHP_METHOD (Uri_Rfc3986_Uri , withPassword )
339337{
340338 URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_PASSWORD ));
341339}
342340
343- PHP_METHOD (Uri_Rfc3986Uri , getHost )
341+ PHP_METHOD (Uri_Rfc3986_Uri , getHost )
344342{
345343 URI_GETTER (ZSTR_KNOWN (ZEND_STR_HOST ));
346344}
347345
348- PHP_METHOD (Uri_Rfc3986Uri , withHost )
346+ PHP_METHOD (Uri_Rfc3986_Uri , withHost )
349347{
350348 URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_HOST ));
351349}
352350
353- PHP_METHOD (Uri_Rfc3986Uri , getPort )
351+ PHP_METHOD (Uri_Rfc3986_Uri , getPort )
354352{
355353 URI_GETTER (ZSTR_KNOWN (ZEND_STR_PORT ));
356354}
357355
358- PHP_METHOD (Uri_Rfc3986Uri , withPort )
356+ PHP_METHOD (Uri_Rfc3986_Uri , withPort )
359357{
360358 URI_WITHER_LONG (ZSTR_KNOWN (ZEND_STR_PORT ));
361359}
362360
363- PHP_METHOD (Uri_Rfc3986Uri , getPath )
361+ PHP_METHOD (Uri_Rfc3986_Uri , getPath )
364362{
365363 URI_GETTER (ZSTR_KNOWN (ZEND_STR_PATH ));
366364}
367365
368- PHP_METHOD (Uri_Rfc3986Uri , withPath )
366+ PHP_METHOD (Uri_Rfc3986_Uri , withPath )
369367{
370368 URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_PATH ));
371369}
372370
373- PHP_METHOD (Uri_Rfc3986Uri , getQuery )
371+ PHP_METHOD (Uri_Rfc3986_Uri , getQuery )
374372{
375373 URI_GETTER (ZSTR_KNOWN (ZEND_STR_QUERY ));
376374}
377375
378- PHP_METHOD (Uri_Rfc3986Uri , withQuery )
376+ PHP_METHOD (Uri_Rfc3986_Uri , withQuery )
379377{
380378 URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_QUERY ));
381379}
382380
383- PHP_METHOD (Uri_Rfc3986Uri , getFragment )
381+ PHP_METHOD (Uri_Rfc3986_Uri , getFragment )
384382{
385383 URI_GETTER (ZSTR_KNOWN (ZEND_STR_FRAGMENT ));
386384}
387385
388- PHP_METHOD (Uri_Rfc3986Uri , withFragment )
386+ PHP_METHOD (Uri_Rfc3986_Uri , withFragment )
389387{
390388 URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_FRAGMENT ));
391389}
392390
393- PHP_METHOD (Uri_Rfc3986Uri , equals )
391+ PHP_METHOD (Uri_Rfc3986_Uri , equals )
394392{
395393 zend_object * that_object ;
396394 bool exclude_fragment = true;
@@ -468,7 +466,7 @@ PHP_METHOD(Uri_Rfc3986Uri, equals)
468466 }
469467}
470468
471- PHP_METHOD (Uri_Rfc3986Uri , normalize )
469+ PHP_METHOD (Uri_Rfc3986_Uri , normalize )
472470{
473471 ZEND_PARSE_PARAMETERS_NONE ();
474472
@@ -498,7 +496,7 @@ PHP_METHOD(Uri_Rfc3986Uri, normalize)
498496 ZVAL_OBJ (return_value , new_object );
499497}
500498
501- PHP_METHOD (Uri_Rfc3986Uri , toNormalizedString )
499+ PHP_METHOD (Uri_Rfc3986_Uri , toNormalizedString )
502500{
503501 ZEND_PARSE_PARAMETERS_NONE ();
504502
@@ -526,7 +524,7 @@ PHP_METHOD(Uri_Rfc3986Uri, toNormalizedString)
526524 internal_uri -> handler -> free_uri (new_uri );
527525}
528526
529- PHP_METHOD (Uri_Rfc3986Uri , toString )
527+ PHP_METHOD (Uri_Rfc3986_Uri , toString )
530528{
531529 ZEND_PARSE_PARAMETERS_NONE ();
532530
@@ -537,7 +535,7 @@ PHP_METHOD(Uri_Rfc3986Uri, toString)
537535 RETURN_STR (internal_uri -> handler -> uri_to_string (internal_uri -> uri , false));
538536}
539537
540- PHP_METHOD (Uri_Rfc3986Uri , resolve )
538+ PHP_METHOD (Uri_Rfc3986_Uri , resolve )
541539{
542540 zend_string * uri_str ;
543541
@@ -554,7 +552,7 @@ PHP_METHOD(Uri_Rfc3986Uri, resolve)
554552 php_uri_instantiate_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , internal_uri -> handler , uri_str , base_uri_str , true, NULL );
555553}
556554
557- PHP_METHOD (Uri_Rfc3986Uri , __serialize )
555+ PHP_METHOD (Uri_Rfc3986_Uri , __serialize )
558556{
559557 ZEND_PARSE_PARAMETERS_NONE ();
560558
@@ -583,7 +581,7 @@ static void uri_restore_custom_properties(zend_object *object, uri_internal_t *i
583581 } ZEND_HASH_FOREACH_END ();
584582}
585583
586- PHP_METHOD (Uri_Rfc3986Uri , __unserialize )
584+ PHP_METHOD (Uri_Rfc3986_Uri , __unserialize )
587585{
588586 HashTable * ht ;
589587
@@ -614,7 +612,20 @@ PHP_METHOD(Uri_Rfc3986Uri, __unserialize)
614612 uri_restore_custom_properties (object , internal_uri , ht );
615613}
616614
617- PHP_METHOD (Uri_WhatWgUri , __unserialize )
615+ PHP_METHOD (Uri_Rfc3986_Uri , __debugInfo )
616+ {
617+ HashTable * ht ;
618+
619+ ZEND_PARSE_PARAMETERS_NONE ();
620+
621+ zend_object * object = Z_OBJ_P (ZEND_THIS );
622+ uri_internal_t * internal_uri = uri_internal_from_obj (object );
623+ URI_CHECK_INITIALIZATION_RETURN_THROWS (internal_uri , object );
624+
625+ RETURN_ARR (uri_get_properties (object , true));
626+ }
627+
628+ PHP_METHOD (Uri_WhatWg_Url , __unserialize )
618629{
619630 HashTable * ht ;
620631
@@ -645,6 +656,19 @@ PHP_METHOD(Uri_WhatWgUri, __unserialize)
645656 uri_restore_custom_properties (object , internal_uri , ht );
646657}
647658
659+ PHP_METHOD (Uri_WhatWg_Url , __debugInfo )
660+ {
661+ HashTable * ht ;
662+
663+ ZEND_PARSE_PARAMETERS_NONE ();
664+
665+ zend_object * object = Z_OBJ_P (ZEND_THIS );
666+ uri_internal_t * internal_uri = uri_internal_from_obj (object );
667+ URI_CHECK_INITIALIZATION_RETURN_THROWS (internal_uri , object );
668+
669+ RETURN_ARR (uri_get_properties (object , true));
670+ }
671+
648672static zend_object * uri_create_object_handler (zend_class_entry * class_type )
649673{
650674 uri_object_t * uri_object = zend_object_alloc (sizeof (uri_object_t ), class_type );
@@ -804,13 +828,6 @@ static zend_object *uri_clone_obj_handler(zend_object *object)
804828 return & new_uri_object -> std ;
805829}
806830
807- static HashTable * uri_get_debug_info_handler (zend_object * object , int * is_temp )
808- {
809- * is_temp = 1 ;
810-
811- return uri_get_properties (object , true);
812- }
813-
814831static HashTable * uri_get_gc_handler (zend_object * object , zval * * table , int * n )
815832{
816833 * table = NULL ;
@@ -844,7 +861,6 @@ PHPAPI void php_uri_implementation_set_object_handlers(zend_class_entry *ce, zen
844861 object_handlers -> write_property = uri_write_property_handler ;
845862 object_handlers -> unset_property = uri_unset_property_handler ;
846863 object_handlers -> clone_obj = uri_clone_obj_handler ;
847- object_handlers -> get_debug_info = uri_get_debug_info_handler ;
848864 object_handlers -> get_gc = uri_get_gc_handler ;
849865 object_handlers -> get_properties_for = uri_get_properties_for_handler ;
850866}
@@ -870,11 +886,11 @@ static PHP_MINIT_FUNCTION(uri)
870886{
871887 uri_interface_ce = register_class_Uri_Uri ();
872888
873- rfc3986_uri_ce = register_class_Uri_Rfc3986Uri ( uri_interface_ce );
889+ rfc3986_uri_ce = register_class_Uri_Rfc3986_Uri ( );
874890 php_uri_implementation_set_object_handlers (rfc3986_uri_ce , & rfc3986_uri_object_handlers );
875891
876- whatwg_uri_ce = register_class_Uri_WhatWgUri ( uri_interface_ce );
877- php_uri_implementation_set_object_handlers (whatwg_uri_ce , & whatwg_uri_object_handlers );
892+ whatwg_url_ce = register_class_Uri_WhatWg_Url ( );
893+ php_uri_implementation_set_object_handlers (whatwg_url_ce , & whatwg_uri_object_handlers );
878894
879895 uri_exception_ce = register_class_Uri_UriException (zend_ce_exception );
880896 uninitialized_uri_exception_ce = register_class_Uri_UninitializedUriException (uri_exception_ce );
0 commit comments