Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Add theclock.default_timezone option#58434
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
1bffa55 todbc185aComparesrc/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
dbc185a to8caa882Compare
nicolas-grekas left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
To challenge this: not setting the ini option while setting the config option might create discrepancies between parts that use the time without getting through the clock component. Not sure this is a win. Having better control of ini settings might be preferable. When using Platform.sh for example, you can commit aphp.ini file at the root of your app. That's a better alternative to me.
| } | ||
| try { | ||
| returnnew \DateTimeZone($v); |
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.
this validation logic prevents using env vars for configuring the option
alexandre-daubois commentedOct 4, 2024
I understand, maybe this option could come with a warning in the However, I understand your point of view about omitting the option in |
nicolas-grekas commentedOct 4, 2024
I'd say you need to improve your dev stack: eg if you use |
alexandre-daubois commentedOct 4, 2024
I wasn't aware of this feature. Indeed, that's way better. Let's close then, thanks! |
alexandre-daubois commentedOct 4, 2024
Thanks for this feedback@ro0NL, would this PR solve your issue? Could you maybe elaborate a bit on how this would help you if possible? I'd be happy to reopen if relevant 🙂 |
Uh oh!
There was an error while loading.Please reload this page.
We are introducing the clock component in a project. Because of legacy reasons, dates are stored using the
Europe/Paristimezone instead of using UTC. Because we'd like to use theclockservice and theClockAwareTrait, it would be nice to configure the timezone to use right in the framework configuration, under a new option calledclock.default_timezone:This adds more flexibility to developers to configure the default timezone to use. Even if the clock gets a default timezone using
date_default_timezone_get(), having the possibility to set this option would remove some magic. More than that, it makes the clock service consistent across different PHP installation that may have any value in theirphp.ini.