Re: drop TZ environment variable support in 5.4+?
On Mon, Sep 5, 2011 at 4:05 PM, Derick Rethans <[email protected]> wrote:
> On Mon, 5 Sep 2011, Pierre Joye wrote:
>
>> The main problem is that putenv and getenv are not thread safe and
>> many tests will fail either when using TS SAPIs or on Windows. This
>> method is already deprecated and it is recommended to rely on the
>> other methods.
>>
>> Objections/comments?
>
> I'm against removing this in PHP 5.4.
What's the arguement then? It should not have been supported since
years already.
> Tests run all in different processes so the environment variable can't
> leak between them.
the main problem here is the production code relying on putenv, not
only our testing environments.
But your case only covers the classic run-tests.php executed from
CLI/CGI. We run most of the phpt via apache's mod_php as well.
It is very easy for one to update an app to make it work with museum
version of php as well:
if (function_exists('date_default_timezone_set')) {
date_default_timezone_set("UTC");
} else {
putenv("TZ=UTC");
}
Cheers,
--
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
Thread (6 messages)