Skip to content

Instantly share code, notes, and snippets.

@birnam
Created April 12, 2014 20:22
Show Gist options
  • Save birnam/10554925 to your computer and use it in GitHub Desktop.
Save birnam/10554925 to your computer and use it in GitHub Desktop.
local env not correct
$env = $app->detectEnvironment(function () use ($app) {
// Possible Environments:
// - local
// - test
// - stage
// - production (default)
var_dump(gethostname());
preg_match("/karefirst\\/([a-z]+)/usm", __FILE__, $match);
// If on the web server, parse from path
if (isset($match[1])) {
return $match[1];
}
return $app->detectEnvironment(array(
'local' => ['localhost','cmMBPr.local','codeinvim.local']
));
});
// outputs:
//
// string(15) "codeinvim.local"
// Current application environment: site
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment