Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.0] Compatible with PHP 8.4 (PDO) #5483

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1070,31 +1070,42 @@ EOF
thirdparty/php81/pdo_pgsql/pgsql_driver.c \
thirdparty/php81/pdo_pgsql/pgsql_statement.c \
thirdparty/php83/pdo_pgsql/pgsql_driver.c \
thirdparty/php83/pdo_pgsql/pgsql_statement.c"
thirdparty/php83/pdo_pgsql/pgsql_statement.c \
thirdparty/php83/pdo_pgsql/pgsql_statement.c \
thirdparty/php84/pdo_pgsql/pgsql_driver.c \
thirdparty/php84/pdo_pgsql/pgsql_statement.c \
thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c"
fi

if test "$PHP_SWOOLE_ORACLE" != "no"; then
swoole_source_file="$swoole_source_file \
thirdparty/php81/pdo_oci/oci_driver.c \
thirdparty/php81/pdo_oci/oci_statement.c \
thirdparty/php83/pdo_oci/oci_driver.c \
thirdparty/php83/pdo_oci/oci_statement.c"
thirdparty/php83/pdo_oci/oci_statement.c \
thirdparty/php84/pdo_oci/oci_driver.c \
thirdparty/php84/pdo_oci/oci_statement.c"
fi

if test "$PHP_SWOOLE_ODBC" != "no"; then
swoole_source_file="$swoole_source_file \
thirdparty/php81/pdo_odbc/odbc_driver.c \
thirdparty/php81/pdo_odbc/odbc_stmt.c \
thirdparty/php83/pdo_odbc/odbc_driver.c \
thirdparty/php83/pdo_odbc/odbc_stmt.c"
thirdparty/php83/pdo_odbc/odbc_stmt.c \
thirdparty/php84/pdo_odbc/odbc_driver.c \
thirdparty/php84/pdo_odbc/odbc_stmt.c"
fi

if test "$PHP_SWOOLE_SQLITE" != "no"; then
swoole_source_file="$swoole_source_file \
thirdparty/php81/pdo_sqlite/sqlite_driver.c \
thirdparty/php81/pdo_sqlite/sqlite_statement.c \
thirdparty/php83/pdo_sqlite/sqlite_driver.c \
thirdparty/php83/pdo_sqlite/sqlite_statement.c"
thirdparty/php83/pdo_sqlite/sqlite_statement.c \
thirdparty/php84/pdo_sqlite/sqlite_driver.c \
thirdparty/php84/pdo_sqlite/sqlite_statement.c \
thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c"
fi

SW_ASM_DIR="thirdparty/boost/asm/"
Expand Down Expand Up @@ -1255,17 +1266,21 @@ EOF
if test "$PHP_SWOOLE_PGSQL" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php81/pdo_pgsql)
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php83/pdo_pgsql)
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php84/pdo_pgsql)
fi
if test "$PHP_SWOOLE_ODBC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php81/pdo_odbc)
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php83/pdo_odbc)
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php84/pdo_odbc)
fi
if test "$PHP_SWOOLE_ORACLE" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php81/pdo_oci)
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php83/pdo_oci)
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php84/pdo_oci)
fi
if test "$PHP_SWOOLE_SQLITE" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php81/pdo_sqlite)
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php83/pdo_sqlite)
PHP_ADD_BUILD_DIR($ext_builddir/thirdparty/php84/pdo_sqlite)
fi
fi
10 changes: 10 additions & 0 deletions ext-src/php_swoole_odbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ BEGIN_EXTERN_C()

#include "ext/pdo/php_pdo_driver.h"

#if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80100
#include "thirdparty/php80/pdo_odbc/php_pdo_odbc_int.h"
#elif PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80200
#include "thirdparty/php81/pdo_odbc/php_pdo_odbc_int.h"
#elif PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80300
#include "thirdparty/php81/pdo_odbc/php_pdo_odbc_int.h"
#elif PHP_VERSION_ID >= 80300 && PHP_VERSION_ID < 80400
#include "thirdparty/php83/pdo_odbc/php_pdo_odbc_int.h"
#else
#include "thirdparty/php84/pdo_odbc/php_pdo_odbc_int.h"
#endif

extern const pdo_driver_t swoole_pdo_odbc_driver;

Expand Down
11 changes: 11 additions & 0 deletions ext-src/php_swoole_oracle.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,18 @@
BEGIN_EXTERN_C()

#include "ext/pdo/php_pdo_driver.h"

#if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80100
#include "thirdparty/php80/pdo_oci/php_pdo_oci_int.h"
#elif PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80200
#include "thirdparty/php81/pdo_oci/php_pdo_oci_int.h"
#elif PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80300
#include "thirdparty/php81/pdo_oci/php_pdo_oci_int.h"
#elif PHP_VERSION_ID >= 80300 && PHP_VERSION_ID < 80400
#include "thirdparty/php83/pdo_oci/php_pdo_oci_int.h"
#else
#include "thirdparty/php84/pdo_oci/php_pdo_oci_int.h"
#endif

extern const pdo_driver_t swoole_pdo_oci_driver;

Expand Down
13 changes: 13 additions & 0 deletions ext-src/php_swoole_pgsql.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ BEGIN_EXTERN_C()

#include "ext/pdo/php_pdo_driver.h"

#if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80100
#include "thirdparty/php80/pdo_pgsql/php_pdo_pgsql_int.h"
#elif PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80200
#include "thirdparty/php81/pdo_pgsql/php_pdo_pgsql_int.h"
#elif PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80300
#include "thirdparty/php81/pdo_pgsql/php_pdo_pgsql_int.h"
#elif PHP_VERSION_ID >= 80300 && PHP_VERSION_ID < 80400
#include "thirdparty/php83/pdo_pgsql/php_pdo_pgsql_int.h"
#else
#include "thirdparty/php84/pdo_pgsql/php_pdo_pgsql_int.h"
#endif


extern const pdo_driver_t swoole_pdo_pgsql_driver;

#include <libpq-fe.h>
Expand Down
11 changes: 11 additions & 0 deletions ext-src/php_swoole_sqlite.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@
BEGIN_EXTERN_C()

#include "ext/pdo/php_pdo_driver.h"

#if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80100
#include "thirdparty/php80/pdo_sqlite/php_pdo_sqlite_int.h"
#elif PHP_VERSION_ID >= 80100 && PHP_VERSION_ID < 80200
#include "thirdparty/php81/pdo_sqlite/php_pdo_sqlite_int.h"
#elif PHP_VERSION_ID >= 80200 && PHP_VERSION_ID < 80300
#include "thirdparty/php81/pdo_sqlite/php_pdo_sqlite_int.h"
#elif PHP_VERSION_ID >= 80300 && PHP_VERSION_ID < 80400
#include "thirdparty/php83/pdo_sqlite/php_pdo_sqlite_int.h"
#else
#include "thirdparty/php84/pdo_sqlite/php_pdo_sqlite_int.h"
#endif

extern const pdo_driver_t swoole_pdo_sqlite_driver;
void swoole_sqlite_set_blocking(bool blocking);
Expand Down
1 change: 0 additions & 1 deletion ext-src/swoole_pgsql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "swoole_coroutine_system.h"

#ifdef SW_USE_PGSQL
#include "thirdparty/php81/pdo_pgsql/php_pdo_pgsql_int.h"

using swoole::Reactor;
using swoole::coroutine::Socket;
Expand Down
Loading
Loading