Needs work
Project:
Drupal core
Version:
main
Component:
base system
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Oct 2014 at 21:16 UTC
Updated:
24 Aug 2023 at 12:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
chx commentedComment #2
fabianx commentedI really like the API idea here! :)
Comment #3
chx commentedComment #4
chx commenteddawehner points out that
So borrowing the
service:methodfairly ubiquitous syntax (due to ControllerResolver/ClassResolver).Comment #5
sdboyer commentedthis is graphsort, and we could def use gliph to facilitate it.
if it's just operating on strings then i'd probably need to write another graph implementation that allows non-objects...and update the php5.3 branch to php5.4. but that's all fine and doable, and i'd be willing to do it to facilitate this.
Comment #6
chx commentedYes, it's topological sort again, but since module dependencies do not use glyph but my really primitive little graph class I will use just that. When module dependencies convert to glyph this can too. It's really simple except where some some already have weights.
Comment #7
znerol commentedWhat happens if a referenced service is not available in the container for some reason? Either as a result of an alter-implementation or because it is not always present in the first place?
Comment #8
chx commentedSince your subscriber prescribed a hard dependency we put a 'broken' flag on it and have the dispatcher throw an exception? We don't want the container rebuild to throw an exception, do we.
Comment #9
Crell commentedThis very strongly feels like something that belongs upstream in Symfony directly. We still have a little time before 2.7. :-)
Comment #10
chx commentedThen it won't be who writes it because this is too much work to throw away aka MIT license it. Otherwise, I might look at it in December...
Comment #11
fabianx commentedI think we can add our own implementation first and then upstream can take the idea if they want?
Comment #12
Crell commentedAnd then switch ours? No, start upstream. I've had multiple requests from the Symfony folks to work more closely with them to avoid duplication, as they *would* like some of the improvements we're making. At least start the conversation upstream and see if they're interested. We have a Symfonian now coming to the weekly WSCCI meetings if you want to talk real time first. Stop on by this Thursday. :-)
Comment #15
wim leersPostponed #2566019: [PP-1] HtmlResponseSubscriber and DynamicPageCacheSubscriber should have negative priorities so that vanilla response subscribers can have priority zero on this. Inheriting its issue tags.
Comment #16
dawehnerI'm working on it at the moment.
Comment #18
dawehnerAfter some experiments I believe with linear interpolation we can actually keep full BC compliance, potentially.
This patch uses the following idea:
Comment #20
dawehnerThis could fix a good couple of failures.
Comment #22
dawehnerThis could be quite some less failures ...
Comment #25
joachim commentedI like this idea, but we need to be aware that it introduces a major change in what counts as internal and what counts as public when it comes to events.
Currently, an ES must implement getSubscribedEvents(), for example:
The methods onTerminate(), onRequest() are public PHP methods, and their signatures are defined by the event system, but I am free to call them what I want and rename them whenever I like at any time without affecting anything. The thing I mustn't change is the priority values, as that could break other another module that is expecting my listener to run, say, at priority 100, and has set its own listener to run at a higher or lower value. (Though I don't believe that is actually documented properly anywhere.)
With the new system, another module that wants to ensure it runs relative to my listener will no longer care about a priority value, but it will explicitly reference my method names.
So the names of methods in the event subscriber class have effectively become part of my module's public API, and may NOT be changed as that would break other modules.
Comment #29
larowlanRe
Comment #30
larowlanwhoops
Comment #31
wim leersThis would be so much better 🙏
Comment #32
sokru commentedDoesn't need a reroll, since patch from #22 applies cleanly.
Comment #41
amateescu commentedOne idea for the issue mentioned in #25 could be that the before/after syntax will specify "providers" (module names), because that's the majority use-case for this feature: "I want my hook/event implementation to run before or after the same hook/event from module X".