Based on https://gist.github.com/sun/10732324
-
Make
DrupalKernelautomatically consume a$conf_path/services.ymlfile, if available. -
Provide the simple concept of a "secondary config storage to write to" in core.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff.txt | 4.78 KB | sun |
| #6 | config.chainwrite.5.patch | 6.38 KB | sun |
| #4 | config.chainwrite.4.patch | 6.38 KB | sun |
| #1 | config.chainwrite.1.patch | 6.98 KB | sun |
Comments
Comment #1
sunComment #2
tim.plunkettSo 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?
Comment #3
sunThe
$conf_path/services.ymlmakes 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
Comment #4
sunThat has landed. Merged 8.x.
I like @tim.plunkett's suggestion in #2 — going to try out whether that works now.
Comment #5
Anonymous (not verified) commentedcool issue, i look forward to rm -rf'ing the config devel project once this lands.
Comment #6
sunUse 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.ymlfile; 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).
Comment #7
jibransomewhat related #2315613: Add a development.services.yml for development
Comment #23
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #24
smustgrave commentedwanted to bump 1 more time before closing.
Comment #26
smustgrave commentedNot comfortable closing this one so moving to active.