Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Config] ResourceCheckerConfigCache metadata unserialize emits warning#60137
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…alize emits warning
carsonbot commentedApr 3, 2025
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
Thank you@elcmichou. |
e10963f
intosymfony:7.2Uh oh!
There was an error while loading.Please reload this page.
Description
This PR fixes the warning unserialize(): Function spl_autoload_call() hasn't defined the class it was called for that occurs when unserializing metadata in the ResourceCheckerConfigCache when unserialize_callback_func is set to spl_autoload_call.
The fix adds the allowed_classes => false parameter to the unserialize() call, preventing PHP from attempting to reconstruct objects of unknown classes, which eliminates the warnings while maintaining the intended functionality.
Test case
The issue can be reproduced by:
ini_set('unserialize_callback_func', 'spl_autoload_call');
at the beginning of a Symfony application (e.g., inbin/console
)bin/console cache:clear
With this change, the warnings no longer appear while the cache continues to function correctly.