Zaphpa = PHP + REST

Intuitive, flexible and powerful HTTP router.

require_once(__DIR__ . '/vendor/zaphpa/zaphpa.lib.php');
$router = new Zaphpa_Router();

$router->attach('ZaphpaAutoDocumentator', '/apidocs'); //auto-docs middleware

$router->addRoute(array(
    'path'  => '/users/{id}',
    'get'   => array('UserController', 'getUser'),
    'post'   => array('UserController', 'updateUser'),
));    
$router->route();

Created to make REST in PHP easy.

Zaphpa, pronounced as the last name of Frank Zappa, is a routing microkernel inspired by Sinatra.rb, and implemented in PHP (hence the extra geeky "h" in the name creating the sub-pattern of: "php").

Zaphpa is a lightweight library that excels at single mission: free PHP API developers from the boilerplate of handling HTTP requests and implementing REST.

You can think of it as an equivalent of Sinatra (in Ruby) or Express.js (in Javascript) frameworks for PHP, if you will.

Who uses it?

Zaphpa is actively used by NPR's software teams in the Digital Media and Digital Services divisions, benefiting from thorough bug-fixing and various contributions by: @inadarei, @karoun, @randallsquared, @johnymonster, @jsgrosman and @d1b1.