PHPackages                             hypercharge/php-middleware - 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. hypercharge/php-middleware

ActiveLibrary

hypercharge/php-middleware
==========================

Generalized middleware implementation for PHP.

5101PHP

Since Jan 27Pushed 12y ago9 watchersCompare

[ Source](https://github.com/hypercharge/php-middleware)[ Packagist](https://packagist.org/packages/hypercharge/php-middleware)[ RSS](/packages/hypercharge-php-middleware/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Middleware
==========

[](#middleware)

This is a generalized library for using middleware patterns within your PHP projects.

`php-middleware` is a PHP port of the ruby [middleware](https://github.com/mitchellh/middleware) library.

Only a subset of ruby `middleware` is implemented yet. Stay tuned to see more features ported.

To get started, the best place to look is the [user guide](https://github.com/mitchellh/middleware/blob/master/user_guide.md).

[![Build Status](https://camo.githubusercontent.com/94ede8de4070d9d6b83b241c40385dd0f46a6af8dc3285a408aa96c00ad91303/68747470733a2f2f7472617669732d63692e6f72672f68797065726368617267652f7068702d6d6964646c65776172652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/hypercharge/php-middleware)

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

[](#installation)

This project is distributed as a [composer](http://getcomposer.org/) package.

in your project root folder create a `composer.json` file

```
{
  "require": {
    "hypercharge/php-middleware": "dev-master"
  }
}
```

In a shell `cd` to your project root folder and run the command

```
$ php composer.phar install
```

A Basic Example
---------------

[](#a-basic-example)

Below is a basic example of the library in use. If you don't understand what middleware is, please read [the ruby middleware doc](https://github.com/mitchellh/middleware/blob/master/user_guide.md#middleware). This example is simply meant to give you a quick idea of what the library looks like.

```
