Skip to content

Commit

Permalink
Support PHP 8.2 (#62)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
huangdijia and huangdijia authored Apr 28, 2023
1 parent 76de10e commit f8ad497
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest ]
php: [ '8.0', '8.1' ]
php: [ '8.0', '8.1', '8.2' ]
engine: [ 'swoole' ]
swoole: [ 'v4.6.7', 'v4.7.1', 'v4.8.11', 'master' ]
swoole: [ 'v4.6.7', 'v4.7.1', 'v4.8.12', 'v5.0.3', 'master' ]
exclude:
- php: '8.1'
swoole: 'v4.6.7'
- php: '8.1'
swoole: 'v4.7.1'
- php: '8.2'
swoole: 'v4.6.7'
- php: '8.2'
swoole: 'v4.7.1'
- php: '8.2'
swoole: 'v4.8.12'
max-parallel: 16
steps:
- name: Checkout
Expand All @@ -31,20 +37,28 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: phpize
extensions: redis, pdo, pdo_mysql, bcmath
ini-values: opcache.enable_cli=0, swoole.use_shortname='Off'
coverage: none
- name: Setup Swoole
if: ${{ matrix.engine == 'swoole' }}
run: |
sudo apt-get clean
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
sudo apt-get upgrade -f
sudo apt-get install libcurl4-openssl-dev libc-ares-dev libpq-dev
wget https://github.com/swoole/swoole-src/archive/${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz
mkdir -p swoole
tar -xf swoole.tar.gz -C swoole --strip-components=1
rm swoole.tar.gz
cd swoole
phpize
./configure --enable-openssl --enable-http2 --enable-swoole-curl --enable-swoole-json
if [ _${{ matrix.sw-version }} = '_v5.0.3' ] || [ _${{ matrix.sw-version }} = '_master' ]
then
./configure --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql --enable-brotli
else
./configure --enable-openssl --enable-http2 --enable-swoole-curl --enable-swoole-json
fi
make -j$(nproc)
sudo make install
sudo sh -c "echo extension=swoole > /etc/php/${{ matrix.php }}/cli/conf.d/swoole.ini"
Expand Down
1 change: 1 addition & 0 deletions example/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function bar(): string
$app = AppFactory::createBase('0.0.0.0', 9501, [
FooInterface::class => Foo::class,
]);

$app->config([
'server' => [
'settings' => [
Expand Down

0 comments on commit f8ad497

Please sign in to comment.