SOURCES: php-creole-nullts.patch (NEW) - let strtotime('0000-00-00...

glen glen at pld-linux.org
Mon Mar 17 15:52:26 CET 2008


Author: glen                         Date: Mon Mar 17 14:52:26 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- let strtotime('0000-00-00 00:00:00') behave like in php 5.2.1:
$ php -r "echo php_uname('m'), ' - ', PHP_VERSION, ': ', var_dump(strtotime('0000-00-00 00:00:00'));"
i686 - 5.2.1: int(943912800)
$ php -r "echo php_uname('m'), ' - ', PHP_VERSION, ': ', var_dump(strtotime('0000-00-00 00:00:00'));"
x86_64 - 5.2.1: int(943912800)
$ php -r "echo php_uname('m'), ' - ', PHP_VERSION, ': ', var_dump(strtotime('0000-00-00 00:00:00'));"
i686 - 5.2.5: bool(false)
$ php -r "echo php_uname('m'), ' - ', PHP_VERSION, ': ', var_dump(strtotime('0000-00-00 00:00:00'));"
x86_64 - 5.2.6-dev: int(-62169989992)

---- Files affected:
SOURCES:
   php-creole-nullts.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/php-creole-nullts.patch
diff -u /dev/null SOURCES/php-creole-nullts.patch:1.1
--- /dev/null	Mon Mar 17 15:52:26 2008
+++ SOURCES/php-creole-nullts.patch	Mon Mar 17 15:52:21 2008
@@ -0,0 +1,11 @@
+--- creole-1.1.0/classes/creole/drivers/mysql/MySQLResultSet.php	2006-02-05 22:25:29.000000000 +0200
++++ creole-1.1.0/classes/creole/drivers/mysql/MySQLResultSet.php	2008-03-17 16:03:05.254283407 +0200
+@@ -122,6 +122,8 @@
+         if (!array_key_exists($column, $this->fields)) { throw new SQLException("Invalid resultset column: " . (is_int($column) ? $column + 1 : $column)); }
+         if ($this->fields[$column] === null) { return null; }
+         
++        if ($this->fields[$column] == '0000-00-00 00:00:00')
++        	return 943912800;
+         $ts = strtotime($this->fields[$column]);
+         if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
+             // otherwise it's an ugly MySQL timestamp!
================================================================


More information about the pld-cvs-commit mailing list