Macaw - A Simple PHP Router
github.com
Macaw - A Simple PHP Router
1–10 of 52 posts
Re: Macaw - A Simple PHP Router
#2 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
#3Re: Macaw - A Simple PHP Router
#4nice job on creating a really damn simple interface.
Re: Macaw - A Simple PHP Router
#5Re: Macaw - A Simple PHP Router
#6this is very elegant. i haven't used php (beyond wordpress) in years, so i am sure a lot has changed with all the frameworks which cropped up. one of the things i miss about php was the simplicity of dropping a file into a path and making requests directly to it, no extra dependencies required. i know a lot of people prefer prettier urls, so why not use .htaccess file for mod_rewrite rather than using something like…
Re: Macaw - A Simple PHP Router
#7this is very elegant. i haven't used php (beyond wordpress) in years, so i am sure a lot has changed with all the frameworks which cropped up. one of the things i miss about php was the simplicity of dropping a file into a path and making requests directly to it, no extra dependencies required. i know a lot of people prefer prettier urls, so why not use .htaccess file for mod_rewrite rather than using something like…
.htacess and nginx rewriting breaks down when you need to do more complex stuff, at least if you wasn't to keep things maintainable and clean. Pushing routing like this through to the app side gives a lot more flexibility :)
Re: Macaw - A Simple PHP Router
#8For 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
#9if 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.