Slide 23
Slide 23 text
$hosts = array(
'local' => array(
'localhost',
'127.0.0.1',
'myapp.local',
'myapp.local.dev',
'myapp.dev.local',
'local.myapp.com'
),
'production' => array('myapp.com', 'www.myapp.com'),
'test' => array('test.myapp.com', 'myapp.test.local'),
'development' => array(
'10.183.1.63', '10.183.1.57',
'50.56.80.111', '50.56.80.107',
'dev.myapp.com'
)
);
$current = $request->get('http:host');
foreach ($hosts as $env => $list) {
if (in_array($current, $list)) {
return $env;
}
}
return 'production';