derick Thu Nov 6 09:46:36 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/date php_date.c php_date.h /php-src/ext/date/lib parse_date.c Log: - MFH: Export DateTime and DateTimeZone class entries so that external extensions can make use of it as well. http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.51.2.57&r2=1.43.2.45.2.51.2.58&diff_format=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.45.2.51.2.57 php-src/ext/date/php_date.c:1.43.2.45.2.51.2.58 --- php-src/ext/date/php_date.c:1.43.2.45.2.51.2.57 Sun Nov 2 21:19:30 2008 +++ php-src/ext/date/php_date.c Thu Nov 6 09:45:58 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.c,v 1.43.2.45.2.51.2.57 2008/11/02 21:19:30 felipe Exp $ */ +/* $Id: php_date.c,v 1.43.2.45.2.51.2.58 2008/11/06 09:45:58 derick Exp $ */ #include "php.h" #include "php_streams.h" @@ -556,55 +556,22 @@ zend_class_entry *date_ce_date, *date_ce_timezone, *date_ce_interval, *date_ce_period; + +PHPAPI zend_class_entry *php_date_get_date_ce(void) +{ + return date_ce_date; +} + +PHPAPI zend_class_entry *php_date_get_timezone_ce(void) +{ + return date_ce_timezone; +} + static zend_object_handlers date_object_handlers_date; static zend_object_handlers date_object_handlers_timezone; static zend_object_handlers date_object_handlers_interval; static zend_object_handlers date_object_handlers_period; -typedef struct _php_date_obj php_date_obj; -typedef struct _php_timezone_obj php_timezone_obj; -typedef struct _php_interval_obj php_interval_obj; -typedef struct _php_period_obj php_period_obj; - -struct _php_date_obj { - zend_object std; - timelib_time *time; - HashTable *props; -}; - -struct _php_timezone_obj { - zend_object std; - int initialized; - int type; - union { - timelib_tzinfo *tz; /* TIMELIB_ZONETYPE_ID; */ - timelib_sll utc_offset; /* TIMELIB_ZONETYPE_OFFSET */ - struct /* TIMELIB_ZONETYPE_ABBR */ - { - timelib_sll utc_offset; - char *abbr; - int dst; - } z; - } tzi; -}; - -struct _php_interval_obj { - zend_object std; - timelib_rel_time *diff; - HashTable *props; - int initialized; -}; - -struct _php_period_obj { - zend_object std; - timelib_time *start; - timelib_time *end; - timelib_rel_time *interval; - int recurrences; - int initialized; - int include_start_date; -}; - #define DATE_SET_CONTEXT \ zval *object; \ object = getThis(); \ @@ -2609,7 +2576,7 @@ /* }}} */ /* Helper function used to add an associative array of warnings and errors to a zval */ -void zval_from_error_container(zval *z, timelib_error_container *error) +static void zval_from_error_container(zval *z, timelib_error_container *error) { int i; zval *element; http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.h?r1=1.17.2.11.2.3.2.9&r2=1.17.2.11.2.3.2.10&diff_format=u Index: php-src/ext/date/php_date.h diff -u php-src/ext/date/php_date.h:1.17.2.11.2.3.2.9 php-src/ext/date/php_date.h:1.17.2.11.2.3.2.10 --- php-src/ext/date/php_date.h:1.17.2.11.2.3.2.9 Fri Jul 18 14:33:53 2008 +++ php-src/ext/date/php_date.h Thu Nov 6 09:45:58 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.h,v 1.17.2.11.2.3.2.9 2008/07/18 14:33:53 derick Exp $ */ +/* $Id: php_date.h,v 1.17.2.11.2.3.2.10 2008/11/06 09:45:58 derick Exp $ */ #ifndef PHP_DATE_H #define PHP_DATE_H @@ -101,6 +101,50 @@ PHP_MSHUTDOWN_FUNCTION(date); PHP_MINFO_FUNCTION(date); +typedef struct _php_date_obj php_date_obj; +typedef struct _php_timezone_obj php_timezone_obj; +typedef struct _php_interval_obj php_interval_obj; +typedef struct _php_period_obj php_period_obj; + +struct _php_date_obj { + zend_object std; + timelib_time *time; + HashTable *props; +}; + +struct _php_timezone_obj { + zend_object std; + int initialized; + int type; + union { + timelib_tzinfo *tz; /* TIMELIB_ZONETYPE_ID; */ + timelib_sll utc_offset; /* TIMELIB_ZONETYPE_OFFSET */ + struct /* TIMELIB_ZONETYPE_ABBR */ + { + timelib_sll utc_offset; + char *abbr; + int dst; + } z; + } tzi; +}; + +struct _php_interval_obj { + zend_object std; + timelib_rel_time *diff; + HashTable *props; + int initialized; +}; + +struct _php_period_obj { + zend_object std; + timelib_time *start; + timelib_time *end; + timelib_rel_time *interval; + int recurrences; + int initialized; + int include_start_date; +}; + ZEND_BEGIN_MODULE_GLOBALS(date) char *default_timezone; char *timezone; @@ -128,4 +172,8 @@ PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb); PHPAPI timelib_tzinfo *get_timezone_info(TSRMLS_D); +/* Grabbing CE's so that other exts can use the date objects too */ +PHPAPI zend_class_entry *php_date_get_date_ce(void); +PHPAPI zend_class_entry *php_date_get_timezone_ce(void); + #endif /* PHP_DATE_H */ http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.29.2.30.2.14.2.27&r2=1.29.2.30.2.14.2.28&diff_format=u Index: php-src/ext/date/lib/parse_date.c diff -u php-src/ext/date/lib/parse_date.c:1.29.2.30.2.14.2.27 php-src/ext/date/lib/parse_date.c:1.29.2.30.2.14.2.28 --- php-src/ext/date/lib/parse_date.c:1.29.2.30.2.14.2.27 Wed Nov 5 10:42:17 2008 +++ php-src/ext/date/lib/parse_date.c Thu Nov 6 09:45:58 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Wed Nov 5 11:30:55 2008 */ +/* Generated by re2c 0.13.5 on Wed Nov 5 11:44:09 2008 */ #line 1 "ext/date/lib/parse_date.re" /* +----------------------------------------------------------------------+ @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: parse_date.c,v 1.29.2.30.2.14.2.27 2008/11/05 10:42:17 derick Exp $ */ +/* $Id: parse_date.c,v 1.29.2.30.2.14.2.28 2008/11/06 09:45:58 derick Exp $ */ #include "timelib.h"
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php