mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 23:47:03 +03:00
MailSo optimizations: Logging, Fetch Callback
Contacts: remove transaction support
This commit is contained in:
parent
2f074433a2
commit
d07e3b0247
11 changed files with 245 additions and 317 deletions
|
|
@ -48,14 +48,6 @@ abstract class PdoAbstract
|
|||
return array('', '', '', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function isTransactionSupported()
|
||||
{
|
||||
return \in_array($this->sDbType, array('mysql'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \PDO
|
||||
*
|
||||
|
|
@ -364,11 +356,6 @@ abstract class PdoAbstract
|
|||
$oPdo = $this->getPDO();
|
||||
if ($oPdo)
|
||||
{
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
$oPdo->beginTransaction();
|
||||
}
|
||||
|
||||
$sQuery = 'DELETE FROM rainloop_system WHERE sys_name = ? AND value_int <= ?;';
|
||||
$this->writeLog($sQuery);
|
||||
|
||||
|
|
@ -385,18 +372,6 @@ abstract class PdoAbstract
|
|||
$bResult = !!$oStmt->execute(array($sName.'_version', $iVersion));
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
if ($bResult)
|
||||
{
|
||||
$oPdo->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$oPdo->rollBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $bResult;
|
||||
|
|
@ -466,11 +441,6 @@ rl_email text NOT NULL DEFAULT \'\'
|
|||
{
|
||||
try
|
||||
{
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
$oPdo->beginTransaction();
|
||||
}
|
||||
|
||||
foreach ($aQ as $sQuery)
|
||||
{
|
||||
if ($bResult)
|
||||
|
|
@ -487,27 +457,10 @@ rl_email text NOT NULL DEFAULT \'\'
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
if ($bResult)
|
||||
{
|
||||
$oPdo->rollBack();
|
||||
}
|
||||
else
|
||||
{
|
||||
$oPdo->commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (\Exception $oException)
|
||||
{
|
||||
$this->writeLog($oException);
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
$oPdo->rollBack();
|
||||
}
|
||||
|
||||
throw $oException;
|
||||
}
|
||||
}
|
||||
|
|
@ -568,11 +521,6 @@ rl_email text NOT NULL DEFAULT \'\'
|
|||
{
|
||||
try
|
||||
{
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
$oPdo->beginTransaction();
|
||||
}
|
||||
|
||||
foreach ($aQuery as $sQuery)
|
||||
{
|
||||
$this->writeLog($sQuery);
|
||||
|
|
@ -585,27 +533,10 @@ rl_email text NOT NULL DEFAULT \'\'
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
if ($bResult)
|
||||
{
|
||||
$oPdo->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$oPdo->rollBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (\Exception $oException)
|
||||
{
|
||||
$this->writeLog($oException);
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
$oPdo->rollBack();
|
||||
}
|
||||
|
||||
throw $oException;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -442,11 +442,6 @@ class PdoAddressBook
|
|||
|
||||
try
|
||||
{
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
$this->beginTransaction();
|
||||
}
|
||||
|
||||
$aFreq = array();
|
||||
if ($bUpdate)
|
||||
{
|
||||
|
|
@ -582,19 +577,9 @@ class PdoAddressBook
|
|||
}
|
||||
catch (\Exception $oException)
|
||||
{
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
$this->rollBack();
|
||||
}
|
||||
|
||||
throw $oException;
|
||||
}
|
||||
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
$this->commit();
|
||||
}
|
||||
|
||||
return 0 < $iIdContact;
|
||||
}
|
||||
|
||||
|
|
@ -619,11 +604,6 @@ class PdoAddressBook
|
|||
$mResult = false;
|
||||
try
|
||||
{
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
$this->beginTransaction();
|
||||
}
|
||||
|
||||
$sSql = 'INSERT INTO rainloop_ab_tags '.
|
||||
'(id_user, tag_name) VALUES (:id_user, :tag_name)';
|
||||
|
||||
|
|
@ -642,19 +622,9 @@ class PdoAddressBook
|
|||
}
|
||||
catch (\Exception $oException)
|
||||
{
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
$this->rollBack();
|
||||
}
|
||||
|
||||
throw $oException;
|
||||
}
|
||||
|
||||
if ($this->isTransactionSupported())
|
||||
{
|
||||
$this->commit();
|
||||
}
|
||||
|
||||
return $mResult;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue