101 karma · joined September 8, 2011
For precisely this reason, I wrote a PHP router like this called Marg - http://github.com/vaidik/marg. Used it for 3 projects and I love the way I can keep things simple and sane. And that's why I appreciate this project as well.
Great to see sane projects like these in the PHP community.
This would have saved a lot of programming effort.
I know about how PHP is considered uncool around here. I am not here to debate that. Personally I use Python more but I started off with PHP 3 years back and I do use it sometimes for quick prototyping. Its not all that bad for everything. Is it? I guess you'd agree.
Yes, PATH_INFO is an issue I am aware of. Thanks for that Symfony reference. I will definitely check out how they do it.
The request class can still handle other HTTP methods like HEAD / PUT / DELETE. The verb property ($request->verb) has the HTTP method used for the incoming request. Therefore, you can handle different HTTP methods as well.
Thanks once again!
If Ruby, RoR should be the first choice I guess. You may also want to consider Sinatra.
I am no Ruby-ist but I am sure Ruby is not that bad that you will have troubles scaling. You just have to understand how to scale and you can use either PHP or Ruby to apply the general concepts of scalability.