25 lines
426 B
PHP
25 lines
426 B
PHP
|
<?php
|
||
|
class ListLogsJob extends AbstractJob
|
||
|
{
|
||
|
public function execute()
|
||
|
{
|
||
|
$path = TextHelper::absolutePath(getConfig()->main->logsPath);
|
||
|
|
||
|
$logs = [];
|
||
|
foreach (glob($path . DS . '*.log') as $log)
|
||
|
$logs []= basename($log);
|
||
|
|
||
|
usort($logs, function($a, $b)
|
||
|
{
|
||
|
return strnatcasecmp($b, $a); //reverse natcasesort
|
||
|
});
|
||
|
|
||
|
return $logs;
|
||
|
}
|
||
|
|
||
|
public function requiresPrivilege()
|
||
|
{
|
||
|
return Privilege::ListLogs;
|
||
|
}
|
||
|
}
|