Commit graph

1379 commits

Author SHA1 Message Date
Ayesh Karunaratne
94a12d5b31
ext/curl: Cleanup config.w32 to remove superfluous checks and outdated comments (#13684)
- Remove a check for an always-true curl version check
- Remove a `TODO` comment for curl_version_info check that should be always available since libcurl 7.10
2024-03-12 17:56:07 +01:00
Ayesh Karunaratne
ba0f9fb501
ext/curl: Add feature_info assoc array to curl_version() (#13439)
The `phpinfo()` section of the Curl extension lists individual features
supported by the particular ext-Curl + libcurl build. However, the
`curl_version()` function return values do not indicate the same level of
details.

`curl_version()` has a `protocols` key that returns an array of all protocols
supported by the build. But the `features` key is a bitmask of all the features.
Checking the availability of certain feature requires knowing the corresponding
`CURL_VERSION` constant, and checking the availability of the constant and a
bitmask check for it in the `features` value.

For example, to determine HTTP2 support, it requires evaluating:

```php
defined('CURL_VERSION_HTTP2') && (curl_version()['features'] & CURL_VERSION_HTTP2 === CURL_VERSION_HTTP2)
```

To make feature availability checks more intuitive, this adds a new
`feature_list` key to `curl_version()` output array.

With it, checking for individual features availability is easier, and does
not require inspecting the availability of the `CURL_VERSION` constant and
the `features` key.

```php
!empty(curl_version()['feature_list']['HTTP2']);
```
2024-02-21 00:46:22 +00:00
Máté Kocsis
10957e498c
Do not generate frameless info items when func info generation is disabled
While here, I fixed newlines around arginfo and function entry generation. Previously, newlines were repeated.
2024-02-18 11:39:00 +01:00
Peter Kokot
b222c020bf
Fix linking ext/curl against OpenSSL (#13262)
Following 68f6ab7113, the ext/curl doesn't
need to be linked against OpenSSL anymore, if curl_version_info_data
ssl_version is OpenSSL/1.1 or later.

With OpenSSL 3 and later the check for old SSL crypto locking callbacks
was detected here.

This also uses a common PHP_SETUP_OPENSSL macro for checking OpenSSL and
syncs the minimum OpenSSL version (currently 1.0.2 or later) across the
PHP build system.
2024-02-14 13:52:01 +01:00
Ilija Tovilo
c149b4f56f
Fix missing syntax error message in cli-server router script
Fixes GH-13113
Closes GH-13275
2024-02-07 16:13:08 +01:00
Niels Dossche
2b629f0e0b Merge branch 'PHP-8.3'
* PHP-8.3:
  ext/curl: Fix failing tests due to string changes in libcurl 8.6.0
2024-01-31 21:59:06 +01:00
Niels Dossche
7e3a6a1b42 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  ext/curl: Fix failing tests due to string changes in libcurl 8.6.0
2024-01-31 21:58:59 +01:00
Ayesh Karunaratne
404803577d ext/curl: Fix failing tests due to string changes in libcurl 8.6.0
Upstream libcurl 8.6.0 contains a change[^1] that caused a test failure.
This fixes it by updating the test's `EXPECTF` to use a regex to account for both string patterns.

[^1]: 45cf4755e7 (diff-a8a54563608f8155973318f4ddb61d7328dab512b8ff2b5cc48cc76979d4204cL1683)

Closes GH-13293.
2024-01-31 21:58:27 +01:00
Ayesh Karunaratne
edb9f65f16
ext/curl: Bump minimum Curl version to >= 7.61.0 (#13259)
Bumps the minimum required libcurl version to 7.61.0.

Please also see #4917, which bumped minimum libcurl version to the current >= 7.29.0.
This bumps the minimum requirement to Curl 7.61.0 (released 2018 Sept).

Ubuntu, Debian, RHEL, and RHEL derivatives have major and LTS version bumps this year. Following are the
libcurl-dev/libcurl-devel versions available in the oldest supported (LTS or otherwise) in major OSs.

 - Debian buster: [7.64](https://packages.debian.org/buster/libcurl4-openssl-dev)
 - Ubuntu 20.04: [7.68](https://packages.ubuntu.com/focal/libcurl-dev)
 - CentOS/RHEL 7: 7.29
 - RHEL 8/Rocky 8/EL 8: 7.61
 - Fedora 38: 7.87

RHEL/CentOS 7 reaches EOL mid 2024, so for PHP 8.4 scheduled towards the end of this year, we can safely
bump the minimum libcurl version.

7.61.0 was selected as the new minimum because RHEL and derivatives have libcurl-devel version 7.61. RHEL 8 is
a current and supported RHEL version.
2024-01-31 13:48:17 +00:00
Ayesh Karunaratne
e30c11f599
ext/curl: Update sync_constants.php const matching to uncover more constants (#13282)
The `sync_constants.php` file uncovers constants present in libcurl source, but\
not present in PHP ext/curl source. There is a regular expression to match
Curl constants, but to it did not previously include `CURLE_*` and `CURLINFO_*`
constants, which PHP should expose as constants.

This updates the `sync_constants.php` file's constant filter regex to expose those
constants patterns as well. The new missing constants will be added in a later PR.
2024-01-31 13:36:23 +00:00
Ayesh Karunaratne
ec0044129a ext/curl: Fix sync-constants script
The Curl doc page that was used to check the constants was changed from `<pre></pre>` tags to an HTML page.
This updates the regexps to account for the changes, the Cthulu way.

 - New: https://curl.se/libcurl/c/symbols-in-versions.html
 - Old: https://web.archive.org/web/20231201000000*/https://curl.se/libcurl/c/symbols-in-versions.html
 - Change in curl-www: 2baba5ed45
2024-01-21 08:23:03 +01:00
divinity76
822769f412
missing SKIP_ONLINE_TESTS (#13155)
* missing SKIP_ONLINE_TESTS

gethostbynamel may contact DNS servers, so it should be skipped if SKIP_ONLINE_TESTS , and on a AMD Ryzen 9 7950x WSL Ubuntu this test took ~2 seconds (some DNS timeout i guess?) so it should also have SKIP_SLOW_TESTS

* error message nitpick
2024-01-17 11:11:21 +01:00
Niels Dossche
92d53c8ba0 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix missing error check in curl_multi_init()
2024-01-16 19:36:09 +01:00
Niels Dossche
83c8d02602 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix missing error check in curl_multi_init()
2024-01-16 19:36:03 +01:00
divinity76
9814d4a191 Fix missing error check in curl_multi_init()
Closes GH-13157.
2024-01-16 19:35:36 +01:00
hanshenrik
fc16285538 ext/curl: deprecate CURLOPT_BINARYTRANSFER
This is long overdue, CURLOPT_BINARYTRANSFER has been a no-op since PHP5.1.2 in 2004 (ref https://bugs.php.net/bug.php?id=55635 )

Close GH-13114.
2024-01-10 18:16:52 +00:00
Ilija Tovilo
c5c189da34
Merge branch 'PHP-8.3'
* PHP-8.3:
  [skip ci] Skip intermittently failing curl test on macOS
2023-12-08 13:38:54 +01:00
Ilija Tovilo
1c39cdd63e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Skip intermittently failing curl test on macOS
2023-12-08 13:38:48 +01:00
Ilija Tovilo
1b5a159183
[skip ci] Skip intermittently failing curl test on macOS
The test fails with "CURL ERROR: 56". I will create an issue for it shortly.
2023-12-08 13:36:52 +01:00
Ayesh Karunaratne
3a04532a94
[skip ci] curl: sync-constants.php regex and URL improvements (#12544)
- Updates the URL of Curl constant page from `https://curl.haxx.se/libcurl/c/symbols-in-versions.html`
   to `https://curl.se/libcurl/c/symbols-in-versions.html`.

 - Fixes the regex used to filter constants to match `CURL_HTTP` constants.

Related: GH-12543
2023-10-28 13:38:39 +01:00
Ilija Tovilo
f39b5c4c25
Close PHP tags in tests
Closes GH-12422
2023-10-18 17:34:10 +02:00
Ilija Tovilo
2b2d2b04e7
Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix EXPECT for bug52820.phpt on newer curl versions
  Fix curl_basic_009.phpt for newer curl versions
2023-08-10 15:52:21 +02:00
Ilija Tovilo
1aae59cf43
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix EXPECT for bug52820.phpt on newer curl versions
  Fix curl_basic_009.phpt for newer curl versions
2023-08-10 15:52:14 +02:00
Ilija Tovilo
0e843c5d82
Fix EXPECT for bug52820.phpt on newer curl versions
New curl versions have a "processing: url" line. The connection number in
"Closing connection" is apparently also dropped.
2023-08-10 15:51:53 +02:00
Ilija Tovilo
3af76b2302
Fix curl_basic_009.phpt for newer curl versions 2023-08-10 15:51:49 +02:00
Niels Dossche
de60872cfd
Add new curl constants from curl until (including) 7.87 (#10459)
Fixes GH-10454
2023-07-17 20:42:39 +02:00
Niels Dossche
7c5a57077a Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix return value of _php_server_push_callback in case of failure
2023-07-09 01:09:56 +02:00
Niels Dossche
e25e14ad95 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix return value of _php_server_push_callback in case of failure
2023-07-09 01:09:50 +02:00
Niels Dossche
dc9adda653 Fix return value of _php_server_push_callback in case of failure
It should return CURL_PUSH_DENY by default instead of CURL_PUSH_OK in
the branch I added, just like the check above.
I forgot to change this after doing tests.
2023-07-09 01:08:34 +02:00
Niels Dossche
46a0d043b5 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix crash when an invalid callback function is passed to CURLMOPT_PUSHFUNCTION
2023-07-08 21:44:26 +02:00
Niels Dossche
d0c824cb7e Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix crash when an invalid callback function is passed to CURLMOPT_PUSHFUNCTION
2023-07-08 21:39:17 +02:00
Niels Dossche
3ccd8d7866 Fix crash when an invalid callback function is passed to CURLMOPT_PUSHFUNCTION
Previously this caused a SIGABRT.

Closes GH-11639.
2023-07-08 21:32:10 +02:00
Ilija Tovilo
7e57e108f9
Merge branch 'PHP-8.2'
* PHP-8.2:
  tests(ext-curl): fix HTTP/2 Server Push tests
2023-07-07 10:38:55 +02:00
Ilija Tovilo
30a80b8e41
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  tests(ext-curl): fix HTTP/2 Server Push tests
2023-07-07 10:38:48 +02:00
Kévin Dunglas
47d478806a
tests(ext-curl): fix HTTP/2 Server Push tests
Closes GH-10669
2023-07-07 10:38:26 +02:00
nielsdos
18f2f0a0ab Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-11433: Unable to set CURLOPT_ACCEPT_ENCODING to NULL
  Fix "invalid state error" with cloned namespace declarations
  Fix lifetime issue with getAttributeNodeNS()
2023-06-13 17:38:04 +02:00
nielsdos
c160693515 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11433: Unable to set CURLOPT_ACCEPT_ENCODING to NULL
  Fix "invalid state error" with cloned namespace declarations
  Fix lifetime issue with getAttributeNodeNS()
2023-06-13 17:35:16 +02:00
nielsdos
a8a3b99e00 Fix GH-11433: Unable to set CURLOPT_ACCEPT_ENCODING to NULL
Closes GH-11446.
2023-06-13 17:30:57 +02:00
George Peter Banyard
d5ad75108e
More usage of known zend_str instead of C string (#11381) 2023-06-08 13:03:29 +01:00
Ilija Tovilo
b22758d764
Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Add all conflict to curl
2023-04-19 16:24:23 +02:00
Ilija Tovilo
f948f79696
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Add all conflict to curl
2023-04-19 16:24:16 +02:00
Ilija Tovilo
af6b413691
[skip ci] Add all conflict to curl 2023-04-19 16:23:52 +02:00
Ilija Tovilo
49fd6306db
Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Skip bug45161.phpt on Windows
2023-04-13 13:21:18 +02:00
Ilija Tovilo
023e17a89d
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Skip bug45161.phpt on Windows
2023-04-13 13:20:45 +02:00
Ilija Tovilo
4b22c3e3ad
[skip ci] Skip bug45161.phpt on Windows
See GH-10753

The test is insanely slow on Windows and it's unclear why. It might be a curl
issue.
2023-04-13 13:19:52 +02:00
George Peter Banyard
ad997987dd
ext/curl: Protocol should be a case insensitive check (#11052)
Minor drive-by refactoring to use the new API
2023-04-11 11:45:05 +01:00
Niels Dossche
2ba3c999b9 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10928: PHP Build Failed - Test curl_version() basic functionality [ext/curl/tests/curl_version_basic_001.phpt]
2023-03-25 18:16:55 +01:00
Niels Dossche
a095203a03 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10928: PHP Build Failed - Test curl_version() basic functionality [ext/curl/tests/curl_version_basic_001.phpt]
2023-03-25 18:15:42 +01:00
Niels Dossche
8e620b4ecb Fix GH-10928: PHP Build Failed - Test curl_version() basic functionality [ext/curl/tests/curl_version_basic_001.phpt]
It's possible that curl was compiled without SSL, and/or without libz
support. In the case of the issue reporter it was without libz support.
This causes the test to fail because we expect a non-empty string.
Fix it by using %S instead of %s to allow empty strings.

Closes GH-10930.
2023-03-25 18:15:20 +01:00
Ilija Tovilo
7b4c7374c3
Merge branch 'PHP-8.2'
* PHP-8.2:
  ext/curl: suppress -Wdeprecated-declarations in curl_arginfo.h
2023-03-22 20:58:33 +01:00