first commit

This commit is contained in:
sujan
2024-08-06 18:06:00 +05:45
commit a2fa49071a
2745 changed files with 391199 additions and 0 deletions

38
system/library/log.php Normal file
View File

@ -0,0 +1,38 @@
<?php
/**
* @package OpenCart
* @author Daniel Kerr
* @copyright Copyright (c) 2005 - 2022, OpenCart, Ltd. (https://www.opencart.com/)
* @license https://opensource.org/licenses/GPL-3.0
* @link https://www.opencart.com
*/
namespace Opencart\System\Library;
/**
* Class Log
*/
class Log {
/**
* @var string
*/
private string $file;
/**
* Constructor
*
* @param string $filename
*/
public function __construct(string $filename) {
$this->file = DIR_LOGS . $filename;
}
/**
* Write
*
* @param string $message
*
* @return void
*/
public function write(string|array $message): void {
file_put_contents($this->file, date('Y-m-d H:i:s') . ' - ' . print_r($message, true) . "\n", FILE_APPEND);
}
}