several SQLite compatability improvements, as suggested by naikoto on the forums

git-svn-id: file:///home/shish/svn/shimmie2/trunk@680 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish
2008-01-02 21:49:12 +00:00
parent bcca76969e
commit 19d80a244f
5 changed files with 90 additions and 119 deletions

View File

@ -152,6 +152,15 @@ class ADODB_sqlite extends ADOConnection {
{
@sqlite_create_function($this->_connectionID, 'adodb_date', 'adodb_date', 1);
@sqlite_create_function($this->_connectionID, 'adodb_date2', 'adodb_date2', 2);
// XXX: shimmie customisation, as suggested by naikoto on the forums
@sqlite_create_function($this->_connectionID, 'UNIX_TIMESTAMP', 'UNIX_TIMESTAMP', 1);
@sqlite_create_function($this->_connectionID, 'now', 'now', 0);
@sqlite_create_function($this->_connectionID, 'floor', 'mfloor', 1);
@sqlite_create_function($this->_connectionID, 'log', 'mlog', 1);
@sqlite_create_function($this->_connectionID, 'isnull', 'fisnull', 1);
@sqlite_create_function($this->_connectionID, 'md5', 'fmd5', 1);
@sqlite_create_function($this->_connectionID, 'concat', 'fconcat', 2);
}
@ -395,4 +404,14 @@ class ADORecordset_sqlite extends ADORecordSet {
}
}
?>
// shimmie functions
ini_set ( 'sqlite.assoc_case' , 0 );
function UNIX_TIMESTAMP($date) { return strtotime($date); }
function now() { return date("Y-m-d h:i:s"); }
function mfloor($a) { return floor($a); }
function mlog($a) { return log($a); }
function fisnull($a) { return is_null($a); }
function fmd5($a) { return md5($a); }
function fconcat($a, $b) { return $a . $b; }
?>