bmaximilian/laravel-env-overloader
Composer 安装命令:
composer require bmaximilian/laravel-env-overloader
包简介
A Dotenv extension to use multiple environment config files
README 文档
README
A Dotenv extension to use multiple environment config files.
Environment overloading can be useful when dealing with local environment variables (such as APP_KEY) or when dealing with secrets that should not be committed to your repository.
Installation
Install with composer
composer require bmaximilian/laravel-env-overloader
Overload the environment with multiple env files
Paste the following code in your bootstrap/app.php
$env = $app->detectEnvironment(function() { MaximilianBeck\Environment\Overloader\EnvironmentOverloader::overload(); });
Use commands to generate a simple .env file
If you are on Laravel < 5.4: Add the following provider to your $providers in config/app.php
MaximilianBeck\Environment\Overloader\Console\Providers\EnvironmentConsoleServiceProvider::class,
For newer Laravel versions, this service provider should be auto-discovered.
Usage
Create .env Files in the root directory of your Laravel application.
The .env.base File can be created for configuration that should be the same for all environments (e.g. feature flags).
The .env.${APP_ENV} File is loaded for all specific configurations for the currently deployed environment.
You can also pass an array of file names to the EnvironmentOverloader::overload() as first argument for more custom environment files.
The standard .env File is loaded as master which overrides other files.
bmaximilian/laravel-env-overloader 适用场景与选型建议
bmaximilian/laravel-env-overloader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.66k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 09 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「environment」 「env」 「dotenv」 「Overload」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bmaximilian/laravel-env-overloader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bmaximilian/laravel-env-overloader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bmaximilian/laravel-env-overloader 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Environment processor and contexts autoloader
The tenancy/tenancy identification driver using environment variables
Multiple cascading environmental configuration files support for Laravel 5
An environment variable convenience library extension for vlucas/phpdotenv
Laravel dotenv manager
Utils to load, parse and work with configuration on Mezzio projects
统计信息
- 总下载量: 3.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-18