PHPackages                             tourze/psr15-symfony-request-request-handler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. tourze/psr15-symfony-request-request-handler

ActiveLibrary[HTTP &amp; Networking](/categories/http)

tourze/psr15-symfony-request-request-handler
============================================

PSR-15 Symfony Request Handler

0.1.0(8mo ago)0179↓93.3%2MITPHPCI passing

Since Apr 24Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/tourze/psr15-symfony-request-request-handler)[ Packagist](https://packagist.org/packages/tourze/psr15-symfony-request-request-handler)[ RSS](/packages/tourze-psr15-symfony-request-request-handler/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (11)Versions (6)Used By (2)

tourze/psr15-symfony-request-request-handler
============================================

[](#tourzepsr15-symfony-request-request-handler)

[English](README.md) | [中文](README.zh-CN.md)

[![PHP Version](https://camo.githubusercontent.com/cc9cdea9aa96b40a822425e981b0a030e3371202973c7d57b74e8e99834f81dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c7565)](https://www.php.net/)![Build Status](https://camo.githubusercontent.com/b0c6c6845a74cb65a7f0a32bdcfd8fbf80eeb40026c4029af424ab371c94b8bd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c642d70617373696e672d627269676874677265656e)![Code Coverage](https://camo.githubusercontent.com/5e42e684db0b346e908766a69406e072bca0c9faa59c5decaa0735919337eb37/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d38352532352d627269676874677265656e)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)

A PSR-15 compatible HTTP request handler for integrating Symfony's HttpKernel and HttpFoundation with the PSR-7/PSR-15 ecosystem. This package enables seamless conversion between PSR-7 requests and Symfony requests, providing robust handling for authentication headers, HTTPS proxy forwarding, real IP forwarding, and comprehensive error logging with backtrace details.

Features
--------

[](#features)

- ✅ Complete PSR-15 `RequestHandlerInterface` implementation
- ✅ Bidirectional conversion between PSR-7 ServerRequest and Symfony Request
- ✅ HTTPS proxy header handling (Force-Https)
- ✅ Real IP forwarding support (X-Real-IP)
- ✅ Authorization header processing (Basic, Digest, Bearer)
- ✅ Cookie parsing and $\_GET/$\_REQUEST global variable setup
- ✅ Comprehensive exception handling with detailed backtraces
- ✅ Internal request/response object access for advanced scenarios
- ✅ High compatibility with Symfony 6.4+ and modern PSR standards

Dependencies
------------

[](#dependencies)

This package requires the following dependencies:

- **Core Requirements:**

    - `php: ^8.1` - PHP 8.1 or higher
    - `psr/http-message: ^1.0|^2.0` - PSR-7 HTTP message interfaces
    - `psr/http-server-handler: ^1.0` - PSR-15 request handler interfaces
    - `psr/log: ^1.0|^2.0|^3.0` - PSR-3 logger interface
- **Symfony Components:**

    - `symfony/http-kernel: ^6.4|^7.0` - Symfony HTTP kernel component
    - `symfony/http-foundation: ^6.4|^7.0` - Symfony HTTP foundation
    - `symfony/psr-http-message-bridge: ^6.4|^7.0` - PSR-7/Symfony bridge
- **Additional Dependencies:**

    - `tourze/backtrace-helper: ^1.0` - Enhanced exception tracing

Installation
------------

[](#installation)

**Requirements:**

- PHP ^8.1
- Symfony 6.4+
- PSR-7, PSR-15 compatible packages

Install via Composer:

```
composer require tourze/psr15-symfony-request-request-handler
```

Quick Start
-----------

[](#quick-start)

```
use Tourze\PSR15SymfonyRequestHandler\SymfonyRequestHandler;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;

$handler = new SymfonyRequestHandler(
    $kernel, // HttpKernelInterface or KernelInterface instance
    new HttpFoundationFactory(),
    new PsrHttpFactory(...),
    $logger // optional PSR-3 LoggerInterface
);

$response = $handler->handle($psrRequest);
```

Key Features
------------

[](#key-features)

### HTTP Processing

[](#http-processing)

- Supports all HTTP methods compatible with Symfony
- Automatic cookie parsing and global variable population ($\_GET, $\_REQUEST, $\_COOKIE)
- Header conversion for maximum PSR-7/Symfony compatibility

### Security &amp; Proxy Support

[](#security--proxy-support)

- **HTTPS Proxy**: Automatically detects `Force-Https` header and sets HTTPS mode
- **Real IP Forwarding**: Supports `X-Real-IP` header for load balancer scenarios
- **Authorization Headers**: Comprehensive support for Basic, Digest, and Bearer authentication

### Advanced Usage

[](#advanced-usage)

```
// Access internal Symfony objects
$sfRequest = $handler->getRequest();
$sfResponse = $handler->getResponse();

// Custom injection for middleware scenarios
$handler->setRequest($customSymfonyRequest);
$handler->setResponse($customSymfonyResponse);
```

### Error Handling

[](#error-handling)

- Automatic exception logging with detailed backtraces via `tourze/backtrace-helper`
- Returns formatted error details in response content
- PSR-3 logger integration for centralized error tracking

Contributing
------------

[](#contributing)

- Please submit issues and pull requests via GitHub
- Follow PSR coding standards
- Ensure all tests pass (`phpunit`)
- Run static analysis (`phpstan`)

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

Changelog
---------

[](#changelog)

See Git history for detailed changes. Major features and bugfixes are documented in release notes.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance64

Regular maintenance activity

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~47 days

Total

5

Last Release

245d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13899502?v=4)[tourze](/maintainers/tourze)[@tourze](https://github.com/tourze)

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (1 commits)")

---

Tags

psr15

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-psr15-symfony-request-request-handler/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-psr15-symfony-request-request-handler/health.svg)](https://phpackages.com/packages/tourze-psr15-symfony-request-request-handler)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
