Skip to content

Commit 1f11265

Browse files
committed
Add Uri\WhatWg classes to ext/uri
Relates to php#14461 and https://wiki.php.net/rfc/url_parsing_api
1 parent 7d24cce commit 1f11265

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3272
-4
lines changed

Zend/zend_string.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,9 @@ EMPTY_SWITCH_DEFAULT_CASE()
597597
_(ZEND_STR_HOST, "host") \
598598
_(ZEND_STR_PORT, "port") \
599599
_(ZEND_STR_USER, "user") \
600+
_(ZEND_STR_USERNAME, "username") \
600601
_(ZEND_STR_PASS, "pass") \
602+
_(ZEND_STR_PASSWORD, "password") \
601603
_(ZEND_STR_PATH, "path") \
602604
_(ZEND_STR_QUERY, "query") \
603605
_(ZEND_STR_FRAGMENT, "fragment") \

build/gen_stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3055,6 +3055,8 @@ class PropertyInfo extends VariableLike
30553055
private const PHP_85_KNOWN = [
30563056
"self" => "ZEND_STR_SELF",
30573057
"parent" => "ZEND_STR_PARENT",
3058+
"username" => "ZEND_STR_USERNAME",
3059+
"password" => "ZEND_STR_PASSWORD",
30583060
];
30593061

30603062
/**

ext/uri/config.m4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ dnl Configure options
22
dnl
33

44
PHP_INSTALL_HEADERS([ext/uri], m4_normalize([
5+
php_lexbor.h
56
php_uri.h
7+
php_uri_common.h
68
]))
79

810
AC_DEFINE([URI_ENABLE_ANSI], [1], [Define to 1 for enabling ANSI support of uriparser.])
@@ -15,6 +17,6 @@ $URIPARSER_DIR/src/UriMemory.c $URIPARSER_DIR/src/UriNormalize.c $URIPARSER_DIR/
1517
$URIPARSER_DIR/src/UriParse.c $URIPARSER_DIR/src/UriParseBase.c $URIPARSER_DIR/src/UriQuery.c \
1618
$URIPARSER_DIR/src/UriRecompose.c $URIPARSER_DIR/src/UriResolve.c $URIPARSER_DIR/src/UriShorten.c"
1719

18-
PHP_NEW_EXTENSION(uri, [php_uri.c $URIPARSER_SOURCES], [no],,[-I$ext_srcdir/$URIPARSER_DIR/include -DURI_STATIC_BUILD -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
20+
PHP_NEW_EXTENSION(uri, [php_lexbor.c php_uri.c php_uri_common.c $URIPARSER_SOURCES], [no],,[-Iext_srcdir/$URIPARSER_DIR/include -DURI_STATIC_BUILD -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
1921
PHP_ADD_EXTENSION_DEP(uri, lexbor)
2022
PHP_ADD_BUILD_DIR($ext_builddir/$URIPARSER_DIR/src $ext_builddir/$URIPARSER_DIR/include)

ext/uri/config.w32

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
EXTENSION("uri", "php_uri.c", false /* never shared */, "/I ext/lexbor /I ext/uri/uriparser/include /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
1+
EXTENSION("uri", "php_lexbor.c php_uri.c php_uri_common.c", false /* never shared */, "/I ext/lexbor /I ext/uri/uriparser/include /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
22

33
AC_DEFINE("URI_ENABLE_ANSI", 1, "Define to 1 for enabling ANSI support of uriparser.")
44
AC_DEFINE("URI_NO_UNICODE", 1, "Define to 1 for disabling unicode support of uriparser.")
55
ADD_FLAG("CFLAGS_URI", "/D URI_STATIC_BUILD");
66

77
ADD_EXTENSION_DEP('uri', 'lexbor');
88
ADD_SOURCES("ext/uri/uriparser/src", "UriCommon.c UriCompare.c UriEscape.c UriFile.c UriIp4.c UriIp4Base.c UriMemory.c UriNormalize.c UriNormalizeBase.c UriParse.c UriParseBase.c UriQuery.c UriRecompose.c UriShorten.c", "uri");
9-
PHP_INSTALL_HEADERS("ext/uri", "php_uri.h uriparser/src uriparser/include");
9+
PHP_INSTALL_HEADERS("ext/uri", "php_lexbor.h php_uri.h php_uri_common.h uriparser/src uriparser/include");

0 commit comments

Comments
 (0)