https://github.com/bckp/roadrunner
https://github.com/bckp/roadrunner
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bckp/roadrunner
- Owner: bckp
- License: other
- Created: 2023-12-04T20:00:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-04T20:21:32.000Z (over 1 year ago)
- Last Synced: 2025-01-31T07:11:09.907Z (4 months ago)
- Language: PHP
- Size: 63.5 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: license.md
Awesome Lists containing this project
README
MallGroup/Roadrunner
======[](https://github.com/bckp/roadrunner/actions/workflows/main.yml)
[](https://coveralls.io/github/bckp/roadrunner?branch=main)
[](https://packagist.org/packages/bckp/roadrunner)
[](https://packagist.org/packages/bckp/roadrunner)
[](https://coveralls.io/github/bckp/roadrunner?branch=master)
[](https://github.com/bckp/roadrunner/blob/master/license.md)Integration of [RoadRunner](https://roadrunner.dev) into Nette Framework
Installation
------------The best way to install Bckp/Roadrunner is using [Composer](http://getcomposer.org/):
```sh
$ composer require bckp/roadrunner
```Then you need to create small update to your app.
### Configure app
Create new RR config, in our case it is roadrunner.neon
```neon
extensions:
roadrunner: Bckp\RoadRunner\DI\Extensionroadrunner:
showExceptions: %debugMode%
```Then we need to update our bootstrap, as RR extension is still big WIP, it is recomended not to enable debug mode. So in current Bootstrap we create new static method for booting into RR plugin
```php
public static function bootRR(string $appDir): Configurator
{
$configurator = new Configurator;$configurator->setTimeZone('Europe/Prague');
$configurator->setTempDirectory($appDir . '/temp');$configurator->createRobotLoader()
->addDirectory(__DIR__)
->register();$configurator->addConfig($appDir . '/config/common.neon');
$configurator->addConfig($appDir . '/config/services.neon');
$configurator->addConfig($appDir . '/config/local.neon');
$configurator->addConfig($appDir . '/config/roadrunner.neon');return $configurator;
}
```And finally, we need our entrypoint that will be runned by RoadRunner, we call this script a roadrunner.php
```php
createContainer()
->getByType(RoadRunner::class)
->run();
```
and shell counterpart (we use it for redirect of err messages)
```shell
#!/usr/bin/env sh
exec php /app-path/app/roadrunner.php 2>&3
```Now we can run RoadRunner with our app, simply run it
```yaml
server:
command: "sh /app-path/app/roadrunner.sh -d opcache.enable_cli=1"
relay: "pipes"
```