Skip to content

Commit 5495030

Browse files
mpociotdixyes
authored andcommitted
Add PHP 8.4 fixes
1 parent 034ec9a commit 5495030

7 files changed

+101
-22
lines changed

patches/cli_checks_84.patch

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,6 @@ index 8d45b2ae41..35e9403a31 100644
6464
|| strcmp(sapi_module.name, "phpdbg") == 0);
6565

6666
if (!sapi_requires_preload_user) {
67-
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
68-
index ac0ad2c378..ac1381a4ee 100644
69-
--- a/ext/pcre/php_pcre.c
70-
+++ b/ext/pcre/php_pcre.c
71-
@@ -305,7 +305,7 @@ static PHP_GINIT_FUNCTION(pcre) /* {{{ */
72-
73-
/* If we're on the CLI SAPI, there will only be one request, so we don't need the
74-
* cache to survive after RSHUTDOWN. */
75-
- pcre_globals->per_request_cache = strcmp(sapi_module.name, "cli") == 0;
76-
+ pcre_globals->per_request_cache = strcmp(sapi_module.name, "cli") == 0 || strcmp(sapi_module.name, "micro") == 0;
77-
if (!pcre_globals->per_request_cache) {
78-
zend_hash_init(&pcre_globals->pcre_cache, 0, NULL, php_free_pcre_cache, 1);
79-
}
8067
diff --git a/ext/pdo_sqlite/pdo_sqlite.c b/ext/pdo_sqlite/pdo_sqlite.c
8168
index 49a477998b..18fe71cce4 100644
8269
--- a/ext/pdo_sqlite/pdo_sqlite.c
File renamed without changes.

patches/macos_iconv_81.patch

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/build/php.m4 b/build/php.m4
2+
index 01b8250598..0a8c5fba53 100644
3+
--- a/build/php.m4
4+
+++ b/build/php.m4
5+
@@ -1963,9 +1963,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
6+
7+
dnl Check libc first if no path is provided in --with-iconv.
8+
if test "$PHP_ICONV" = "yes"; then
9+
- dnl Reset LIBS temporarily as it may have already been included -liconv in.
10+
- LIBS_save="$LIBS"
11+
- LIBS=
12+
+ LIBS="$LIBS -liconv"
13+
AC_CHECK_FUNC(iconv, [
14+
found_iconv=yes
15+
],[
16+
@@ -1974,7 +1972,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
17+
found_iconv=yes
18+
])
19+
])
20+
- LIBS="$LIBS_save"
21+
fi
22+
23+
dnl Check external libs for iconv funcs.

patches/macos_iconv_82.patch

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/build/php.m4 b/build/php.m4
2+
index 01b8250598..0a8c5fba53 100644
3+
--- a/build/php.m4
4+
+++ b/build/php.m4
5+
@@ -1963,9 +1963,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
6+
7+
dnl Check libc first if no path is provided in --with-iconv.
8+
if test "$PHP_ICONV" = "yes"; then
9+
- dnl Reset LIBS temporarily as it may have already been included -liconv in.
10+
- LIBS_save="$LIBS"
11+
- LIBS=
12+
+ LIBS="$LIBS -liconv"
13+
AC_CHECK_FUNC(iconv, [
14+
found_iconv=yes
15+
],[
16+
@@ -1974,7 +1972,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
17+
found_iconv=yes
18+
])
19+
])
20+
- LIBS="$LIBS_save"
21+
fi
22+
23+
dnl Check external libs for iconv funcs.

patches/macos_iconv_83.patch

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/build/php.m4 b/build/php.m4
2+
index 01b8250598..0a8c5fba53 100644
3+
--- a/build/php.m4
4+
+++ b/build/php.m4
5+
@@ -1963,9 +1963,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
6+
7+
dnl Check libc first if no path is provided in --with-iconv.
8+
if test "$PHP_ICONV" = "yes"; then
9+
- dnl Reset LIBS temporarily as it may have already been included -liconv in.
10+
- LIBS_save="$LIBS"
11+
- LIBS=
12+
+ LIBS="$LIBS -liconv"
13+
AC_CHECK_FUNC(iconv, [
14+
found_iconv=yes
15+
],[
16+
@@ -1974,7 +1972,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
17+
found_iconv=yes
18+
])
19+
])
20+
- LIBS="$LIBS_save"
21+
fi
22+
23+
dnl Check external libs for iconv funcs.

patches/macos_iconv_84.patch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/build/php.m4 b/build/php.m4
2+
index e45b22b766..506be904f1 100644
3+
--- a/build/php.m4
4+
+++ b/build/php.m4
5+
@@ -1821,15 +1821,12 @@ AC_DEFUN([PHP_SETUP_ICONV], [
6+
7+
dnl Check libc first if no path is provided in --with-iconv.
8+
AS_VAR_IF([PHP_ICONV], [yes], [
9+
- dnl Reset LIBS temporarily as it may have already been included -liconv in.
10+
- LIBS_save=$LIBS
11+
- LIBS=
12+
+ LIBS="$LIBS -liconv"
13+
AC_CHECK_FUNC([iconv], [found_iconv=yes],
14+
[AC_CHECK_FUNC([libiconv], [
15+
AC_DEFINE([HAVE_LIBICONV], [1])
16+
found_iconv=yes
17+
])])
18+
- LIBS=$LIBS_save
19+
])
20+
21+
dnl Check external libs for iconv funcs.

patches/static_extensions_win32_84.patch

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,23 @@ index c7d897c1ca..d6f7cec5e2 100644
1111
ADD_SOURCES(configure_module_dirname + '\\libmagic', LIBMAGIC_SOURCES, "fileinfo");
1212
}
1313
diff --git a/ext/openssl/config.w32 b/ext/openssl/config.w32
14-
index 76e3079e50..b6fd2c7755 100644
14+
index 24064ec2a5..87ff31618c 100644
1515
--- a/ext/openssl/config.w32
1616
+++ b/ext/openssl/config.w32
17-
@@ -1,12 +1,12 @@
17+
@@ -1,6 +1,6 @@
1818
// vim:ft=javascript
1919

2020
-ARG_WITH("openssl", "OpenSSL support", "no,shared");
2121
+ARG_WITH("openssl", "OpenSSL support", "no");
2222

23-
if (PHP_OPENSSL != "no") {
23+
ARG_WITH("openssl-legacy-provider", "OPENSSL: Load legacy algorithm provider in addition to default provider", "no");
24+
25+
@@ -10,7 +10,7 @@ if (PHP_OPENSSL != "no") {
2426
var ret = SETUP_OPENSSL("openssl", PHP_OPENSSL);
2527

26-
if (ret > 0) {
27-
- EXTENSION("openssl", "openssl.c xp_ssl.c");
28-
+ EXTENSION("openssl", "openssl.c xp_ssl.c", PHP_OPENSSL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
29-
AC_DEFINE("HAVE_OPENSSL_EXT", 1, "Define to 1 if the openssl extension is available.");
30-
}
31-
}
28+
if (ret >= 2) {
29+
- EXTENSION("openssl", "openssl.c openssl_pwhash.c xp_ssl.c");
30+
+ EXTENSION("openssl", "openssl.c openssl_pwhash.c xp_ssl.c", PHP_OPENSSL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
31+
AC_DEFINE("HAVE_OPENSSL_EXT", 1, "Define to 1 if the PHP extension 'openssl' is available.");
32+
if (PHP_OPENSSL_LEGACY_PROVIDER != "no") {
33+
AC_DEFINE("LOAD_OPENSSL_LEGACY_PROVIDER", 1, "Define to 1 to load the OpenSSL legacy algorithm provider in addition to the default provider.");

0 commit comments

Comments
 (0)