rstgroup/zf-local-config-module 问题修复 & 功能扩展

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

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

rstgroup/zf-local-config-module

Composer 安装命令:

composer require rstgroup/zf-local-config-module

包简介

Module responsible for adding custom config.

README 文档

README

This module allows you to dynamically adjust configuration of your application via command-line interface.

Installation

Require module with Composer:

composer require rstgroup/zf-local-config-module

The next step is adding module to ZF system configuration (config/application.config.php):

return [
    'modules' => [
        (...),
        'RstGroup\ZfLocalConfigModule',
    ],
    (...)
]

... and providing the required configuration in your application's config:

return [
    'rst_group' => [
        'local_config' => [
            'filename' => 'config/autoload/dynamic-config.local.php'
        ],
    ],
];

Usage

The module provides command-line commands to help managing local, dynamically generated, application configuration.

Setting configuration

Setting configuration is as simple as writing the line:

php public/index.php local-config set path.to.value string-value

This will result in writing the code into config/autoload/dynamic-config.local.php file:

return [
    'path' => [
        'to' => [
            'value' => 'string-value'
        ],
    ],
];

By default, all values passed via command line are treated as strings. To set value of any simple type, you can use JSON notation. To enable it, just add --json flag.

Look at some of the examples below:

# setting a number
php public/index.php local-config set path.to.value 1234 --json
# setting null
php public/index.php local-config set path.to.value null --json

JSON notation can also be used to set a structure or an array in given path:

# setting an array
php public/index.php local-config set array "[1,2,3,4]" --json
# setting complex structure
php public/index.php local-config set structure '{"complex":{"structure":{"x":"y"},"x":null}}' --json

The result of these two commands ran one after another would be a config/autoload/dynamic-config.local.php file like:

return [
    'array' => [ 1, 2, 3, 4 ],
    'complex' => [
        'structure' => [
            'x' => 'y'
        ],
        'x' => null,
    ],
];

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固