1 | <?php |
||
5 | class Env |
||
6 | { |
||
7 | const CONVERT_BOOL = 1; |
||
8 | const CONVERT_NULL = 2; |
||
9 | const CONVERT_INT = 4; |
||
10 | const STRIP_QUOTES = 8; |
||
11 | const USE_ENV_ARRAY = 16; |
||
12 | const LOCAL_FIRST = 32; |
||
13 | |||
14 | public static $options = 15; //All flags enabled |
||
15 | public static $default = null; //Default value if not exists |
||
16 | |||
17 | /** |
||
18 | * Returns an environment variable. |
||
19 | * |
||
20 | * @param string $name |
||
21 | */ |
||
22 | public static function get($name) |
||
42 | |||
43 | /** |
||
44 | * Converts the type of values like "true", "false", "null" or "123". |
||
45 | * |
||
46 | * @param string $value |
||
47 | * @param int|null $options |
||
48 | * |
||
49 | * @return mixed |
||
50 | */ |
||
51 | public static function convert($value, $options = null) |
||
78 | |||
79 | /** |
||
80 | * Strip quotes. |
||
81 | * |
||
82 | * @param string $value |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | private static function stripQuotes($value) |
||
97 | } |
||
98 |