]> git.donarmstrong.com Git - roundcube.git/commitdiff
Added custom patch for using php timestamp capabilities since sqlite 2 does not have...
authorRomain Beauxis <toots@rastageeks.org>
Sun, 20 May 2007 15:34:16 +0000 (15:34 +0000)
committerJérémy Bobbio <lunar@debian.org>
Sat, 18 Jun 2011 16:27:23 +0000 (18:27 +0200)
debian/changelog
debian/patches/series
debian/patches/use_php_timestamp_implementation_for_sqlite.patch [new file with mode: 0644]

index cad3a46a1e566428e2af9b1582c91f122d771374..9b7f92ddafc42978001949eb8bf3a9a5c7b7b47f 100644 (file)
@@ -1,8 +1,13 @@
 roundcube (0.1~rc1~dfsg-1) unstable; urgency=low
 
+  [ Vincent Bernat ]
   * New upstream release
+  [ Romain Beauxis ]
   * Fixed dh_link calls
     Closes: #423824
+  * Added custom patch to use php unix timestamp support
+    with sqlite since UNIX_TIMESTAMP is not supported by sqlite
+    before 3.
 
  -- Vincent Bernat <bernat@luffy.cx>  Sun, 20 May 2007 13:59:44 +0200
 
index d9c2b5e56c3fba7d3deddf888f0649d7c59210c2..442222483c4f9783fce67573339f15203ed320dc 100644 (file)
@@ -1,3 +1,4 @@
 dbconfig-common_support.patch
 correct_install_path.patch
 use_mcrypt.patch
+use_php_timestamp_implementation_for_sqlite.patch
diff --git a/debian/patches/use_php_timestamp_implementation_for_sqlite.patch b/debian/patches/use_php_timestamp_implementation_for_sqlite.patch
new file mode 100644 (file)
index 0000000..c5f631b
--- /dev/null
@@ -0,0 +1,40 @@
+diff -urN roundcubemail-0.1~rc1~dfsg.orig/program/include/rcube_db.inc roundcubemail-0.1~rc1~dfsg/program/include/rcube_db.inc
+--- roundcubemail-0.1~rc1~dfsg.orig/program/include/rcube_db.inc       2007-04-28 20:07:12.000000000 +0200
++++ roundcubemail-0.1~rc1~dfsg/program/include/rcube_db.inc    2007-05-20 17:28:05.000000000 +0200
+@@ -27,6 +27,13 @@
+  */
+ require_once('DB.php');
++/* User function for getting timestamps under sqlite */
++function custom_date_to_timestamp($data) {
++   $date = strptime($data,'%Y-%m-%d %H:%M:%S');
++   return mktime($date['tm_hour'],$date['tm_min'],$date['tm_sec'],$date['tm_mon']+1,$date['tm_mday'],1900 + $date['tm_year']);
++}
++
++
+ /**
+  * Database independent query interface
+@@ -152,6 +159,9 @@
+       $dsn = $this->db_dsnw;
+     $this->db_handle = $this->dsn_connect($dsn);
++    if ($this->db_provider == "sqlite") {
++        sqlite_create_function($this->db_handle->connection,'custom_date_to_timestamp','custom_date_to_timestamp',1);    
++    }
+     $this->db_connected = $this->db_handle ? TRUE : FALSE;
+     }
+     
+@@ -462,8 +471,11 @@
+       case 'mssql':
+         return "datediff(s, '1970-01-01 00:00:00', $field)";
++      case 'sqlite':
++        return "custom_date_to_timestamp($field)";
++
+       default:
+-        return "UNIX_TIMESTAMP($field)";
++        return "UNIX_TIMESTAMP($field)"; 
+       }
+     }