Is this valid or a bad idea?
WEBROOT || define('WEBROOT', $config_file_setting);
BEFORE THE ABOVE IS USED...
My controller calls scripts which can also run independently (direct, outside of the controller) and runs pre-config.
Since my controller is called by htaccess at web root, do I even need the absolute path "WEBROOT"; I guess I could just rename it if needed?
case '/verify/':
case (preg_match('/\/verify\/([\d\w]{10,50})$/', $_SERVER['SCRIPT_URL']) ? true : false) :
require(WEBROOT.'/controller-dir/verify.php');
exit;
What about this one for ajax, good or bad idea?
case (preg_match('/\/ajax\/([\w]{5,20})\.php$/', $_SERVER['SCRIPT_URL'], $filename) ? true : false) :
require(WEBROOT.'/ajax-dir/'.$filename[1].'.php');
exit;
Right now I am calling ajax scripts direct, but was considering putting it in the controller; secured better of course :)
I do the case preg_match's at the end of the switch, before default which becomes a 404 to avoid slowing valid & 301 redirects.
Thanks!