hi,
ext/date still supports the TZ environment variable in 5.3+ despite
the better alternative available via either php.ini (per directory
too) or http://www.php.net/date_default_timezone_set.
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?
--
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
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.
Tests run all in different processes so the environment variable can't
leak between them.
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
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
Hi!
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
I'm not sure I understand how putenv()
being non-thread-safe leads to
tests failing - tests aren't threaded and AFAIK TS API doesn't do
anything special there. Can you explain?
method is already deprecated and it is recommended to rely on the
other methods.
Unfortunately, some functions - like strftime - still are TZ-dependant
on some systems (like Darwin), so ignoring TZ altogether is not
achievable. And once we have people use TZ, why not have it work for all?
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Hi!
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. ThisI'm not sure I understand how
putenv()
being non-thread-safe leads to tests
failing - tests aren't threaded and AFAIK TS API doesn't do anything special
there. Can you explain?
getenv and putenv are per se not threadsafe.
method is already deprecated and it is recommended to rely on the
other methods.Unfortunately, some functions - like strftime - still are TZ-dependant on
some systems (like Darwin), so ignoring TZ altogether is not achievable. And
once we have people use TZ, why not have it work for all?
It is not about ignoring the timezone, it is about dropping something
that we already have deprecated and that should have been removed
since long already. Also the date extension documents and say that the
right way to do it is to use either the ini settings or the tz setter
function.
strftime is a system function, not something we can do about it (and
noone should use it tbh, really not, there are better date/time
formatting function now). And users still relying on it can still set
the process TZ using putenv as they used to do, and get all the issues
while being at it, they know them as they already live with them. The
only difference is that the date codes won't be affected.
Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
hi,
For your information, TZ via environment has been removed from 5.4+.
It is not used anymore by the ext/date/lib/ functions, while strftime
and similar system's functions may need it. But the php's date
alternative should be used instead.
Cheers,
hi,
ext/date still supports the TZ environment variable in 5.3+ despite
the better alternative available via either php.ini (per directory
too) or http://www.php.net/date_default_timezone_set.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?
--
Pierre@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
--
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org