Skip to content

Commit

Permalink
[5.1] Fix pgsql header version error (#5484)
Browse files Browse the repository at this point in the history
* fix pgsql header version error

* remove php8.4
  • Loading branch information
NathanFreeman authored Sep 23, 2024
1 parent 20add68 commit 620c7ac
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '8.0', '8.1', '8.2', '8.3', '8.4' ]
php-version: [ '8.0', '8.1', '8.2', '8.3' ]
framework: [ 'Laravel Octane', 'Hyperf', 'Simps', 'imi' ]
name: ${{ matrix.framework }} - PHP ${{ matrix.php-version }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2', '8.3', '8.4-dev']
php: ['8.0', '8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4
- name: Setup PHP
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/xdebug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2', '8.3', '8.4-dev']
php: ['8.0', '8.1', '8.2', '8.3']

name: PHP ${{ matrix.php }} - Swoole

Expand Down
12 changes: 12 additions & 0 deletions ext-src/php_swoole_pgsql.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +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_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
5 changes: 0 additions & 5 deletions ext-src/swoole_pgsql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@
#include "swoole_coroutine_system.h"

#ifdef SW_USE_PGSQL
#if PHP_VERSION_ID > 80100
#include "thirdparty/php81/pdo_pgsql/php_pdo_pgsql_int.h"
#else
#include "thirdparty/php80/pdo_pgsql/php_pdo_pgsql_int.h"
#endif

using swoole::Coroutine;
using swoole::Reactor;
Expand Down

0 comments on commit 620c7ac

Please sign in to comment.