gacela-project/gacela-env-config-reader
最新稳定版本:0.3
Composer 安装命令:
composer require gacela-project/gacela-env-config-reader
包简介
Load .env files into Gacela
README 文档
README
Load .env configuration files for your Gacela projects.
composer require gacela-project/gacela-env-config-reader
Setup
You can define the reader configuration either in the Gacela::bootstrap() or in a gacela.php file.
Option A)
Define the configuration in a gacela.php file in the root of your project (recommended way):
<?php # gacela.php use Gacela\Framework\Bootstrap\GacelaConfig; use Gacela\Framework\Config\ConfigReader\EnvConfigReader; return static function (GacelaConfig $config): void { $config->addAppConfig('config/.env*', 'config/.env.local.dist', EnvConfigReader::class); };
Option B)
Define all configuration on the fly in the bootstrap itself.
<?php # public/index.php use Gacela\Framework\Bootstrap\GacelaConfig; use Gacela\Framework\Config\ConfigReader\EnvConfigReader; use Gacela\Framework\Gacela; $config = static function (GacelaConfig $config): void { $config->addAppConfig('config/.env*', 'config/.env.local.dist', EnvConfigReader::class); }; Gacela::bootstrap($appRootDir, $config);
You can define more than one ConfigReader at once.
$config = static function (GacelaConfig $config): void { $config->addAppConfig('config/.env*', 'config/.env.local.dist', EnvConfigReader::class); $config->addAppConfig('config/*.php', 'config/local.php'); $config->addAppConfig('config/*.custom', '', CustomConfigReader::class); }
统计信息
- 总下载量: 1.08k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-30