Skip to content

Commit f8ad497

Browse files
authored
Support PHP 8.2 (#62)
* Support PHP 8.2 * ⚙️ chore(dependencies) upgrade swoole to v4.8.12 for PHP v8.2 * ⚙️chore(workflows): add PHPUnit-Swow YAML configuration file * 🛠️refactor(workflow): rename server script in test-swow.yml * 🛠️refactor(example): rename swow.php to index.php in start command * 🛠️refactor(index.php) define SWOOLE_HOOK_ALL constant for swow fix * ⚙️ chore(dependencies): upgrade composer packages and add Hyperf Swow Engine support * 🛠️refactor(example) update index.php to support Swow hook * ⚙️chore(swow) update routes and add middleware * ⚙️ chore(test-swow): update engine environment variable in example * ⚙️ chore(test-swow.yml): update server run command * ⚙️chore(workflow): remove test-swow.yml * 🛠️refactor(app): simplify server creation in index.php * ⚙️chore(example) remove unused routes and middleware --------- Co-authored-by: Deeka Wong <[email protected]>
1 parent 76de10e commit f8ad497

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ ubuntu-latest ]
17-
php: [ '8.0', '8.1' ]
17+
php: [ '8.0', '8.1', '8.2' ]
1818
engine: [ 'swoole' ]
19-
swoole: [ 'v4.6.7', 'v4.7.1', 'v4.8.11', 'master' ]
19+
swoole: [ 'v4.6.7', 'v4.7.1', 'v4.8.12', 'v5.0.3', 'master' ]
2020
exclude:
2121
- php: '8.1'
2222
swoole: 'v4.6.7'
2323
- php: '8.1'
2424
swoole: 'v4.7.1'
25+
- php: '8.2'
26+
swoole: 'v4.6.7'
27+
- php: '8.2'
28+
swoole: 'v4.7.1'
29+
- php: '8.2'
30+
swoole: 'v4.8.12'
2531
max-parallel: 16
2632
steps:
2733
- name: Checkout
@@ -31,20 +37,28 @@ jobs:
3137
with:
3238
php-version: ${{ matrix.php }}
3339
tools: phpize
40+
extensions: redis, pdo, pdo_mysql, bcmath
3441
ini-values: opcache.enable_cli=0, swoole.use_shortname='Off'
3542
coverage: none
3643
- name: Setup Swoole
3744
if: ${{ matrix.engine == 'swoole' }}
3845
run: |
46+
sudo apt-get clean
3947
sudo apt-get update
40-
sudo apt-get install libcurl4-openssl-dev
48+
sudo apt-get upgrade -f
49+
sudo apt-get install libcurl4-openssl-dev libc-ares-dev libpq-dev
4150
wget https://github.com/swoole/swoole-src/archive/${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz
4251
mkdir -p swoole
4352
tar -xf swoole.tar.gz -C swoole --strip-components=1
4453
rm swoole.tar.gz
4554
cd swoole
4655
phpize
47-
./configure --enable-openssl --enable-http2 --enable-swoole-curl --enable-swoole-json
56+
if [ _${{ matrix.sw-version }} = '_v5.0.3' ] || [ _${{ matrix.sw-version }} = '_master' ]
57+
then
58+
./configure --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql --enable-brotli
59+
else
60+
./configure --enable-openssl --enable-http2 --enable-swoole-curl --enable-swoole-json
61+
fi
4862
make -j$(nproc)
4963
sudo make install
5064
sudo sh -c "echo extension=swoole > /etc/php/${{ matrix.php }}/cli/conf.d/swoole.ini"

example/index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function bar(): string
3939
$app = AppFactory::createBase('0.0.0.0', 9501, [
4040
FooInterface::class => Foo::class,
4141
]);
42+
4243
$app->config([
4344
'server' => [
4445
'settings' => [

0 commit comments

Comments
 (0)