定制 justcoded/dotenv-sync 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

justcoded/dotenv-sync

最新稳定版本:1.0.1

Composer 安装命令:

composer require justcoded/dotenv-sync

包简介

README 文档

README

The package is intended for avoiding problems with .env and .env.example files content mismatch.

Installation

Start by requiring the package with composer:

composer require justcoded/dotenv-sync

or add it to your composer.json and run composer update

Usage

Add the next line to your git pre-commit hooks (.git/hooks/pre-commit) to prevent committing if .env has params missed in .env.example and vice versa. Ensure the file vendor/bin/dotenv-diff is executable.

exec vendor/bin/dotenv-diff {envFileName} {envExampleFileName}

We also recommend to use this package to manage your git hooks inside composer.json: https://github.com/BrainMaestro/composer-git-hooks

To make bin scripts executable just run:

chmod +x vendor/bin/dotenv-diff vendor/bin/dotenv-sync

To sync missing variables to your .env and .env.example files run the next command

vendor/bin/dotenv-sync {envFileName} {envExampleFileName}

Also you can notify about diff on composer install. To do this add such script to your composer.json:

{
  // ...
  "scripts": {
    "post-install-cmd": [
      "dotenv-diff"
    ],
    "post-update-cmd": [
      "dotenv-diff"
    ]
  }

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 4
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-20