Summary | Add date_default_timezone_set to avoid E_WARNING's |
Queue | Horde Framework Packages |
Queue Version | Git master |
Type | Enhancement |
State | Rejected |
Priority | 1. Low |
Owners | |
Requester | mindboosternoori (at) gmail (dot) com |
Created | 02/28/2011 (5242 days ago) |
Due | |
Updated | 09/16/2016 (3215 days ago) |
Assigned | |
Resolved | 02/28/2011 (5242 days ago) |
Milestone | |
Patch | Yes |
prefer:
https://github.com/marado/horde/commit/18140f6dd5b8f964b0d2dcc648f7d4b578199712
https://github.com/horde/horde/pull/6/commits/18140f6dd5b8f964b0d2dcc648f7d4b578199712
State ⇒ Rejected
Beside that, we already set the timezone in Horde application context,
if a timezone is set in the user's preferences, either by the user, or
by the admin setting a default.
least), then let me suggest, instead of the initial feature request,
that both the INSTALL documentation and test.php should reflect that
(by mentioning that it needs to be set up in the first one, and
testing if it is properly set up in the second one)...
do them every single time. The responsibility of configuring the
default timezone is also, in my opinion, outside the responsibility
of the Log package. Why do you feel like this should be done in
Horde_Log?
be called once (but it needs to). I've added it there since I couldn't
find anywhere else where to add it and be 100% sure that date would
never be called without date_default_timezone_set being previously
called. I've seen this issue on Horde_Log happening in an "intrusive"
way in at least two different "actions": horde/bin/db_migrate and
while trying to use Imp.
On horde/bin/db_migrate it is only annoying, and this one line in that
script will correct it. On the other hand, on IMP this message appears
in the alert popup's, and the calls made (for instance to see the
messages in one folder) have the E_WARNING returned instead of the
expected result, making IMP unusable:
Post:
[...]/horde/services/ajax.php/imp/viewPort?checkcache=1&slice=1%3A91&view=INBOX
Response body:
/*-secure-{"response":null,"msgs":[{"charset":"UTF-8","message":"DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe\/Paris' for 'WET\/0,0\/no DST'
instead","flags":[],"type":"horde.error"}]}*/
Once again, I believe that there might be a place (that I can try to
find out, if you think this is the way to go) on IMP to make the
date_default_timezone_set, but I'm afraid more places will have the
Logger calls without the previous date_default_timezone_set ...
Anyway, please tell me how do you think this should be properly fixed.
If you think we should add this on what calls Logger and not in Logger
itself, I can work on submitting a patch to fix this issue on the
places I've found out using Logger this way.
Priority ⇒ 1. Low
State ⇒ Feedback
them every single time. The responsibility of configuring the default
timezone is also, in my opinion, outside the responsibility of the Log
package. Why do you feel like this should be done in Horde_Log?
Priority ⇒ 3. High
Type ⇒ Enhancement
Summary ⇒ Add date_default_timezone_set to avoid E_WARNING's
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ Yes
New Attachment: 18140f6.patch
State ⇒ New
Horde_Log_Logger. This is being setted up as "high priority" since
this warnings appear as popups every time a user tries to do something
on imp (besides having the server's error log full of warnings).
More info at
http://php.net/manual/en/function.date-default-timezone-set.php , but,
basicly, since PHP 5.1.0 you have to date_default_timezone_set before
using date (or else you'll get an E_WARNING), and that's not being
done at Horde_Log_Logger. The patch is a simple one liner, and will
work in previous PHP versions (if the function doesn't exist, then it
doesn't try to use it).
The patch (attached) can be fetched from github directly if you
prefer:
https://github.com/marado/horde/commit/18140f6dd5b8f964b0d2dcc648f7d4b578199712