two-thirds/env-parser
Composer 安装命令:
composer require two-thirds/env-parser
包简介
README 文档
README
This is a simple library that extends vlucas/phpdotenv to parse an env file and return an array of values. It is designed to be completely isolated from the current environment by default. It will never export variables into the current environment. By default it will not import current environment variables for nested replacement, but there is an option to do so.
.env.test:
EXAMPLE="Hello World!"
NUMBER=123
WITH_SPACES="with spaces"
REPLACEMENT="the example variable says ${EXAMPLE}"
$variables = EnvParser::parse(realpath('.env.test'));
$variables === [
'EXAMPLE' => 'Hello World!',
'NUMBER' => '123',
'WITH_SPACES' => 'with spaces',
'REPLACEMENT' => 'the example variable says Hello World!',
];
Note: The returned values will always be strings. In certain frameworks like Laravel, conversion of
"(false)"tofalseor"null"tonullhappens within the framework and is not the responsibility of this library orvlucas/phpdotenv
Versions
This library currently supports two versions of vlucas/phpdotenv
| env-parser tag | phpdotenv tag |
|---|---|
| 2.2.x | ^2.2 |
| 3.3.x | ^3.3 |
This is primarily done to provide support for Laravel 5.3 and up, which at the time of writing this only used ^2.2 and ^3.3. If you encounter bugs, please be sure to report the exact version of phpdotenv that you're using so this can be adjusted accordingly.
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-17