As i am not a fan of relative paths i find it pretty much annoying to write $_SERVER[‘document_root’] . ‘…/data/something’ whenever i want to work with files placed in data directory.
I have document_root set on public/, so i always have to add ‘…/’ in all of my paths to move one directory up and then go to desired directory from there. One way is to modify $_SERVER[‘document_root’] in index.php so it points to real root directory, not public. Other way is to define global const named ROOT_PATH or something like that, though i find this wrong as well.
How do you handle this trivial problem, when you want to use absolute paths to your files?