See http://symfony.com/doc/current/components/dependency_injection/parentser...
Credits to @dawehner for finding this.
The attached patch (following in comment) shows this using plugin managers. There are some problems, we use constructor injection, so we can't just change a single argument easily (e.g. different cache bin) or add another one. We could change some of the other plugin managers to use setter injection instead, though. And for cache, we could just unify them to use all the same cache bin, possibly introduce a cache.plugin, which could be a cache collector (see #2064511: Use a cache collector to combine related plugin caches)
Comment | File | Size | Author |
---|---|---|---|
#1 | abstract-service-definitions-2118991-1.patch | 5.2 KB | Berdir |
Comments
Comment #1
BerdirHere we go.
Comment #2
dawehnerHere is the approach I went with, so I guess we should leverage the patch from berdir and sort of use the other one for views?
Comment #3
dawehnerI do way more like the patch from berdir, RTBC to that one.
Comment #4
tim.plunkettHiding the other patch so it is clearer that Berdir's patch is the RTBC one
Comment #5
BerdirThere are more examples that could be simplified with this approach, cache bins for example. They only differ in the argument that's passed to the cache factory.
Do we want to get this in as an example and open a follow-up (meta?) issue to use it in other places?
Comment #6
webchickWicked. This patch is very nice. Nice that the Symfonic folks already thought of this, and we can just use what they do.
Committed and pushed to 8.x. Thanks!