Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The proxybuilder is our approach to improve the speed by not initialization services, where its not needed.
Sadly it has a bug. Let's assume the following structure of code:
interface InterfaceA {}
interface InterfaceB extends InterfaceA {}
class ExampleClass implements InterfaceB {}
Sadly reflection returns both interfaces so the resulting proxy class looks like:
class Proxy_class_ExampleClass implements InterfaceB, InterfaceA
which is invalid PHP.
There is also an additional bug:
We also have to protect ourselves against including a proxy for multiple services using the same class.
Proposed resolution
Filter out parent interfaces.
Maybe some reflection gurus have better ideas, would be wonderful.
Remaining tasks
User interface changes
API changes
Beta phase evaluation
Issue category | Bug, because the proxy builder produces invalid PHP |
---|---|
Issue priority | Major, because it might block the usage of a proxy for some classses |
Disruption | No disruption, just internal fixes. |
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff.txt | 328 bytes | dawehner |
#7 | 2408357-7.patch | 6.02 KB | dawehner |
Comments
Comment #1
dawehnerAlright, here is a patch, but its just sad that you have to do it.
Comment #2
dawehnerWe also have to protect ourselves against including a proxy for multiple services using the same class.
Comment #3
dawehnerHere is another issue which came up.
Comment #4
Wim LeersLooks ready to me, except for a bunch of nitpicks (sorry…).
s/php/PHP/
Some unfinished phrases here.
s/interface/interfaces/
Missing docs.
Comment #5
dawehnerThank you for your review.
Fixed.
Comment #6
Wim LeersI don't think this was intentional :) Can be fixed on commit.
Comment #7
dawehnerHa.
Comment #8
alexpottThis issue addresses a major bug and is allowed per https://www.drupal.org/core/beta-changes. Committed f12134b and pushed to 8.0.x. Thanks!