Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ss23
Created October 14, 2013 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ss23/6972041 to your computer and use it in GitHub Desktop.
Save ss23/6972041 to your computer and use it in GitHub Desktop.
<?php
$dir = __DIR__; // Start in our current directory
$envFile = '_ss_environment.php';
while ($dir) {
if (is_readable($dir)) {
if (file_exists($dir . $envFile)) {
require $dir . $envFile;
break;
}
}
$dir = substr($dir, 0, strrpos($dir, '/'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment