Is there a favored method for specifying the root folder of your website/application without having to resort to code like this:
require '../../../../config/settings.php';
I've used various methods before, and the one I'm currently considering is setting an environment variable on my host, so that I can do something like this instead:
require getenv('PROJECT_ROOT') . '/config/settings.php';
But this is really only feasible for systems with one project on them, and it has various other disadvantages, so I was wondering if there was a better method?