News for hackers. Stuff that matters.
Re:Toro - a php micro-router with great examples by mmcnickle on Thursday August 23, 2012 @03:58PM (#4424514)
Well done! This has a really clean interface, I wish I'd come across it when looking for a simple router a few weeks ago. A lot of the other ones lean heavily towards a style associated with their related framework, or are too esoteric/basic.

There are a few things I would have to add before I would use it however, and I hope they make it in some day:

1) You should add a whitelist for the HTTP request method names, i.e only allow calls to get(), post(), not some_suspicious_call_from_bad_user(). People will often put non HTTP methods in their views (view as in django sense) and you don't want them to be able to be called by a malicious user.

2) You should make it easy for the developer to configure their own xhr headers.

3) Nitpick: You should probably use 405 (Method Not Allowed) instead of 404 for when a method handler isn't found.

Maybe I'll use it in this project, in which case you may have a few pull requests headed your way!

Re:Toro - a php micro-router with great examples by jasonmoo on Thursday August 23, 2012 @04:04PM (#4424533)
Wow fantastic code review! I'm a minor contributor on this project and those changes sound great.