mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
* log errors instead showing them to users with system directories
* now it will print a notice, and aditionally log full path into system/logs/error.log * also, when it fails to load config.lua it will output error also to error.log * fix when $_SERVER['HTTP_ACCEPT_ENCODING'] is not set.
This commit is contained in:
@@ -1202,7 +1202,7 @@ function convert_bytes($size)
|
||||
function log_append($file, $str)
|
||||
{
|
||||
$f = fopen(LOGS . $file, 'a');
|
||||
fwrite($f, $str . PHP_EOL);
|
||||
fwrite($f, '[' . date(DateTime::RFC1123) . '] ' . $str . PHP_EOL);
|
||||
fclose($f);
|
||||
}
|
||||
|
||||
@@ -1215,8 +1215,11 @@ function load_config_lua($filename)
|
||||
die('ERROR: Cannot find ' . $filename . ' file.');
|
||||
|
||||
$tempFile = @tempnam('/tmp', 'lua');
|
||||
$file = fopen($tempFile, 'w');
|
||||
if(!$file) die('Cannot load server config!');
|
||||
$file = @fopen($tempFile, 'w');
|
||||
if(!$file) {
|
||||
log_append('error.log', '[functions.php] Cannot load config.lua file. Error: ' . print_r(error_get_last(), true));
|
||||
die('Cannot load server config! More info in system/logs/error.log file.');
|
||||
}
|
||||
|
||||
// TODO: new parser that will also load dofile() includes
|
||||
|
||||
|
Reference in New Issue
Block a user