HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/public/snappymail/snappymail/v/2.38.2/app/libraries/MailSo/Log/Drivers/File.php
<?php

/*
 * This file is part of MailSo.
 *
 * (c) 2014 Usenko Timur
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace MailSo\Log\Drivers;

/**
 * @category MailSo
 * @package Log
 * @subpackage Drivers
 */
class File extends \MailSo\Log\Driver
{
	private string $sLoggerFileName;

	function __construct(string $sLoggerFileName)
	{
		parent::__construct();

		$sLogFileDir = \dirname($sLoggerFileName);
		if (!\is_dir($sLogFileDir)) {
			\mkdir($sLogFileDir, 0755, true);
		}
		$this->sLoggerFileName = $sLoggerFileName;
	}

	protected function writeImplementation($mDesc) : bool
	{
		if (\is_array($mDesc)) {
			$mDesc = \implode("\n\t", $mDesc);
		}
		return \error_log($mDesc . "\n", 3, $this->sLoggerFileName);
	}

	protected function clearImplementation() : bool
	{
		return \unlink($this->sLoggerFileName);
	}
}