mirror of
https://github.com/timendum/Youtube-dl-WebUI.git
synced 2025-02-28 23:53:10 +08:00
quicker founction for logging in header
This commit is contained in:
parent
61513f892b
commit
fb7eb6db0c
2 changed files with 13 additions and 1 deletions
|
@ -34,6 +34,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()
|
||||
{
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue