mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 16:15:49 +03:00
[PR #121] [CLOSED] Suppress warnings on date_default_timezone_get() #944
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#944
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Seldaek/monolog/pull/121
Author: @dcousineau
Created: 9/27/2012
Status: ❌ Closed
Base:
master← Head:fix-default-timezone-warning📝 Commits (1)
64b9651Suppress warnings on date_default_timezone_get()📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
src/Monolog/Logger.php(+1 -1)📄 Description
Unfortunately
date_default_timezone_get()still triggers the classic timezone warning, and there is no other way to determine if a timezone has been set.While one can ensure their projects always perform a
date_default_timezone_set()there are still common places where monolog can be imported without direct user control over setting default timezones.In my particular case, including monolog in a Symfony2 composer project with the stock Symfony2
post-install-cmdandpost-update-cmdchain causes failures at the end of an install/update cycle. I believe it's composer in this case that translates all triggered warnings/errors into exceptions which causes whatever process that is running to fail.Therefore I propose we just suppress the warnings from
date_default_timezone_set()for now.In the future timezone management should maybe be mildly refactored to be injectable and default to UTC, but this will eliminate
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.