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
|
||||
/install/.lock
|
||||
/install/log/debug.log
|
||||
/updates/*.xml
|
||||
/updates/*.html
|
||||
/images/eqsl_card_images/*.jpg
|
||||
|
||||
@@ -57,20 +57,48 @@ function is_really_writable($path) {
|
||||
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 read_logfile() {
|
||||
global $logfile;
|
||||
$file_content = file_get_contents($logfile);
|
||||
echo $file_content;
|
||||
if (verify_log()) {
|
||||
global $logfile;
|
||||
$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 log_message($level, $message) {
|
||||
global $logfile;
|
||||
$level = strtoupper($level);
|
||||
$timestamp = date("Y-m-d H:i:s");
|
||||
$logMessage = $level . " - " . $timestamp . " --> " . $message . PHP_EOL;
|
||||
file_put_contents($logfile, $logMessage, FILE_APPEND);
|
||||
if (verify_log()) {
|
||||
global $logfile;
|
||||
$level = strtoupper($level);
|
||||
$timestamp = date("Y-m-d H:i:s");
|
||||
$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
|
||||
|
||||
0
install/log/.keep
Normal file
0
install/log/.keep
Normal file
Reference in New Issue
Block a user