Whisper is a project mainly written in PHP, it's free.
A PHP MicroFramework
Whisper is a micro framework written in PHP 5.3 inspired from frameworks like Flask or Express.js It uses the PHP 5.3 closures and namespaces to provide an easy to use framework for building working sites very fast.
A detailed documentation can be found here
This is a basic usage redirecting a user to a route upon landing on the index and displaying him a nice 'safe' hello
require_once 'Whisper/Kernel.php';
use WhisperKernel, WhisperRequest;
/* create a default kernel */
$app = new Kernel();
/* register a route for index */
$app->route('/', function(Kernel $app) {
return $app->redirect('/hello');
});
/* register a route hello */
$hello_routes = array('/hello', '/hello/:name');
$app->route($hello_routes, function(Kernel $app, Request $req) {
/* try to retrieve variable 'name' from route */
$name = $req->resolve('name', FILTER_SANITIZE_SPECIAL_CHARS);
if ($name == null) {
$name = 'world';
}
return 'Hello ' . $name . '!';
});
/* dispatch call */
$app->dispatch();
Current version is very alpha and doesn't support half of the final framework, here are the current features:
The features to be implemented: