iliaa Sun Nov 27 01:51:44 2005 EDT Modified files: (Branch: PHP_5_1) /php-src NEWS /php-src/ext/date php_date.c /php-src/ext/date/tests bug33869.phpt bug34087.phpt bug34676.phpt bug34771.phpt date_default_timezone_set-1.phpt mktime-3.phpt strtotime.phpt Log: Disabled native date class, to prevent pear::date conflict.
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.228&r2=1.2027.2.229&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.228 php-src/NEWS:1.2027.2.229 --- php-src/NEWS:1.2027.2.228 Sun Nov 27 01:41:32 2005 +++ php-src/NEWS Sun Nov 27 01:51:39 2005 @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2006, PHP 5.1.1 +- Disabled native date class, to prevent pear::date conflict. (Ilia) - Make reflection constants be both PHP and class constants. (Johannes) - Added an additional field $frame['object'] to the result array of debug_backtrace() that contains a reference to the respective object when the http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.43.2.24&r2=1.43.2.25&ty=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.24 php-src/ext/date/php_date.c:1.43.2.25 --- php-src/ext/date/php_date.c:1.43.2.24 Sat Nov 26 07:35:27 2005 +++ php-src/ext/date/php_date.c Sun Nov 27 01:51:40 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.c,v 1.43.2.24 2005/11/26 12:35:27 tony2001 Exp $ */ +/* $Id: php_date.c,v 1.43.2.25 2005/11/27 06:51:40 iliaa Exp $ */ #include "php.h" #include "php_streams.h" @@ -74,9 +74,8 @@ {NULL, NULL, NULL} }; - -function_entry date_funcs_date[] = { #ifdef EXPERIMENTAL_DATE_SUPPORT +function_entry date_funcs_date[] = { ZEND_NAMED_FE(format, ZEND_FN(date_format), NULL) ZEND_NAMED_FE(modify, ZEND_FN(date_modify), NULL) ZEND_NAMED_FE(getTimezone, ZEND_FN(date_timezone_get), NULL) @@ -85,23 +84,21 @@ ZEND_NAMED_FE(setTime, ZEND_FN(date_time_set), NULL) ZEND_NAMED_FE(setDate, ZEND_FN(date_date_set), NULL) ZEND_NAMED_FE(setISODate, ZEND_FN(date_isodate_set), NULL) -#endif {NULL, NULL, NULL} }; function_entry date_funcs_timezone[] = { -#ifdef EXPERIMENTAL_DATE_SUPPORT ZEND_NAMED_FE(getName, ZEND_FN(timezone_name_get), NULL) ZEND_NAMED_FE(getOffset, ZEND_FN(timezone_offset_get), NULL) ZEND_NAMED_FE(getTransistions, ZEND_FN(timezone_transistions_get), NULL) ZEND_MALIAS(timezone, listAbbreviations, abbreviations_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) ZEND_MALIAS(timezone, listIdentifiers, identifiers_list, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) -#endif {NULL, NULL, NULL} }; -static char* guess_timezone(TSRMLS_D); static void date_register_classes(TSRMLS_D); +#endif +static char* guess_timezone(TSRMLS_D); /* }}} */ ZEND_DECLARE_MODULE_GLOBALS(date) @@ -116,6 +113,7 @@ PHP_INI_END() /* }}} */ +#ifdef EXPERIMENTAL_DATE_SUPPORT zend_class_entry *date_ce_date, *date_ce_timezone; static zend_object_handlers date_object_handlers_date; @@ -134,7 +132,6 @@ timelib_tzinfo *tz; }; -#ifdef EXPERIMENTAL_DATE_SUPPORT #define DATE_SET_CONTEXT \ zval *object; \ object = getThis(); \ @@ -153,12 +150,11 @@ } \ obj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); \ -#endif - static void date_object_free_storage_date(void *object TSRMLS_DC); static void date_object_free_storage_timezone(void *object TSRMLS_DC); static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC); +#endif /* {{{ Module struct */ zend_module_entry date_module_entry = { @@ -235,8 +231,19 @@ { ZEND_INIT_MODULE_GLOBALS(date, php_date_init_globals, NULL); REGISTER_INI_ENTRIES(); - +#ifdef EXPERIMENTAL_DATE_SUPPORT date_register_classes(TSRMLS_C); +#endif + REGISTER_STRING_CONSTANT("DATE_ATOM", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_ISO8601", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_RFC822", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_RFC1036", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_RFC1123", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_RFC2822", DATE_FORMAT_RFC2822, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_RSS", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_W3C", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT); php_date_global_timezone_db = NULL; php_date_global_timezone_db_enabled = 0; @@ -1002,6 +1009,7 @@ } /* }}} */ +#ifdef EXPERIMENTAL_DATE_SUPPORT static void date_register_classes(TSRMLS_D) { zend_class_entry ce_date, ce_timezone; @@ -1107,7 +1115,6 @@ efree(object); } -#ifdef EXPERIMENTAL_DATE_SUPPORT /* Advanced Interface */ static zval * date_instanciate(zend_class_entry *pce, zval *object TSRMLS_DC) { http://cvs.php.net/diff.php/php-src/ext/date/tests/bug33869.phpt?r1=1.2.2.1&r2=1.2.2.2&ty=u Index: php-src/ext/date/tests/bug33869.phpt diff -u php-src/ext/date/tests/bug33869.phpt:1.2.2.1 php-src/ext/date/tests/bug33869.phpt:1.2.2.2 --- php-src/ext/date/tests/bug33869.phpt:1.2.2.1 Thu Nov 17 16:05:30 2005 +++ php-src/ext/date/tests/bug33869.phpt Sun Nov 27 01:51:43 2005 @@ -4,17 +4,17 @@ <?php date_default_timezone_set("UTC"); $tm = strtotime("2005-01-01 01:01:01"); - echo date(date::ISO8601, strtotime('+5days', $tm)); + echo date(DATE_ISO8601, strtotime('+5days', $tm)); echo "\n"; - echo date(date::ISO8601, strtotime('+1month', $tm)); + echo date(DATE_ISO8601, strtotime('+1month', $tm)); echo "\n"; - echo date(date::ISO8601, strtotime('+1year', $tm)); + echo date(DATE_ISO8601, strtotime('+1year', $tm)); echo "\n"; - echo date(date::ISO8601, strtotime('+5 days', $tm)); + echo date(DATE_ISO8601, strtotime('+5 days', $tm)); echo "\n"; - echo date(date::ISO8601, strtotime('+1 month', $tm)); + echo date(DATE_ISO8601, strtotime('+1 month', $tm)); echo "\n"; - echo date(date::ISO8601, strtotime('+1 year', $tm)); + echo date(DATE_ISO8601, strtotime('+1 year', $tm)); echo "\n"; ?> --EXPECT-- http://cvs.php.net/diff.php/php-src/ext/date/tests/bug34087.phpt?r1=1.1.2.3&r2=1.1.2.4&ty=u Index: php-src/ext/date/tests/bug34087.phpt diff -u php-src/ext/date/tests/bug34087.phpt:1.1.2.3 php-src/ext/date/tests/bug34087.phpt:1.1.2.4 --- php-src/ext/date/tests/bug34087.phpt:1.1.2.3 Thu Nov 17 16:05:30 2005 +++ php-src/ext/date/tests/bug34087.phpt Sun Nov 27 01:51:43 2005 @@ -6,10 +6,10 @@ echo "Y/m/d: ", strtotime("2005/8/12"), "\n"; echo "Y-m-d: ", strtotime("2005-8-12"), "\n"; -echo date(date::ISO8601, strtotime("2005/1/2")), "\n"; -echo date(date::ISO8601, strtotime("2005/01/02")), "\n"; -echo date(date::ISO8601, strtotime("2005/01/2")), "\n"; -echo date(date::ISO8601, strtotime("2005/1/02")), "\n"; +echo date(DATE_ISO8601, strtotime("2005/1/2")), "\n"; +echo date(DATE_ISO8601, strtotime("2005/01/02")), "\n"; +echo date(DATE_ISO8601, strtotime("2005/01/2")), "\n"; +echo date(DATE_ISO8601, strtotime("2005/1/02")), "\n"; ?> --EXPECT-- Y/m/d: 1123804800 http://cvs.php.net/diff.php/php-src/ext/date/tests/bug34676.phpt?r1=1.1.2.3&r2=1.1.2.4&ty=u Index: php-src/ext/date/tests/bug34676.phpt diff -u php-src/ext/date/tests/bug34676.phpt:1.1.2.3 php-src/ext/date/tests/bug34676.phpt:1.1.2.4 --- php-src/ext/date/tests/bug34676.phpt:1.1.2.3 Thu Nov 17 16:05:30 2005 +++ php-src/ext/date/tests/bug34676.phpt Sun Nov 27 01:51:43 2005 @@ -10,7 +10,7 @@ foreach ($tests as $test) { $t = strtotime("2005-12-22 ". $test); - printf("%-10s => %s\n", $test, date(date::ISO8601, $t)); + printf("%-10s => %s\n", $test, date(DATE_ISO8601, $t)); } ?> http://cvs.php.net/diff.php/php-src/ext/date/tests/bug34771.phpt?r1=1.1.2.3&r2=1.1.2.4&ty=u Index: php-src/ext/date/tests/bug34771.phpt diff -u php-src/ext/date/tests/bug34771.phpt:1.1.2.3 php-src/ext/date/tests/bug34771.phpt:1.1.2.4 --- php-src/ext/date/tests/bug34771.phpt:1.1.2.3 Thu Nov 17 16:05:30 2005 +++ php-src/ext/date/tests/bug34771.phpt Sun Nov 27 01:51:43 2005 @@ -13,7 +13,7 @@ foreach ($tests as $test) { $t = strtotime("2005-12-22 ". $test); - printf("%-10s => %s\n", $test, date(date::ISO8601, $t)); + printf("%-10s => %s\n", $test, date(DATE_ISO8601, $t)); } ?> http://cvs.php.net/diff.php/php-src/ext/date/tests/date_default_timezone_set-1.phpt?r1=1.1.2.3&r2=1.1.2.4&ty=u Index: php-src/ext/date/tests/date_default_timezone_set-1.phpt diff -u php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.1.2.3 php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.1.2.4 --- php-src/ext/date/tests/date_default_timezone_set-1.phpt:1.1.2.3 Thu Nov 17 16:05:30 2005 +++ php-src/ext/date/tests/date_default_timezone_set-1.phpt Sun Nov 27 01:51:43 2005 @@ -12,10 +12,10 @@ $date4 = strtotime("2005-07-12 08:00:00"); echo date_default_timezone_get(), "\n"; - echo date(date::ISO8601, $date1), "\n"; - echo date(date::ISO8601, $date2), "\n"; - echo date(date::ISO8601, $date3), "\n"; - echo date(date::ISO8601, $date4), "\n"; + echo date(DATE_ISO8601, $date1), "\n"; + echo date(DATE_ISO8601, $date2), "\n"; + echo date(DATE_ISO8601, $date3), "\n"; + echo date(DATE_ISO8601, $date4), "\n"; ?> --EXPECTF-- Strict Standards: strtotime(): It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. We selected 'Europe/London' for 'UTC/0.0/no DST' instead in %sdate_default_timezone_set-1.php on line 3 http://cvs.php.net/diff.php/php-src/ext/date/tests/mktime-3.phpt?r1=1.1.2.1&r2=1.1.2.2&ty=u Index: php-src/ext/date/tests/mktime-3.phpt diff -u php-src/ext/date/tests/mktime-3.phpt:1.1.2.1 php-src/ext/date/tests/mktime-3.phpt:1.1.2.2 --- php-src/ext/date/tests/mktime-3.phpt:1.1.2.1 Thu Nov 17 16:05:30 2005 +++ php-src/ext/date/tests/mktime-3.phpt Sun Nov 27 01:51:43 2005 @@ -16,7 +16,7 @@ if ($ret == FALSE) { echo "out of range\n"; } else { - echo date("F ".date::ISO8601, $ret), "\n"; + echo date("F ".DATE_ISO8601, $ret), "\n"; } } echo "\n"; http://cvs.php.net/diff.php/php-src/ext/date/tests/strtotime.phpt?r1=1.1.2.1&r2=1.1.2.2&ty=u Index: php-src/ext/date/tests/strtotime.phpt diff -u php-src/ext/date/tests/strtotime.phpt:1.1.2.1 php-src/ext/date/tests/strtotime.phpt:1.1.2.2 --- php-src/ext/date/tests/strtotime.phpt:1.1.2.1 Thu Nov 17 16:05:30 2005 +++ php-src/ext/date/tests/strtotime.phpt Sun Nov 27 01:51:43 2005 @@ -8,7 +8,7 @@ $d[] = strtotime("2005-07-14 22:30:41 GMT"); foreach($d as $date) { - echo date(date::ISO8601, $date), "\n"; + echo date(DATE_ISO8601, $date), "\n"; } ?> --EXPECT--
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php