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.
This commit is contained in:
parent
87afb489b4
commit
af14c812ce
@ -74,6 +74,13 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common
|
|||||||
$this->options['server_version'] = '';
|
$this->options['server_version'] = '';
|
||||||
*/
|
*/
|
||||||
parent::__construct($manager, $adapter);
|
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
|
* initializes database functions missing in sqlite
|
||||||
@ -83,6 +90,10 @@ class Doctrine_Connection_Sqlite extends Doctrine_Connection_Common
|
|||||||
*/
|
*/
|
||||||
public function connect()
|
public function connect()
|
||||||
{
|
{
|
||||||
|
if ($this->isConnected) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
parent::connect();
|
parent::connect();
|
||||||
|
|
||||||
$this->dbh->sqliteCreateFunction('mod', array('Doctrine_Expression_Sqlite', 'modImpl'), 2);
|
$this->dbh->sqliteCreateFunction('mod', array('Doctrine_Expression_Sqlite', 'modImpl'), 2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user