]> git.donarmstrong.com Git - roundcube.git/blobdiff - program/include/rcube_sqlite.inc
Merge commit 'upstream/0.6+dfsg'
[roundcube.git] / program / include / rcube_sqlite.inc
index 44e4b8169ac37c41ca81802c634b191f88768832..0af3eb85d107a4fcb63971ee77ed003c1d0b0d5e 100644 (file)
@@ -4,8 +4,8 @@
  +-----------------------------------------------------------------------+
  | program/include/rcube_sqlite.inc                                      |
  |                                                                       |
- | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005, RoundCube Dev. - Switzerland                      |
+ | This file is part of the Roundcube Webmail client                     |
+ | Copyright (C) 2005-2010, The Roundcube Dev Team                       |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
  | Author: Thomas Bruederli <roundcube@gmail.com>                        |
  +-----------------------------------------------------------------------+
 
- $Id: rcube_sqlite.inc 88 2005-12-03 16:54:12Z roundcube $
+ $Id: rcube_sqlite.inc 4410 2011-01-12 18:25:02Z thomasb $
 
 */
 
+/**
+ * Callback functions for sqlite database interface
+ *
+ * @package Database
+ */
+
 
 function rcube_sqlite_from_unixtime($timestamp)
-  {
-       $timestamp = trim($timestamp);
-       if (!preg_match("/^[0-9]+$/is", $timestamp))
-         $ret = strtotime($timestamp);
-       else
-         $ret = $timestamp;
-         
-       $ret = date("Y-m-d H:i:s", $ret);
-       rcube_sqlite_debug("FROM_UNIXTIME ($timestamp) = $ret");
-       return $ret;
-  }
-
-
-function rcube_sqlite_unix_timestamp($timestamp="")
-  {
-       $timestamp = trim($timestamp);
-       if (!$timestamp)
-         $ret = time();
-       else if (!preg_match("/^[0-9]+$/is", $timestamp))
-         $ret = strtotime($timestamp);
-       else
-         $ret = $timestamp;
-
-       rcube_sqlite_debug("UNIX_TIMESTAMP ($timestamp) = $ret");
-       return $ret;
-  }
+{
+    $timestamp = trim($timestamp);
+    if (!preg_match('/^[0-9]+$/is', $timestamp))
+        $ret = strtotime($timestamp);
+    else
+        $ret = $timestamp;
+    
+    $ret = date('Y-m-d H:i:s', $ret);
+    rcube_sqlite_debug("FROM_UNIXTIME ($timestamp) = $ret");
+    return $ret;
+}
+
+
+function rcube_sqlite_unix_timestamp($timestamp='')
+{
+    $timestamp = trim($timestamp);
+    if (!$timestamp)
+        $ret = time();
+    else if (!preg_match('/^[0-9]+$/is', $timestamp))
+        $ret = strtotime($timestamp);
+    else
+        $ret = $timestamp;
+
+    rcube_sqlite_debug("UNIX_TIMESTAMP ($timestamp) = $ret");
+    return $ret;
+}
 
 
 function rcube_sqlite_now()
-  {
-       rcube_sqlite_debug("NOW() = ".date("Y-m-d H:i:s"));
-       return date("Y-m-d H:i:s");
-  }
+{
+    rcube_sqlite_debug("NOW() = ".date("Y-m-d H:i:s"));
+    return date("Y-m-d H:i:s");
+}
 
 
 function rcube_sqlite_md5($str)
-  {
-       return md5($str);
-  }
+{
+    return md5($str);
+}
 
 
 function rcube_sqlite_debug($str)
-  {
-       //console($str);
-  }
-       
-?>
\ No newline at end of file
+{
+    //console($str);
+}
+