PHPackages                             concept-labs/http - 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. concept-labs/http

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

concept-labs/http
=================

(C)oncept-Labs HTTP application

1.3.6(3mo ago)0452Apache-2.0PHPPHP &gt;=8.2

Since Aug 2Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Concept-Labs/http)[ Packagist](https://packagist.org/packages/concept-labs/http)[ RSS](/packages/concept-labs-http/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (25)Used By (2)

Concept-Labs HTTP Application Ecosystem
=======================================

[](#concept-labs-http-application-ecosystem)

[![PHP Version](https://camo.githubusercontent.com/c5e8da782b1a0673c08b4f474108036d2cc973470eed2d5d89d48e8c8475eee6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d626c75652e737667)](https://www.php.net/)[![License](https://camo.githubusercontent.com/a549a7a30bacba7bfceebdc207a8e86c3f2c02995a2527640dca30048fd2b64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d417061636865253230322e302d626c75652e737667)](https://opensource.org/licenses/Apache-2.0)[![PSR-7](https://camo.githubusercontent.com/1e31c6255577a0f143560a817dd59107a1264660e7e123104b4ad69a36b37d10/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5053522d372d626c75652e737667)](https://www.php-fig.org/psr/psr-7/)[![PSR-11](https://camo.githubusercontent.com/d05455d277a8176ea3300f6caa2b6ee38d823f95a879504982b914773de8d6ec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5053522d31312d626c75652e737667)](https://www.php-fig.org/psr/psr-11/)[![PSR-15](https://camo.githubusercontent.com/715fe19567469d13f5e8c2a2430501b6853988f14adeee4fb0775821d72c2a08/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5053522d31352d626c75652e737667)](https://www.php-fig.org/psr/psr-15/)

A low-level, PSR-compliant HTTP application foundation built on configuration-driven architecture and integrated with the Singularity DI container. Part of the Concept-Labs ecosystem.

🎯 Philosophy
------------

[](#-philosophy)

The Concept-Labs HTTP ecosystem embraces the principles of:

- **Configuration-Driven Architecture**: Build entirely different applications (REST APIs, web apps, CLI runners) through configuration alone. See [Configuration Package](https://github.com/Concept-Labs/config) for the powerful configuration system.
- **Dependency Injection First**: Fully integrated with [Singularity DI Container](https://github.com/Concept-Labs/singularity)
- **PSR Standards**: Built on PSR-7 (HTTP Messages), PSR-11 (Container), and PSR-15 (HTTP Handlers)
- **Lazy Initialization**: Middleware wrappers ensure components are only instantiated when actually needed
- **Low-Level Foundation**: Provides core HTTP handling that higher-level packages build upon (like [simple-http](https://github.com/Concept-Labs/simple-http))
- **SOLID Principles**: Clean, maintainable, and testable code architecture

### Concept-Labs Ecosystem

[](#concept-labs-ecosystem)

This package is part of the Concept-Labs ecosystem and leverages:

- **Singularity**: Advanced PSR-11 DI container with lifecycle management
- **Config**: Powerful [configuration system](https://github.com/Concept-Labs/config) enabling configuration-driven application building
- **HTTP Message**: PSR-7 compliant HTTP message implementation
- **Event Dispatcher**: PSR-14 event dispatcher for application events

This is a **low-level** HTTP application foundation. For higher-level applications, see:

- **[simple-http](https://github.com/Concept-Labs/simple-http)**: Higher-level HTTP application with additional features

✨ Key Features
--------------

[](#-key-features)

- 🚀 **Bootstrap System**: Simple application bootstrapping with minimal configuration
- 🎭 **Middleware Pipeline**: PSR-15 middleware with priority-based ordering and lazy initialization
- 🏗️ **Dependency Injection**: Full integration with Singularity DI container
- ⚙️ **Configuration System**: Build different applications through configuration (see [Config Package](https://github.com/Concept-Labs/config))
- 🔌 **Extensible**: Low-level foundation for higher-level packages
- 🧪 **Fully Tested**: Comprehensive test coverage with PEST
- 📦 **PSR Compliant**: Follows PHP-FIG standards

📋 Requirements
--------------

[](#-requirements)

- **PHP**: &gt;= 8.2
- **Extensions**: Standard PHP extensions
- **Dependencies**:
    - `concept-labs/singularity`: ^1
    - `concept-labs/http-message`: ^1
    - `concept-labs/event-dispatcher`: ^1
    - `psr/http-server-middleware`: ^1

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require concept-labs/http
```

🚀 Quick Start
-------------

[](#-quick-start)

### Basic Application

[](#basic-application)

```
