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

AbandonedLibrary

bogart/router
=============

A simple RESTful router for PHP 5.3

013PHP

Since Mar 24Pushed 13y ago1 watchersCompare

[ Source](https://github.com/simonda86/Bogart)[ Packagist](https://packagist.org/packages/bogart/router)[ RSS](/packages/bogart-router/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Bogart
======

[](#bogart)

Bogart is a simple RESTful PHP library, the syntax is based on ruby's sinatra so Bogart was named after fellow Rat Packer Humpfrey Bogart. Bogart was designed for use with PHP anonymous functions, so PHP version 5.3.0 or higher is required.

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

[](#installation)

Download the library, include the bogart file and create an new instance of the class.

```
require 'bogart.php';
$bogart = new Bogart();

```

You will need to create a .htaccess file with the following for your project.

```
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?uri=$1 [QSA,L]

```

Usage
-----

[](#usage)

When you have the library installed all you need to do is setup your routes and call the response function.

```
$bogart->get('/',function(){
	echo 'Hello, World!';
});

$bogart->response();

```

Bogart uses 4 HTTP methods for CRUD operations.

```
$bogart->get('/',function(){
	echo 'List all items';
});

$bogart->post('/',function(){
	echo 'Create a new item';
});

$bogart->put('/',function(){
	echo 'Update an item';
});
$bogart->delete('/',function(){
	echo 'Delete an item';
});

```

Put and Delete are both actually POST requests with a hidden form \_method element

```

```

Wildcards
---------

[](#wildcards)

You can use wilcards to recieve variables such (:num) and (:alpha), the variables will then be passed to the function as an argument.

```
$bogart->get('/item/(:num)', function($id){
	echo 'Item id: ' . $id;
});
$bogart->get('/item/(:alpha)', function($name){
	echo 'Item name: ' . $name;
});

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b44d60572fe69fdbe7b4f07ee67935fdc5522b3e52508ec2fb8cb89fa28309a0?d=identicon)[wearemode](/maintainers/wearemode)

---

Top Contributors

[![simonda86](https://avatars.githubusercontent.com/u/495114?v=4)](https://github.com/simonda86 "simonda86 (11 commits)")

### Embed Badge

![Health badge](/badges/bogart-router/health.svg)

```
[![Health](https://phpackages.com/badges/bogart-router/health.svg)](https://phpackages.com/packages/bogart-router)
```

PHPackages © 2026

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