[PHP-CVS] cvs: php-src /ext/date TODO

2005-08-04 Thread Derick Rethans
derick  Thu Aug  4 10:59:29 2005 EDT

  Modified files:  
/php-src/ext/date   TODO 
  Log:
  - Update TODO
  
  
http://cvs.php.net/diff.php/php-src/ext/date/TODO?r1=1.9r2=1.10ty=u
Index: php-src/ext/date/TODO
diff -u php-src/ext/date/TODO:1.9 php-src/ext/date/TODO:1.10
--- php-src/ext/date/TODO:1.9   Wed Jul 20 04:31:00 2005
+++ php-src/ext/date/TODO   Thu Aug  4 10:59:29 2005
@@ -2,3 +2,5 @@
 - Write an error handler for unexpected characters while parsing dates.
 - Cache lookups for timezone information.
 - Optimize parsing @ with a negative timestamp.
+- Make sure that date_default_timezone_set() validates the passed timezone
+  identifier.

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/date TODO /ext/date/lib dow.c parse_tz.c timelib.c timelib_structs.h tm2unixtime.c unixtime2tm.c

2005-06-29 Thread Derick Rethans
derick  Wed Jun 29 15:08:26 2005 EDT

  Modified files:  
/php-src/ext/date   TODO 
/php-src/ext/date/lib   dow.c parse_tz.c timelib.c timelib_structs.h 
tm2unixtime.c unixtime2tm.c 
  Log:
  - Reorganize headers, and update TODO.
  
  
http://cvs.php.net/diff.php/php-src/ext/date/TODO?r1=1.7r2=1.8ty=u
Index: php-src/ext/date/TODO
diff -u php-src/ext/date/TODO:1.7 php-src/ext/date/TODO:1.8
--- php-src/ext/date/TODO:1.7   Mon Jun 20 07:08:28 2005
+++ php-src/ext/date/TODO   Wed Jun 29 15:08:26 2005
@@ -1,6 +1,6 @@
 - Port over my 200 test cases to .phpt format.
 - Write an error handler for unexpected characters while parsing dates.
 - Cache lookups for timezone information.
-- Change tz structure lookup to use binary search.
 - Move all date/time related functions from ext/standard to ext/date.
 - Move all date/time related tests from ext/standard/tests to ext/data/tests.
+- Optimize parsing @ with a negative timestamp.
http://cvs.php.net/diff.php/php-src/ext/date/lib/dow.c?r1=1.5r2=1.6ty=u
Index: php-src/ext/date/lib/dow.c
diff -u php-src/ext/date/lib/dow.c:1.5 php-src/ext/date/lib/dow.c:1.6
--- php-src/ext/date/lib/dow.c:1.5  Fri Jun 17 10:53:59 2005
+++ php-src/ext/date/lib/dow.c  Wed Jun 29 15:08:26 2005
@@ -16,11 +16,9 @@
+--+
  */
 
-/* $Id: dow.c,v 1.5 2005/06/17 14:53:59 derick Exp $ */
+/* $Id: dow.c,v 1.6 2005/06/29 19:08:26 derick Exp $ */
 
-#include timelib_config.h
-
-#include timelib_structs.h
+#include timelib.h
 
 static int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 
1 = jan */
 static int m_table_leap[13] =   { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 
1 = jan */
http://cvs.php.net/diff.php/php-src/ext/date/lib/parse_tz.c?r1=1.15r2=1.16ty=u
Index: php-src/ext/date/lib/parse_tz.c
diff -u php-src/ext/date/lib/parse_tz.c:1.15 
php-src/ext/date/lib/parse_tz.c:1.16
--- php-src/ext/date/lib/parse_tz.c:1.15Tue Jun 28 17:37:36 2005
+++ php-src/ext/date/lib/parse_tz.c Wed Jun 29 15:08:26 2005
@@ -16,9 +16,9 @@
+--+
  */
 
-/* $Id: parse_tz.c,v 1.15 2005/06/28 21:37:36 derick Exp $ */
+/* $Id: parse_tz.c,v 1.16 2005/06/29 19:08:26 derick Exp $ */
 
-#include timelib_config.h
+#include timelib.h
 
 #include stdio.h
 
@@ -27,8 +27,6 @@
 #else
 #include strings.h
 #endif
-
-#include timelib.h
 #include timezonedb.h
 
 #ifdef WORDS_BIGENDIAN
http://cvs.php.net/diff.php/php-src/ext/date/lib/timelib.c?r1=1.4r2=1.5ty=u
Index: php-src/ext/date/lib/timelib.c
diff -u php-src/ext/date/lib/timelib.c:1.4 php-src/ext/date/lib/timelib.c:1.5
--- php-src/ext/date/lib/timelib.c:1.4  Fri Jun 17 10:54:00 2005
+++ php-src/ext/date/lib/timelib.c  Wed Jun 29 15:08:26 2005
@@ -16,11 +16,8 @@
+--+
  */
 
-/* $Id: timelib.c,v 1.4 2005/06/17 14:54:00 derick Exp $ */
+/* $Id: timelib.c,v 1.5 2005/06/29 19:08:26 derick Exp $ */
 
-#include timelib_config.h
-
-#include timelib_structs.h
 #include timelib.h
 #include ctype.h
 
http://cvs.php.net/diff.php/php-src/ext/date/lib/timelib_structs.h?r1=1.9r2=1.10ty=u
Index: php-src/ext/date/lib/timelib_structs.h
diff -u php-src/ext/date/lib/timelib_structs.h:1.9 
php-src/ext/date/lib/timelib_structs.h:1.10
--- php-src/ext/date/lib/timelib_structs.h:1.9  Sat Jun 18 15:23:58 2005
+++ php-src/ext/date/lib/timelib_structs.h  Wed Jun 29 15:08:26 2005
@@ -16,11 +16,13 @@
+--+
  */
 
-/* $Id: timelib_structs.h,v 1.9 2005/06/18 19:23:58 derick Exp $ */
+/* $Id: timelib_structs.h,v 1.10 2005/06/29 19:08:26 derick Exp $ */
 
 #ifndef __TIMELIB_STRUCTS_H__
 #define __TIMELIB_STRUCTS_H__
 
+#include timelib_config.h
+
 #ifdef HAVE_SYS_TYPES_H
 #include sys/types.h
 #endif
http://cvs.php.net/diff.php/php-src/ext/date/lib/tm2unixtime.c?r1=1.10r2=1.11ty=u
Index: php-src/ext/date/lib/tm2unixtime.c
diff -u php-src/ext/date/lib/tm2unixtime.c:1.10 
php-src/ext/date/lib/tm2unixtime.c:1.11
--- php-src/ext/date/lib/tm2unixtime.c:1.10 Sat Jun 18 15:23:58 2005
+++ php-src/ext/date/lib/tm2unixtime.c  Wed Jun 29 15:08:26 2005
@@ -16,9 +16,8 @@
+--+
  */
 
-/* $Id: tm2unixtime.c,v 1.10 2005/06/18 19:23:58 derick Exp $ */
+/* $Id: tm2unixtime.c,v 1.11 2005/06/29 19:08:26 derick Exp $ */
 
-#include timelib_config.h
 #include timelib.h
 
 /*jan  feb  mrt  apr  may  jun  jul  aug  
sep  oct  nov  dec */
http://cvs.php.net/diff.php/php-src/ext/date/lib/unixtime2tm.c?r1=1.8r2=1.9ty=u
Index: php-src/ext/date/lib/unixtime2tm.c
diff -u php-src/ext/date/lib/unixtime2tm.c:1.8 
php-src/ext/date/lib/unixtime2tm.c:1.9
--- php-src/ext/date/lib/unixtime2tm.c:1.8  Fri Jun 17 10:54:00 2005
+++ 

[PHP-CVS] cvs: php-src /ext/date TODO

2005-06-20 Thread Derick Rethans
derick  Mon Jun 20 07:08:29 2005 EDT

  Modified files:  
/php-src/ext/date   TODO 
  Log:
  - Update TODO.
  
  
http://cvs.php.net/diff.php/php-src/ext/date/TODO?r1=1.6r2=1.7ty=u
Index: php-src/ext/date/TODO
diff -u php-src/ext/date/TODO:1.6 php-src/ext/date/TODO:1.7
--- php-src/ext/date/TODO:1.6   Sun Jun 19 18:15:25 2005
+++ php-src/ext/date/TODO   Mon Jun 20 07:08:28 2005
@@ -1,4 +1,6 @@
 - Port over my 200 test cases to .phpt format.
 - Write an error handler for unexpected characters while parsing dates.
-- Move all date/time related functions from ext/standard to ext/date
-- Move all date/time related tests from ext/standard/tests to ext/data/tests
+- Cache lookups for timezone information.
+- Change tz structure lookup to use binary search.
+- Move all date/time related functions from ext/standard to ext/date.
+- Move all date/time related tests from ext/standard/tests to ext/data/tests.

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/date TODO

2005-06-18 Thread Jani Taskinen
sniper  Sat Jun 18 14:11:33 2005 EDT

  Modified files:  
/php-src/ext/date   TODO 
  Log:
  some more things to do
  
http://cvs.php.net/diff.php/php-src/ext/date/TODO?r1=1.2r2=1.3ty=u
Index: php-src/ext/date/TODO
diff -u php-src/ext/date/TODO:1.2 php-src/ext/date/TODO:1.3
--- php-src/ext/date/TODO:1.2   Wed Jun 15 03:58:21 2005
+++ php-src/ext/date/TODO   Sat Jun 18 14:11:33 2005
@@ -1,5 +1,8 @@
 - Fix one bug that prevent current testcases from working.
-- Implement INI settings default timezone, for now the env var TZ can be
+- Implement INI setting default timezone, for now the env var TZ can be
   used.
 - Port over my 200 test cases to .phpt format.
 - Write an error handler for unexpected characters while parsing dates.
+- Remove old parsedate.* code from ext/standard 
+- Move all date/time related functions from ext/standard to ext/date
+- Move all date/time related tests from ext/standard/tests to ext/data/tests

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/date TODO php_date.c php_date.h /ext/date/tests default-timezone-1.phpt default-timezone-2.phpt

2005-06-18 Thread Derick Rethans
derick  Sat Jun 18 16:23:19 2005 EDT

  Added files: 
/php-src/ext/date/tests default-timezone-1.phpt 
default-timezone-2.phpt 

  Modified files:  
/php-src/ext/date   TODO php_date.c php_date.h 
  Log:
  - Allow default timezone to be set with the .ini setting date.timezone.
  
  
http://cvs.php.net/diff.php/php-src/ext/date/TODO?r1=1.4r2=1.5ty=u
Index: php-src/ext/date/TODO
diff -u php-src/ext/date/TODO:1.4 php-src/ext/date/TODO:1.5
--- php-src/ext/date/TODO:1.4   Sat Jun 18 15:40:31 2005
+++ php-src/ext/date/TODO   Sat Jun 18 16:23:18 2005
@@ -1,5 +1,3 @@
-- Implement INI setting default timezone, for now the env var TZ can be
-  used.
 - Port over my 200 test cases to .phpt format.
 - Write an error handler for unexpected characters while parsing dates.
 - Remove old parsedate.* code from ext/standard 
http://cvs.php.net/diff.php/php-src/ext/date/php_date.c?r1=1.10r2=1.11ty=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.10 php-src/ext/date/php_date.c:1.11
--- php-src/ext/date/php_date.c:1.10Fri Jun 17 10:53:56 2005
+++ php-src/ext/date/php_date.c Sat Jun 18 16:23:18 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.10 2005/06/17 14:53:56 derick Exp $ */
+/* $Id: php_date.c,v 1.11 2005/06/18 20:23:18 derick Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -33,8 +33,10 @@
{NULL, NULL, NULL}
 };
 
+ZEND_DECLARE_MODULE_GLOBALS(date)
+
 PHP_INI_BEGIN()
-/* STD_PHP_INI_ENTRY(date.timezone, TIMEZONE_DB_LOCATION, PHP_INI_ALL, 
OnUpdateString, timezonedb_location, zend_date_globals, date_globals) */
+   STD_PHP_INI_ENTRY(date.timezone, GMT, PHP_INI_ALL, OnUpdateString, 
default_timezone, zend_date_globals, date_globals)
 PHP_INI_END()
 
 
@@ -51,10 +53,17 @@
STANDARD_MODULE_PROPERTIES
 };
 
+/* {{{ php_date_init_globals */
+static void php_date_init_globals(zend_date_globals *date_globals)
+{
+   date_globals-default_timezone = NULL;
+}
+/* }}} */
 
 
 PHP_MINIT_FUNCTION(date)
 {
+   ZEND_INIT_MODULE_GLOBALS(date, php_date_init_globals, NULL);
REGISTER_INI_ENTRIES();
 
return SUCCESS;
@@ -84,6 +93,9 @@
if (env) {
return env;
}
+   if (DATEG(default_timezone)) {
+   return DATEG(default_timezone);
+   }
/* Check config setting */
/*
 */
http://cvs.php.net/diff.php/php-src/ext/date/php_date.h?r1=1.3r2=1.4ty=u
Index: php-src/ext/date/php_date.h
diff -u php-src/ext/date/php_date.h:1.3 php-src/ext/date/php_date.h:1.4
--- php-src/ext/date/php_date.h:1.3 Fri Jun 17 10:53:56 2005
+++ php-src/ext/date/php_date.h Sat Jun 18 16:23:18 2005
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_date.h,v 1.3 2005/06/17 14:53:56 derick Exp $ */
+/* $Id: php_date.h,v 1.4 2005/06/18 20:23:18 derick Exp $ */
 
 #ifndef PHP_DATE_H
 #define PHP_DATE_H
@@ -30,5 +30,14 @@
 PHP_MSHUTDOWN_FUNCTION(date);
 PHP_MINFO_FUNCTION(date);
 
+ZEND_BEGIN_MODULE_GLOBALS(date)
+   char *default_timezone;
+ZEND_END_MODULE_GLOBALS(date)
+
+#ifdef ZTS
+#define DATEG(v) TSRMG(date_globals_id, zend_date_globals *, v)
+#else
+#define DATEG(v) (date_globals.v)
+#endif
 
 #endif /* PHP_DATE_H */

http://cvs.php.net/co.php/php-src/ext/date/tests/default-timezone-1.phpt?r=1.1p=1
Index: php-src/ext/date/tests/default-timezone-1.phpt
+++ php-src/ext/date/tests/default-timezone-1.phpt
--TEST--
date.timezone setting [1]
--INI--
date.timezone=GMT
--FILE--
?php
echo strtotime(2005-06-18 22:15:44);
?
--EXPECT--
1119132944

http://cvs.php.net/co.php/php-src/ext/date/tests/default-timezone-2.phpt?r=1.1p=1
Index: php-src/ext/date/tests/default-timezone-2.phpt
+++ php-src/ext/date/tests/default-timezone-2.phpt
--TEST--
date.timezone setting [2]
--INI--
date.timezone=Europe/Oslo
--FILE--
?php
echo strtotime(2005-06-18 22:15:44);
?
--EXPECT--
1119125744

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/date TODO /ext/date/lib parse_date.c /ext/date/lib/resource parse_date.re

2005-06-15 Thread Derick Rethans
derick  Wed Jun 15 03:58:22 2005 EDT

  Modified files:  
/php-src/ext/date   TODO 
/php-src/ext/date/lib   parse_date.c 
/php-src/ext/date/lib/resource  parse_date.re 
  Log:
  - Hide the Unexpected character... message for now.
  
  
http://cvs.php.net/diff.php/php-src/ext/date/TODO?r1=1.1r2=1.2ty=u
Index: php-src/ext/date/TODO
diff -u php-src/ext/date/TODO:1.1 php-src/ext/date/TODO:1.2
--- php-src/ext/date/TODO:1.1   Tue Jun 14 17:32:27 2005
+++ php-src/ext/date/TODO   Wed Jun 15 03:58:21 2005
@@ -2,3 +2,4 @@
 - Implement INI settings default timezone, for now the env var TZ can be
   used.
 - Port over my 200 test cases to .phpt format.
+- Write an error handler for unexpected characters while parsing dates.
http://cvs.php.net/diff.php/php-src/ext/date/lib/parse_date.c?r1=1.4r2=1.5ty=u
Index: php-src/ext/date/lib/parse_date.c
diff -u php-src/ext/date/lib/parse_date.c:1.4 
php-src/ext/date/lib/parse_date.c:1.5
--- php-src/ext/date/lib/parse_date.c:1.4   Wed Jun 15 03:43:05 2005
+++ php-src/ext/date/lib/parse_date.c   Wed Jun 15 03:58:21 2005
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.8.dev on Wed Jun 15 09:42:20 2005 */
+/* Generated by re2c 0.9.8.dev on Wed Jun 15 09:57:28 2005 */
 #line 1 parse_date.re
 /*
+--+
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: parse_date.c,v 1.4 2005/06/15 07:43:05 derick Exp $ */
+/* $Id: parse_date.c,v 1.5 2005/06/15 07:58:21 derick Exp $ */
 
 #include stdlib.h
 #include stdio.h
@@ -936,7 +936,7 @@
 
 #line 1322 parse_date.re
 {
-   printf(unexpected character: #%d, %c\n, *s-tok, *s-tok);
+/* printf(unexpected character: #%d, %c\n, *s-tok, *s-tok); */
goto std;
}
 #line 928 stdout
http://cvs.php.net/diff.php/php-src/ext/date/lib/resource/parse_date.re?r1=1.3r2=1.4ty=u
Index: php-src/ext/date/lib/resource/parse_date.re
diff -u php-src/ext/date/lib/resource/parse_date.re:1.3 
php-src/ext/date/lib/resource/parse_date.re:1.4
--- php-src/ext/date/lib/resource/parse_date.re:1.3 Wed Jun 15 03:23:27 2005
+++ php-src/ext/date/lib/resource/parse_date.re Wed Jun 15 03:58:21 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: parse_date.re,v 1.3 2005/06/15 07:23:27 derick Exp $ */
+/* $Id: parse_date.re,v 1.4 2005/06/15 07:58:21 derick Exp $ */
 
 #include stdlib.h
 #include stdio.h
@@ -1320,7 +1320,7 @@
 
any
{
-   printf(unexpected character: #%d, %c\n, *s-tok, *s-tok);
+/* printf(unexpected character: #%d, %c\n, *s-tok, *s-tok); */
goto std;
}
 */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php