check if log can be written before trying it
This commit is contained in:
parent
f0a4fedfe1
commit
34390f9f12
@ -82,11 +82,11 @@ function logMessage($message, $eol = true) {
|
|||||||
$message .= PHP_EOL;
|
$message .= PHP_EOL;
|
||||||
}
|
}
|
||||||
if (defined('LOG_CURRENT_FILE')) {
|
if (defined('LOG_CURRENT_FILE')) {
|
||||||
if (!file_put_contents(LOG_CURRENT_FILE, $message, FILE_APPEND)) {
|
if (!is_writable(dirname(LOG_CURRENT_FILE)) || !file_put_contents(LOG_CURRENT_FILE, $message, FILE_APPEND)) {
|
||||||
echo 'Logfile not write-able, please check the File Permissions!';
|
echo 'Current-Logfile not write-able, please check the File Permissions!';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!file_put_contents(LOG_FILE, $message, FILE_APPEND)) {
|
if (!is_writable(dirname(LOG_FILE)) || !file_put_contents(LOG_FILE, $message, FILE_APPEND)) {
|
||||||
echo 'Logfile not write-able, please check the File Permissions!';
|
echo 'Logfile not write-able, please check the File Permissions!';
|
||||||
}
|
}
|
||||||
echo $message;
|
echo $message;
|
||||||
|
Loading…
Reference in New Issue
Block a user