Skip to content

Commit a566a9e

Browse files
committed
Made default env overridable.
1 parent 7ab4f66 commit a566a9e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
namespace phpish\app;
4-
5-
function env($custom_envs=[])
4+
5+
function env($custom_envs=[], $default='production')
66
{
77
$default_envs = [
88
'/^127\.0\.0\.1.*/' => 'development',
@@ -13,7 +13,7 @@ function env($custom_envs=[])
1313
$envs = $custom_envs + $default_envs;
1414
foreach ($envs as $pattern=>$env_name) if (preg_match($pattern, $_SERVER['HTTP_HOST'])) return $env_name;
1515

16-
return 'production';
16+
return $default;
1717
}
1818

1919
//TODO: Deprecate in next major version

0 commit comments

Comments
 (0)