]> granicus.if.org Git - php/commitdiff
- Added timezone_version_get() to retrieve the version of the used timezone
authorDerick Rethans <derick@php.net>
Sun, 3 May 2009 19:57:35 +0000 (19:57 +0000)
committerDerick Rethans <derick@php.net>
Sun, 3 May 2009 19:57:35 +0000 (19:57 +0000)
  database.

ext/date/php_date.c
ext/date/php_date.h

index d04baeb778eb31c049d8337bfe9de002a7909195..22110f1e207dee156e3c50f999bc889d925d2a80 100644 (file)
@@ -329,6 +329,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()
@@ -405,6 +408,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)
@@ -3893,6 +3897,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_ASCII_STRING(tzdb->version, 1);
+}
+/* }}} */
+
 /* {{{ proto array timezone_abbreviations_list() U
    Returns associative array containing dst, offset and the timezone name
 */
index 1c9ed4a750b5aac28a5e0e1e18bad38de08ab72e..f8fab46f519fef204b37be6536ae4a407371285e 100644 (file)
@@ -80,6 +80,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(timezone, identifiers_list);
 PHP_METHOD(timezone, abbreviations_list);