News for hackers. Stuff that matters.
Re:Macaw - A Simple PHP Router by nodesocket on Saturday December 28, 2013 @10:51PM (#6978260)
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");
    });
Re:Macaw - A Simple PHP Router by X4 on Sunday December 29, 2013 @02:59AM (#6978823)
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 by NoahBuscher on Sunday December 29, 2013 @12:33AM (#6978544)
Errors are now functions!