boesing / mezzio-httphandlerrunner-roadrunner
Adds native HTTP handler runner for mezzio projects to work with spiral/roadrunner
Requires
- php: ~8.1.0
- laminas/laminas-cli: ^1.4
- laminas/laminas-httphandlerrunner: ^2.1
- mezzio/mezzio: ^3.11
- spiral/roadrunner: ^2.7
Requires (Dev)
- laminas/laminas-coding-standard: ~2.3.0
- laminas/laminas-config-aggregator: ^1.7
- laminas/laminas-diactoros: ^2.8
- laminas/laminas-servicemanager: ^3.10
- lctrs/psalm-psr-container-plugin: ^1.9
- phpunit/phpunit: ^9.5
- psalm/plugin-phpunit: ^0.18.4
- vimeo/psalm: ^5.11
This package is auto-updated.
Last update: 2024-11-08 21:26:29 UTC
README
This library provides an implementation to run mezzio via spiral/roadrunner
.
Installation
Run the following to install this library:
$ composer require boesing/mezzio-httphandlerrunner-roadrunner
Creating roadrunner configuration
server: command: "php -dopcache.enable_cli=1 -dopcache.validate_timestamps=0 vendor/bin/laminas roadrunner:run" http: address: "localhost:8080" pool: num_workers: 8 logs: mode: production channels: http: level: info # Log all http requests, set to info to disable server: level: debug # Everything written to worker stderr is logged
A list of available configuration parameters can be found in the spiral/roadrunner-binary
repository on github.
Retrieve roadrunner binary
To be able to run roadrunner, you need to fetch the roadrunner binary. Use the following command to do so for your environment:
vendor/bin/rr get-binary
NOTE: By doing so, a rr
binary will be fetched to your current working directory. That binary only works for your current environment. So when you execute that command on MacOS, you will receive a binary prepared to run on MacOS and which is not compatible with Ubuntu for example.
Run
To run your project, simply execute the binary fetched in the Retrieve roadrunner binary installation step:
./rr serve
This should ramp up the amount of workers configured in the Creating roadrunner configuration installation step and listens to the configured port.