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

[FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable#38063

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
fabpot merged 1 commit intosymfony:4.4fromnicolas-grekas:preload-project-dir
Sep 7, 2020

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedSep 4, 2020
edited
Loading

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

As seen insymfonycorp/cloud-templates#15, having the path of the preload file vary by env+debug makes configuring PHP.ini settings impossible.

This PR dump a newpreload.php file insrc/ whencache:clear is called.
This makes the path predictable.

This is submitted as a bugfix because the current behavior is barely usable without this change.

OskarStark, deguif, sweoggy, mynameisbogdan, and Ioni14 reacted with thumbs up emoji
@nicolas-grekas
Copy link
MemberAuthor

Recipe update atsymfony/recipes#817

@nicolas-grekas
Copy link
MemberAuthor

Doc update:symfony/symfony-docs#14176

Copy link
Contributor

@OskarStarkOskarStark left a comment

Choose a reason for hiding this comment

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

Thank you Nicolas 🥰😍

@nicolas-grekasnicolas-grekas changed the title[FrameworkBundle] generate .preload.php in project_dir to make opcache.preload predictable[FrameworkBundle] generate preload.php in src/ to make opcache.preload predictableSep 7, 2020
@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedSep 7, 2020
edited
Loading

Updated tosrc/preload.php

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commitd441d86 intosymfony:4.4Sep 7, 2020
@nicolas-grekasnicolas-grekas deleted the preload-project-dir branchSeptember 7, 2020 07:19
xabbuh added a commit to symfony/symfony-docs that referenced this pull requestSep 7, 2020
This PR was merged into the 4.4 branch.Discussion----------Fix path to preload fileAccording tosymfony/symfony#38063Commits-------b830395 Fix path to preload file
@deflock
Copy link

@nicolas-grekas sorry, I'm not sure, but will this work on environments with read-only src/?

lyrixx and CthulhuDen reacted with thumbs up emoji

This was referencedSep 27, 2020
@alexander-schranz
Copy link
Contributor

alexander-schranz commentedSep 28, 2020
edited
Loading

@nicolas-grekas any way to disable this behaviour? We currently have some issues with the preloading in sulu and this file should not be generated in our case.

Also I personally think cache:clear should nothing write in thesrc as its a generated cache file so I think a better place in my opinion would bevar folder e.g.:var/.preload.php, maybe we can make a container parameter to make it configurable? Alternative tovar I would think thatconfig/.preload.php would maybe be a better place because I think its more similar to the config/bundles.php.

If the file stays atsrc/ or any folder in the git versioning, I think it would be better to create this file over a symfony/flex recipe so I can edit it the way I want it instead of creating it on every cache:clear.

niklasnatter and jvasseur reacted with thumbs up emoji

@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedSep 28, 2020
edited
Loading

var/ and config/ don't exist from the pov of the code. The code knows only about a cache-dir, a project-dir and the directory where the Kernel is found (by reflection).
Putting it anywhere else would need extra knowledge that is not present today.

But why is generating this file an issue? You didn't explain it. If preloading doesn't work with sulu, just don't use it?

I think it would be better to create this file over a symfony/flex recipe so I can edit it the way I want it instead of creating it on every cache:clear.

That'd mean hardcoding the env in the path (since the path contains "prod"). Doable, but this would need a reason (the current way has the benefit of being unconditional, thus quite easy to configure by default by hosters).

@nicolas-grekas
Copy link
MemberAuthor

Please note that if you think this should be discussed seriously, a closed PR is not the place as itwill be forgotten.

@alexander-schranz
Copy link
Contributor

@nicolas-grekas oh sorry you are correct an own issue would be better created one here:#38334. Mostly the problem is on our side that its misleading devs using sulu that preloading is now possible over this file generated by symfony but its currently not in sulu so we would like to avoid generating of it until preloading is supported.

nicolas-grekas added a commit to nicolas-grekas/symfony that referenced this pull requestSep 29, 2020
…rc/ to make opcache.preload predictable (nicolas-grekas)"This reverts commitd441d86, reversingchanges made to043e7c3.
fabpot added a commit that referenced this pull requestSep 30, 2020
…in src/ to make opcache.preload predictable" (nicolas-grekas)This PR was merged into the 4.4 branch.Discussion----------Revert "bug#38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable"| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Fix#38334| License       | MIT| Doc PR        | -As discussed in the linked issue, let's replace this with a recipe:symfony/recipes#825TL;DR, these PRs replace `src/.preload.php` (generated) by `config/preload.php` (committed).Commits-------662fcff Revert "bug#38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)"
fabpot added a commit that referenced this pull requestSep 30, 2020
* 4.4:  Revert "bug#38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)"  [PhpUnitBridge] Fix class_alias() for PHPUnit\Framework\Error\Error
fabpot added a commit that referenced this pull requestSep 30, 2020
* 5.1:  [FrameworkBundle] Add Mailjet definition  Revert "bug#38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)"  [PhpUnitBridge] Fix class_alias() for PHPUnit\Framework\Error\Error
This was referencedOct 4, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@OskarStarkOskarStarkOskarStark approved these changes

@ycerutoycerutoyceruto approved these changes

+1 more reviewer

@ro0NLro0NLro0NL left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

8 participants

@nicolas-grekas@fabpot@deflock@alexander-schranz@OskarStark@ro0NL@yceruto@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp