Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 80bdd04

Browse files
author
mattpass
committed
Create error.log if doesn't exist, we need from init
1 parent 7075ced commit 80bdd04

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

classes/System.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ private function createDirIfNotExists($path)
2121
}
2222
}
2323

24+
/**
25+
* @param $path
26+
*/
27+
private function createFileIfNotExists($path)
28+
{
29+
if (false === file_exists($path)) {
30+
touch($path);
31+
}
32+
}
33+
2434
/**
2535
* @return string
2636
*/
@@ -40,6 +50,7 @@ public function setErrorHandling()
4050
ini_set('log_errors', '1');
4151
$this->createDirIfNotExists(dirname(__FILE__) . '/../data/logs');
4252
$this->createDirIfNotExists(dirname(__FILE__) . '/../data/logs/error');
53+
$this->createFileIfNotExists(dirname(__FILE__) . '/../data/logs/error/error.log');
4354
ini_set('error_log', dirname(__FILE__) . '/../data/logs/error/error.log');
4455
error_reporting(-1);
4556
}

0 commit comments

Comments
 (0)