From 80bdd04e59ad0d7437fc0e3ea7397a1714b4114a Mon Sep 17 00:00:00 2001 From: mattpass Date: Sat, 26 Jun 2021 22:17:52 +0100 Subject: [PATCH] Create error.log if doesn't exist, we need from init --- classes/System.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/classes/System.php b/classes/System.php index a9d0b1b..ed298fc 100644 --- a/classes/System.php +++ b/classes/System.php @@ -21,6 +21,16 @@ class System } } + /** + * @param $path + */ + private function createFileIfNotExists($path) + { + if (false === file_exists($path)) { + touch($path); + } + } + /** * @return string */ @@ -40,6 +50,7 @@ class System ini_set('log_errors', '1'); $this->createDirIfNotExists(dirname(__FILE__) . '/../data/logs'); $this->createDirIfNotExists(dirname(__FILE__) . '/../data/logs/error'); + $this->createFileIfNotExists(dirname(__FILE__) . '/../data/logs/error/error.log'); ini_set('error_log', dirname(__FILE__) . '/../data/logs/error/error.log'); error_reporting(-1); }