2014-05-03 10:54:40 +02:00
|
|
|
<?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()
|
|
|
|
{
|
2014-05-04 16:27:15 +02:00
|
|
|
return new Privilege(Privilege::ListLogs);
|
2014-05-03 10:54:40 +02:00
|
|
|
}
|
|
|
|
}
|