ytake / hackdotenv
从 .env 文件加载环境变量到 getenv()
0.9.1
2020-07-03 00:17 UTC
Requires
- hhvm: ^4.62
- hhvm/hhvm-autoload: ^3.0
- hhvm/hsl: ^4.0
- hhvm/hsl-experimental: ^4.25
Requires (Dev)
- facebook/fbexpect: ^2.7.3
- hhvm/hacktest: ^2.0.0
- hhvm/hhast: ^4.0.0
README
从 .env 文件加载环境变量到 getenv()。
vlucas/phpdotenv 转换为 Hack
require HHVM >=4.20
安装
$ hhvm $(which composer) require ytake/hackdotenv
用法
将您的应用程序配置保存到项目根目录下的 .env 文件中。
FOO=bar
BAR=baz
然后您可以在应用程序中加载 .env 文件。
use type Ytake\Dotenv\Loader; $dotenv = new Dotenv($this->dir); await $dotenv->loadAsync();
use namespace Ytake\Dotenv; Dot\env('FOO');