What would be the most elegant way to express the following in PHP:
- Look into the parent directory for a file called 'config.php'.
- If it is there, include it.
- It its not, look at the next higher level for a file called 'config.php'.
- And so on, until you have either found the root 'config.php', or have reached some defined endpoint (e.g. DOCUMENT_ROOT).
Are there any predefined functions or "inclusion strategies" to serve that purpose, or would I have to implement this snippet myself?