99designs / ergo
Micro-framework for routing and request/response handling in PHP 5.3
Installs: 10 534
Dependents: 1
Suggesters: 0
Security: 0
Stars: 32
Watchers: 51
Forks: 3
Open Issues: 1
Requires
- php: >=5.3.0
- psr/log: 1.0.*
Requires (Dev)
- mockery/mockery: dev-master
- phpunit/phpunit: 3.7.*
- dev-master
- v2.7.0
- v2.6.2
- v2.6.1
- v2.6.0
- v2.5.1
- v2.5.0
- v2.4.6
- v2.4.5
- v2.4.4
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- 2.3.0
- v2.2.1
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.0
- dev-lazy-load-the-error-handler
- dev-composer_lock
- dev-template-uniqueness
- dev-nginx
- dev-trash/build
- dev-features/cibuild_script
- dev-bugs/web-error-handler-ob-fix
- dev-request-factory-http-host
This package is not auto-updated.
Last update: 2020-01-24 14:45:58 UTC
README
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".
Install
Ergo is designed to be easy to install and integrate.
$ pear channel-discover pearhub.org
$ pear install pearhub/Ergo
Alternately, check it out as a submodule and use your own classloader on the classes dir.
Basic Usage
require_once('Ergo/ergo.php');
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 Composer is used to pull in SimpleTest as a dependancy.
To install dependancies via Composer:
$ composer install --dev
Run the test suite:
$ phpunit
PHPUnit 3.7.10 by Sebastian Bergmann.
Configuration read from /home/vagrant/ergo/phpunit.xml.dist
............................................................... 63 / 100 ( 63%)
.....................................
Time: 0 seconds, Memory: 11.25Mb
OK (100 tests, 269 assertions)
Status
Used in several high-volume production websites, including 99designs.com, flippa.com, learnable.com and sitepoint.com.