{"id":36388059,"url":"https://github.com/noglitchyo/symfony-middleware-bundle","last_synced_at":"2026-01-11T15:05:01.013Z","repository":{"id":57028055,"uuid":"193289196","full_name":"noglitchyo/symfony-middleware-bundle","owner":"noglitchyo","description":"Introduces PSR-15 middleware support into Symfony framework.","archived":false,"fork":false,"pushed_at":"2019-08-15T08:48:59.000Z","size":73,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-13T13:55:15.399Z","etag":null,"topics":["dispatcher","middleware","psr-15","psr-7","request-handler","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noglitchyo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-22T23:53:33.000Z","updated_at":"2021-06-22T19:27:46.000Z","dependencies_parsed_at":"2022-08-23T16:20:40.701Z","dependency_job_id":null,"html_url":"https://github.com/noglitchyo/symfony-middleware-bundle","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/noglitchyo/symfony-middleware-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noglitchyo%2Fsymfony-middleware-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noglitchyo%2Fsymfony-middleware-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noglitchyo%2Fsymfony-middleware-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noglitchyo%2Fsymfony-middleware-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noglitchyo","download_url":"https://codeload.github.com/noglitchyo/symfony-middleware-bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noglitchyo%2Fsymfony-middleware-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28309752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dispatcher","middleware","psr-15","psr-7","request-handler","symfony"],"created_at":"2026-01-11T15:05:00.449Z","updated_at":"2026-01-11T15:05:01.007Z","avatar_url":"https://github.com/noglitchyo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# symfony-middleware-bundle\n\nIntroduces PSR-15 middleware support into Symfony framework.\n\n![PHP from Packagist](https://img.shields.io/packagist/php-v/noglitchyo/symfony-middleware-bundle.svg)\n[![Build Status](https://travis-ci.org/noglitchyo/symfony-middleware-bundle.svg?branch=master)](https://travis-ci.org/noglitchyo/symfony-middleware-bundle)\n[![codecov](https://codecov.io/gh/noglitchyo/symfony-middleware-bundle/branch/master/graph/badge.svg)](https://codecov.io/gh/noglitchyo/symfony-middleware-bundle)\n![Scrutinizer code quality (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/quality/g/noglitchyo/symfony-middleware-bundle.svg)\n![Packagist](https://img.shields.io/packagist/l/noglitchyo/symfony-middleware-bundle.svg)\n\nRoadmap\n============\n\n- Full test coverage\n- Documentation\n\nThis bundle is under heavy development and is not meant to be used in production. \nFeel free to contribute!\n\nDescription\n============\n\nSymfony Middleware Bundle provides support for PSR-15 middleware execution in Symfony application. \nIt introduces a middleware dispatcher in a non-intrusive way, so it can be used with a minimal and simple configuration.\n\nThis bundle attempts to offer two implementations, so it can be used in different ways:\n\n- through an event listener plugged on the events dispatched by the HttpKernel.\nIt will execute the middleware collection before passing the request to the controller if no response were created by the middlewares.\n\n- as a decorator of the HttpKernel with the MiddlewareStackKernel.\n\nGetting started\n============\n\nRequirements\n============\n\n- Symfony 4\n- PHP 7.3\n\nInstallation\n============\n\nApplications that use Symfony Flex\n----------------------------------\n\nOpen a command console, enter your project directory and execute:\n\n```console\n$ composer require noglitchyo/symfony-middleware-bundle\n```\n\nApplications that don't use Symfony Flex\n----------------------------------------\n\n### Step 1: Download the Bundle\n\nOpen a command console, enter your project directory and execute the\nfollowing command to download the latest stable version of this bundle:\n\n```console\n$ composer require noglitchyo/symfony-middleware-bundle\n```\n\nThis command requires you to have Composer installed globally, as explained\nin the [installation chapter](https://getcomposer.org/doc/00-intro.md)\nof the Composer documentation.\n\n### Step 2: Enable the Bundle\n\nThen, enable the bundle by adding it to the list of registered bundles\nin the `config/bundles.php` file of your project:\n\n```php\n// config/bundles.php\n\nreturn [\n    // ...\n    NoGlitchYo\\MiddlewareBundle\\NoGlitchYoMiddlewareBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\nUsage\n=====\n\n#### Step 1: Create a middleware collection\n\nFirst, it is required to define a middleware collection. The middleware collection will, as states its name, contains all\nthe middleware to execute.\n\nFor this purpose, this bundle rely on the middleware collection implementation from \n[noglitchyo/middleware-collection-request-handler](https://github.com/noglitchyo/middleware-collection-request-handler)\nwhich gives the ability to execute a collection of middlewares as if it was a single PSR-15 middleware or request handler with different execution strategies.\n\n#### Example\n\n`services.yaml`\n```yaml \n\n  # Let's define some middlewares that we want to use.\n  App\\Middleware\\SecurityMiddleware: ~\n  App\\Middleware\\CorsMiddleware: ~\n  App\\Middleware\\RouterMiddleware: ~*\n\n  # Then, we define the middleware\n  middleware_collections.default:\n    class: NoGlitchYo\\MiddlewareCollectionRequestHandler\\Collection\\MiddlewareCollectionInterface \n        # Define the middleware collection class which MUST implement MiddlewareCollectionInterface.\n        # Some default implementations are provided. Choose one of them or create your own.\n        # NoGlitchYo\\MiddlewareCollectionRequestHandler\\Collection\\ArrayStackMiddlewareCollection\n        # NoGlitchYo\\MiddlewareCollectionRequestHandler\\Collection\\SplQueueMiddlewareCollection\n        # NoGlitchYo\\MiddlewareCollectionRequestHandler\\Collection\\SplStackMiddlewareCollection\n    arguments:\n      - ['@App\\Middleware\\EncoderMiddleware', '@App\\Middleware\\RouterMiddleware', '@App\\Middleware\\EncoderMiddleware']\n    tags: ['middlewares.collection'] # Tag it! So the collection can be picked up.\n```\n\n#### Step 2: Define a middleware handler\n\nHandler gives the instruction to execute the attached middleware collection. \nOnce, it is defined, the collection of middlewares will be executed for every incoming requests.\n\nIt is possible to define some conditions on when the handler should be run:\n- Route Path matching : if the route path of the request match the given route path \n- Route Name matching : if the route name of the request match the given route name\n\n#### Example\n\n`middlewares.yaml`\n\n```yaml\nmiddlewares:\n  handlers:\n    default: # Name of your handler configuration\n      collection: default.middleware_collection # should be the collection class name / service name defined in services.yaml\n      condition: # Condition is optional, if not provided the collection will be executed for every requests\n        routePath: '/path/test/1'\n        routeName: 'myCustomRouteName'\n```\n\nTests\n=====\n\nWould like to the run the test suite? Go ahead:\n\n`composer test`\n\nReferences\n==========\n\nhttps://www.php-fig.org/psr/psr-15/\n\nLicense\n==========\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoglitchyo%2Fsymfony-middleware-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoglitchyo%2Fsymfony-middleware-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoglitchyo%2Fsymfony-middleware-bundle/lists"}