-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Config] ResourceCheckerConfigCache metadata unserialize emits warning #59196
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
Comments
Having the same issue as @simitter in a Symfony application which wraps a legacy Symfony1 application. |
I can confirm the same issue on 7.2.x, also wrapping a legacy sf1 application. The issue doesn't exist in 7.1.11. |
@oojacoboo do you also notice that the Symfony debug-toolbar is not visible anymore when wrapping SF 1.x with SF 6.4 (while it was working with SF 5.4)? I guess there are some changes in the |
@thePanz we haven't used that thing in a decade. Our sf1 implementation is really stripped down - basically just the controllers and views, nothing else. |
Also experiencing the issue as @thePanz, with a Symfony application which wraps a legacy Symfony1 application. |
…alize emits warning
…mits warning (Colin Michoudet) This PR was merged into the 7.2 branch. Discussion ---------- [Config] ResourceCheckerConfigCache metadata unserialize emits warning | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #59196 | License | MIT ## 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: 1. Adding `ini_set('unserialize_callback_func', 'spl_autoload_call');` at the beginning of a Symfony application (e.g., in `bin/console`) 2. Running `bin/console cache:clear` 3. Observing the warnings about classes that couldn't be found With this change, the warnings no longer appear while the cache continues to function correctly. Commits ------- e50f936 bug #59196 [Config] ResourceCheckerConfigCache metadata unserialize emits warning
* 7.2: Update validators.pt.xlf bug #59196 [Config] ResourceCheckerConfigCache metadata unserialize emits warning fix(validator): only check for puny code in tld
Symfony version(s) affected
7.2.1
Description
The ResourceCheckerConfigCache may crash while in dev environement /debug mode on unserialize.
This happens if there is an additional unserialize_callback_func set
How to reproduce
https://github.com/simitter/symfony_config_unserialize_bug
Steps:
On an empty cache bin/console should trigger the bug
Possible Solution
Using the allowed_classes parameter of unserialize should force every class to be __Php_Incomoplete_Class before triggering unserialize_callback_func.
Only suppressing the error on unseralize would prevent the metadata json file to be written / contain the correct data.
Additional Context
No response
The text was updated successfully, but these errors were encountered: