Oh, that sort of router... For a second I thought someone had coded an IP router in PHP. Which would be a really interesting thing to see, if not particularly practical.
Macaw - A Simple PHP Router
31–40 of 52 posts
Re: Macaw - A Simple PHP Router
#32Probably shouldn't be "hard" coding the scheme (http). Check $_SERVER['https']. You can make sure this fastcgi param exists with a simple directive in nginx (fastcgi_params): fastcgi_param HTTPS $https if_not_empty; Also, the 404 route, should be able to be defined as a custom function: Macaw::fourofour(function() { header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found"); header("Status: 404 Not Found"); });
idk. this mixes up routing and api building, right? What people currently use most to build their api (mostly afterwards) is: http://docs.guzzlephp.org/en/latest/
btw. here's a nice and new php framework I've just recently found: http://www.cygniteframework.com/2013/07/quickstart.html
Re: Macaw - A Simple PHP Router
#33Re: Macaw - A Simple PHP Router
#34If you want something with more features but still just as simple, check out: http://flightphp.com/ I'm using it to make a JSON backend API and it works great.
Re: Macaw - A Simple PHP Router
#35Re: Macaw - A Simple PHP Router
#36Oh, that sort of router... For a second I thought someone had coded an IP router in PHP. Which would be a really interesting thing to see, if not particularly practical.
Re: Macaw - A Simple PHP Router
#37Earlier quoted context omitted.
two people can't name their thing after the same bird?
Well when one thing has had a viral kickstarter campaign, been on every Tech blog, and its name known by just about every developer who cares about web design. Then to hear something else named the exact same name around the same time feels kinda weird.
Re: Macaw - A Simple PHP Router
#38Re: Macaw - A Simple PHP Router
#39really nice. if I had any suggestions at all though it would be to have the 404 route actually return the 404 header (or have a way to specify headers with routes), and also have it handle https.
Great! I'll get to work on these. :D