]> granicus.if.org Git - php/commitdiff
- Fixed TSRM issue.
authorDerick Rethans <derick@php.net>
Tue, 9 Aug 2005 21:07:54 +0000 (21:07 +0000)
committerDerick Rethans <derick@php.net>
Tue, 9 Aug 2005 21:07:54 +0000 (21:07 +0000)
- Added guessed timezone to phpinfo() output.
- Initialize is_dst in some cases.
- Corrected some test cases.

ext/date/lib/parse_date.c
ext/date/lib/parse_date.re
ext/date/lib/resource/parse_date.re
ext/date/php_date.c
ext/date/tests/bug33414-2.phpt
ext/date/tests/date_create-3.phpt [new file with mode: 0644]
ext/date/tests/mktime-2.phpt

index 583b36c46be4ff3727124eae786b6b17801fc8a3..486061f830ab56481ac04c41a87a971b68e4dc24 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.8 on Tue Jul 26 18:01:10 2005 */
+/* Generated by re2c 0.9.8.dev on Tue Aug  9 23:05:03 2005 */
 #line 1 "resource/parse_date.re"
 /*
    +----------------------------------------------------------------------+
@@ -712,6 +712,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
                t->is_localtime = 1;
                t->zone_type = TIMELIB_ZONETYPE_OFFSET;
                *tz_not_found = 0;
+               t->dst = 0;
 
                return -1 * timelib_parse_tz_cor(ptr);
        } else if (**ptr == '-') {
@@ -719,6 +720,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
                t->is_localtime = 1;
                t->zone_type = TIMELIB_ZONETYPE_OFFSET;
                *tz_not_found = 0;
+               t->dst = 0;
 
                return timelib_parse_tz_cor(ptr);
        } else {
@@ -771,7 +773,7 @@ static int scan(Scanner *s)
 std:
        s->tok = cursor;
        s->len = 0;
-#line 876 "resource/parse_date.re"
+#line 878 "resource/parse_date.re"
 
 
 {
@@ -810,7 +812,7 @@ std:
          0,   0,   0,   0,   0,   0,   0,   0, 
        };
 
-#line 814 "<stdout>"
+#line 816 "<stdout>"
 {
        YYCTYPE yych;
        unsigned int yyaccept;
@@ -895,7 +897,7 @@ yy2:
 yy3:
        YYDEBUG(3, *YYCURSOR);
 
-#line 1340 "resource/parse_date.re"
+#line 1342 "resource/parse_date.re"
 {
                int tz_not_found;
                TIMELIB_INIT;
@@ -904,7 +906,7 @@ yy3:
                TIMELIB_DEINIT;
                return TIMELIB_TIMEZONE;
        }
-#line 901 "<stdout>"
+#line 903 "<stdout>"
 yy4:
        YYDEBUG(4, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -990,13 +992,13 @@ yy6:
 yy7:
        YYDEBUG(7, *YYCURSOR);
 
-#line 1404 "resource/parse_date.re"
+#line 1406 "resource/parse_date.re"
 {
 /*             printf("unexpected character: #%d, %c ", *s->tok, *s->tok); */
                s->errors++;
                goto std;
        }
-#line 984 "<stdout>"
+#line 986 "<stdout>"
 yy8:
        YYDEBUG(8, *YYCURSOR);
        yyaccept = 0;
@@ -1919,11 +1921,11 @@ yy43:
 yy44:
        YYDEBUG(44, *YYCURSOR);
 
-#line 1393 "resource/parse_date.re"
+#line 1395 "resource/parse_date.re"
 {
                goto std;
        }
-#line 1832 "<stdout>"
+#line 1834 "<stdout>"
 yy45:
        YYDEBUG(45, *YYCURSOR);
        ++YYCURSOR;
@@ -1931,12 +1933,12 @@ yy45:
 yy46:
        YYDEBUG(46, *YYCURSOR);
 
-#line 1398 "resource/parse_date.re"
+#line 1400 "resource/parse_date.re"
 {
                s->pos = cursor; s->line++;
                goto std;
        }
-#line 1841 "<stdout>"
+#line 1843 "<stdout>"
 yy47:
        YYDEBUG(47, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -2394,7 +2396,7 @@ yy84:
 yy85:
        YYDEBUG(85, *YYCURSOR);
 
-#line 1377 "resource/parse_date.re"
+#line 1379 "resource/parse_date.re"
 {
                timelib_ull i;
 
@@ -2409,7 +2411,7 @@ yy85:
                TIMELIB_DEINIT;
                return TIMELIB_RELATIVE;
        }
-#line 2231 "<stdout>"
+#line 2233 "<stdout>"
 yy86:
        YYDEBUG(86, *YYCURSOR);
        ++YYCURSOR;
@@ -3102,11 +3104,11 @@ yy150:
 yy151:
        YYDEBUG(151, *YYCURSOR);
 
-#line 1335 "resource/parse_date.re"
+#line 1337 "resource/parse_date.re"
 {
                goto std;
        }
-#line 2794 "<stdout>"
+#line 2796 "<stdout>"
 yy152:
        YYDEBUG(152, *YYCURSOR);
        yyaccept = 1;
@@ -3145,7 +3147,7 @@ yy157:
 yy158:
        YYDEBUG(158, *YYCURSOR);
 
-#line 1319 "resource/parse_date.re"
+#line 1321 "resource/parse_date.re"
 {
                const timelib_relunit* relunit;
 
@@ -3160,7 +3162,7 @@ yy158:
                TIMELIB_DEINIT;
                return TIMELIB_RELATIVE;
        }
-#line 2834 "<stdout>"
+#line 2836 "<stdout>"
 yy159:
        YYDEBUG(159, *YYCURSOR);
        yyaccept = 1;
@@ -3529,7 +3531,7 @@ yy189:
 yy190:
        YYDEBUG(190, *YYCURSOR);
 
-#line 1303 "resource/parse_date.re"
+#line 1305 "resource/parse_date.re"
 {
                timelib_sll i;
 
@@ -3544,7 +3546,7 @@ yy190:
                TIMELIB_DEINIT;
                return TIMELIB_RELATIVE;
        }
-#line 3152 "<stdout>"
+#line 3154 "<stdout>"
 yy191:
        YYDEBUG(191, *YYCURSOR);
        ++YYCURSOR;
@@ -9174,7 +9176,7 @@ yy508:
 yy509:
        YYDEBUG(509, *YYCURSOR);
 
-#line 1135 "resource/parse_date.re"
+#line 1137 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -9185,7 +9187,7 @@ yy509:
                TIMELIB_DEINIT;
                return TIMELIB_DATE_TEXT;
        }
-#line 8144 "<stdout>"
+#line 8146 "<stdout>"
 yy510:
        YYDEBUG(510, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -9317,7 +9319,7 @@ yy526:
 yy527:
        YYDEBUG(527, *YYCURSOR);
 
-#line 1350 "resource/parse_date.re"
+#line 1352 "resource/parse_date.re"
 {
                int tz_not_found;
                TIMELIB_INIT;
@@ -9343,7 +9345,7 @@ yy527:
                TIMELIB_DEINIT;
                return TIMELIB_SHORTDATE_WITH_TIME;
        }
-#line 8266 "<stdout>"
+#line 8268 "<stdout>"
 yy528:
        YYDEBUG(528, *YYCURSOR);
        yyaccept = 7;
@@ -9651,7 +9653,7 @@ yy561:
 yy562:
        YYDEBUG(562, *YYCURSOR);
 
-#line 1111 "resource/parse_date.re"
+#line 1113 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -9662,7 +9664,7 @@ yy562:
                TIMELIB_DEINIT;
                return TIMELIB_DATE_NO_DAY;
        }
-#line 8515 "<stdout>"
+#line 8517 "<stdout>"
 yy563:
        YYDEBUG(563, *YYCURSOR);
        yyaccept = 6;
@@ -9792,7 +9794,7 @@ yy576:
 yy577:
        YYDEBUG(577, *YYCURSOR);
 
-#line 1239 "resource/parse_date.re"
+#line 1241 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -9803,7 +9805,7 @@ yy577:
                TIMELIB_DEINIT;
                return TIMELIB_PG_TEXT;
        }
-#line 8626 "<stdout>"
+#line 8628 "<stdout>"
 yy578:
        YYDEBUG(578, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -11300,7 +11302,7 @@ yy672:
 yy673:
        YYDEBUG(673, *YYCURSOR);
 
-#line 1289 "resource/parse_date.re"
+#line 1291 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                s->time->relative.y = 0 - s->time->relative.y;
@@ -11313,7 +11315,7 @@ yy673:
                TIMELIB_DEINIT;
                return TIMELIB_AGO;
        }
-#line 9944 "<stdout>"
+#line 9946 "<stdout>"
 yy674:
        YYDEBUG(674, *YYCURSOR);
        yyaccept = 1;
@@ -13243,7 +13245,7 @@ yy776:
 yy777:
        YYDEBUG(777, *YYCURSOR);
 
-#line 1147 "resource/parse_date.re"
+#line 1149 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -13252,7 +13254,7 @@ yy777:
                TIMELIB_DEINIT;
                return TIMELIB_DATE_TEXT;
        }
-#line 11671 "<stdout>"
+#line 11673 "<stdout>"
 yy778:
        YYDEBUG(778, *YYCURSOR);
        yyaccept = 10;
@@ -13341,7 +13343,7 @@ yy785:
 yy786:
        YYDEBUG(786, *YYCURSOR);
 
-#line 963 "resource/parse_date.re"
+#line 965 "resource/parse_date.re"
 {
                int tz_not_found;
                DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@@ -13364,7 +13366,7 @@ yy786:
                TIMELIB_DEINIT;
                return TIMELIB_TIME24_WITH_ZONE;
        }
-#line 11765 "<stdout>"
+#line 11767 "<stdout>"
 yy787:
        YYDEBUG(787, *YYCURSOR);
        yyaccept = 11;
@@ -13491,7 +13493,7 @@ yy800:
 yy801:
        YYDEBUG(801, *YYCURSOR);
 
-#line 948 "resource/parse_date.re"
+#line 950 "resource/parse_date.re"
 {
                DEBUG_OUTPUT("timeshort12 | timelong12");
                TIMELIB_INIT;
@@ -13505,7 +13507,7 @@ yy801:
                TIMELIB_DEINIT;
                return TIMELIB_TIME12;
        }
-#line 11876 "<stdout>"
+#line 11878 "<stdout>"
 yy802:
        YYDEBUG(802, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -13627,7 +13629,7 @@ yy813:
 yy814:
        YYDEBUG(814, *YYCURSOR);
 
-#line 1087 "resource/parse_date.re"
+#line 1089 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -13638,7 +13640,7 @@ yy814:
                TIMELIB_DEINIT;
                return TIMELIB_DATE_FULL;
        }
-#line 11983 "<stdout>"
+#line 11985 "<stdout>"
 yy815:
        YYDEBUG(815, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -14000,7 +14002,7 @@ yy855:
 yy856:
        YYDEBUG(856, *YYCURSOR);
 
-#line 1099 "resource/parse_date.re"
+#line 1101 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -14011,7 +14013,7 @@ yy856:
                TIMELIB_DEINIT;
                return TIMELIB_DATE_FULL_POINTED;
        }
-#line 12272 "<stdout>"
+#line 12274 "<stdout>"
 yy857:
        YYDEBUG(857, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -14738,7 +14740,7 @@ yy922:
 yy923:
        YYDEBUG(923, *YYCURSOR);
 
-#line 1075 "resource/parse_date.re"
+#line 1077 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -14749,7 +14751,7 @@ yy923:
                TIMELIB_DEINIT;
                return TIMELIB_ISO_DATE;
        }
-#line 12876 "<stdout>"
+#line 12878 "<stdout>"
 yy924:
        YYDEBUG(924, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -14771,7 +14773,7 @@ yy926:
 yy927:
        YYDEBUG(927, *YYCURSOR);
 
-#line 1050 "resource/parse_date.re"
+#line 1052 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -14784,7 +14786,7 @@ yy927:
                TIMELIB_DEINIT;
                return TIMELIB_AMERICAN;
        }
-#line 12903 "<stdout>"
+#line 12905 "<stdout>"
 yy928:
        YYDEBUG(928, *YYCURSOR);
        yyaccept = 12;
@@ -15006,7 +15008,7 @@ yy959:
 yy960:
        YYDEBUG(960, *YYCURSOR);
 
-#line 1263 "resource/parse_date.re"
+#line 1265 "resource/parse_date.re"
 {
                int tz_not_found;
                TIMELIB_INIT;
@@ -15023,7 +15025,7 @@ yy960:
                TIMELIB_DEINIT;
                return TIMELIB_CLF;
        }
-#line 13076 "<stdout>"
+#line 13078 "<stdout>"
 yy961:
        YYDEBUG(961, *YYCURSOR);
        yyaccept = 13;
@@ -15332,7 +15334,7 @@ yy999:
 yy1000:
        YYDEBUG(1000, *YYCURSOR);
 
-#line 1251 "resource/parse_date.re"
+#line 1253 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -15343,7 +15345,7 @@ yy1000:
                TIMELIB_DEINIT;
                return TIMELIB_PG_TEXT;
        }
-#line 13315 "<stdout>"
+#line 13317 "<stdout>"
 yy1001:
        YYDEBUG(1001, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -15476,14 +15478,14 @@ yy1011:
 yy1012:
        YYDEBUG(1012, *YYCURSOR);
 
-#line 1281 "resource/parse_date.re"
+#line 1283 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                s->time->y = timelib_get_nr((char **) &ptr, 4);
                TIMELIB_DEINIT;
                return TIMELIB_CLF;
        }
-#line 13430 "<stdout>"
+#line 13432 "<stdout>"
 yy1013:
        YYDEBUG(1013, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -15618,7 +15620,7 @@ yy1020:
 yy1021:
        YYDEBUG(1021, *YYCURSOR);
 
-#line 1123 "resource/parse_date.re"
+#line 1125 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -15629,7 +15631,7 @@ yy1021:
                TIMELIB_DEINIT;
                return TIMELIB_DATE_NO_DAY;
        }
-#line 13555 "<stdout>"
+#line 13557 "<stdout>"
 yy1022:
        YYDEBUG(1022, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -15838,7 +15840,7 @@ yy1040:
 yy1041:
        YYDEBUG(1041, *YYCURSOR);
 
-#line 1220 "resource/parse_date.re"
+#line 1222 "resource/parse_date.re"
 {
                timelib_sll w, d;
 
@@ -15856,7 +15858,7 @@ yy1041:
                TIMELIB_DEINIT;
                return TIMELIB_ISO_WEEK;
        }
-#line 13742 "<stdout>"
+#line 13744 "<stdout>"
 yy1042:
        YYDEBUG(1042, *YYCURSOR);
        ++YYCURSOR;
@@ -15864,7 +15866,7 @@ yy1042:
 yy1043:
        YYDEBUG(1043, *YYCURSOR);
 
-#line 1201 "resource/parse_date.re"
+#line 1203 "resource/parse_date.re"
 {
                timelib_sll w, d;
 
@@ -15882,7 +15884,7 @@ yy1043:
                TIMELIB_DEINIT;
                return TIMELIB_ISO_WEEK;
        }
-#line 13764 "<stdout>"
+#line 13766 "<stdout>"
 yy1044:
        YYDEBUG(1044, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -15951,7 +15953,7 @@ yy1046:
 yy1047:
        YYDEBUG(1047, *YYCURSOR);
 
-#line 1189 "resource/parse_date.re"
+#line 1191 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -15962,7 +15964,7 @@ yy1047:
                TIMELIB_DEINIT;
                return TIMELIB_PG_YEARDAY;
        }
-#line 13836 "<stdout>"
+#line 13838 "<stdout>"
 yy1048:
        YYDEBUG(1048, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -16077,7 +16079,7 @@ yy1053:
 yy1054:
        YYDEBUG(1054, *YYCURSOR);
 
-#line 1157 "resource/parse_date.re"
+#line 1159 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -16087,7 +16089,7 @@ yy1054:
                TIMELIB_DEINIT;
                return TIMELIB_DATE_NOCOLON;
        }
-#line 13943 "<stdout>"
+#line 13945 "<stdout>"
 yy1055:
        YYDEBUG(1055, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -16185,7 +16187,7 @@ yy1064:
 yy1065:
        YYDEBUG(1065, *YYCURSOR);
 
-#line 1168 "resource/parse_date.re"
+#line 1170 "resource/parse_date.re"
 {
                int tz_not_found;
                TIMELIB_INIT;
@@ -16205,7 +16207,7 @@ yy1065:
                TIMELIB_DEINIT;
                return TIMELIB_XMLRPC_SOAP;
        }
-#line 14039 "<stdout>"
+#line 14041 "<stdout>"
 yy1066:
        YYDEBUG(1066, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -16822,7 +16824,7 @@ yy1158:
 yy1159:
        YYDEBUG(1159, *YYCURSOR);
 
-#line 1064 "resource/parse_date.re"
+#line 1066 "resource/parse_date.re"
 {
                TIMELIB_INIT;
                TIMELIB_HAVE_DATE();
@@ -16832,7 +16834,7 @@ yy1159:
                TIMELIB_DEINIT;
                return TIMELIB_ISO_DATE;
        }
-#line 14478 "<stdout>"
+#line 14480 "<stdout>"
 yy1160:
        YYDEBUG(1160, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -17507,7 +17509,7 @@ yy1235:
 yy1236:
        YYDEBUG(1236, *YYCURSOR);
 
-#line 987 "resource/parse_date.re"
+#line 989 "resource/parse_date.re"
 {
                DEBUG_OUTPUT("gnunocolon");
                TIMELIB_INIT;
@@ -17528,7 +17530,7 @@ yy1236:
                TIMELIB_DEINIT;
                return TIMELIB_GNU_NOCOLON;
        }
-#line 15018 "<stdout>"
+#line 15020 "<stdout>"
 yy1237:
        YYDEBUG(1237, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -17625,7 +17627,7 @@ yy1243:
 yy1244:
        YYDEBUG(1244, *YYCURSOR);
 
-#line 1032 "resource/parse_date.re"
+#line 1034 "resource/parse_date.re"
 {
                int tz_not_found;
                DEBUG_OUTPUT("iso8601nocolon");
@@ -17642,7 +17644,7 @@ yy1244:
                TIMELIB_DEINIT;
                return TIMELIB_ISO_NOCOLON;
        }
-#line 15116 "<stdout>"
+#line 15118 "<stdout>"
 yy1245:
        YYDEBUG(1245, *YYCURSOR);
        yyaccept = 21;
@@ -17854,7 +17856,7 @@ yy1260:
 yy1261:
        YYDEBUG(1261, *YYCURSOR);
 
-#line 924 "resource/parse_date.re"
+#line 926 "resource/parse_date.re"
 {
                timelib_ull i;
 
@@ -17877,7 +17879,7 @@ yy1261:
                TIMELIB_DEINIT;
                return TIMELIB_RELATIVE;
        }
-#line 15311 "<stdout>"
+#line 15313 "<stdout>"
 yy1262:
        YYDEBUG(1262, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -17948,7 +17950,7 @@ yy1269:
 yy1270:
        YYDEBUG(1270, *YYCURSOR);
 
-#line 912 "resource/parse_date.re"
+#line 914 "resource/parse_date.re"
 {
                DEBUG_OUTPUT("tomorrow");
                TIMELIB_INIT;
@@ -17959,7 +17961,7 @@ yy1270:
                TIMELIB_DEINIT;
                return TIMELIB_RELATIVE;
        }
-#line 15375 "<stdout>"
+#line 15377 "<stdout>"
 yy1271:
        YYDEBUG(1271, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -17972,7 +17974,7 @@ yy1272:
 yy1273:
        YYDEBUG(1273, *YYCURSOR);
 
-#line 902 "resource/parse_date.re"
+#line 904 "resource/parse_date.re"
 {
                DEBUG_OUTPUT("today");
                TIMELIB_INIT;
@@ -17981,7 +17983,7 @@ yy1273:
                TIMELIB_DEINIT;
                return TIMELIB_RELATIVE;
        }
-#line 15391 "<stdout>"
+#line 15393 "<stdout>"
 yy1274:
        YYDEBUG(1274, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -18015,7 +18017,7 @@ yy1275:
 yy1276:
        YYDEBUG(1276, *YYCURSOR);
 
-#line 893 "resource/parse_date.re"
+#line 895 "resource/parse_date.re"
 {
                DEBUG_OUTPUT("now");
                TIMELIB_INIT;
@@ -18023,7 +18025,7 @@ yy1276:
                TIMELIB_DEINIT;
                return TIMELIB_RELATIVE;
        }
-#line 15427 "<stdout>"
+#line 15429 "<stdout>"
 yy1277:
        YYDEBUG(1277, *YYCURSOR);
        yych = *++YYCURSOR;
@@ -18081,7 +18083,7 @@ yy1284:
 yy1285:
        YYDEBUG(1285, *YYCURSOR);
 
-#line 881 "resource/parse_date.re"
+#line 883 "resource/parse_date.re"
 {
                DEBUG_OUTPUT("yesterday");
                TIMELIB_INIT;
@@ -18092,10 +18094,10 @@ yy1285:
                TIMELIB_DEINIT;
                return TIMELIB_RELATIVE;
        }
-#line 15478 "<stdout>"
+#line 15480 "<stdout>"
 }
 }
-#line 1409 "resource/parse_date.re"
+#line 1411 "resource/parse_date.re"
 
 }
 
index e7ff41c20b811e01a7410597f495a272c67170c0..7575741c247508caf5be50bfe728bca794db2bc9 100644 (file)
@@ -710,6 +710,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
                t->is_localtime = 1;
                t->zone_type = TIMELIB_ZONETYPE_OFFSET;
                *tz_not_found = 0;
+               t->dst = 0;
 
                return -1 * timelib_parse_tz_cor(ptr);
        } else if (**ptr == '-') {
@@ -717,6 +718,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
                t->is_localtime = 1;
                t->zone_type = TIMELIB_ZONETYPE_OFFSET;
                *tz_not_found = 0;
+               t->dst = 0;
 
                return timelib_parse_tz_cor(ptr);
        } else {
index e7ff41c20b811e01a7410597f495a272c67170c0..7575741c247508caf5be50bfe728bca794db2bc9 100644 (file)
@@ -710,6 +710,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
                t->is_localtime = 1;
                t->zone_type = TIMELIB_ZONETYPE_OFFSET;
                *tz_not_found = 0;
+               t->dst = 0;
 
                return -1 * timelib_parse_tz_cor(ptr);
        } else if (**ptr == '-') {
@@ -717,6 +718,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
                t->is_localtime = 1;
                t->zone_type = TIMELIB_ZONETYPE_OFFSET;
                *tz_not_found = 0;
+               t->dst = 0;
 
                return timelib_parse_tz_cor(ptr);
        } else {
index ea105b0fc575401591c684b975ad6e12623aa520..bee2a4e89318a1bc4502bb30d662146f8f101fa7 100644 (file)
@@ -88,11 +88,13 @@ function_entry date_funcs_timezone[] = {
        {NULL, NULL, NULL}
 };
 
-static void date_register_classes(void);
-# define DATE_REGISTER_CLASSES date_register_classes()
+static void date_register_classes(TSRMLS_D);
+# define DATE_REGISTER_CLASSES date_register_classes(TSRMLS_C)
 #else
 # define DATE_REGISTER_CLASSES /* */
 #endif
+
+static char* guess_timezone(TSRMLS_D);
 /* }}} */
 
 ZEND_DECLARE_MODULE_GLOBALS(date)
@@ -237,7 +239,10 @@ PHP_MINFO_FUNCTION(date)
 {
        php_info_print_table_start();
        php_info_print_table_row(2, "date/time support", "enabled");
+       php_info_print_table_row(2, "Default timezone", guess_timezone(TSRMLS_C));
        php_info_print_table_end();
+
+       DISPLAY_INI_ENTRIES();
 }
 /* }}} */
 
@@ -925,7 +930,6 @@ PHP_FUNCTION(getdate)
 static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC)
 {
        php_date_obj *intern;
-       zval         *tmp;
        zend_object_value retval;
 
        intern = emalloc(sizeof(php_date_obj));
@@ -941,7 +945,6 @@ static zend_object_value date_object_new_date(zend_class_entry *class_type TSRML
 static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC)
 {
        php_timezone_obj *intern;
-       zval             *tmp;
        zend_object_value retval;
 
        intern = emalloc(sizeof(php_timezone_obj));
@@ -975,7 +978,7 @@ static void date_object_free_storage_timezone(void *object TSRMLS_DC)
        efree(object);
 }
 
-static void date_register_classes(void)
+static void date_register_classes(TSRMLS_D)
 {
        zend_class_entry ce_date, ce_timezone;
 
index 1710f67cd2de177c4626395b7f411ff0d765ca38..7f8e7b675c53f1a5275f5a98fca541978afef249 100644 (file)
@@ -87,7 +87,7 @@ wanted=Tuesday            00:00:00
 
 TZ=America/Port-au-Prince - wrong day.
 tStamp=Monday 2005-03-28 17:17:17 EST 0
-result=Monday 2005-04-04 00:00:00 EST 0
+result=Monday 2005-04-04 00:00:00 EDT 1
 wanted=Monday            00:00:00
 
 TZ=Pacific/Enderbury - wrong day, off by 2 days.
@@ -102,7 +102,7 @@ wanted=Monday            00:00:00
 
 TZ=America/Managua - wrong day.
 tStamp=Tuesday 2005-04-05 17:17:17 CST 0
-result=Tuesday 2005-04-12 00:00:00 CST 0
+result=Tuesday 2005-04-12 00:00:00 CDT 1
 wanted=Tuesday            00:00:00
 
 TZ=Pacific/Pitcairn - wrong day.
diff --git a/ext/date/tests/date_create-3.phpt b/ext/date/tests/date_create-3.phpt
new file mode 100644 (file)
index 0000000..67be1a0
--- /dev/null
@@ -0,0 +1,11 @@
+--TEST--
+date_create() function [3]
+--FILE--
+<?php
+date_default_timezone_set("GMT");
+echo date_format(date_create("Dec31 2005 +0100"), DATE_ISO8601), "\n";
+echo date(DATE_ISO8601, strtotime("Dec31 2005 +0100")), "\n";
+?>
+--EXPECT--
+2005-12-31T00:00:00+0100
+2005-12-31T00:00:00+0100
index 304d9bad3a199e08d86b31c8a1f4e29d50e9f541..def140f3a08fdbbfbc372239e5916b9efbac95d9 100644 (file)
@@ -1,5 +1,5 @@
 --TEST--
-mktime()
+mktime() [2]
 --INI--
 error_reporting=2047
 --FILE--