Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
9e35702c
Commit
9e35702c
authored
Nov 02, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sqlite driver: added support for md5, mod and concat
parent
76f4bfb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
Sqlite.php
lib/Doctrine/Connection/Sqlite.php
+9
-0
Sqlite.php
lib/Doctrine/Expression/Sqlite.php
+26
-0
No files found.
lib/Doctrine/Connection/Sqlite.php
View file @
9e35702c
...
...
@@ -72,6 +72,15 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common {
parent
::
__construct
(
$manager
,
$pdo
);
}
/**
* initializes database functions missing in sqlite
*/
public
function
initFunctions
()
{
$this
->
dbh
->
sqliteCreateFunction
(
'md5'
,
array
(
'Doctrine_Expression_Sqlite'
,
'md5Impl'
),
1
);
$this
->
dbh
->
sqliteCreateFunction
(
'mod'
,
array
(
'Doctrine_Expression_Sqlite'
,
'modImpl'
),
2
);
$this
->
dbh
->
sqliteCreateFunction
(
'concat'
,
array
(
'Doctrine_Expression_Sqlite'
,
'concatImpl'
));
$this
->
dbh
->
sqliteCreateFunction
(
'now'
,
'time'
,
0
);
}
/**
* Set the transacton isolation level.
*
...
...
lib/Doctrine/Expression/Sqlite.php
View file @
9e35702c
...
...
@@ -27,6 +27,32 @@ Doctrine::autoload('Doctrine_Expression');
* @license LGPL
*/
class
Doctrine_Expression_Sqlite
extends
Doctrine_Expression
{
/**
* Returns the md5 sum of the data that SQLite's md5() function receives.
*
* @return string
*/
public
static
function
md5Impl
(
$data
)
{
return
md5
(
$data
);
}
/**
* Returns the modules of the data that SQLite's mod() function receives.
*
* @return string
*/
public
static
function
modImpl
(
$dividend
,
$divisor
)
{
return
$dividend
%
$divisor
;
}
/**
* Returns a concattenation of the data that SQLite's concat() function receives.
*
* @return string
*/
public
static
function
concatImpl
()
{
$args
=
func_get_args
();
return
join
(
''
,
$args
);
}
/**
* returns the regular expression operator
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment