123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace think;
- class Env
- {
-
- public static function get($name, $default = null)
- {
- $result = getenv(ENV_PREFIX . strtoupper(str_replace('.', '_', $name)));
- if (false !== $result) {
- if ('false' === $result) {
- $result = false;
- } elseif ('true' === $result) {
- $result = true;
- }
- return $result;
- }
- return $default;
- }
- }
|