mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
gitignore and file creation
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,6 +8,7 @@
|
|||||||
/uploads/*.tq8
|
/uploads/*.tq8
|
||||||
/uploads/*.TQ8
|
/uploads/*.TQ8
|
||||||
/install/.lock
|
/install/.lock
|
||||||
|
/install/log/debug.log
|
||||||
/updates/*.xml
|
/updates/*.xml
|
||||||
/updates/*.html
|
/updates/*.html
|
||||||
/images/eqsl_card_images/*.jpg
|
/images/eqsl_card_images/*.jpg
|
||||||
|
|||||||
@@ -57,20 +57,48 @@ function is_really_writable($path) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function verify_log() {
|
||||||
|
global $logfile;
|
||||||
|
|
||||||
|
if (!file_exists($logfile)) {
|
||||||
|
if (touch($logfile)) {
|
||||||
|
if(is_writable($logfile)) {
|
||||||
|
$log_header = "Wavelog Installer Debug Log\n-------\n\n";
|
||||||
|
file_put_contents($logfile, $log_header, FILE_APPEND);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return is_writable($logfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Function to read the debug logfile
|
// Function to read the debug logfile
|
||||||
function read_logfile() {
|
function read_logfile() {
|
||||||
global $logfile;
|
if (verify_log()) {
|
||||||
$file_content = file_get_contents($logfile);
|
global $logfile;
|
||||||
echo $file_content;
|
$file_content = file_get_contents($logfile);
|
||||||
|
echo $file_content;
|
||||||
|
} else {
|
||||||
|
echo "Log file is not available.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to log messages in the installer logfile
|
// Function to log messages in the installer logfile
|
||||||
function log_message($level, $message) {
|
function log_message($level, $message) {
|
||||||
global $logfile;
|
if (verify_log()) {
|
||||||
$level = strtoupper($level);
|
global $logfile;
|
||||||
$timestamp = date("Y-m-d H:i:s");
|
$level = strtoupper($level);
|
||||||
$logMessage = $level . " - " . $timestamp . " --> " . $message . PHP_EOL;
|
$timestamp = date("Y-m-d H:i:s");
|
||||||
file_put_contents($logfile, $logMessage, FILE_APPEND);
|
$logMessage = $level . " - " . $timestamp . " --> " . $message . PHP_EOL;
|
||||||
|
file_put_contents($logfile, $logMessage, FILE_APPEND);
|
||||||
|
} else {
|
||||||
|
echo "Log file is not available or not writable.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Custom error handler
|
// Custom error handler
|
||||||
|
|||||||
0
install/log/.keep
Normal file
0
install/log/.keep
Normal file
Reference in New Issue
Block a user