Commit graph

1406 commits

Author SHA1 Message Date
Peter Kokot
f66feaec0f
Sync HAVE_<extension> help texts (#15167)
This syncs all help texts of extension preprocessor macros to the same
style "Define to 1 if the PHP extension '<ext>' is available.".
[skip ci]
2024-08-02 01:41:47 +02:00
Christoph M. Becker
2d88427bc7
Merge branch 'PHP-8.3'
* PHP-8.3:
  Revert "Skip bug45161.phpt on Windows"
2024-07-18 12:44:27 +02:00
Christoph M. Becker
fc93300407
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Revert "Skip bug45161.phpt on Windows"
2024-07-18 12:43:35 +02:00
Christoph M. Becker
355baf982e
Revert "Skip bug45161.phpt on Windows"
This reverts commit 4b22c3e3ad.

As quick measure for GH-10753, that test was skipped on Windows.
However, it seems that there are no longer performance issues with
newer cURL versions, so we run that test again on Windows.

Fixes GH-10753.
Closes GH-14998.
2024-07-18 12:42:01 +02:00
David Carlier
223683dfb5
Merge branch 'PHP-8.3' 2024-07-18 06:26:54 +01:00
David Carlier
383d1b0330
Merge branch 'PHP-8.2' into PHP-8.3 2024-07-18 06:26:22 +01:00
David Carlier
efd00b8ff0
ext/curl: curl_error using curl_easy_strerror if CURLOPT_ERRORBUFFER
did not fill the error buffer.

close GH-14984
2024-07-18 06:25:37 +01:00
Christoph M. Becker
f590b34530
Drop support for OpenSSL < 1.1.0 on Windows
PR #13498 bumped the required OpenSSL version to 1.1.1, but apparently
only for non Windows system.  We catch up somewhat by dropping support
for OpenSSL < 1.1.0 on Windows; besides completely removing detection
of old OpenSSL versions in `SETUP_OPENSSL`, we also ensure that all
bundled extension using this function do no longer accept OpenSSL <
1.1.0, to avoid to still be able to build these extensions with older
`phpize` scripts.

We do not cater to `--phar-native-ssl` yet; that might better be
addressed by #14578.

Closes GH-14973.
2024-07-17 12:22:59 +02:00
Peter Kokot
09d61b6368
Autotools: Refactor curl config.m4 (#14948)
- CS synced
- When checking for libcurl linked against old OpenSSL the LIBS can be
  used instead of LDFLAGS to put -lcurl to proper place. Also, flags
  manipulation variables are wrapped in the AC_CACHE_CHECK commands
  because there is also OpenSSL setup done later in the code which
  changes LDFLAGS, LIBS and/or CFLAGS.
- CFLAGS added to the check to have edge case of -I flags of custom
  installation paths taken into consideration
- All macro arguments quoted
- SSL check simplified a bit
- The HAVE_CURL symbol help text synced
2024-07-14 03:55:23 +02:00
Peter Kokot
42530c6543
Remove unused SMART_STR_PREALLOC (#14848) 2024-07-07 01:04:53 +02:00
Niels Dossche
bcfdf10686
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13688: Test curl_basic_008 can fail (#13693)
2024-07-04 18:09:16 +02:00
Niels Dossche
9e476775e2
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13688: Test curl_basic_008 can fail (#13693)
2024-07-04 18:09:09 +02:00
Niels Dossche
39ed9993f7
Fix GH-13688: Test curl_basic_008 can fail (#13693)
.invalid is a reserved TLD that should never be caught.
2024-07-04 18:07:54 +02:00
Peter Kokot
bee84c0468
Autotools: Quote PHP_SUBST arguments in extensions (#14748) 2024-07-02 06:56:18 +02:00
Arnaud Le Blanc
11accb5cdf
Preferably include from build dir (#13516)
* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

    -I$(top_builddir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/main
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM
    -I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

    -I$(top_builddir)/main
    -I$(top_builddir)
    -I$(top_srcdir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.
2024-06-26 00:26:43 +02:00
Niels Dossche
7e2d47d2b8 curl: change uses of sprintf into snprintf 2024-06-14 08:12:03 -07:00
Peter Kokot
5433f02e79
Use default argument in AS_CASE instead of pattern 2024-06-11 11:26:52 +02:00
Peter Kokot
9dbcb91152
Refactor check for libcurl linkage with OpenSSL < 1.1 (#14319)
- One excessive AC_MSG_RESULT removed
- AC_RUN_IFELSE wrapped in AC_CACHE_CHECK for easier cross-compiling
  edge cases
- Check wrapped in the thread safety condition since this is relevant
  only when ZTS is enabled
2024-06-08 17:59:59 +02:00
Gina Peter Banyard
bb2fae1ffc ext/curl: Fix [-Wsign-compare] warning 2024-06-06 16:18:23 +01:00
Niels Dossche
9ad17791c6
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14307: Test curl_basic_024 fails with curl 8.8.0
2024-05-24 14:42:50 +02:00
Niels Dossche
ae26dc11d1
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14307: Test curl_basic_024 fails with curl 8.8.0
2024-05-24 14:42:41 +02:00
Niels Dossche
a2c5b4ec05
Fix GH-14307: Test curl_basic_024 fails with curl 8.8.0
Curl changed the behaviour, from the changelog:
  - lib: make protocol handlers store scheme name lowercase curl/curl@c294f9c

From the docs: "The returned scheme might be upper or lowercase. Do
comparisons case insensitively."

Closes GH-14312.
2024-05-24 14:41:29 +02:00
Ilija Tovilo
d2a9edfee6
Callable curl options should be nullable
symfony/http-client/Response/CurlResponse.php depends on this behavior.

Closes GH-14165
2024-05-07 16:34:49 +02:00
Gina Peter Banyard
f4dbe2390d
ext/curl: Refactor cURL to only use FCC (#13291)
* ext/curl: Convert handlers.progress to just be a FCC

* ext/curl: Convert handlers.sshhostkey to just be a FCC

* ext/curl: Convert handlers.xferinfo to just be a FCC

* ext/curl: Convert handlers.fnmatch to just be a FCC

* ext/curl: Convert handlers.server_push to just be a FCC

* ext/curl: Convert php_curl_write to just use FCC without a function name zval

* ext/curl: Convert php_curl_read to just use FCC without a function name zval

* ext/curl: Remove workaround for old libcurl

* ext/curl: Create macros to codegen the handling of callable options
2024-05-01 15:09:11 +01:00
David Carlier
f2f656c97e CI: update freebsd 13 image.
13.2 is going to be EOL.

close GH-13622
2024-03-19 22:36:33 +00:00
David Carlier
f2ec6e4806 Merge branch 'PHP-8.2' into PHP-8.3 2024-03-19 22:35:18 +00:00
David Carlier
db063cb771 CI: update freebsd 13 image.
13.2 is going to be EOL.

close GH-13622
2024-03-19 22:34:56 +00:00
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