Skip to content

Instantly share code, notes, and snippets.

@WISHPRO
Forked from paulofreitas/environment.php
Last active August 29, 2015 14:19
Show Gist options
  • Save WISHPRO/0526dd1e39ddbb756fdd to your computer and use it in GitHub Desktop.
Save WISHPRO/0526dd1e39ddbb756fdd to your computer and use it in GitHub Desktop.
<?php
$env = $app->detectEnvironment(function () {
$env_files = glob(__DIR__ . '/../.env.*.php');
if (count($env_files)) {
list($env) = sscanf(basename(current($env_files)), '.env.%[^.].php');
return $env;
}
return 'production';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment