-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[HttpKernel] Restructure Share Dir for using kernel.share_dir without environment specific directory #62248
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
Conversation
|
Hey! To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done? Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review. Cheers! Carsonbot |
|
Can you please remove everything from #62249 so that we can have only the patch about your proposal? |
c841415 to
e7d402d
Compare
|
@nicolas-grekas done! |
|
Okay I was thinking that in But as you stated thats not the case its always there now. As we still fallback to getCacheDir? Which I had expected would not longer be the case my suggestion, won't work or would require lot of more magic logic, so I'm lost. I personally would have make the share dir opt-in and defined it in the recipe. That would also make bundles automatically fail as the share dir is then not defined automatically for all bundles running tests against the Kernel.php. Was thinking that was what @Seldaek suggested. I think this way we maybe run into issue that bundles use |
Yes, then No, see https://github.com/symfony/symfony/pull/62204/files#diff-ee9b2c16aec8aa80f67e6b3925791d7b092fc097651bcc2df21b70e7dc8bef12R130 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would work for me. I don't have a strong opinion on the topic. What do others think?
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
Outdated
Show resolved
Hide resolved
|
@alexander-schranz we want the |
nicolas-grekas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
|
@stof Understand make sense. Then its definitly good choice to use kernel.share_dir for our storage and indexes. As the rule also make sense there if you multi region like for caches using redis, you want for indexes use Elasticsearch and for file storage a S3 or similar. |
|
Alternative thought: it might be safer to have per-env by default |
|
@nicolas-grekas that would end in the strange directory we had before in the discussion: |
|
Yes of course. However, I don't see this as "strange" :) |
|
Okay, you need to maintain it if you see it as safer I understand it, we will discuss it what we do on our side in @sulu if we maybe keep our own parameters and directories, as But one question will Symfony Cloud also keep the |
The env var won't contain the env since it's the responsibility of the kernel to add it when desired - that's only a default when using MicroKernelTrait. |
|
@nicolas-grekas okay Thx, that would atleast avoid us using the |
If I work on a Sulu project its common sometimes to debug things that I switch between
dev,stage(sulu specific),prodenvs. And if we put ourstorageandindexesdirectory into%kernel.share_dir%that path should not include the%kernel.environment%.So uploads and search index in sulu are stored in
var/share/storageandvar/share/indexes, not including the current ENV.With the change in #62204 it make possible to know that and only add
%kernel.environment%to the caches where its relevant. But we could still use%kernel.share_dir%/storagein the cloud template here:symfonycorp/cloud-templates#43 (comment)
So what changed:
Before:
Now:
This should not as in #62187 break something as with #62204 we now know if there is kernel.share_dir configured or not.