33
33
zend_class_entry * uri_interface_ce ;
34
34
zend_class_entry * rfc3986_uri_ce ;
35
35
zend_object_handlers rfc3986_uri_object_handlers ;
36
- zend_class_entry * whatwg_uri_ce ;
36
+ zend_class_entry * whatwg_url_ce ;
37
37
zend_object_handlers whatwg_uri_object_handlers ;
38
38
zend_class_entry * uri_exception_ce ;
39
39
zend_class_entry * uninitialized_uri_exception_ce ;
@@ -243,13 +243,11 @@ PHPAPI void php_uri_instantiate_uri(
243
243
static void create_rfc3986_uri (INTERNAL_FUNCTION_PARAMETERS , bool is_constructor )
244
244
{
245
245
zend_string * uri_str , * base_url_str = NULL ;
246
- zval * errors ;
247
246
248
247
ZEND_PARSE_PARAMETERS_START (1 , 2 )
249
248
Z_PARAM_PATH_STR (uri_str )
250
249
Z_PARAM_OPTIONAL
251
250
Z_PARAM_PATH_STR_OR_NULL (base_url_str )
252
- Z_PARAM_ZVAL (errors )
253
251
ZEND_PARSE_PARAMETERS_END ();
254
252
255
253
if (ZSTR_LEN (uri_str ) == 0 ) {
@@ -265,12 +263,12 @@ static void create_rfc3986_uri(INTERNAL_FUNCTION_PARAMETERS, bool is_constructor
265
263
php_uri_instantiate_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , & uriparser_uri_handler , uri_str , base_url_str , is_constructor , NULL );
266
264
}
267
265
268
- PHP_METHOD (Uri_Rfc3986Uri , parse )
266
+ PHP_METHOD (Uri_Rfc3986_Uri , parse )
269
267
{
270
268
create_rfc3986_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , false);
271
269
}
272
270
273
- PHP_METHOD (Uri_Rfc3986Uri , __construct )
271
+ PHP_METHOD (Uri_Rfc3986_Uri , __construct )
274
272
{
275
273
create_rfc3986_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , true);
276
274
}
@@ -300,97 +298,97 @@ static void create_whatwg_uri(INTERNAL_FUNCTION_PARAMETERS, bool is_constructor)
300
298
php_uri_instantiate_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , & lexbor_uri_handler , uri_str , base_url_str , is_constructor , errors );
301
299
}
302
300
303
- PHP_METHOD (Uri_WhatWgUri , parse )
301
+ PHP_METHOD (Uri_WhatWg_Url , parse )
304
302
{
305
303
create_whatwg_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , false);
306
304
}
307
305
308
- PHP_METHOD (Uri_WhatWgUri , __construct )
306
+ PHP_METHOD (Uri_WhatWg_Url , __construct )
309
307
{
310
308
create_whatwg_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , true);
311
309
}
312
310
313
- PHP_METHOD (Uri_Rfc3986Uri , getScheme )
311
+ PHP_METHOD (Uri_Rfc3986_Uri , getScheme )
314
312
{
315
313
URI_GETTER (ZSTR_KNOWN (ZEND_STR_SCHEME ));
316
314
}
317
315
318
- PHP_METHOD (Uri_Rfc3986Uri , withScheme )
316
+ PHP_METHOD (Uri_Rfc3986_Uri , withScheme )
319
317
{
320
318
URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_SCHEME ));
321
319
}
322
320
323
- PHP_METHOD (Uri_Rfc3986Uri , getUser )
321
+ PHP_METHOD (Uri_Rfc3986_Uri , getUser )
324
322
{
325
323
URI_GETTER (ZSTR_KNOWN (ZEND_STR_USER ));
326
324
}
327
325
328
- PHP_METHOD (Uri_Rfc3986Uri , withUser )
326
+ PHP_METHOD (Uri_Rfc3986_Uri , withUser )
329
327
{
330
328
URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_USER ));
331
329
}
332
330
333
- PHP_METHOD (Uri_Rfc3986Uri , getPassword )
331
+ PHP_METHOD (Uri_Rfc3986_Uri , getPassword )
334
332
{
335
333
URI_GETTER (ZSTR_KNOWN (ZEND_STR_PASSWORD ));
336
334
}
337
335
338
- PHP_METHOD (Uri_Rfc3986Uri , withPassword )
336
+ PHP_METHOD (Uri_Rfc3986_Uri , withPassword )
339
337
{
340
338
URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_PASSWORD ));
341
339
}
342
340
343
- PHP_METHOD (Uri_Rfc3986Uri , getHost )
341
+ PHP_METHOD (Uri_Rfc3986_Uri , getHost )
344
342
{
345
343
URI_GETTER (ZSTR_KNOWN (ZEND_STR_HOST ));
346
344
}
347
345
348
- PHP_METHOD (Uri_Rfc3986Uri , withHost )
346
+ PHP_METHOD (Uri_Rfc3986_Uri , withHost )
349
347
{
350
348
URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_HOST ));
351
349
}
352
350
353
- PHP_METHOD (Uri_Rfc3986Uri , getPort )
351
+ PHP_METHOD (Uri_Rfc3986_Uri , getPort )
354
352
{
355
353
URI_GETTER (ZSTR_KNOWN (ZEND_STR_PORT ));
356
354
}
357
355
358
- PHP_METHOD (Uri_Rfc3986Uri , withPort )
356
+ PHP_METHOD (Uri_Rfc3986_Uri , withPort )
359
357
{
360
358
URI_WITHER_LONG (ZSTR_KNOWN (ZEND_STR_PORT ));
361
359
}
362
360
363
- PHP_METHOD (Uri_Rfc3986Uri , getPath )
361
+ PHP_METHOD (Uri_Rfc3986_Uri , getPath )
364
362
{
365
363
URI_GETTER (ZSTR_KNOWN (ZEND_STR_PATH ));
366
364
}
367
365
368
- PHP_METHOD (Uri_Rfc3986Uri , withPath )
366
+ PHP_METHOD (Uri_Rfc3986_Uri , withPath )
369
367
{
370
368
URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_PATH ));
371
369
}
372
370
373
- PHP_METHOD (Uri_Rfc3986Uri , getQuery )
371
+ PHP_METHOD (Uri_Rfc3986_Uri , getQuery )
374
372
{
375
373
URI_GETTER (ZSTR_KNOWN (ZEND_STR_QUERY ));
376
374
}
377
375
378
- PHP_METHOD (Uri_Rfc3986Uri , withQuery )
376
+ PHP_METHOD (Uri_Rfc3986_Uri , withQuery )
379
377
{
380
378
URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_QUERY ));
381
379
}
382
380
383
- PHP_METHOD (Uri_Rfc3986Uri , getFragment )
381
+ PHP_METHOD (Uri_Rfc3986_Uri , getFragment )
384
382
{
385
383
URI_GETTER (ZSTR_KNOWN (ZEND_STR_FRAGMENT ));
386
384
}
387
385
388
- PHP_METHOD (Uri_Rfc3986Uri , withFragment )
386
+ PHP_METHOD (Uri_Rfc3986_Uri , withFragment )
389
387
{
390
388
URI_WITHER_STR (ZSTR_KNOWN (ZEND_STR_FRAGMENT ));
391
389
}
392
390
393
- PHP_METHOD (Uri_Rfc3986Uri , equals )
391
+ PHP_METHOD (Uri_Rfc3986_Uri , equals )
394
392
{
395
393
zend_object * that_object ;
396
394
bool exclude_fragment = true;
@@ -468,7 +466,7 @@ PHP_METHOD(Uri_Rfc3986Uri, equals)
468
466
}
469
467
}
470
468
471
- PHP_METHOD (Uri_Rfc3986Uri , normalize )
469
+ PHP_METHOD (Uri_Rfc3986_Uri , normalize )
472
470
{
473
471
ZEND_PARSE_PARAMETERS_NONE ();
474
472
@@ -498,7 +496,7 @@ PHP_METHOD(Uri_Rfc3986Uri, normalize)
498
496
ZVAL_OBJ (return_value , new_object );
499
497
}
500
498
501
- PHP_METHOD (Uri_Rfc3986Uri , toNormalizedString )
499
+ PHP_METHOD (Uri_Rfc3986_Uri , toNormalizedString )
502
500
{
503
501
ZEND_PARSE_PARAMETERS_NONE ();
504
502
@@ -526,7 +524,7 @@ PHP_METHOD(Uri_Rfc3986Uri, toNormalizedString)
526
524
internal_uri -> handler -> free_uri (new_uri );
527
525
}
528
526
529
- PHP_METHOD (Uri_Rfc3986Uri , toString )
527
+ PHP_METHOD (Uri_Rfc3986_Uri , toString )
530
528
{
531
529
ZEND_PARSE_PARAMETERS_NONE ();
532
530
@@ -537,7 +535,7 @@ PHP_METHOD(Uri_Rfc3986Uri, toString)
537
535
RETURN_STR (internal_uri -> handler -> uri_to_string (internal_uri -> uri , false));
538
536
}
539
537
540
- PHP_METHOD (Uri_Rfc3986Uri , resolve )
538
+ PHP_METHOD (Uri_Rfc3986_Uri , resolve )
541
539
{
542
540
zend_string * uri_str ;
543
541
@@ -554,7 +552,7 @@ PHP_METHOD(Uri_Rfc3986Uri, resolve)
554
552
php_uri_instantiate_uri (INTERNAL_FUNCTION_PARAM_PASSTHRU , internal_uri -> handler , uri_str , base_uri_str , true, NULL );
555
553
}
556
554
557
- PHP_METHOD (Uri_Rfc3986Uri , __serialize )
555
+ PHP_METHOD (Uri_Rfc3986_Uri , __serialize )
558
556
{
559
557
ZEND_PARSE_PARAMETERS_NONE ();
560
558
@@ -583,7 +581,7 @@ static void uri_restore_custom_properties(zend_object *object, uri_internal_t *i
583
581
} ZEND_HASH_FOREACH_END ();
584
582
}
585
583
586
- PHP_METHOD (Uri_Rfc3986Uri , __unserialize )
584
+ PHP_METHOD (Uri_Rfc3986_Uri , __unserialize )
587
585
{
588
586
HashTable * ht ;
589
587
@@ -614,7 +612,20 @@ PHP_METHOD(Uri_Rfc3986Uri, __unserialize)
614
612
uri_restore_custom_properties (object , internal_uri , ht );
615
613
}
616
614
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 )
618
629
{
619
630
HashTable * ht ;
620
631
@@ -645,6 +656,19 @@ PHP_METHOD(Uri_WhatWgUri, __unserialize)
645
656
uri_restore_custom_properties (object , internal_uri , ht );
646
657
}
647
658
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
+
648
672
static zend_object * uri_create_object_handler (zend_class_entry * class_type )
649
673
{
650
674
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)
804
828
return & new_uri_object -> std ;
805
829
}
806
830
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
-
814
831
static HashTable * uri_get_gc_handler (zend_object * object , zval * * table , int * n )
815
832
{
816
833
* table = NULL ;
@@ -844,7 +861,6 @@ PHPAPI void php_uri_implementation_set_object_handlers(zend_class_entry *ce, zen
844
861
object_handlers -> write_property = uri_write_property_handler ;
845
862
object_handlers -> unset_property = uri_unset_property_handler ;
846
863
object_handlers -> clone_obj = uri_clone_obj_handler ;
847
- object_handlers -> get_debug_info = uri_get_debug_info_handler ;
848
864
object_handlers -> get_gc = uri_get_gc_handler ;
849
865
object_handlers -> get_properties_for = uri_get_properties_for_handler ;
850
866
}
@@ -870,11 +886,11 @@ static PHP_MINIT_FUNCTION(uri)
870
886
{
871
887
uri_interface_ce = register_class_Uri_Uri ();
872
888
873
- rfc3986_uri_ce = register_class_Uri_Rfc3986Uri ( uri_interface_ce );
889
+ rfc3986_uri_ce = register_class_Uri_Rfc3986_Uri ( );
874
890
php_uri_implementation_set_object_handlers (rfc3986_uri_ce , & rfc3986_uri_object_handlers );
875
891
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 );
878
894
879
895
uri_exception_ce = register_class_Uri_UriException (zend_ce_exception );
880
896
uninitialized_uri_exception_ce = register_class_Uri_UninitializedUriException (uri_exception_ce );
0 commit comments