定制 alpaca-sh/magento2-environmentconfig 二次开发

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

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

alpaca-sh/magento2-environmentconfig

最新稳定版本:0.2.0

Composer 安装命令:

composer require alpaca-sh/magento2-environmentconfig

包简介

Apply environment specific configuration for Magento 2 projects

README 文档

README

This Magento 2 module aims to be a simple way of applying specific Magento configuration for the current environment, based on YAML or JSON files.

Build upon the semaio/magento2-configimportexport module.

Installation

Install via composer

composer require alpaca-sh/magento2-environmentconfig

Enable and install the module

php bin/magento module:enable Alpaca_EnvironmentConfig
php bin/magento setup:upgrade

Usage

Configuration folder

Create a new folder in the root of your project (default: .environment), and add this folder to your .gitignore. Next, create one or more files (yaml or json) with your desired configuration.

See File Formats for an extensive overview of the supported file formats, supported by the underlying module semaio/magento2-configimportexport.

Example

# .environment/web.yaml

web/unsecure/base_url:
  default:
    0: 'http://magento-app.com/'
web/secure/base_url:
  default:
    0: 'https://magento-app.com/'

Encrypted values

If you need to save encrypted values but prefer to store the decryted value in your yaml or json file you can use the !encryted prefix.

service/api/key:
  default:
    0: '!encrypted supersecretapikey'

Apply changes (manually)

Apply changes using the defaults:

  • Folder: .environment
  • Format: yaml
bin/magento environment:config:process

Apply changes with non-default folder name and format

bin/magento environment:config:process --folder <folder-path> --format json

After the changes have been applied, the cache will be cleared automaticly. To skip that you can use the --no-cache option.

Apply changes (automatically)

The configuration can also be applied automatically when running bin/magento setup:upgrade.

Add the following configuration to your app/etc/env.php.

'environment_config' => [
    'auto_update' => [
        'enabled' => true
    ]
]

You can override the defaults:

'environment_config' => [
    'auto_update' => [
        'enabled' => true,
        'directory' => '.environment',
        'format' => 'yaml'
    ]
]

Licence

Open Software License (OSL 3.0)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2021-06-25