stefanocbt/phpdotenv-sync
Composer 安装命令:
composer require stefanocbt/phpdotenv-sync
包简介
A package that makes sure that your .env file is in sync with your .env.example
README 文档
README
phpdotenv-sync
A package that makes sure that your .env file is in sync with your .env.example
Usage
add the library to your project with composer:
composer require stefanocbt/phpdotenv-sync
using the library: phpdotenv-sync has the following operations:
- check: to check diffs between two dotenv files (Example: .env.example and .env)
- sync: to sync two dotenv files (add missing dotenv parameters to destination dotenv file)
Executing:
./vendor/bin/phpdotenvsync [options]
Options:
--opt[=OPT] Specify the right operation (Required) ("check" or "sync")
--src[=SOURCE] Specify the source dotenv file (Optional) (default: current-folder-path/.env.example)
--dest[=DESTINATION] Specify the destination dotenv file (Optional) (default: current-folder-path/.env)
--no-interaction Avoid all kind of user interactions. Default action is to syncing by copying all parameters with their default values (Optional)
if you are in a standard environment and you have .env.example and .env inside the root project folder you can just execute the following command to sync .env.example and .env files:
./vendor/bin/phpdotenvsync --opt=sync
for --src and --dest options you can use absolute and/or relative paths. If, for example, you have the files inside the current pwd folder but dotenv files have different filenames you can launch phpdotenvsync this way:
./vendor/bin/phpdotenvsync --opt=sync --src=./[SRC_FILENAME] --dest=./[DEST_FILENAME]
or if you want to specify an absolute path:
./vendor/bin/phpdotenvsync --opt=sync --src=/absolute/path/to/[SRC_FILENAME] --dest=/absolute/path/to/[DEST_FILENAME]
Development
testing CHECK command into development environment (execute from project root dir):
php bin/phpdotenvsync --opt=check --src="./bin/dev_testing/.env.example" --dest="./bin/dev_testing/.env"
testing SYNC command into development environment (execute from project root dir):
php bin/phpdotenvsync --opt=sync --src="./bin/dev_testing/.env.example" --dest="./bin/dev_testing/.env"
Codequality tests
phpcs
automatic fix with phpcs:
php vendor/bin/phpcbf --standard=PSR12 -n -p src/
stefanocbt/phpdotenv-sync 适用场景与选型建议
stefanocbt/phpdotenv-sync 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 68.35k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 12 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 stefanocbt/phpdotenv-sync 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 stefanocbt/phpdotenv-sync 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 68.35k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-12-07