This package provides a StackPHP middleware that can be used to use a Symfony application as a middleware (instead of an app)
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Allow to use in functional testing Dec 16, 2015
.gitignore Initial commit Jan 28, 2015
README.md First working implementation Jan 28, 2015
composer.json Adding Symfony 3.0 to the list of accepted dependencies Feb 9, 2016
logo.png Initial commit Jan 28, 2015

README.md

Symfony middleware for StackPHP

This package contains a StackPHP middleware that enables you to push a Symfony application (actually a Kernel) directly on the middleware stack. The Symfony application will try to handle requests but instead of sending a 404 response if no route is found, the next middleware on the stack will be called.

Installation

Through Composer as mouf/symfony-middleware.

Usage

Simply use the SymfonyMiddleWare class in your middleware stack:

use Mouf\StackPhp\SymfonyMiddleware;
use My\Symfony\Application;
use Stack\Builder;

$app = ...

$symfonyApplication = new Application(...);

$stack = (new Stack\Builder())
    ->push(SymfonyMiddleware::class, $symfonyApplication);

$app = $stack->resolve($app);

Why?

Why would I want to make a Symfony app a middleware? Because if every app becomes a middleware, we can easily chain middlewares together, and therefore, chain many frameworks in the same application... and this is cool :)