stefanocbt/phpdotenv-sync 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

stefanocbt/phpdotenv-sync

最新稳定版本:1.3.0

Composer 安装命令:

composer require stefanocbt/phpdotenv-sync

包简介

A package that makes sure that your .env file is in sync with your .env.example

README 文档

README

Tests Actions Status Tests Actions Status

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/

统计信息

  • 总下载量: 47.78k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-07