Skip to content

POC: Add ext/url #11315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ asan_task:
--enable-pcntl
--with-readline
--enable-mbstring
--enable-url
--with-curl
--with-gettext
--enable-sockets
Expand Down Expand Up @@ -194,7 +195,7 @@ freebsd_task:
- pkg install -y autoconf bison gmake re2c icu libiconv png freetype2 enchant2 bzip2 krb5 t1lib gmp tidyp libsodium libzip libxml2 libxslt openssl oniguruma pkgconf webp libavif
script:
- ./buildconf -f
- ./configure --prefix=/usr/local --enable-debug --enable-option-checking=fatal --enable-fpm --with-pdo-sqlite --without-pear --with-bz2 --with-avif --with-jpeg --with-webp --with-freetype --enable-gd --enable-exif --with-zip --with-zlib --enable-soap --enable-xmlreader --with-xsl --with-libxml --enable-shmop --enable-pcntl --enable-mbstring --with-curl --enable-sockets --with-openssl --with-iconv=/usr/local --enable-bcmath --enable-calendar --enable-ftp --with-kerberos --with-ffi --enable-zend-test --enable-dl-test=shared --enable-intl --with-mhash --with-sodium --enable-werror --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d
- ./configure --prefix=/usr/local --enable-debug --enable-option-checking=fatal --enable-fpm --with-pdo-sqlite --without-pear --with-bz2 --with-avif --with-jpeg --with-webp --with-freetype --enable-gd --enable-exif --with-zip --with-zlib --enable-soap --enable-xmlreader --with-xsl --with-libxml --enable-shmop --enable-pcntl --enable-mbstring --enable-url --with-curl --enable-sockets --with-openssl --with-iconv=/usr/local --enable-bcmath --enable-calendar --enable-ftp --with-kerberos --with-ffi --enable-zend-test --enable-dl-test=shared --enable-intl --with-mhash --with-sodium --enable-werror --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d
- gmake -j2
- mkdir /etc/php.d
- gmake install
Expand Down Expand Up @@ -318,6 +319,7 @@ arm_task:
--enable-pcntl
--with-readline
--enable-mbstring
--enable-url
--with-curl
--with-gettext
--enable-sockets
Expand Down
1 change: 1 addition & 0 deletions .github/actions/configure-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ runs:
--enable-pcntl \
--with-readline=/usr/local/opt/readline \
--enable-mbstring \
--enable-url \
--with-curl \
--with-gettext=/usr/local/opt/gettext \
--enable-sockets \
Expand Down
1 change: 1 addition & 0 deletions .github/actions/configure-x32/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ runs:
--enable-pcntl \
--with-readline \
--enable-mbstring \
--enable-url \
--with-curl \
--with-gettext \
--enable-sockets \
Expand Down
1 change: 1 addition & 0 deletions .github/actions/configure-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ runs:
--enable-pcntl \
--with-readline \
--enable-mbstring \
--enable-url \
--with-curl \
--with-gettext \
--enable-sockets \
Expand Down
6 changes: 6 additions & 0 deletions EXTENSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ PRIMARY MAINTAINER: Andrei Zmievski <[email protected]> (2002 - 2002)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: url
PRIMARY MAINTAINER Máté Kocsis <[email protected]> (2022 - 2023)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 8.3.0
-------------------------------------------------------------------------------
EXTENSION: zip
PRIMARY MAINTAINER: Pierre-Alain Joye <[email protected]> (2006 - 2011)
Remi Collet <[email protected]> (2013-2020)
Expand Down
10 changes: 5 additions & 5 deletions Zend/zend_enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ static ZEND_NAMED_FUNCTION(zend_enum_cases_func)
} ZEND_HASH_FOREACH_END();
}

ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_class_entry *ce, zend_long long_key, zend_string *string_key, bool try)
ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_class_entry *ce, zend_long long_key, zend_string *string_key, bool isTry)
{
if (ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) {
if (zend_update_class_constants(ce) == FAILURE) {
Expand All @@ -308,7 +308,7 @@ ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_clas

if (case_name_zv == NULL) {
not_found:
if (try) {
if (isTry) {
*result = NULL;
return SUCCESS;
}
Expand Down Expand Up @@ -338,7 +338,7 @@ ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_clas
return SUCCESS;
}

static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool try)
static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool isTry)
{
zend_class_entry *ce = execute_data->func->common.scope;
bool release_string = false;
Expand Down Expand Up @@ -373,12 +373,12 @@ static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool try)
}

zend_object *case_obj;
if (zend_enum_get_case_by_value(&case_obj, ce, long_key, string_key, try) == FAILURE) {
if (zend_enum_get_case_by_value(&case_obj, ce, long_key, string_key, isTry) == FAILURE) {
goto throw;
}

if (case_obj == NULL) {
ZEND_ASSERT(try);
ZEND_ASSERT(isTry);
goto return_null;
}

Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ZEND_API void zend_enum_add_case(zend_class_entry *ce, zend_string *case_name, z
ZEND_API void zend_enum_add_case_cstr(zend_class_entry *ce, const char *name, zval *value);
ZEND_API zend_object *zend_enum_get_case(zend_class_entry *ce, zend_string *name);
ZEND_API zend_object *zend_enum_get_case_cstr(zend_class_entry *ce, const char *name);
ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_class_entry *ce, zend_long long_key, zend_string *string_key, bool try);
ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_class_entry *ce, zend_long long_key, zend_string *string_key, bool isTry);

static zend_always_inline zval *zend_enum_fetch_case_name(zend_object *zobj)
{
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ EMPTY_SWITCH_DEFAULT_CASE()
_(ZEND_STR_PORT, "port") \
_(ZEND_STR_USER, "user") \
_(ZEND_STR_PASS, "pass") \
_(ZEND_STR_PASSWORD, "password") \
_(ZEND_STR_PATH, "path") \
_(ZEND_STR_QUERY, "query") \
_(ZEND_STR_FRAGMENT, "fragment") \
Expand Down
1 change: 0 additions & 1 deletion ext/standard/basic_functions.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -3628,7 +3628,6 @@ function uniqid(string $prefix = "", bool $more_entropy = false): string {}

/**
* @return int|string|array<string, int|string>|null|false
* @compile-time-eval
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only removed this just to be able to compare its real performance

* @refcount 1
*/
function parse_url(string $url, int $component = -1): int|string|array|null|false {}
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/basic_functions_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading