summaryrefslogtreecommitdiff
path: root/program/include/rcube_sqlite.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-08-07 21:02:12 +0000
committerthomascube <thomas@roundcube.net>2007-08-07 21:02:12 +0000
commit6d969b4d9020560d3491d19a5b0487e325e9bce4 (patch)
tree030bc9d63bf4dc40b8bbf1cefd00e5ad6b460439 /program/include/rcube_sqlite.inc
parent93be5b7606ed7a85323732b074ce380ac06875b7 (diff)
Documentation, code style and cleanup
Diffstat (limited to 'program/include/rcube_sqlite.inc')
-rw-r--r--program/include/rcube_sqlite.inc52
1 files changed, 29 insertions, 23 deletions
diff --git a/program/include/rcube_sqlite.inc b/program/include/rcube_sqlite.inc
index 78c671d38..2b0d044c1 100644
--- a/program/include/rcube_sqlite.inc
+++ b/program/include/rcube_sqlite.inc
@@ -20,52 +20,58 @@
*/
+/**
+ * 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;
+ $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;
+ $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;
+ 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);
+ //console($str);
}
-
+
?> \ No newline at end of file