Skip to content
This repository

A lightweight php5 library for request/response routing, controllers and http interaction.

This branch is 1 commit ahead and 78 commits behind master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 classes
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE Added an MIT license file and a README for opensourcing. February 26, 2010
Octocat-spinner-32 Pundlefile
Octocat-spinner-32 ergo.php Migrated to use PHP 5.3 packages and closures where appropriate October 26, 2010
Octocat-spinner-32 runtests.php


A light-weight library for processing requests and responses in PHP5.3. Provides a closure-based infrastructure for routing, controllers and templating.

The name is from the latin, Cogito ergo sum. "I think, therefore I am".


Ergo is designed to be easy to install and integrate.

$ pear channel-discover
$ pear install pearhub/Ergo

Alternately, check it out as a submodule and use your own classloader on the classes dir.

Basic Usage


Ergo::router()->connect('/helloworld', 'helloworld', function() {
    return Ergo::template('helloworld.tpl.php', array(
      'greeting'=>'Hello World'

Ergo::router()->connect('/*', 'any', function() {
    throw new \Ergo\Http\NotFound("Not implemented yet");

How to develop

For running, Ergo has no external dependancies. For development Pundle is used to pull in SimpleTest as a dependancy.

To install dependancies via Pundle:

$ pear channel-discover
$ pear install webzeile/Pundle
$ pundle install

Run the test suite:

$ ./runtests.php
Test cases run: 14/14, Passes: 206, Failures: 0, Exceptions: 0


Used in several high-volume production websites, including,, and

Something went wrong with that request. Please try again.