Postponed (maintainer needs more info)
Project:
Drupal core
Version:
main
Component:
plugin system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Aug 2012 at 08:50 UTC
Updated:
30 Oct 2025 at 14:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
xanoYes! If, in the future, we will also get things like #2458789: Introduce PluginDefinitionInterface, we have access to all plugins of all plugin types in the code.
In the meantime, what about we something similar to
plugin_manager_cache_clear? We could extendPluginManagerPasswith support for that tag andplugin_managerand use it for listing all plugin managers and cache clearing at the same time.Comment #2
dawehnerI'd say that both, the plugin cache clear, as well as the potential plugin type listing service could leverage the same information.
Comment #3
xanoGiven a service ID, can we find out which module defined it? I dug through how
DrupalKerneldiscovers all services, but apart from the fact that on every service definition it sets the file it was defined in–which is partly useful at best–I can't really see any useful metadata.Comment #4
dawehnerNot really at the moment ...
Comment #5
xanoComment #7
xanoComment #10
xanoRe-roll.
Comment #11
dawehnerUrgs, so once you would use that particular class somewhere you would initialize all the plugin managers. Maybe make at least plugin.manager_collection lazy?
Nitpick: missing empty line
It would be great to document the purpose of this interface :)
Comment #12
xanoAn alternative would be to inject the service IDs and the container. The downside of that is that it tightly couples the class with Symfony's DependencyInjection component and we'd have to add some runtime validation to make sure the service IDs do indeed reference instances of classes that implement
PluginManagerInterface.Comment #13
xanoThe suggestion in #12 also means this code would have to be moved from
\Drupal\Componentto\Drupal\Core.Comment #14
dawehnerAt least we should make the plugin.manager_collection lazy, so we don't inject all the things unless we really want to do something with it.
Comment #15
xanoWhat exactly does lazy mean in this case?
Comment #16
xanoSee #2513946: Add plugin type discovery for a more comprehensive contrib solution.
Comment #17
xanoComment #18
xanoI propose we include Plugin's solution in core, as described in PLUGIN_TYPES.md. This means modules should expose their plugin types using
$module.plugin_type.ymlfiles in their root folders (example). PluginTypeManager uses PluginType as the default plugin type 'definition' class, but as you can see that's pluggable, and as such plugin managers can be defined in custom ways.If this approach is seen as viable, I can work on a patch.
Comment #34
smustgrave commentedThank 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!
Comment #35
smustgrave commentedWanted to bump this 1 more time.