espressobytes/mergeconfigfiles

用于 Magento 2 合并配置文件

1.0.4 2020-06-23 09:27 UTC

This package is auto-updated.

Last update: 2024-09-23 20:08:56 UTC


README

简介

此模块的目的是将两个配置文件(config.php形式)合并到一个新的配置文件中

安装

通过 composer 安装

composer require espressobytes/mergeconfigfiles

用法

在 Magento-Root 中使用

 bin/magento config-merge:merge-files <input config file 1> <input config file 2> <output config file> [<output config file> Default: app/etc/]

示例

 bin/magento config-merge:merge-files config.php config_build_addons.php config_buildsystem.php

在 Magento 2 部署中集成

要在 Magento 部署中使用此命令,必须修改默认命令列表。您可以通过 composer-patches 来实现

在您的 `composer.json` 中添加(示例)

...
"extra": {
    "patches": {
        "magento/magento2-base": {
            "Add new Command to CommandList": "patches/composer/magento2base_add_command.patch"
        },

按照此示例,您必须在 patches/composer 文件夹中创建一个新的补丁文件,命名为 magento2base_add_command.patch

将以下内容添加到该文件中

Index: a/setup/src/Magento/Setup/Console/CommandList.php
<+>UTF-8
===================================================================
--- a/setup/src/Magento/Setup/Console/CommandList.php
+++ a/setup/src/Magento/Setup/Console/CommandList.php
@@ -74,7 +74,8 @@
             \Magento\Setup\Console\Command\RollbackCommand::class,
             \Magento\Setup\Console\Command\UpgradeCommand::class,
             \Magento\Setup\Console\Command\UninstallCommand::class,
-            \Magento\Setup\Console\Command\DeployStaticContentCommand::class
+            \Magento\Setup\Console\Command\DeployStaticContentCommand::class,
+            \Espressobytes\MergeConfigFiles\Command\MergeConfigFilesCommand::class
         ];
     }