diff options
author | Derick Rethans <derick@php.net> | 2009-05-03 19:58:49 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2009-05-03 19:58:49 +0000 |
commit | cba1765799bc8638f956f7f5fb01e1228379086f (patch) | |
tree | d86aff5ea7318ec40865add21a7d837c9555e780 | |
parent | 65fc90414390f62441ba8ba0ce177fbf6dbe60ec (diff) | |
download | php-git-cba1765799bc8638f956f7f5fb01e1228379086f.tar.gz |
- MFH: Added timezone_version_get() to retrieve the version of the used
timezone database.
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/date/php_date.c | 16 | ||||
-rw-r--r-- | ext/date/php_date.h | 1 |
3 files changed, 19 insertions, 0 deletions
@@ -13,6 +13,8 @@ PHP NEWS - Implemented FR #41712 (curl progress callback: CURLOPT_PROGRESSFUNCTION). (sdteffen[at]gmail[dot].com, Pierre) +- Added timezone_version_get() to retrieve the version of the used timezone + database. (Derick) - Added 'n' flag to fopen to allow passing O_NONBLOCK to the underlying open(2) system call. (Mikko) - Added "dechunk" filter which can decode HTTP responses with chunked diff --git a/ext/date/php_date.c b/ext/date/php_date.c index b4017ba995..2036652a04 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -328,6 +328,9 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_timezone_abbreviations_list, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO(arginfo_timezone_version_get, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_date_interval_create_from_date_string, 0, 0, 1) ZEND_ARG_INFO(0, time) ZEND_END_ARG_INFO() @@ -398,6 +401,7 @@ const zend_function_entry date_functions[] = { PHP_FE(timezone_location_get, arginfo_timezone_location_get) PHP_FE(timezone_identifiers_list, arginfo_timezone_identifiers_list) PHP_FE(timezone_abbreviations_list, arginfo_timezone_abbreviations_list) + PHP_FE(timezone_version_get, arginfo_timezone_version_get) PHP_FE(date_interval_create_from_date_string, arginfo_date_interval_create_from_date_string) PHP_FE(date_interval_format, arginfo_date_interval_format) @@ -3760,6 +3764,18 @@ PHP_FUNCTION(timezone_identifiers_list) } /* }}} */ +/* {{{ proto array timezone_version_get() + Returns the Olson database version number. +*/ +PHP_FUNCTION(timezone_version_get) +{ + const timelib_tzdb *tzdb; + + tzdb = DATE_TIMEZONEDB; + RETURN_STRING(tzdb->version, 1); +} +/* }}} */ + /* {{{ proto array timezone_abbreviations_list() Returns associative array containing dst, offset and the timezone name */ diff --git a/ext/date/php_date.h b/ext/date/php_date.h index 74887b4961..93518a3a6b 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -79,6 +79,7 @@ PHP_FUNCTION(timezone_transitions_get); PHP_FUNCTION(timezone_location_get); PHP_FUNCTION(timezone_identifiers_list); PHP_FUNCTION(timezone_abbreviations_list); +PHP_FUNCTION(timezone_version_get); PHP_METHOD(DateInterval, __construct); PHP_FUNCTION(date_interval_format); |