Commit af14c812 authored by jackbravo's avatar jackbravo

Memory problem solved. Sqlite creating functions repeatedly.

Doctrine_Connection_Sqlite::connect was creating functions every time it was called even if it was allready connected.
parent 87afb489
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment