I wrote a couple of simple functions to parse MVC URLs (based on kissmvc.com), and this is the only php in my document root:
<?php require '../bootstrap.php'; parse_request();
So, if something happened, it will see everything. Everything else is handled starting with bootstrap. If I wanted, I could move parse_request () to bootstrap.php, but I did it in such a way that I could include my boot file and not send all the website materials if I only clicked the cron script (and this was before I understood about the php_sapi_name () function and constant).
It is not profitable if you have an existing site with php in docroot or are using Wordpress, etc., but if you have this option, this will not allow this particular problem to kick you from boys.
Hans
source share