mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 08:57:03 +03:00
Filter improvements
This commit is contained in:
parent
f91f74fe7c
commit
05b1c1dfe5
14 changed files with 222 additions and 68 deletions
|
|
@ -296,11 +296,13 @@ class Logger extends \MailSo\Base\Collection
|
|||
* @param string $sDesc
|
||||
* @param int $iType = \MailSo\Log\Enumerations\Type::INFO
|
||||
* @param string $sName = ''
|
||||
* @param bool $bSearchWords = false
|
||||
* @param bool $bSearchSecretWords = true
|
||||
* @param bool $bDiplayCrLf = false
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function Write($sDesc, $iType = \MailSo\Log\Enumerations\Type::INFO, $sName = '', $bSearchWords = false)
|
||||
public function Write($sDesc, $iType = \MailSo\Log\Enumerations\Type::INFO,
|
||||
$sName = '', $bSearchSecretWords = true, $bDiplayCrLf = false)
|
||||
{
|
||||
if (isset($this->aForbiddenTypes[$iType]) && true === $this->aForbiddenTypes[$iType])
|
||||
{
|
||||
|
|
@ -313,7 +315,7 @@ class Logger extends \MailSo\Base\Collection
|
|||
$aLoggers = array();
|
||||
$iResult = 1;
|
||||
|
||||
if ($bSearchWords && !$this->bShowSecter && 0 < \count($this->aSecretWords))
|
||||
if ($bSearchSecretWords && !$this->bShowSecter && 0 < \count($this->aSecretWords))
|
||||
{
|
||||
$sDesc = \str_replace($this->aSecretWords, '*******', $sDesc);
|
||||
}
|
||||
|
|
@ -321,7 +323,7 @@ class Logger extends \MailSo\Base\Collection
|
|||
$aLoggers =& $this->GetAsArray();
|
||||
foreach ($aLoggers as /* @var $oLogger \MailSo\Log\Driver */ $oLogger)
|
||||
{
|
||||
$iResult &= $oLogger->Write($sDesc, $iType, $sName);
|
||||
$iResult &= $oLogger->Write($sDesc, $iType, $sName, $bDiplayCrLf);
|
||||
}
|
||||
|
||||
return (bool) $iResult;
|
||||
|
|
@ -332,12 +334,14 @@ class Logger extends \MailSo\Base\Collection
|
|||
* @param int $iType = \MailSo\Log\Enumerations\Type::INFO
|
||||
* @param string $sName = ''
|
||||
* @param bool $bSearchSecretWords = false
|
||||
* @param bool $bDiplayCrLf = false
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function WriteDump($oValue, $iType = \MailSo\Log\Enumerations\Type::INFO, $sName = '', $bSearchSecretWords = false)
|
||||
public function WriteDump($oValue, $iType = \MailSo\Log\Enumerations\Type::INFO, $sName = '',
|
||||
$bSearchSecretWords = false, $bDiplayCrLf = false)
|
||||
{
|
||||
return $this->Write(\print_r($oValue, true), $iType, $sName, $bSearchSecretWords);
|
||||
return $this->Write(\print_r($oValue, true), $iType, $sName, $bSearchSecretWords, $bDiplayCrLf);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -345,10 +349,12 @@ class Logger extends \MailSo\Base\Collection
|
|||
* @param int $iType = \MailSo\Log\Enumerations\Type::NOTICE
|
||||
* @param string $sName = ''
|
||||
* @param bool $bSearchSecretWords = true
|
||||
* @param bool $bDiplayCrLf = false
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function WriteException($oException, $iType = \MailSo\Log\Enumerations\Type::NOTICE, $sName = '', $bSearchSecretWords = true)
|
||||
public function WriteException($oException, $iType = \MailSo\Log\Enumerations\Type::NOTICE, $sName = '',
|
||||
$bSearchSecretWords = true, $bDiplayCrLf = false)
|
||||
{
|
||||
if ($oException instanceof \Exception)
|
||||
{
|
||||
|
|
@ -359,7 +365,7 @@ class Logger extends \MailSo\Base\Collection
|
|||
|
||||
$oException->__LOGINNED__ = true;
|
||||
|
||||
return $this->Write((string) $oException, $iType, $sName, $bSearchSecretWords);
|
||||
return $this->Write((string) $oException, $iType, $sName, $bSearchSecretWords, $bDiplayCrLf);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
@ -370,10 +376,12 @@ class Logger extends \MailSo\Base\Collection
|
|||
* @param int $iType = \MailSo\Log\Enumerations\Type::NOTICE
|
||||
* @param string $sName = ''
|
||||
* @param bool $bSearchSecretWords = true
|
||||
* @param bool $bDiplayCrLf = false
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function WriteMixed($mData, $iType = null, $sName = '', $bSearchSecretWords = true)
|
||||
public function WriteMixed($mData, $iType = null, $sName = '',
|
||||
$bSearchSecretWords = true, $bDiplayCrLf = false)
|
||||
{
|
||||
$iType = null === $iType ? \MailSo\Log\Enumerations\Type::INFO : $iType;
|
||||
if (\is_array($mData) || \is_object($mData))
|
||||
|
|
@ -381,16 +389,16 @@ class Logger extends \MailSo\Base\Collection
|
|||
if ($mData instanceof \Exception)
|
||||
{
|
||||
$iType = null === $iType ? \MailSo\Log\Enumerations\Type::NOTICE : $iType;
|
||||
return $this->WriteException($mData, $iType, $sName, $bSearchSecretWords);
|
||||
return $this->WriteException($mData, $iType, $sName, $bSearchSecretWords, $bDiplayCrLf);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->WriteDump($mData, $iType, $sName, $bSearchSecretWords);
|
||||
return $this->WriteDump($mData, $iType, $sName, $bSearchSecretWords, $bDiplayCrLf);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->Write($mData, $iType, $sName, $bSearchSecretWords);
|
||||
return $this->Write($mData, $iType, $sName, $bSearchSecretWords, $bDiplayCrLf);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue