roadrunner-laravel

RoadRunner ⇆ Laravel bridge

Github星跟蹤圖

RoadRunner ⇆ Laravel bridge

Version
Version
Build Status
Coverage
Downloads count
License

Easy way for connecting RoadRunner and Laravel applications.

Install

Require this package with composer using next commands:

$ composer require avto-dev/roadrunner-laravel "^3.0"

Installed composer is required (how to install composer).

You need to fix the major version of package.

Previous major versions still available, but it's development is abandoned. Use only latest major version!

After that you can "publish" package configuration file (./config/roadrunner.php) using next command:

$ php ./artisan vendor:publish --provider='AvtoDev\RoadRunnerLaravel\ServiceProvider' --tag=config

And basic RoadRunner configuration file (./.rr.yaml.dist):

$ php ./artisan vendor:publish --provider='AvtoDev\RoadRunnerLaravel\ServiceProvider' --tag=rr-config

If you wants to disable package service-provider auto discover, just add into your composer.json next lines:

{
    "extra": {
        "laravel": {
            "dont-discover": [
                "avto-dev/roadrunner-laravel"
            ]
        }
    }
}

After that you can modify configuration files as you wish.

Important: despite the fact that worker allows you to refresh application instance on each HTTP request (if environment variable APP_REFRESH set to true), we strongly recommend to avoid this for performance reasons. Large applications can be hard to integrate with RoadRunner (you must decide which of service providers must be reloaded on each request, avoid "static optimization" in some cases), but it's worth it.

Usage

After package installation you can use provided "binary" file as RoadRunner worker: ./vendor/bin/rr-worker. This worker allows you to interact with incoming requests and outcoming responses using laravel events system. Also events contains:

Event classname, Application object, HTTP server request, HTTP request, HTTP response
----------------------------, :----------------:, :-----------------:, :----------:, :-----------:
BeforeLoopStartedEvent, ✔, BeforeLoopIterationEvent, ✔, ✔, BeforeRequestHandlingEvent, ✔, ✔, AfterRequestHandlingEvent, ✔, ✔, ✔
AfterLoopIterationEvent, ✔, ✔, ✔
AfterLoopStoppedEvent, ✔, ### Listeners

This package provides event listeners for resetings application state without full application reload (like cookies, HTTP request, application instance, service-providers and other). Some of them already declared in configuration file, but you can declare own without any limitations.

Environment variables

You can use the following environment variables:

Variable name, Description
-----------------, -----------
APP_FORCE_HTTPS, (declared in configuration file) Forces application HTTPS schema usage
APP_REFRESH, Refresh application instance on every request

Testing

For package testing we use phpunit framework and docker-ce + docker-compose as develop environment. So, just write into your terminal after repository cloning:

$ make build
$ make latest # or 'make lowest'
$ make test

Changes log

Release date
Commits since latest release

Changes log can be found here.

Support

Issues
Issues

If you will find any package errors, please, make an issue in current repository.

License

This is open-sourced software licensed under the MIT License.

主要指標

概覽
名稱與所有者avto-dev/roadrunner-laravel
主編程語言PHP
編程語言Makefile (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2019-02-02 13:48:45
推送於2020-05-22 17:16:44
最后一次提交2020-05-22 22:16:44
發布數22
最新版本名稱v3.3.0 (發布於 )
第一版名稱v1.0.0-rc1 (發布於 )
用户参与
星數120
關注者數7
派生數15
提交數100
已啟用問題?
問題數18
打開的問題數1
拉請求數24
打開的拉請求數0
關閉的拉請求數5
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?