[TYPO3-core] Alternative patch to RFC #11587: PHP Warnings concerning missing timezone settings under PHP 5.3

Rupert Germann rupi at gmx.li
Thu Nov 5 16:32:43 CET 2009


hi dudes,

thanks for improving this.

but ernestos patch does not work under PHP 5.3

date_default_timezone_get() always returns something. If timezone is not 
set in php.ini it return the value that PHP has choosen - in my case 
this was "Europe/Paris"

to get the real value ini_get() must be used.

see attached patch where I changed this.


greets
rupert



Ernesto Baschny [cron IT] schrieb:
> Martin Kutschker schrieb:
>> Ernesto Baschny [cron IT] schrieb:
>>> Dmitry Dulepov schrieb:
>>>> Hi!
>>>>
>>>> Ernesto Baschny [cron IT] wrote:
>>>>> I don't see why users should complain about the setting. If someone sets
>>>>> it in PHP, it works (leave it empty in TYPO3) if someone cannot set it
>>>>> in PHP.ini or wants to override it in TYPO3, use the single setting. So
>>>>> why add the complexity for users to understand two setting for this?
>>>> I do not object :) I wanted to provide more flexibility but you got a fair point too. You solution more simple. May be we should use it instead of mine.
>> The patches uses "phpTimeZone" and "phpTimeZoneForce". I suggest the simple "timeZone". The PHP adds
>> nothing to the meaning.
> 
> Ups, yes, my patch is buggy, is should have been phpTimeZone on both
> places. Attached fixed patch.
> 
>> And furthermore I suggest to remove the unused "serverTimeZone" (or to reuse it for the new
>> setting). Having two settings so close at each other with one being non-functional will be confusing.
> 
> Difficult topic (the holy cow), but serverTimeZone was meant for
> frontend extensions to add / substract an "offset" to all times for
> display purposes. Sure this setting is kind of "lame" and old-school but
> it might have already been used for that purpose, so I wouldn't
> recommend misusing it.
> 
> Instead the new setting which makes it clear what it makes (affects
> date() calls in PHP) and also that it doesn't make any "magic" which one
> might be mislead into thinking if it is called "serverTimeZone".
> 
>>> Here is a trunk patch with that algorithm in place and also a TYPO3-4_2
>>> variant with no new setting, but avoiding the warnings by setting the
>>> "default" if none is found.
> 
>> This one looks good: +1 by reading.
> 
> Cheers,
> Ernesto
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 11587-v5.diff
Type: text/x-diff
Size: 3012 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20091105/1b0c2ba2/attachment.diff>


More information about the TYPO3-team-core mailing list