4 +-----------------------------------------------------------------------+
5 | program/include/rcube_sqlite.inc |
7 | This file is part of the RoundCube Webmail client |
8 | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland |
9 | Licensed under the GNU GPL |
12 | Provide callback functions for sqlite that will emulate |
13 | sone MySQL functions |
15 +-----------------------------------------------------------------------+
16 | Author: Thomas Bruederli <roundcube@gmail.com> |
17 +-----------------------------------------------------------------------+
19 $Id: rcube_sqlite.inc 850 2007-10-03 00:13:32Z ihug $
24 * Callback functions for sqlite database interface
30 function rcube_sqlite_from_unixtime($timestamp)
32 $timestamp = trim($timestamp);
33 if (!preg_match("/^[0-9]+$/is", $timestamp))
34 $ret = strtotime($timestamp);
38 $ret = date("Y-m-d H:i:s", $ret);
39 rcube_sqlite_debug("FROM_UNIXTIME ($timestamp) = $ret");
44 function rcube_sqlite_unix_timestamp($timestamp="")
46 $timestamp = trim($timestamp);
49 else if (!preg_match("/^[0-9]+$/is", $timestamp))
50 $ret = strtotime($timestamp);
54 rcube_sqlite_debug("UNIX_TIMESTAMP ($timestamp) = $ret");
59 function rcube_sqlite_now()
61 rcube_sqlite_debug("NOW() = ".date("Y-m-d H:i:s"));
62 return date("Y-m-d H:i:s");
66 function rcube_sqlite_md5($str)
72 function rcube_sqlite_debug($str)