Skip to content

Commit 1fc86ff

Browse files
committed
POC: Add ext/url
1 parent 96ea06a commit 1fc86ff

23 files changed

+22481
-10
lines changed

.cirrus.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ asan_task:
108108
--enable-pcntl
109109
--with-readline
110110
--enable-mbstring
111+
--enable-url
111112
--with-curl
112113
--with-gettext
113114
--enable-sockets
@@ -194,7 +195,7 @@ freebsd_task:
194195
- 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
195196
script:
196197
- ./buildconf -f
197-
- ./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
198+
- ./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
198199
- gmake -j2
199200
- mkdir /etc/php.d
200201
- gmake install
@@ -318,6 +319,7 @@ arm_task:
318319
--enable-pcntl
319320
--with-readline
320321
--enable-mbstring
322+
--enable-url
321323
--with-curl
322324
--with-gettext
323325
--enable-sockets

.github/actions/configure-macos/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ runs:
4747
--enable-pcntl \
4848
--with-readline=/usr/local/opt/readline \
4949
--enable-mbstring \
50+
--enable-url \
5051
--with-curl \
5152
--with-gettext=/usr/local/opt/gettext \
5253
--enable-sockets \

.github/actions/configure-x32/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ runs:
4646
--enable-pcntl \
4747
--with-readline \
4848
--enable-mbstring \
49+
--enable-url \
4950
--with-curl \
5051
--with-gettext \
5152
--enable-sockets \

.github/actions/configure-x64/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ runs:
4141
--enable-pcntl \
4242
--with-readline \
4343
--enable-mbstring \
44+
--enable-url \
4445
--with-curl \
4546
--with-gettext \
4647
--enable-sockets \

EXTENSIONS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,12 @@ PRIMARY MAINTAINER: Andrei Zmievski <[email protected]> (2002 - 2002)
511511
MAINTENANCE: Maintained
512512
STATUS: Working
513513
-------------------------------------------------------------------------------
514+
EXTENSION: url
515+
PRIMARY MAINTAINER Máté Kocsis <[email protected]> (2022 - 2023)
516+
MAINTENANCE: Maintained
517+
STATUS: Working
518+
SINCE: 8.3.0
519+
-------------------------------------------------------------------------------
514520
EXTENSION: zip
515521
PRIMARY MAINTAINER: Pierre-Alain Joye <[email protected]> (2006 - 2011)
516522
Remi Collet <[email protected]> (2013-2020)

Zend/zend_enum.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static ZEND_NAMED_FUNCTION(zend_enum_cases_func)
284284
} ZEND_HASH_FOREACH_END();
285285
}
286286

287-
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)
287+
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)
288288
{
289289
if (ce->type == ZEND_USER_CLASS && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) {
290290
if (zend_update_class_constants(ce) == FAILURE) {
@@ -308,7 +308,7 @@ ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_clas
308308

309309
if (case_name_zv == NULL) {
310310
not_found:
311-
if (try) {
311+
if (isTry) {
312312
*result = NULL;
313313
return SUCCESS;
314314
}
@@ -338,7 +338,7 @@ ZEND_API zend_result zend_enum_get_case_by_value(zend_object **result, zend_clas
338338
return SUCCESS;
339339
}
340340

341-
static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool try)
341+
static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool isTry)
342342
{
343343
zend_class_entry *ce = execute_data->func->common.scope;
344344
bool release_string = false;
@@ -373,12 +373,12 @@ static void zend_enum_from_base(INTERNAL_FUNCTION_PARAMETERS, bool try)
373373
}
374374

375375
zend_object *case_obj;
376-
if (zend_enum_get_case_by_value(&case_obj, ce, long_key, string_key, try) == FAILURE) {
376+
if (zend_enum_get_case_by_value(&case_obj, ce, long_key, string_key, isTry) == FAILURE) {
377377
goto throw;
378378
}
379379

380380
if (case_obj == NULL) {
381-
ZEND_ASSERT(try);
381+
ZEND_ASSERT(isTry);
382382
goto return_null;
383383
}
384384

Zend/zend_enum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ZEND_API void zend_enum_add_case(zend_class_entry *ce, zend_string *case_name, z
4444
ZEND_API void zend_enum_add_case_cstr(zend_class_entry *ce, const char *name, zval *value);
4545
ZEND_API zend_object *zend_enum_get_case(zend_class_entry *ce, zend_string *name);
4646
ZEND_API zend_object *zend_enum_get_case_cstr(zend_class_entry *ce, const char *name);
47-
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);
47+
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);
4848

4949
static zend_always_inline zval *zend_enum_fetch_case_name(zend_object *zobj)
5050
{

ext/standard/basic_functions.stub.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3628,7 +3628,6 @@ function uniqid(string $prefix = "", bool $more_entropy = false): string {}
36283628

36293629
/**
36303630
* @return int|string|array<string, int|string>|null|false
3631-
* @compile-time-eval
36323631
* @refcount 1
36333632
*/
36343633
function parse_url(string $url, int $component = -1): int|string|array|null|false {}

ext/standard/basic_functions_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)