TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Link: A fast and simple PHP Router

47 点作者 apsdehal将近 11 年前
Link supports RESTful routes and helps you create clean Web apps and APIs through its various features like Named Routes. Its an effort to combine good parts of various php router, like toro's method of parsing routes, laravel's named routes, others middleware etc. so much.

10 条评论

nubs将近 11 年前
The claim of &quot;fast&quot; definitely looks inaccurate in comparison to nikic&#x27;s router[0]. I&#x27;d recommend reading through his blog[1] on the matter.<p>[0]: <a href="https://github.com/nikic/FastRoute" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nikic&#x2F;FastRoute</a><p>[1]: <a href="http://nikic.github.io/2014/02/18/Fast-request-routing-using-regular-expressions.html" rel="nofollow">http:&#x2F;&#x2F;nikic.github.io&#x2F;2014&#x2F;02&#x2F;18&#x2F;Fast-request-routing-using...</a>
评论 #7817145 未加载
leeoniya将近 11 年前
there are so many php routers these days that any &quot;fast&quot; claims should probably be accompanied by benchmarks.<p>routing is a fairly uncomplicated task and the speed difference will only become apparent at really high loads.<p><a href="http://c9s.github.io/Pux/" rel="nofollow">http:&#x2F;&#x2F;c9s.github.io&#x2F;Pux&#x2F;</a><p><a href="http://auraphp.com/packages/Aura.Router/" rel="nofollow">http:&#x2F;&#x2F;auraphp.com&#x2F;packages&#x2F;Aura.Router&#x2F;</a><p><a href="http://zaphpa.org/" rel="nofollow">http:&#x2F;&#x2F;zaphpa.org&#x2F;</a><p><a href="http://toroweb.org/" rel="nofollow">http:&#x2F;&#x2F;toroweb.org&#x2F;</a><p><a href="https://github.com/dannyvankooten/PHP-Router" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dannyvankooten&#x2F;PHP-Router</a><p><a href="https://github.com/symfony/Routing" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;symfony&#x2F;Routing</a><p><a href="http://docs.phalconphp.com/en/latest/api/Phalcon_Mvc_Router.html" rel="nofollow">http:&#x2F;&#x2F;docs.phalconphp.com&#x2F;en&#x2F;latest&#x2F;api&#x2F;Phalcon_Mvc_Router....</a>
评论 #7816894 未加载
评论 #7817534 未加载
评论 #7818058 未加载
mcfunley将近 11 年前
FWIW at Etsy I built and subsequently helped completely dismantle a minimal PHP routing framework. We just used .htaccess and php files.<p>PHP&#x2F;Apache affords you a fast, simple alternative, and what you gain with a framework (route lookup for an object) just isn&#x27;t compelling enough IMO to justify the added overhead and complexity.<p>I think the endless proliferation of PHP microrouters (including mine, RIP) is people porting Django and Rails features to PHP without applying critical thinking first. (Myself included.)
评论 #7817419 未加载
评论 #7821147 未加载
127001brewer将近 11 年前
Why would you want to use <i>any</i> PHP router instead of writing the rewrite rules within an Apache VirtualHost file or a .htaccess file?
评论 #7817116 未加载
评论 #7816895 未加载
评论 #7817282 未加载
评论 #7817174 未加载
评论 #7816908 未加载
erming将近 11 年前
Looks like everyone and their grandma has written their own PHP router.<p>Here&#x27;s mine:<p><a href="https://github.com/erming/route" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;erming&#x2F;route</a><p>Code: <a href="https://github.com/erming/route/blob/master/route.php" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;erming&#x2F;route&#x2F;blob&#x2F;master&#x2F;route.php</a><p>~80 LOC
评论 #7818663 未加载
insky将近 11 年前
How does this compare with something like Slim?<p>+1 for being lightweight and readable.
评论 #7817159 未加载
jamesmoss将近 11 年前
Meh, another PHP library using lengthy static methods making it impossible to extend.
评论 #7817149 未加载
alphadevx将近 11 年前
Nice work! A micro-micro-framework, makes Slim and Silex look big.
评论 #7816990 未加载
pothibo将近 11 年前
Is it a PHP thing to indent with tabs rather than 2 spaces? Genuinely curious.
评论 #7817639 未加载
评论 #7817538 未加载
darkstar999将近 11 年前
No tests?
评论 #7817305 未加载
评论 #7817349 未加载