Live data from Hacker News

Macaw - A Simple PHP Router

github.com

31–40 of 52 posts

Re: Macaw - A Simple PHP Router

#32

Probably 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"); });

fourofour is not as semantic as notFound, or not_found xD ..

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

#36

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.

an even better solution is http://cumulusnetworks.com/ but it's not in php. wouldn't make sense in php anyway.

Re: Macaw - A Simple PHP Router

#37
post #13
post #12

Earlier 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.

[deleted]

Re: Macaw - A Simple PHP Router

#39
post #9

really 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

how about caching as a separate composer requirement, or do you think caching should be in a higher level in the stack?
Post reply on HN