MailSo optimizations: Logging, Fetch Callback

Contacts: remove transaction support
This commit is contained in:
RainLoop Team 2014-05-26 19:50:23 +04:00
parent 2f074433a2
commit d07e3b0247
11 changed files with 245 additions and 317 deletions

View file

@ -1681,6 +1681,7 @@ class ImapClient extends \MailSo\Net\NetClient
{
$oImapResponse = null;
$sEndTag = (null === $sEndTag) ? $this->getCurrentTag() : $sEndTag;
while (true)
{
$oImapResponse = Response::NewInstance();
@ -2258,8 +2259,16 @@ class ImapClient extends \MailSo\Net\NetClient
$this->writeLog('Callback for '.$sParent.' / '.$sLiteralAtomUpperCase.
' - try to read '.$iLiteralLen.' bytes.', \MailSo\Log\Enumerations\Type::NOTE);
\call_user_func($this->aFetchCallbacks[$sFetchKey],
$sParent, $sLiteralAtomUpperCase, $rImapLiteralStream);
try
{
\call_user_func($this->aFetchCallbacks[$sFetchKey],
$sParent, $sLiteralAtomUpperCase, $rImapLiteralStream);
}
catch (\Exception $oException)
{
$this->writeLog('Callback Exception', \MailSo\Log\Enumerations\Type::NOTICE);
$this->writeLogException($oException);
}
$iNotReadLiteralLen = 0;
while (!\feof($rImapLiteralStream))

View file

@ -204,7 +204,17 @@ abstract class Driver
\MailSo\Log\Enumerations\Type::ERROR
)))
{
$this->aCache[] = $this->loggerLineImplementation($this->getTimeWithMicroSec(), '--- FlushCache: WriteOnErrorOnly', \MailSo\Log\Enumerations\Type::INFO, 'LOGS');
$sFlush = '--- FlushLogCache: WriteOnErrorOnly';
if (isset($this->aCache[0]) && empty($this->aCache[0]))
{
$this->aCache[0] = $sFlush;
array_unshift($this->aCache, '');
}
else
{
array_unshift($this->aCache, $sFlush);
}
$this->aCache[] = $this->loggerLineImplementation($this->getTimeWithMicroSec(), $sDesc, $iType, $sName);
$this->bFlushCache = true;
@ -213,8 +223,16 @@ abstract class Driver
}
else if (0 < $this->iWriteOnTimeoutOnly && \time() - APP_START_TIME > $this->iWriteOnTimeoutOnly)
{
$this->aCache[] = $this->loggerLineImplementation($this->getTimeWithMicroSec(), '--- FlushCache: WriteOnTimeoutOnly['.
(\time() - APP_START_TIME).'/'.$this->iWriteOnTimeoutOnly.']', \MailSo\Log\Enumerations\Type::NOTE, 'LOGS');
$sFlush = '--- FlushLogCache: WriteOnTimeoutOnly ['.(\time() - APP_START_TIME).'sec]';
if (isset($this->aCache[0]) && empty($this->aCache[0]))
{
$this->aCache[0] = $sFlush;
array_unshift($this->aCache, '');
}
else
{
array_unshift($this->aCache, $sFlush);
}
$this->aCache[] = $this->loggerLineImplementation($this->getTimeWithMicroSec(), $sDesc, $iType, $sName);