承接 kukharenko/env-manager 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kukharenko/env-manager

最新稳定版本:v1.0.4

Composer 安装命令:

composer require kukharenko/env-manager

包简介

none

README 文档

README

Overview

Env Replacer is a powerful tool for managing environment files across multiple projects. It simplifies the process of switching between different environment configurations, ensuring consistency and reducing the risk of errors.

Installation

To install Env Replacer globally using Composer, run the following command:

composer global require kukharenko/env-manager

Follow after install instructions:

cd $(composer global show -P | grep "kukharenko/env-manager" | awk '{print $2}') && composer install

Verify Installation Path

Ensure that vendor/bin is added to your PATH environment variable. You can check this by running:

echo $PATH

If vendor/bin is not included, you need to add it manually:

Edit your ~/.zshrc and ~/.bash_profile files:

vim ~/.zshrc
vim ~/.bash_profile

Add the following line:

export PATH="$PATH:/Users/yourusername/.composer/vendor/bin"

Apply the Changes

After editing the respective files, apply the changes by sourcing them:

source ~/.zshrc
source ~/.bash_profile

Usage

Env Replacer provides several options to manage your environment files efficiently:

Options

  • --project - Specify the environment name to replace. Example: ua
  • --service - List the service names to search, separated by commas. Example: case-service,dictionary-service,import-service. You can also use shorter names for the services, such as: case,dict,imp
  • --restore - If set to true, projects will revert to their previous .env files

Example Command

Show current project configuration:

php er
er

To replace environment files for all projects, run the following command:

php er --project=ua
er ua

To replace environment files for the case-service, run the following command:

php er --project=ua --service=case-service
er ua case-service

To restore the previous .env file for case-service, run the following command:

php er --projects=case-service --restore=true
er --projects=case-service --restore=true

Env files

By default, project .env files are stored in the /Users/yourusername/env-replacer/concrete directory. You can create a new configuration file, such as test.env, and then use it as follows:

php er --project=test

or shorter:

er test

This command will replace the existing .env file in every service with a merged version of base.env and test.env.

Custom services

To override variables for specific service, create service-name.env file in the /Users/yourusername/env-replacer/projects directory with variables you want to add.

cat oauth-service.env

# OAUTH
AUTH_KEY=some value

License

Env Replacer is open-source software licensed under the MIT license.

By following the above steps, you should be able to easily install and use Env Replacer to manage your environment configurations across multiple projects efficiently.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2024-06-29