Based on https://gist.github.com/sun/10732324

  1. Make DrupalKernel automatically consume a $conf_path/services.yml file, if available.

  2. Provide the simple concept of a "secondary config storage to write to" in core.

    (cf. https://drupal.org/project/config_devel)

Files: 
CommentFileSizeAuthor
#6 interdiff.txt4.78 KBsun
#6 config.chainwrite.5.patch6.38 KBsun
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch config.chainwrite.5.patch. Unable to apply patch. See the log in the details link for more information. View
#4 config.chainwrite.4.patch6.38 KBsun
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 71,125 pass(es). View
#1 config.chainwrite.1.patch6.98 KBsun
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 67,804 pass(es). View

Comments

sun’s picture

Status: Active » Needs review
FileSize
6.98 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 67,804 pass(es). View
tim.plunkett’s picture

+++ b/sites/default/default.settings.php
@@ -244,6 +244,35 @@
+ *     calls:
+ *       - [addStorage, ['@config.storage.file']]

So then if you had one module doing this, and you wanted another tertiary write, you'd need ServiceModifierInterface to add another addStorage call?

Why not use a tagged service?

And why not (similar to routing) ship with the ChainWriteStorage on by default, and just not having any secondary storages?

sun’s picture

The $conf_path/services.yml makes sense on its own, and a test for that actually revealed that site-specific overrides are not processed in the correct order.

Therefore, I've split that change out into a separate issue:

#2241633: Simplify site-specific service overrides

sun’s picture

FileSize
6.38 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 71,125 pass(es). View

That has landed. Merged 8.x.

I like @tim.plunkett's suggestion in #2 — going to try out whether that works now.

beejeebus’s picture

cool issue, i look forward to rm -rf'ing the config devel project once this lands.

sun’s picture

FileSize
6.38 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch config.chainwrite.5.patch. Unable to apply patch. See the log in the details link for more information. View
4.78 KB

Use ChainWriteStorage as default active storage + use service_collector.

Works nicely.

That said, this use-case revealed that it's currently not possible to "enhance" a service in a site-specific services.yml file; e.g., to just add a tag. — parent: does not work for the same service ID; i.e., it does not "merge" an existing service definition into the "new" definition. Perhaps it should; I'll create an issue to investigate that.


@beejeebus: Unless I'm mistaken, I think you've added some more good ideas + fancy features to config_devel that we should additionally investigate for core (in separate issues).

jibran’s picture

anavarre queued 6: config.chainwrite.5.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, 6: config.chainwrite.5.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.