roygoldman/drupal-env-settings 问题修复 & 功能扩展

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

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

roygoldman/drupal-env-settings

Composer 安装命令:

composer require roygoldman/drupal-env-settings

包简介

A library to generate Drupal projects settings using environmental variables.

README 文档

README

This project provides a composer command to generate Drupal configuration and settings using environmental variables.

Usage

To include the commands in your project, simiply add this as a dependency to your Composer project.

composer require roygoldman\drupal-env-settings

Once added to the project, add the desired configuration to your project's composer.json. Configuration should be added to your project's extras block as follows.

{
  ...
  "extra": {
    ...
    "env-settings": {
      "settings_name": "VALUE",
      "another_setting": {
        "sub_setting": "SUB_VALUE",
        "more_nested_settings": {
          "nested_setting": "NESTED_VALUE"
        }
      }
    }
    ...
  },
  ...
}

Settings configuraiton supports nested settings. Nested settings will be converetd into a php array when they are added to the Drupal settings.php.

Once basic configuration is added, run the following commands to generate the settings.php and config files respectfully.

composer drupal:env-settings:generate
composer drupal:env-settings:configure --generators={generator,list}

Command Usage

The following documents the default command arguements for the two commands.

Usage:
  drupal:env-settings:generate [options]

Options:
  -s, --site[=SITE]              Drupal site name. [default: "default"]
  -t, --template[=TEMPLATE]      Settings file template.
Usage:
  drupal:env-settings:configure [options]

Options:
  -e, --from-env[=FROM-ENV]                  Take values from the current environemnt.
  -g, --generators=GENERATORS                Comma separated list of generators (ex. --generators=apache,dotenv). [default: ""]
      --apache--template[=APACHE--TEMPLATE]  Virtualhost template file.
      --apache--out-file[=APACHE--OUT-FILE]  Filename to write. [default: "apache.conf"]
      --apache--format[=APACHE--FORMAT]      Format for output file. [default: "vhost"]
      --dotenv--template[=DOTENV--TEMPLATE]  Output template file.
      --dotenv--out-file[=DOTENV--OUT-FILE]  Filename to write. [default: ".env"]
      --php--template[=PHP--TEMPLATE]        Output template file.
      --php--out-file[=PHP--OUT-FILE]        Filename to write. [default: "config.php"]

Extending

If you find the need for additional generators, you can add them to them using the following snippet.

<?php
use \RoyGoldman\DrupalEnvSettings\ConfigGenerator\ConfigGeneratorHelper;

ConfigGeneratorHelper::setGenerator($name, $class_name);

Contributing

Please report any issues with this project and submit questions on to the GitHub issue queue. I will do my best to follow up with any issues or questions as quickly. If you develop a feature, or fix a bug, please open a pull request to add the changes to the project.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2018-11-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固