Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3314238
rcube_sqlite.inc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
rcube_sqlite.inc
View Options
<
?
php
/*
+-----------------------------------------------------------------------+
| program/include/rcube_sqlite.inc |
| |
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2010, The Roundcube Dev Team |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Provide callback functions for sqlite that will emulate |
| sone MySQL functions |
| |
+-----------------------------------------------------------------------+
| Author: Thomas Bruederli <roundcube@gmail.com> |
+-----------------------------------------------------------------------+
$Id$
*/
/**
* 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
;
}
function
rcube_sqlite_now
()
{
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
);
}
function
rcube_sqlite_debug
(
$
str
)
{
//console($str);
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Apr 9, 2:55 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
473509
Default Alt Text
rcube_sqlite.inc (2 KB)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment