Upgrading Olson tz database natively implemented in PHP

梦想的初衷 提交于 2019-12-05 15:29:21
Jonathan Leffler

Definitive Answer

The comments above give a much better answer than this - look at the PECL package timezonedb.

I've converted this to Community Wiki.


An Investigation

The distributed source from a package such as php-5.3.8.tar.bz2 contains a translation of the Olson database in the ext/date/lib directory and files timezonedb.h, timezonemap.h, fallbackmap.h. This means that there is code somewhere in the PHP development system that generates this information from a release of the Olson database, but it is not distributed by default. Further, it is not self-evidently distributed as part of SVN; I extracted PHP 5.3 source as of revision 321876 and the ext/date directory contained nothing to assist (just the generated files).

So, it might be appropriate to ask the PHP maintainers how to do it; it certainly should be possible, and it should be automated (it would be silly if they do not have it automated). But it is not clear to me that those outside the PHP maintainers can tell how to do it.

The comments in the NEWS file indicate that Derick Rethans might be a good person to contact - he updated the database to Olson 2010c (2010.3). You can find his email address at PHP in the run-tests.php file in the top-level of the source directory; you can find an alternative email address in the source in ext/date/lib directory.

Derick Rethans made available the conversion tool kit used to generate the file timezonedb.h from the Olson database here:

http://svn.xdebug.org/cgi-bin/viewvc.cgi/timelib/trunk/zones/?root=php

As of 2016-12-09, the link above is 404, and the WayBack Machine at the Internet Archive can't help because it was not allowed to search by a robots.txt file.

However, a Google search for 'php timelib' finds:

which is almost certainly the replacement.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!