Code had two file connections use one.
Noticed there were two open connection for the file log. A few other adjustments.
This commit is contained in:
parent
bc2b14739c
commit
2900b9fb1b
|
|
@ -107,9 +107,9 @@
|
||||||
$file_size = filesize($log_file);
|
$file_size = filesize($log_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
//read the log
|
//open the log file
|
||||||
if (file_exists($log_file)) {
|
if (file_exists($log_file)) {
|
||||||
$file_handle = fopen($log_file, "r");
|
$file = fopen($log_file, "r") or exit($text['error-open_file']);
|
||||||
}
|
}
|
||||||
|
|
||||||
//include the header
|
//include the header
|
||||||
|
|
@ -197,6 +197,8 @@
|
||||||
$array_filter[6]['type'] = 'bold';
|
$array_filter[6]['type'] = 'bold';
|
||||||
$array_filter[6]['font'] = 'monospace';
|
$array_filter[6]['font'] = 'monospace';
|
||||||
|
|
||||||
|
$file_size = filesize($log_file);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// removed: duplicate of above
|
// removed: duplicate of above
|
||||||
if (isset($_POST['submit'])) {
|
if (isset($_POST['submit'])) {
|
||||||
|
|
@ -243,8 +245,8 @@
|
||||||
else {
|
else {
|
||||||
//open the file
|
//open the file
|
||||||
$byte_count ='0';
|
$byte_count ='0';
|
||||||
if ($file_handle) {
|
if ($file) {
|
||||||
fseek($file_handle, 0);
|
fseek($file, 0);
|
||||||
}
|
}
|
||||||
echo "<br>".$text['label-open_file']."<br>";
|
echo "<br>".$text['label-open_file']."<br>";
|
||||||
}
|
}
|
||||||
|
|
@ -267,9 +269,9 @@
|
||||||
|
|
||||||
//start processing
|
//start processing
|
||||||
$byte_count = 0;
|
$byte_count = 0;
|
||||||
if ($file_handle) {
|
if ($file) {
|
||||||
while(!feof($file_handle)) {
|
while(!feof($file)) {
|
||||||
$log_line = escape(fgets($file_handle));
|
$log_line = escape(fgets($file));
|
||||||
$byte_count++;
|
$byte_count++;
|
||||||
$noprint = false;
|
$noprint = false;
|
||||||
|
|
||||||
|
|
@ -337,8 +339,8 @@
|
||||||
require_once "resources/footer.php";
|
require_once "resources/footer.php";
|
||||||
|
|
||||||
//close the file
|
//close the file
|
||||||
if ($file_handle) {
|
if ($file) {
|
||||||
fclose($file_handle);
|
fclose($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue