We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ab4f66 commit a566a9eCopy full SHA for a566a9e
app.php
@@ -1,8 +1,8 @@
1
<?php
2
3
namespace phpish\app;
4
-
5
- function env($custom_envs=[])
+
+ function env($custom_envs=[], $default='production')
6
{
7
$default_envs = [
8
'/^127\.0\.0\.1.*/' => 'development',
@@ -13,7 +13,7 @@ function env($custom_envs=[])
13
$envs = $custom_envs + $default_envs;
14
foreach ($envs as $pattern=>$env_name) if (preg_match($pattern, $_SERVER['HTTP_HOST'])) return $env_name;
15
16
- return 'production';
+ return $default;
17
}
18
19
//TODO: Deprecate in next major version
0 commit comments