Skip to content

[DI] fix related to preloading #33539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2019
Merged

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 4.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

@@ -14,6 +14,10 @@
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;

if (!class_exists(BaseExpressionLanguage::class)) {
throw new \ReflectionException(BaseExpressionLanguage::class.' not found.');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related to #32995

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does that solve #32995 ? It‘s still going to be an exception thrown during autoload. Thus we should get a fatal here, if someone tries to autoload the ExpressionLanguage class defined in this file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#32995 is about the fact that PHP 7.4 does not properly allows us to turn a missing parent class into a catcheable exception.
This is throwing an exception before PHP encounters the missing parent class.

Copy link
Member Author

@nicolas-grekas nicolas-grekas Sep 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue described in #32995 happens when the parent class fails to be loaded while the engine already registered the child as "now loading". This throw happens before the child is flagged as such, thus the exception can be properly caught.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that a return; would do it too. I'm going to update.

nicolas-grekas added a commit that referenced this pull request Sep 10, 2019
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix related to preloading

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

e25c595 [DI] fix related to preloading
@nicolas-grekas nicolas-grekas merged commit e25c595 into symfony:4.4 Sep 10, 2019
@nicolas-grekas nicolas-grekas deleted the di-fix branch September 10, 2019 16:09
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy