quicker founction for logging in header

This commit is contained in:
Timendum 2016-08-22 11:25:05 +02:00
parent 61513f892b
commit fb7eb6db0c
2 changed files with 13 additions and 1 deletions

View file

@ -35,6 +35,18 @@ class FileHandler
return !!($this->config["log"]);
}
public function countLogs()
{
if(!$this->config["log"])
return;
if(!$this->outuput_folder_exists())
return;
$folder = dirname(__DIR__).'/'.$this->config["logFolder"].'/';
return count(glob($folder.'*.txt', GLOB_BRACE));
}
public function listLogs()
{
$files = [];

View file

@ -35,7 +35,7 @@
// Logs
if ($file->is_log_enabled()) {
$filesCount = count($file->listLogs());
$filesCount = $file->countLogs();
if ($filesCount < 1) {
echo ' <li><a href="./logs.php">Logs</a></li>';
} else {