nedsbeds/profile_split_enable
Composer 安装命令:
composer require nedsbeds/profile_split_enable
包简介
Allows Drupal sites using multiple profiles, CMI and config split to have a config split defined for each profile
README 文档
README
This module is now managed at Drupal.org https://www.drupal.org/project/profile_split_enable
To switch, please run composer remove nedsbeds/profile_split_enable and composer require 'drupal/profile_split_enable:^2.0'
Profile Split Enable
This module allows you to install Drupal from a custom Drupal installation profile, ignoring the profile that is set in the default core.extension.yml file.
When using config_split it allows you to dynamically enable and import configuration from a config split for each of your custom installation profiles.
Introduction
Theoretically, using multi-site Drupal 8, you might want to have multiple profiles. Then, you can install various sites on your multi-site platform from any one of the profiles. Going a step farther, you likely want to have configuration for each of the profiles.
There is an issue currently between drupal/core, drupal/config_split, and acquia/blt that isn't allowing config splits at the profile level to work.
The issue, fundamentally, is that a config split model assumes a default set of configuration that is overwritten in the various splits. This works great for single profile models. However with a multi-profile model, this immediately breaks down because drupal/core writes the profile key into core.extensions.yml. The result? As soon as you try to import config on a site with an active profile that is not the profile in core.extensions.yml you get the following error:
The selected installation profile <em class="placeholder">profile_1</em> does not match the profile stored in configuration <em class="placeholder">profile</em>
This module attempts to remedy the situation by filtering the current profile name when Drupal reads or writes to the core.extension file on disk so that the currently installed profile never conflicts with the profile in your default configuration.
Additionally, if you are using config_split, it will enable a split that matches the name of your installed profile at run time. This allows you to have configuration specifically enabled per split.
Requirements
This module requires the following modules:
- Config Filter (https://www.drupal.org/project/config_filter)
Recommended Modules
- Config Split (https://www.drupal.org/project/config_split): When enabled it will allow different config per profile. This module will automatically enable the relevant split
Installation
This module is distributed through packagist therefore should be installed using composer.
composer require nedsbeds/profile_split_enable ^1.0.0
-
Install as you would normally install a contributed Drupal module.
Visit: https://www.drupal.org/documentation/install/modules-themes/modules-8 for further information.
Configuration
The module has no menu or modifiable settings. There is no configuration.
For this module to function, you MUST add it as a dependency of your profile, and then ensure it is also enabled in config (i.e. your core.extenstion file)
This is vital since the module must be enabled before and after you attempt to import your configuration.
example_profile/example_profile.info.yml
name: 'Example Profile' type: profile description: 'Example lightning sub profile.' version: 1.0.0 base profile: lightning core: 8.x dependencies: - profile_split_enable
config/default/core.extension.yml
module: ... config_filter: 0 config_split: 0 ... profile_split_enable: 0 ...
Multiple Profiles
For basic functionality this module only requires Drupal 8 and the config_filter module. Once enabled, it will allow you to install Drupal using a profile that is different to the one specified in your default core.extension file.
You will likely want to use a profile such as acquia/lightning which allows you to create sub-profiles (https://docs.acquia.com/lightning/subprofile). It is recommended that you use acquia/blt to setup your drupal project since sub-profiles currently need a patch to Drupal core to function.
Profile Splits
After the first installation of Drupal with your base profile, enable the config_split module and create splits for each of your profiles. The machine name of the split should match the machine name of your profile.
Limitations/Outstanding features
This module does not currently support installation from existing configuration. You are expected to be using a workflow that involves installing Drupal from a profile and then importing configuration. This workflow is the approach that tools such as Acquia BLT and Acquia ACSF utilise.
Maintainers
- Nick Downton (nedsbeds) - https://www.drupal.org/user/2720065
nedsbeds/profile_split_enable 适用场景与选型建议
nedsbeds/profile_split_enable 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 234.66k 次下载、GitHub Stars 达 11, 最近一次更新时间为 2019 年 04 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 nedsbeds/profile_split_enable 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nedsbeds/profile_split_enable 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 234.66k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2019-04-27