razonyang / yii-runner-swoole
Yii web application runner for Swoole
dev-main
2022-09-17 08:09 UTC
Requires
- php: ^8.0
- razonyang/psr7-swoole: ^0.1.0
- yiisoft/yii-http: ^1.0
- yiisoft/yii-runner: ^1.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.11
- phpunit/phpunit: ^9.5
- swoole/ide-helper: ^5.0
This package is auto-updated.
Last update: 2024-11-17 13:09:27 UTC
README
The Swoole adapter for Yii Runner, built on top of Swoole coroutine.
Installation
composer require razonyang/yii-runner-swoole --prefer-dist
Entrypoint
<?php // server.php declare(strict_types=1); use RazonYang\Yii\Runner\Swoole\SwooleApplicationRunner; ini_set('display_errors', 'stderr'); require_once __DIR__ . '/autoload.php'; (new SwooleApplicationRunner(__DIR__, $_ENV['YII_DEBUG'], $_ENV['YII_ENV']))->run();
Start the server.
php server.php
Configuration
<?php declare(strict_types=1); return [ 'razonyang/yii-runner-swoole' => [ 'pool' => [ 'workerNumber' => 4, ], 'server' => [ 'host' => '0.0.0.0', 'port' => 9501, ], 'coroutine' => [ 'options' => [ // See https://wiki.swoole.com/#/coroutine/coroutine?id=set. // 'log_level' => SWOOLE_LOG_TRACE, // 'trace_flags' => SWOOLE_TRACE_ALL, ], ], ], ];