diff --git a/lib/Doctrine/Connection/Sqlite.php b/lib/Doctrine/Connection/Sqlite.php index 2e81479bb..b3e8e8342 100644 --- a/lib/Doctrine/Connection/Sqlite.php +++ b/lib/Doctrine/Connection/Sqlite.php @@ -74,6 +74,13 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common $this->options['server_version'] = ''; */ parent::__construct($manager, $adapter); + + if ($this->isConnected) { + $this->dbh->sqliteCreateFunction('mod', array('Doctrine_Expression_Sqlite', 'modImpl'), 2); + $this->dbh->sqliteCreateFunction('concat', array('Doctrine_Expression_Sqlite', 'concatImpl')); + $this->dbh->sqliteCreateFunction('md5', 'md5', 1); + $this->dbh->sqliteCreateFunction('now', 'time', 0); + } } /** * initializes database functions missing in sqlite @@ -83,6 +90,10 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common */ public function connect() { + if ($this->isConnected) { + return false; + } + parent::connect(); $this->dbh->sqliteCreateFunction('mod', array('Doctrine_Expression_Sqlite', 'modImpl'), 2);