mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 07:57:02 +03:00
Uploading and preparing the repository to the dev version.
Original unminified source code (dev folder - js, css, less) (fixes #6) Grunt build system Multiple identities correction (fixes #9) Compose html editor (fixes #12) New general settings - Loading Description New warning about default admin password Split general and login screen settings
This commit is contained in:
parent
afad45137e
commit
4cc2207513
846 changed files with 99453 additions and 2123 deletions
87
rainloop/v/0.0.0/app/libraries/MailSo/Log/Drivers/File.php
Normal file
87
rainloop/v/0.0.0/app/libraries/MailSo/Log/Drivers/File.php
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
|
||||
namespace MailSo\Log\Drivers;
|
||||
|
||||
/**
|
||||
* @category MailSo
|
||||
* @package Log
|
||||
* @subpackage Drivers
|
||||
*/
|
||||
class File extends \MailSo\Log\Driver
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sLoggerFileName;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sCrLf;
|
||||
|
||||
/**
|
||||
* @access protected
|
||||
*
|
||||
* @param string $sLoggerFileName
|
||||
* @param string $sCrLf = "\r\n"
|
||||
*/
|
||||
protected function __construct($sLoggerFileName, $sCrLf = "\r\n")
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->sLoggerFileName = $sLoggerFileName;
|
||||
$this->sCrLf = $sCrLf;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sLoggerFileName
|
||||
*/
|
||||
public function SetLoggerFileName($sLoggerFileName)
|
||||
{
|
||||
$this->sLoggerFileName = $sLoggerFileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sLoggerFileName
|
||||
* @param string $sCrLf = "\r\n"
|
||||
*
|
||||
* @return \MailSo\Log\Drivers\File
|
||||
*/
|
||||
public static function NewInstance($sLoggerFileName, $sCrLf = "\r\n")
|
||||
{
|
||||
return new self($sLoggerFileName, $sCrLf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|array $mDesc
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function writeImplementation($mDesc)
|
||||
{
|
||||
return $this->writeToLogFile($mDesc);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function clearImplementation()
|
||||
{
|
||||
return \unlink($this->sLoggerFileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|array $mDesc
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function writeToLogFile($mDesc)
|
||||
{
|
||||
if (is_array($mDesc))
|
||||
{
|
||||
$mDesc = \implode($this->sCrLf, $mDesc);
|
||||
}
|
||||
|
||||
return \error_log($mDesc.$this->sCrLf, 3, $this->sLoggerFileName);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue