PHPackages                             cspray/labrador-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. [Framework](/categories/framework)
4. /
5. cspray/labrador-http

Abandoned → [labrador-kennel/http](/?search=labrador-kennel%2Fhttp)Library[Framework](/categories/framework)

cspray/labrador-http
====================

A framework for building asynchronous applications with Amp and Annotated Container.

0.6.0(10y ago)2902[2 issues](https://github.com/labrador-kennel/http/issues)PHPPHP ~7.0CI passing

Since Aug 23Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/labrador-kennel/http)[ Packagist](https://packagist.org/packages/cspray/labrador-http)[ RSS](/packages/cspray-labrador-http/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (16)Used By (0)

Labrador Framework
==================

[](#labrador-framework)

[![GitHub license](https://camo.githubusercontent.com/ba876b7b1a6f9b71ab6d963c29ac8f6ed4922dcd6b095f8735829ce3fb0cdd88/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c61627261646f722d6b656e6e656c2f687474702e7376673f7374796c653d666c61742d737175617265)](http://opensource.org/licenses/MIT)[![GitHub release](https://camo.githubusercontent.com/2bc416481d7851923fe2bb59efd28b4574da451ad957d0f993e9799a6c0d0f7c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6c61627261646f722d6b656e6e656c2f687474702e7376673f7374796c653d666c61742d737175617265)](https://github.com/labrador-kennel/http/releases/latest)

> Labrador is still in heavy development. A 1.0.0-alpha release is near but the API is still highly volatile and subject to change!

Labrador is a microframework built on-top of [Amphp](https://github.com/amphp) and [Annotated Container](https://github.com/cspray/annotated-container). It offers a non-traditional way of writing small-to-medium sized applications in PHP. Among its many features includes:

- Everything in pure PHP. Have a fully-featured web server up with `php app.php`
- Declarative approach to dependency injection
- Comprehensive, secure solution for handling configuration
- Asynchronous by default
- Robust, data-rich event system for knowing when things happen
- An easy-to-use HTTP and routing layer

If you're looking for a more complete skeleton to get started with writing Labrador-powered apps, you should check out [labrador-kennel/web-app](https://github.com/labrador-kennel/web-app); it is a skeleton for a complete app, including Docker setup, database, and templating.

Install
-------

[](#install)

Use [Composer](https://getcomposer.org) to install the library.

```
composer require labrador-kennel/framework

```

Requirements
------------

[](#requirements)

This is a step-by-step guide to the code you'll need to implement to get this framework serving HTTP requests. This is not meant to be a comprehensive guide on how to deploy in production, but how to get up and running on your local machine.

### Step 1: Logging

[](#step-1-logging)

A critical step that MUST be completed, otherwise your application will not start up. To satisfy this requirement you must implement a `Labrador\Logging\LoggerFactory` and mark it as a service to be managed by the dependency injection container. Somewhere in your `src/` directory, or some other directory that is autoloaded and scaned by Annotated Container, write some code that resembles the following:

```
