Re:Link: A fast and simple PHP Router
by insky on Friday May 30, 2014 @04:42AM
(#7820831)
A late trick I discovered, was that you can configure your php instance to inclued a file with every script. For example the following can be added to .htaccess:
You can then use that for bootstrapping, front controller and to limit access. Can be a bit clumsy, but it's nicely divorced from simple page controllers.
[ Parent
| on HN ]
neat! this beats putting an include at the top of each file...
It certainly does.
I personally would still prefer a router but I know of a project which was written almost entirely in sprawling, procedural PHP that might benefit from this. Although I do wonder what the performance hit would be.