rozehnal/environment-parameters 问题修复 & 功能扩展

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

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

rozehnal/environment-parameters

Composer 安装命令:

composer require rozehnal/environment-parameters

包简介

Composer script building your detached parameters for deploying the app. Built above the great incenteev/composer-parameter-handler library.

README 文档

README

This tool allows you to manage app parameters for deployment in separate repositories. The repo is fully compatible with all parameters from https://github.com/Incenteev/ParameterHandler.

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight Latest Unstable Version Latest Stable Version

Run

composer run-script build --no-interaction -- --env=prod

Usage

Add the following in your root composer.json file:

{
    "require": {
        "rozehnal/environment-parameters": "0.x-dev"
    },
    "scripts": {
       "build": [
             "Paro\\EnvironmentParameters\\ParametersHandler::buildParameters"
           ]
    },
    "extra": {
        "environment-parameters": {
          "build-folder": "build",
          "files": [
			{
			  "file": "{env}/key.{env}.p12",
			  "name": "key.p12"
			}
          ],
          "incenteev-parameters": {
            "file": "parameters.yml",
            "env-map": {
              "path": "PATH"
            }
          }
        }
      }
}

The build/parameters.yml will then be created composer script, to match the structure of the dist file parameters.yml by asking you the missing parameters.

Supported syntax

 imports:
     - { resource: 'include.yml' }

Hierarchical structure

{
    "extra": {
        "environment-parameters": {
          "files": [
			{
			  "file": "{env}/key.p12",
			  "name": "key.p12"
			}
          ],
          "incenteev-parameters": {
            "file": "{env}/parameters.yml"
          }
        }
    }
}

composer run-script build --no-interaction -- --env=test/test01

Files are searched in order test/test01/key.p12, test/key.p12 and test/test01/parameters.yml, test/parameters.yml. It means you are able to build configuration on inheritence from parent folders with overriding details in children folders. Applicable for both - files and *.yml files.

Output formats [yaml, php-constants]

Default output format is well-knownyaml file. Currently there is possible to create php file where each parameter defines constant - define(key, value).

{
    "extra": {
        "environment-parameters": {
          "incenteev-parameters": {
            "file": "{env}/parameters.yml",
            "name": "parameters.php",
            "output-format": "php-constants"
          }
        }
    }
}

Example

https://github.com/rozehnal/environment-parameters-test

Todo

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固