[wp-trac] [WordPress Trac] #23132: wp_timezone_override_offset() has noticeable performance hit
WordPress Trac
noreply at wordpress.org
Sat Feb 23 01:07:29 UTC 2013
#23132: wp_timezone_override_offset() has noticeable performance hit
-------------------------+------------------
Reporter: Rarst | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.6
Component: Date/Time | Version: 3.5
Severity: minor | Resolution:
Keywords: has-patch |
-------------------------+------------------
Comment (by Otto42):
Long term, this should be gutted and rewritten to eliminate gmt_offset
entirely. This stuff is a holdover from when PHP 4 was still supported.
The new stuff added in 2.8 was done this way to support PHP 4 as well and
keep the date/time consistent across the systems. For example, the default
timezone is set to GMT no matter what you select in order to keep this PHP
4/5 code working identically.
The right way:
- Kill gmt_offset entirely.
- Gut the various timezone calculation code to put it back on PHP 5's code
to do the grunt work.
- Most of this can be handled by using the native gmdate/date functions
correctly with date_default_timezone_set.
Nacin's right that switch_to_blog would have to change timezones, but it
would be able to do so by calling date_default_timezone_set to do so
instead of using static cached variables.
We're PHP 5 native now, we should take advantage of this. It is a big job
though.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23132#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list