PuxPHP 路由器
Pux 是一个超级高性能的 PHP 路由器,是对 PHP Router 的重新设计。测试速度比 symfony 快 48.5 倍,比正则表达式方式路由快 31 倍。
路由匹配示例:
/post /post/:id => matches /post/33 /post/:id(/:title) => matches /post/33, /post/33/post%20title /post/:id(\.:format) => matches /post/33, /post/33.json .. /post/33.xml
示例代码:
require 'vendor/autoload.php'; // use PCRE patterns you need Pux\PatternCompiler class. use Pux\Executor; class ProductController { public function listAction() { return 'product list'; } public function itemAction($id) { return "product $id"; } } $mux = new Pux\Mux; $mux->add('/product', ['ProductController','listAction']); $mux->add('/product/:id', ['ProductController','itemAction'] , [ 'require' => [ 'id' => '\d+', ], 'default' => [ 'id' => '1', ] ]); $route = $mux->dispatch('/product/1'); Executor::execute($route);
评论
ZeusHTTP 路由器
Zeus是一个非常简单和快速的HTTP路由器,为Go语言编写。示例代码:package mainimport ( "fmt" "github.com/daryl/zeus" "net
ZeusHTTP 路由器
0
LionHTTP 路由器
Lion是一个Go语言的快速HTTP路由器,支持构建可伸缩的模块化的RESTAPIs应用。特性上下文敏感:Lion使用事实标准net/Context用于存储路由参数并在中间件和HTTP处理器之间共享,
LionHTTP 路由器
0
fabioHTTP(S) 路由器
fabio是一个快速、现代、zero-conf负载均衡HTTP(S)路由器,用于部署consul管理的微服务。fabio由eBayClassifiedsGroup开发,用于处理marktplaats.
fabioHTTP(S) 路由器
0
PHP MacawPHP 路由器
Macaw是一个简单的PHP路由器,超级精简、快速而且很性感。示例代码:Macaw::get('/', function() { echo 'Hello world!';});Macaw::disp
PHP MacawPHP 路由器
0