1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Commit Graph

6 Commits

Author SHA1 Message Date
Arnaud Le Blanc
d16e6f52a4 Generate C enums from internal enums, introduce Z_PARAM_ENUM() (#20917)
Update gen_stubs.php to generate C enums from internal enums, when the stub is annotated with @generate-c-enums. Enum values can be compared to the result of zend_enum_fetch_case_id(zend_object*).

The generated enums are added to separate files named {$extensionName}_decl.h, so that it's possible to include these from anywhere. _arginfo.h files would generate warnings if we tried to include them in a compilation unit that doesn't call the register_{$class} functions, for instance.

Introduce Z_PARAM_ENUM().

* Make ZEND_AST_CONST_ENUM_INIT a 4-children node

* Store enum case id in ZEND_AST_CONST_ENUM_INIT

* Store enum case id in instance

* Expose enum case_id internally

* Generate C enum for internal enums

* Introduce Z_PARAM_ENUM()

* Port extensions
2026-02-03 12:38:04 +01:00
Tim Düsterhus
fe0263f344 uri: Throw UriError for unexpected failures (#19850)
* uri: Add `UriError`

* uri: Throw `UriError` for unexpected failures in uri_parser_rfc3986

This is a follow-up for php/php-src#19779 which updated the error *messages*
for the non-syntax errors, but did not update the exception class, still
implying it's related to invalid URIs.

Given that we don't know ourselves if these are reachable in practice, they are
cannot be meaningfully handled by a user of PHP. Thus this should be a `Error`
according to our exception policy.

* uri: Throw `UriError` when unable to recompose URIs

* uri: Throw `UriError` when unable to read component

* NEWS
2025-09-17 19:46:19 +02:00
Máté Kocsis
4e8058e776 Add support for Uri\Rfc3986\Uri withers (#19636)
Related to https://wiki.php.net/rfc/url_parsing_api
2025-09-08 02:30:44 +02:00
Máté Kocsis
5a9f5a6514 Add the Uri\Rfc3986\Uri class to ext/uri without wither support (#18836)
Relates to #14461 and https://wiki.php.net/rfc/url_parsing_api

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>
2025-07-05 10:00:20 +02:00
Máté Kocsis
3399235bec Add Uri\WhatWg classes to ext/uri (#18672)
Relates to #14461 and https://wiki.php.net/rfc/url_parsing_api

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>
2025-06-10 10:18:22 +02:00
Máté Kocsis
d585a5609d Add ext/uri skeleton along with uriparser (#18658)
Relates to https://github.com/php/php-src/pull/14461/ and https://wiki.php.net/rfc/url_parsing_api
2025-05-27 08:16:24 +02:00