Skip to content

Commit c4e92d0

Browse files
authored
Update the 'Using Yii with RoadRunner' section (#507)
1 parent ec250eb commit c4e92d0

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/guide/tutorial/using-yii-with-roadrunner.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ That would download ready to use RoadRunner server `rr` binary.
2626
First, we need to configure the server itself. Create `/.rr.yaml` and add the following config:
2727

2828
```yaml
29+
version: '3'
30+
2931
server:
3032
command: "php worker.php"
31-
env:
32-
YII_ENV: prod
33-
YII_DEBUG: false
3433

3534
rpc:
3635
listen: tcp://127.0.0.1:6001
@@ -142,13 +141,19 @@ Create `/worker.php`:
142141
143142
declare(strict_types=1);
144143
145-
use Yiisoft\Yii\Runner\RoadRunner\RoadRunnerApplicationRunner;
144+
use App\Environment;
145+
use Yiisoft\Yii\Runner\RoadRunner\RoadRunnerHttpApplicationRunner;
146146
147147
ini_set('display_errors', 'stderr');
148148
149-
require_once __DIR__ . '/preload.php';
149+
require_once __DIR__ . '/src/bootstrap.php';
150150
151-
(new RoadRunnerApplicationRunner(__DIR__, $_ENV['YII_DEBUG'], $_ENV['YII_ENV']))->run();
151+
(new RoadRunnerHttpApplicationRunner(
152+
rootPath: __DIR__,
153+
debug: Environment::appDebug(),
154+
checkEvents: Environment::appDebug(),
155+
environment: Environment::appEnv()
156+
))->run();
152157
```
153158

154159
## Starting a server

0 commit comments

Comments
 (0)