4 +-----------------------------------------------------------------------+
5 | program/include/rcube_sqlite.inc |
7 | This file is part of the RoundCube Webmail client |
8 | Copyright (C) 2005, 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 88 2005-12-03 16:54:12Z roundcube $
24 function rcube_sqlite_from_unixtime($timestamp)
26 $timestamp = trim($timestamp);
27 if (!preg_match("/^[0-9]+$/is", $timestamp))
28 $ret = strtotime($timestamp);
32 $ret = date("Y-m-d H:i:s", $ret);
33 rcube_sqlite_debug("FROM_UNIXTIME ($timestamp) = $ret");
38 function rcube_sqlite_unix_timestamp($timestamp="")
40 $timestamp = trim($timestamp);
43 else if (!preg_match("/^[0-9]+$/is", $timestamp))
44 $ret = strtotime($timestamp);
48 rcube_sqlite_debug("UNIX_TIMESTAMP ($timestamp) = $ret");
53 function rcube_sqlite_now()
55 rcube_sqlite_debug("NOW() = ".date("Y-m-d H:i:s"));
56 return date("Y-m-d H:i:s");
60 function rcube_sqlite_md5($str)
66 function rcube_sqlite_debug($str)