mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 16:07:03 +03:00
cleanup MailSo a bit
This commit is contained in:
parent
31d6666729
commit
a197378b7c
4 changed files with 7 additions and 18 deletions
|
|
@ -25,13 +25,7 @@ class CacheClient
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $sCacheIndex;
|
private $sCacheIndex = '';
|
||||||
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
$this->oDriver = null;
|
|
||||||
$this->sCacheIndex = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function Set(string $sKey, string $sValue) : bool
|
public function Set(string $sKey, string $sValue) : bool
|
||||||
{
|
{
|
||||||
|
|
@ -111,7 +105,7 @@ class CacheClient
|
||||||
|
|
||||||
public function IsInited() : bool
|
public function IsInited() : bool
|
||||||
{
|
{
|
||||||
return $this->oDriver instanceof DriverInterface;
|
return !!$this->oDriver;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function SetCacheIndex(string $sCacheIndex) : self
|
public function SetCacheIndex(string $sCacheIndex) : self
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class NamespaceResult
|
||||||
|
|
||||||
public function InitByImapResponse(\MailSo\Imap\Response $oImapResponse) : self
|
public function InitByImapResponse(\MailSo\Imap\Response $oImapResponse) : self
|
||||||
{
|
{
|
||||||
if ($oImapResponse && $oImapResponse instanceof \MailSo\Imap\Response)
|
if ($oImapResponse)
|
||||||
{
|
{
|
||||||
if (isset($oImapResponse->ResponseList[2][0]) &&
|
if (isset($oImapResponse->ResponseList[2][0]) &&
|
||||||
\is_array($oImapResponse->ResponseList[2][0]) &&
|
\is_array($oImapResponse->ResponseList[2][0]) &&
|
||||||
|
|
|
||||||
|
|
@ -190,16 +190,16 @@ class Logger extends \SplFixedArray
|
||||||
|
|
||||||
public function WriteException(\Throwable $oException, int $iType = \LOG_NOTICE, string $sName = '') : void
|
public function WriteException(\Throwable $oException, int $iType = \LOG_NOTICE, string $sName = '') : void
|
||||||
{
|
{
|
||||||
if (!isset($oException->__LOGINNED__)) {
|
if (empty($oException->__WRITTEN__)) {
|
||||||
$oException->__LOGINNED__ = true;
|
$oException->__WRITTEN__ = true;
|
||||||
$this->Write((string) $oException, $iType, $sName);
|
$this->Write((string) $oException, $iType, $sName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function WriteExceptionShort(\Throwable $oException, int $iType = \LOG_NOTICE, string $sName = '') : void
|
public function WriteExceptionShort(\Throwable $oException, int $iType = \LOG_NOTICE, string $sName = '') : void
|
||||||
{
|
{
|
||||||
if (!isset($oException->__LOGINNED__)) {
|
if (empty($oException->__WRITTEN__)) {
|
||||||
$oException->__LOGINNED__ = true;
|
$oException->__WRITTEN__ = true;
|
||||||
$this->Write($oException->getMessage(), $iType, $sName);
|
$this->Write($oException->getMessage(), $iType, $sName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1299,11 +1299,6 @@ class MailClient
|
||||||
*/
|
*/
|
||||||
public function SetLogger(\MailSo\Log\Logger $oLogger) : self
|
public function SetLogger(\MailSo\Log\Logger $oLogger) : self
|
||||||
{
|
{
|
||||||
if (!($oLogger instanceof \MailSo\Log\Logger))
|
|
||||||
{
|
|
||||||
throw new \InvalidArgumentException;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->oLogger = $oLogger;
|
$this->oLogger = $oLogger;
|
||||||
$this->oImapClient->SetLogger($this->oLogger);
|
$this->oImapClient->SetLogger($this->oLogger);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue