Add tagged services information to runtime container

Created on 10 March 2014, about 11 years ago
Updated 12 March 2025, about 2 months ago

Currently, you can only find tagged services on ContainerBuilder, not ContainerInterface.

This leads to implementing a compiler pass object (the only place to get a ContainerBuilder) that finds the tagged services, and then adds them to th container as a parameter that you later use as an argument to a service.

This seems like an unnecessary step to me. If we're storing the list of each tagged service on the "compiled" container, why not just also store a map of tag => services?

If we did that, we could add a findTaggedServiceIds method on our runtime Container. That would allow us to just pass the container to the object that needs it, and it can find the tagged services whenever it needs to. Any object that is going to do something with a list of service ids is going to need the container anyhow, so this seems a lot simpler to me.

Also, this is something that we could maybe do upstream.

✨ Feature request
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

base system

Created by

πŸ‡ΊπŸ‡ΈUnited States msonnabaum

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for sharing your idea for improving Drupal.

    We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. 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!

Production build 0.71.5 2024