Skip to content
Open
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
26 changes: 23 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
php-versions: ['8.2', '8.3', '8.4']
symfony: ['6.3', '6.4', '7.0', '7.1', '7.2']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} with Symfony ${{ matrix.symfony }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -19,16 +20,35 @@ jobs:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
tools: composer:v2.5
extensions: swoole
extensions: swoole inotify

- name: Get Composer Cache Directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Update Symfony version
run: |
rm -rf composer.lock vendor
composer require symfony/console:${{ matrix.symfony }} \
symfony/dependency-injection:${{ matrix.symfony }} \
symfony/framework-bundle:${{ matrix.symfony }} \
symfony/http-kernel:${{ matrix.symfony }} \
symfony/runtime:${{ matrix.symfony }} \
symfony/http-foundation:${{ matrix.symfony }} \
--no-update --no-scripts

- name: Install Composer dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader

- name: Show installed packages
run: composer show

- name: Show php info
run: |
php -v
php -m

- name: Cache dependencies
uses: actions/cache@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
vendor
composer.lock
.phpunit.cache
/docker-compose.override.yaml
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
],
"require": {
"php": ">=8.2",
"symfony/console": "^6.3",
"symfony/dependency-injection": "^6.3",
"symfony/framework-bundle": "^6.3",
"symfony/http-foundation": "^6.3",
"symfony/http-kernel": "^6.3",
"symfony/runtime": "^6.3"
"symfony/console": "^6.3 | ^7.0",
"symfony/dependency-injection": "^6.3 | ^7.0",
"symfony/framework-bundle": "^6.3 | ^7.0",
"symfony/http-foundation": "^6.3 | ^7.0",
"symfony/http-kernel": "^6.3 | ^7.0",
"symfony/runtime": "^6.3 | ^7.0"
},
"require-dev": {
"mockery/mockery": "^1.6",
Expand All @@ -51,6 +51,6 @@
},
"scripts": {
"tests": "phpunit",
"analyze": "phpstan"
"analyze": "phpstan --memory-limit=-1"
}
}
13 changes: 13 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
swoole-8.2:
image: phpswoole/swoole:php8.2
volumes:
- ./:/app
swoole-8.3:
image: phpswoole/swoole:php8.3
volumes:
- ./:/app
swoole-8.4:
image: phpswoole/swoole:php8.4
volumes:
- ./:/app
4 changes: 2 additions & 2 deletions src/Kernel/SwooleKernelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ protected function initializeContainer(): void
{
parent::initializeContainer();

if ($this->server) {
if ($this->server && null !== $this->container) {
$this->container->set(
'swoolefony.server',
$this->server,
);
}
}

public function __wakeup()
public function __wakeup(): void
{
self::__construct(
$this->environment,
Expand Down
1 change: 1 addition & 0 deletions src/Server/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public function getStatus(): Status
phpPid: $this->options->shouldDaemonize() ? null : $this->pid,
port: $this->server()->port,
ip: $this->server()->host,
// @phpstan-ignore-next-line
stats: new Stats((array) $this->server()->stats())
);
}
Expand Down