grotthecheat/yaml-config-package-installer-plugin

插件,用于自动将包配置设置添加到应用级别的设置文件。

v1.0.5-stable 2023-06-09 10:53 UTC

This package is auto-updated.

Last update: 2024-09-09 13:27:28 UTC


README

grotthecheat/yaml-config-package-installer-plugin 包是一个 composer 插件,可用于从子组件包中包含的配置文件构建集中式应用程序配置文件。

在包根目录中包含一个如以下示例的 config.yaml 文件,当需要时,插件会查找此文件,如果找到,则将定义的设置复制到集中式配置文件中。

vendor: grotthecheat
package: mysql
settings:
    - server
    - port
    - schema
    - username
    - password

此示例将转换为应用程序配置如下

grotthecheat:
    mysql:
        server: null
        port: null
        schema: null
        username: null
        password: null

默认情况下,应用程序配置位于 vendor 目录之上的一级,通常是应用程序的根文件夹,但如果情况不是这样,则可以通过在项目的 composer.json 文件中添加一个 extra 部分来指定一个特定位置。

"extra" : {
    "yaml-config-application-config": "../folder/application_config.yaml"
}

注意:此应用程序配置的路径相对于 composer vendor 目录。