Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DI][Preload] Remove preload primitive types#36866

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

Merged
nicolas-grekas merged 1 commit intosymfony:5.1frommichaljusiega:preloading
May 19, 2020
Merged

[DI][Preload] Remove preload primitive types#36866

nicolas-grekas merged 1 commit intosymfony:5.1frommichaljusiega:preloading
May 19, 2020

Conversation

michaljusiega
Copy link
Contributor

@michaljusiegamichaljusiega commentedMay 19, 2020
edited
Loading

QA
Branch?5.1
Bug fix?no, but it could be for the future
New feature?no
Deprecations?no
Tickets
LicenseMIT
Doc PR

After bump my project to 5.1.x-dev I saw the generated file of*.preload.php contains classes that are primitive types like int, string, bool.

composer create-project symfony/website-skeleton preload "5.1.x-dev"cat preload/var/cache/dev/App_KernelDevDebugContainer.preload.php | grep "bool\|string\|int"
$ cat test/var/cache/dev/App_KernelDevDebugContainer.preload.php | grep "bool\|string\|int"$classes[] = 'int';$classes[] = 'string';$classes[] = 'Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator';$classes[] = 'Symfony\Component\Security\Http\EntryPoint\RetryAuthenticationEntryPoint';$classes[] = 'Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator';$classes[] = 'Symfony\Component\Serializer\Normalizer\ConstraintViolationListNormalizer';$classes[] = 'bool';$classes[] = 'Symfony\Component\Validator\ContainerConstraintValidatorFactory';$classes[] = 'Symfony\Component\Validator\Constraints\EmailValidator';$classes[] = 'Symfony\Component\Validator\Constraints\ExpressionValidator';$classes[] = 'Symfony\Component\Validator\Constraints\NotCompromisedPasswordValidator';$classes[] = 'Symfony\\Component\\Form\\Extension\\Validator\\Constraints\\Form';

I don't know if it is expected behaviour, but if not - then PR fix it.

In addition, classes are sorted for better reading.

@nicolas-grekasnicolas-grekas added this to the5.1 milestoneMay 19, 2020
@nicolas-grekas
Copy link
Member

Thank you@michaljusiega.

@nicolas-grekasnicolas-grekas merged commit754bba4 intosymfony:5.1May 19, 2020
@michaljusiegamichaljusiega deleted the preloading branchMay 19, 2020 17:09
nicolas-grekas added a commit that referenced this pull requestFeb 10, 2025
This PR was squashed before being merged into the 6.4 branch.Discussion----------[DependencyInjection] Do not preload functions| Q             | A| ------------- | ---| Branch?       | 6.4| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| License       | MITEnsure `preload.php` does not have functions in preloaded class names:```$ grep "current" var/cache/prod/App_KernelProdContainer.preload.php$classes[] = 'current';```Happens because the DI declares a factory, which uses built-in `\current`:https://github.com/symfony/symfony/blob/v6.4.18/src/Symfony/Bundle/FrameworkBundle/Resources/config/http_client.php#L39And then the "class" is added byhttps://github.com/symfony/symfony/blob/v6.4.18/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L2317Similar to the#36866Commits-------b52b760 [DependencyInjection] Do not preload functions
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

3 participants
@michaljusiega@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp