Download the PHP package spiral/roadrunner-laravel without Composer

On this page you can find all versions of the php package spiral/roadrunner-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package roadrunner-laravel

logo

RoadRunnerLaravel bridge

Version Version Build Status Coverage Downloads count Chat License

Easy way for connecting RoadRunner and Laravel applications (community integration).

🐋 If you want to see an example of a laravel application in a docker container with RoadRunner as a web server - take a look at this repository.

Installation

Make sure that RR binary file already installed on your system (or docker image). Require this package with composer using next command:

Installed composer is required (how to install composer).

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

Important: despite the fact that worker allows you to refresh application instance on each HTTP request (if worker started with option --refresh-app, eg.: php ./vendor/bin/rr-worker start --refresh-app), we strongly recommend avoiding 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.

Upgrading guide

v4.xv5.x

v3.xv4.x

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 outgoing responses using laravel events system. Event contains:

Event classname Application object HTTP server request HTTP request HTTP response Exception
BeforeLoopStartedEvent
BeforeLoopIterationEvent
BeforeRequestHandlingEvent
AfterRequestHandlingEvent
AfterLoopIterationEvent
AfterLoopStoppedEvent
LoopErrorOccurredEvent

Simple .rr.yaml config example (full example can be found here):

For windows path must be full (eg.: php vendor/spiral/roadrunner-laravel/bin/rr-worker start)

Socket or TCP port relay usage is strongly recommended for avoiding problems with dd(), dump(), echo() and other similar functions, that sends data to the IO pipes.

Roadrunner server starting:

Listeners

This package provides event listeners for resetting 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.

Helpers

This package provides the following helpers:

Name Description
\rr\dump(...) Dump passed values (dumped result will be available in the HTTP response)
\rr\dd(...) Dump passed values and stop the execution
\rr\worker() Easy access to the RoadRunner PSR worker instance

Known issues

Performance degradation

...when file driver is set for your sessions. Please, use redis (or something similar) driver instead (related issue). This package or/and RoadRunner has nothing to do with it, but since this is a fairly common issue - it is described here.

Controller constructors

You should avoid to use HTTP controller constructors (created or resolved instances in a constructor can be shared between different requests). Use dependencies resolving in a controller methods instead.

Bad:

Good:

Middleware constructors

You should never to use middleware constructor for session, session.store, auth or auth Guard instances resolving and storing in properties (for example). Use method-injection or access them through Request instance.

Bad:

Good:

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:

Changes log

Release date Commits since latest release

Changes log can be found here.

Support

Issues Issues

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

License

MIT License (MIT). Please see Spiral Scout.


All versions of roadrunner-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
composer-runtime-api Version ^2.0
laravel/framework Version ~9.33 || ~10.0
nyholm/psr7 Version ^1.5
spiral/roadrunner-http Version ^2.2 || ^3.0
spiral/roadrunner-worker Version ^2.2 || ^3.0
symfony/psr-http-message-bridge Version ^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package spiral/roadrunner-laravel contains the following files

Loading the files please wait ....