Skip to content

Commit f877883

Browse files
authored
Compatible with 8.5 (#5940)
1 parent cea04b2 commit f877883

File tree

92 files changed

+10308
-4469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+10308
-4469
lines changed

‎.github/workflows/ext.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ jobs:
7474
runs-on: ubuntu-latest
7575
strategy:
7676
matrix:
77-
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
77+
php-version: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
7878
max-parallel: 8
7979
fail-fast: false
80+
continue-on-error: ${{ matrix.php-version == '8.5' }}
8081
steps:
8182
- uses: actions/checkout@v6
8283
- name: build

‎.github/workflows/framework.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
php-version: [ '8.2', '8.3', '8.4' ]
14+
php-version: [ '8.2', '8.3', '8.4', '8.5' ]
1515
framework: [ 'Laravel Octane', 'Hyperf', 'Simps' ]
1616
name: ${{ matrix.framework }} - PHP ${{ matrix.php-version }}
1717
steps:
@@ -86,7 +86,7 @@ jobs:
8686
strategy:
8787
fail-fast: false
8888
matrix:
89-
php-version: [ '8.2', '8.3', '8.4' ]
89+
php-version: [ '8.2', '8.3', '8.4', '8.5' ]
9090
framework: [ 'Simps' ]
9191
name: ${{ matrix.framework }} - PHP ${{ matrix.php-version }} - macOS
9292
steps:

‎.github/workflows/iouring.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
php: [ '8.2', '8.3', '8.4' ]
11+
php: [ '8.2', '8.3', '8.4', '8.5' ]
1212
os: [ ubuntu-24.04, ubuntu-24.04-arm ]
1313
name: ${{ matrix.php }}-${{ matrix.os }}-iouring
1414
runs-on: ${{ matrix.os }}

‎.github/workflows/thread.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
php: ['8.2-zts', '8.3-zts', '8.4-zts']
12+
php: ['8.2-zts', '8.3-zts', '8.4-zts', '8.5-zts']
1313
os: [ ubuntu-24.04, ubuntu-24.04-arm ]
1414
name: ${{ matrix.php }}-thread-${{ matrix.os }}
1515
runs-on: ${{ matrix.os }}

‎.github/workflows/unit.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
php: ['8.2', '8.3', '8.4']
12+
php: ['8.2', '8.3', '8.4', '8.5']
1313
os: [ ubuntu-24.04, ubuntu-24.04-arm ]
1414
name: ${{ matrix.php }}-${{ matrix.os }}
1515
runs-on: ${{ matrix.os }}
@@ -50,7 +50,7 @@ jobs:
5050
strategy:
5151
fail-fast: false
5252
matrix:
53-
# php-version: [ '8.2', '8.3', '8.4' ]
53+
# php-version: [ '8.2', '8.3', '8.4', '8.5' ]
5454
php-version: [ '8.3' ]
5555
name: ${{ matrix.php-version }} - macOS
5656
steps:

‎config.m4‎

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,6 @@ EOF
10151015
dnl firebird stop
10161016

10171017

1018-
10191018
dnl ssh2 start
10201019

10211020
if test "$PHP_SWOOLE_SSH2" != "no"; then
@@ -1307,10 +1306,6 @@ EOF
13071306
swoole_source_file="${ext_src_files} ${lib_src_files}"
13081307

13091308
swoole_source_file="$swoole_source_file \
1310-
thirdparty/php/curl/interface.cc \
1311-
thirdparty/php/curl/multi.cc \
1312-
thirdparty/php84/curl/interface.cc \
1313-
thirdparty/php84/curl/multi.cc \
13141309
thirdparty/php/sockets/multicast.cc \
13151310
thirdparty/php/sockets/sendrecvmsg.cc \
13161311
thirdparty/php/sockets/conversions.cc \
@@ -1350,14 +1345,21 @@ EOF
13501345
fi
13511346

13521347
SW_PHP_VERSION_ID=`echo "${SW_PHP_VERSION}" | $AWK 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 10 + [$]2); }'`
1353-
1354-
if test "$SW_PHP_VERSION_ID" = "82"; then
1355-
SW_PHP_THIRDPARTY_DIR="thirdparty/php81"
1356-
else
1357-
SW_PHP_THIRDPARTY_DIR="thirdparty/php${SW_PHP_VERSION_ID}"
1358-
fi
1348+
SW_PHP_THIRDPARTY_DIR="thirdparty/php${SW_PHP_VERSION_ID}"
13591349

13601350
AC_MSG_NOTICE([php version: $SW_PHP_VERSION, version_id: $SW_PHP_VERSION_ID, thirdparty_dir: $SW_PHP_THIRDPARTY_DIR])
1351+
1352+
if test "$PHP_SWOOLE_CURL" != "no"; then
1353+
if test "$SW_PHP_VERSION_ID" -ge "84"; then
1354+
swoole_source_file="$swoole_source_file \
1355+
thirdparty/php84/curl/interface.cc \
1356+
thirdparty/php84/curl/multi.cc"
1357+
else
1358+
swoole_source_file="$swoole_source_file \
1359+
thirdparty/php/curl/interface.cc \
1360+
thirdparty/php/curl/multi.cc"
1361+
fi
1362+
fi
13611363

13621364
if test "$PHP_SWOOLE_PGSQL" != "no"; then
13631365
swoole_source_file="$swoole_source_file \
@@ -1371,10 +1373,10 @@ EOF
13711373

13721374
if test "$PHP_SWOOLE_ORACLE" != "no"; then
13731375
swoole_source_file="$swoole_source_file \
1374-
${SW_PHP_THIRDPARTY_DIR}/pdo_oci/oci_driver.c \
1375-
${SW_PHP_THIRDPARTY_DIR}/pdo_oci/oci_statement.c"
1376+
thirdparty/pdo_oci/oci_driver.c \
1377+
thirdparty/pdo_oci/oci_statement.c"
13761378
fi
1377-
1379+
13781380
if test "$PHP_SWOOLE_ODBC" != "no"; then
13791381
swoole_source_file="$swoole_source_file \
13801382
${SW_PHP_THIRDPARTY_DIR}/pdo_odbc/odbc_driver.c \
@@ -1392,10 +1394,17 @@ EOF
13921394
fi
13931395

13941396
if test "$PHP_SWOOLE_FIREBIRD" != "no"; then
1395-
swoole_source_file="$swoole_source_file \
1396-
thirdparty/php84/pdo_firebird/firebird_driver.c \
1397-
thirdparty/php84/pdo_firebird/firebird_statement.c \
1398-
thirdparty/php84/pdo_firebird/pdo_firebird_utils.cpp"
1397+
if test "$SW_PHP_VERSION_ID" -ge "85"; then
1398+
swoole_source_file="$swoole_source_file \
1399+
thirdparty/php85/pdo_firebird/firebird_driver.c \
1400+
thirdparty/php85/pdo_firebird/firebird_statement.c \
1401+
thirdparty/php85/pdo_firebird/pdo_firebird_utils.cpp"
1402+
else
1403+
swoole_source_file="$swoole_source_file \
1404+
thirdparty/php84/pdo_firebird/firebird_driver.c \
1405+
thirdparty/php84/pdo_firebird/firebird_statement.c \
1406+
thirdparty/php84/pdo_firebird/pdo_firebird_utils.cpp"
1407+
fi
13991408
fi
14001409

14011410
if test "$PHP_SWOOLE_SSH2" != "no"; then
@@ -1566,32 +1575,23 @@ EOF
15661575
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php/standard)
15671576
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php/curl)
15681577
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php/ssh2)
1578+
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/pdo_oci)
15691579
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php84/curl)
15701580
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php84/pdo_firebird)
1581+
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php85/pdo_firebird)
15711582
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/llhttp)
15721583

15731584
if test "$PHP_NGHTTP2_DIR" = "no"; then
15741585
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/nghttp2)
15751586
fi
15761587
if test "$PHP_SWOOLE_PGSQL" != "no"; then
1577-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php81/pdo_pgsql)
1578-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php83/pdo_pgsql)
1579-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php84/pdo_pgsql)
1588+
PHP_ADD_BUILD_DIR($ext_builddir/${SW_PHP_THIRDPARTY_DIR}/pdo_pgsql)
15801589
fi
15811590
if test "$PHP_SWOOLE_ODBC" != "no"; then
1582-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php81/pdo_odbc)
1583-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php83/pdo_odbc)
1584-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php84/pdo_odbc)
1585-
fi
1586-
if test "$PHP_SWOOLE_ORACLE" != "no"; then
1587-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php81/pdo_oci)
1588-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php83/pdo_oci)
1589-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php84/pdo_oci)
1591+
PHP_ADD_BUILD_DIR($ext_builddir/${SW_PHP_THIRDPARTY_DIR}/pdo_odbc)
15901592
fi
15911593
if test "$PHP_SWOOLE_SQLITE" != "no"; then
1592-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php81/pdo_sqlite)
1593-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php83/pdo_sqlite)
1594-
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php84/pdo_sqlite)
1594+
PHP_ADD_BUILD_DIR($ext_builddir/${SW_PHP_THIRDPARTY_DIR}/pdo_sqlite)
15951595
fi
15961596
if test "$PHP_SWOOLE_FTP" != "no"; then
15971597
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php84/ftp)

‎ext-src/php_swoole.cc‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ BEGIN_EXTERN_C()
4040
#endif
4141
END_EXTERN_C()
4242

43+
#include "swoole_coroutine.h"
4344
#include "swoole_mime_type.h"
4445
#include "swoole_server.h"
4546
#include "swoole_util.h"
@@ -368,17 +369,22 @@ static void php_swoole_init_globals(zend_swoole_globals *swoole_globals) {
368369
}
369370

370371
void php_swoole_register_shutdown_function(const char *function) {
371-
php_shutdown_function_entry shutdown_function_entry;
372372
#if PHP_VERSION_ID >= 80500
373-
zval function_name;
374-
memset(&shutdown_function_entry, 0, sizeof(php_shutdown_function_entry));
375-
ZVAL_STRING(&function_name, function);
376-
shutdown_function_entry.params = NULL;
377-
shutdown_function_entry.param_count = 0;
378-
register_user_shutdown_function(Z_STRVAL(function_name), Z_STRLEN(function_name), &shutdown_function_entry);
379-
zval_ptr_dtor(&function_name);
373+
php_shutdown_function_entry shutdown_function_entry = {
374+
.fci_cache = empty_fcall_info_cache,
375+
.params = NULL,
376+
.param_count = 0,
377+
};
378+
auto fn_len = strlen(function);
379+
auto fn_entry = (zend_function *) zend_hash_str_find_ptr(EG(function_table), function, fn_len);
380+
assert(fn_entry);
381+
shutdown_function_entry.fci_cache.function_handler = fn_entry;
382+
register_user_shutdown_function(function, fn_len, &shutdown_function_entry);
380383
#else
384+
php_shutdown_function_entry shutdown_function_entry;
381385
zval function_name;
386+
// In the user_shutdown_function_dtor function, the memory for the function name will be released,
387+
// so must not free it manually here.
382388
ZVAL_STRING(&function_name, function);
383389
zend_fcall_info_init(
384390
&function_name, 0, &shutdown_function_entry.fci, &shutdown_function_entry.fci_cache, nullptr, nullptr);

‎ext-src/php_swoole_firebird.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ BEGIN_EXTERN_C()
2626

2727
#include "ext/pdo/php_pdo_driver.h"
2828

29+
#if PHP_VERSION_ID < 80500
2930
#include "thirdparty/php84/pdo_firebird/php_pdo_firebird_int.h"
31+
#else
32+
#include "thirdparty/php85/pdo_firebird/php_pdo_firebird_int.h"
33+
#endif
3034

3135
extern const pdo_driver_t swoole_pdo_firebird_driver;
3236
void swoole_firebird_set_blocking(bool blocking);

‎ext-src/php_swoole_odbc.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ BEGIN_EXTERN_C()
2424

2525
#include "ext/pdo/php_pdo_driver.h"
2626

27-
#if PHP_VERSION_ID < 80200
28-
#include "thirdparty/php81/pdo_odbc/php_pdo_odbc_int.h"
29-
#elif PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80300
30-
#include "thirdparty/php81/pdo_odbc/php_pdo_odbc_int.h"
27+
#if PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80300
28+
#include "thirdparty/php82/pdo_odbc/php_pdo_odbc_int.h"
3129
#elif PHP_VERSION_ID >= 80300 && PHP_VERSION_ID < 80400
3230
#include "thirdparty/php83/pdo_odbc/php_pdo_odbc_int.h"
33-
#else
31+
#elif PHP_VERSION_ID >= 80400 && PHP_VERSION_ID < 80500
3432
#include "thirdparty/php84/pdo_odbc/php_pdo_odbc_int.h"
33+
#else
34+
#include "thirdparty/php85/pdo_odbc/php_pdo_odbc_int.h"
3535
#endif
3636

3737
extern const pdo_driver_t swoole_pdo_odbc_driver;

‎ext-src/php_swoole_oracle.h‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#ifndef PHP_SWOOLE_ORACLE_H
2020
#define PHP_SWOOLE_ORACLE_H
21+
2122
#include "php_swoole.h"
2223

2324
#ifdef SW_USE_ORACLE
@@ -26,17 +27,7 @@ BEGIN_EXTERN_C()
2627

2728
#include "ext/pdo/php_pdo_driver.h"
2829

29-
#if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80100
30-
#include "thirdparty/php80/pdo_oci/php_pdo_oci_int.h"
31-
#elif PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80200
32-
#include "thirdparty/php81/pdo_oci/php_pdo_oci_int.h"
33-
#elif PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80300
34-
#include "thirdparty/php81/pdo_oci/php_pdo_oci_int.h"
35-
#elif PHP_VERSION_ID >= 80300 && PHP_VERSION_ID < 80400
36-
#include "thirdparty/php83/pdo_oci/php_pdo_oci_int.h"
37-
#else
38-
#include "thirdparty/php84/pdo_oci/php_pdo_oci_int.h"
39-
#endif
30+
#include "thirdparty/pdo_oci/php_pdo_oci_int.h"
4031

4132
extern const pdo_driver_t swoole_pdo_oci_driver;
4233

0 commit comments

Comments
 (0)