Commit 1d8712ff authored by alexpott's avatar alexpott

Issue #3079029 by bircher, ricardoamaro, catch, wouter.adem, marcvangend,...

Issue #3079029 by bircher, ricardoamaro, catch, wouter.adem, marcvangend, alexpott: Move module config exclusion from config_environment to core.services
parent cae168a3
......@@ -129,3 +129,27 @@
* directory.
*/
$settings['skip_permissions_hardening'] = TRUE;
/**
* Exclude modules from configuration synchronisation.
*
* On config export sync, no config or dependent config of any excluded module
* is exported. On config import sync, any config of any installed excluded
* module is ignored. In the exported configuration, it will be as if the
* excluded module had never been installed. When syncing configuration, if an
* excluded module is already installed, it will not be uninstalled by the
* configuration synchronisation, and dependent configuration will remain
* intact. This affects only configuration synchronisation; single import and
* export of configuration are not affected.
*
* Drupal does not validate or sanity check the list of excluded modules. For
* instance, it is your own responsibility to never exclude required modules,
* because it would mean that the exported configuration can not be imported
* anymore.
*
* This is an advanced feature and using it means opting out of some of the
* guarantees the configuration synchronisation provides. It is not recommended
* to use this feature with modules that affect Drupal in a major way such as
* the language or field module.
*/
# $settings['config_exclude_modules'] = ['devel', 'stage_file_proxy'];
......@@ -1280,6 +1280,11 @@ services:
tags:
- { name: event_subscriber }
arguments: ['@config.manager', '@config.storage', '@config.storage.snapshot']
config_exclude_modules_subscriber:
class: Drupal\Core\EventSubscriber\ExcludedModulesEventSubscriber
arguments: ['@config.storage', '@settings', '@config.manager']
tags:
- { name: event_subscriber }
exception.needs_installer:
class: Drupal\Core\EventSubscriber\ExceptionDetectNeedsInstallSubscriber
arguments: ['@database']
......
<?php
namespace Drupal\config_environment\EventSubscriber;
namespace Drupal\Core\EventSubscriber;
use Drupal\Core\Config\ConfigManagerInterface;
use Drupal\Core\Config\StorageInterface;
......
# @todo: Move this test module under the config module in #3079029.
name: 'Configuration Module Exclude Test'
type: module
package: Testing
......
services:
config_environment.excluded_modules.event_subscriber:
class: Drupal\config_environment\EventSubscriber\ExcludedModulesEventSubscriber
arguments: ['@config.storage', '@settings', '@config.manager']
tags:
- { name: event_subscriber }
<?php
namespace Drupal\Tests\config_environment\Kernel\EventSubscriber;
namespace Drupal\KernelTests\Core\Config;
use Drupal\KernelTests\KernelTestBase;
......@@ -16,7 +16,6 @@ class ExcludedModulesEventSubscriberTest extends KernelTestBase {
*/
protected static $modules = [
'system',
'config_environment',
'config_test',
'config_exclude_test',
];
......
......@@ -129,3 +129,27 @@
* directory.
*/
$settings['skip_permissions_hardening'] = TRUE;
/**
* Exclude modules from configuration synchronisation.
*
* On config export sync, no config or dependent config of any excluded module
* is exported. On config import sync, any config of any installed excluded
* module is ignored. In the exported configuration, it will be as if the
* excluded module had never been installed. When syncing configuration, if an
* excluded module is already installed, it will not be uninstalled by the
* configuration synchronisation, and dependent configuration will remain
* intact. This affects only configuration synchronisation; single import and
* export of configuration are not affected.
*
* Drupal does not validate or sanity check the list of excluded modules. For
* instance, it is your own responsibility to never exclude required modules,
* because it would mean that the exported configuration can not be imported
* anymore.
*
* This is an advanced feature and using it means opting out of some of the
* guarantees the configuration synchronisation provides. It is not recommended
* to use this feature with modules that affect Drupal in a major way such as
* the language or field module.
*/
# $settings['config_exclude_modules'] = ['devel', 'stage_file_proxy'];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment