apollo11/env-analyzer 问题修复 & 功能扩展

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

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

apollo11/env-analyzer

Composer 安装命令:

composer require apollo11/env-analyzer

包简介

Analyzes environment files

README 文档

README

Analyzes env dist file and allows to insert missing variables to env file through the console

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist apollo11/env-analyzer "~1.0"

or add

"apollo11/env-analyzer": "~1.0"

to the require section of your composer.json file and run php composer.phar update command.

The package offers:

  1. Env class which can store .env and .env.dist file path, as well as, getting the difference between those files.
  2. Php class which can store env.php and env.dist.php file path, as well as, getting the difference between those files. Note: both php files should return Associative array either strings or integers.
  3. Analyzer class which is used for getting the difference of files through the console

Basic Usage

Generally, the best use case is to call Analyzer from console, because it gives the ability to insert the value of the missing data, as well.

Add the following code to your console command

Analyzer::analyzeEnv($pathToEnv, $pathToEnvDist);

or add

Analyzer::analyzePhp($pathToPhp, $pathToDistPhp);

Usage from Composer

You can also run Analyzer on Composer Scripts

Add the following code to the extra in project's composer.json file

"apollo11-parameters": {
            //env-path and env-dist-path for analyzing env files
            "env-path": ".env",
            "env-dist-path": ".env.dist",
            //php-env-path and php-env-dist-path for analyzing php files
            "php-env-path": "env.php",
            "php-env-dist-path": "env.dist.php"
  },

You should also call the analyzer method from composer script. In this example, I call it from post-install-cmd, which is triggered after composer install is finished. Just add the following code to script in composer.json file

"post-install-cmd": [
            //Analyzer for env files
            "\\apollo11\\envAnalyzer\\Analyzer::analyzeEnvComposer",
            //Analyzer for php files
            "\\apollo11\\envAnalyzer\\Analyzer::analyzePhpComposer"
 ],

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-04-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固