Needs work
Project:
Drupal core
Version:
main
Component:
file system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
9 Apr 2026 at 12:15 UTC
Updated:
17 Jun 2026 at 04:42 UTC
Jump to comment: Most recent
Inspired by #3453216: Clean up outdated mentions of prepareLegacyRequest I wondered why we explicitly have to call StreamWrapperManager::register() in multiple places - is it enough to register the stream wrappers in the constructor?
Call $this->register() from the constructor
Remove all other calls
See what breaks
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
longwaveComment #4
longwaveSlightly surprised this is green, but it seems like it's working; maybe in a followup we can do the same for
ModuleHandler::loadAll()?Comment #5
longwaveAlso maybe we move
register()into the constructor directly, does it need to be a public method at all?Comment #6
longwaveJust realised the reason this probably wasn't done before is that prior to #3414627: Convert StreamWrapperManager to use a service locator the stream wrappers were not available in the constructor, they were injected shortly afterwards.
Comment #7
smustgrave commentedSeems like a nice cleanup. Not suer if a small CR is needed incase contrib needs to update? May be overkill.
Comment #8
catchThis looks good but I think we should mark ::register() as @internal with a note it will become protected in 13.0.0 or similar, if we want to do that in a follow-up, that's OK but let's open the follow-up if so.
Or reading @longwave's comment a second time, if we inline the logic, we can deprecate it now for removal with no replacement, in which case we could just do that there.
Comment #9
longwaveI do also wonder about the comment in ModuleInstaller about drush, perhaps this needs manual testing with drush because I guess this is quite hard to write an automated test for.
Comment #11
cmlara#3256822: StreamWrapperManager Service has public methods not on interface. may become unnecessary if this is completed.