Ham帶緩存的路由庫
Ham 是一款輕量級的路由框架,利用緩存來提升速度。把任何 I/O 相關的東西緩存進 XCache/APC。要求 PHP 5.3+ 和 XCache 或者 APC。
示例代碼:
require '../ham/ham.php';
$app = new Ham('example');
$app->config_from_file('settings.php');
$app->route('/pork', function($app) {
return "Delicious pork.";
});
$hello = function($app, $name='world') {
return $app->render('hello.html', array(
'name' => $name
));
};
$app->route('/hello/<string>', $hello);
$app->route('/', $hello);
$app->run();評論
圖片
表情
