PHPackages                             gabrielbull/router - 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. gabrielbull/router

ActiveLibrary

gabrielbull/router
==================

A lightning fast router for PHP

0.1.7(7y ago)33554MITPHPPHP &gt;=5.6.0

Since Oct 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/gabrielbull/router)[ Packagist](https://packagist.org/packages/gabrielbull/router)[ Docs](https://github.com/chriso/klein.php)[ RSS](/packages/gabrielbull-router/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (10)Used By (4)

Router
======

[](#router)

[![Build Status](https://camo.githubusercontent.com/1235724bb39e113233015102cba8de25ff1a9ba0a0c2925c2cb04c4270a859eb/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6761627269656c62756c6c2f726f757465722f6d61737465722e7376673f7374796c653d666c6174)](https://travis-ci.org/gabrielbull/router)[![Latest Stable Version](https://camo.githubusercontent.com/6f2339132eb0f9b5615a7b2be7a92b6483e550a6fd7c2ef0452b39018b6e9865/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6761627269656c62756c6c2f726f757465722e7376673f7374796c653d666c6174)](https://packagist.org/packages/gabrielbull/router)[![Total Downloads](https://camo.githubusercontent.com/e7b67b27f6e0d867962ec9f8e7bcf40b1eae0a5833db2c5b9d67b411a789cc40/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6761627269656c62756c6c2f726f757465722e7376673f7374796c653d666c6174)](https://packagist.org/packages/gabrielbull/router)[![License](https://camo.githubusercontent.com/0a59e12e678c750c557678777988b30c5380e841970e7d8ab60d53c5aa5c2911/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6761627269656c62756c6c2f726f757465722e7376673f7374796c653d666c6174)](https://packagist.org/packages/gabrielbull/router)

- Flexible regular expression routing (inspired by [Sinatra](http://www.sinatrarb.com/))
- A set of [boilerplate methods](#api) for rapidly building web apps
- Almost no overhead =&gt; [2500+ requests/second](https://gist.github.com/878833)

Getting started
---------------

[](#getting-started)

1. PHP 5.6.x is required
2. Install Router using [Composer](#composer-installation) (recommended) or manually
3. Setup [URL rewriting](https://gist.github.com/874000) so that all requests are handled by **index.php**
4. (Optional) Throw in some [APC](http://pecl.php.net/package/APC) for good measure

Composer Installation
---------------------

[](#composer-installation)

1. Get [Composer](http://getcomposer.org/)
2. Require Router with `php composer.phar require gabrielbull/router`
3. Install dependencies with `php composer.phar install`

Example
-------

[](#example)

*Hello World* - Obligatory hello world example

```
