Nouvel essai avec un glob

This commit is contained in:
leosw
2025-08-30 12:05:22 +02:00
parent 79a33031d6
commit 6bdbcec947
2 changed files with 2 additions and 4 deletions

View File

@@ -124,7 +124,8 @@ if(isset($controller->splitted_url[1]) && $user->rankIsHigher("moderator")) {
if ($user->rankIsHigher("moderator")) {
$head['title'] = "Statistiques";
$report = $config['abs_root_folder'].'report.html';
$command = '(zcat /var/log/nginx/kabano.org-access.log*.gz && cat /var/log/nginx/kabano.org-access.log.1) | goaccess --log-format=COMBINED --no-progress -o '.escapeshellarg($report).' 2>&1';
$files = glob('/var/log/nginx/kabano.org-access.log*.gz');
$command = '(zcat '.implode(' ', $files).' && cat /var/log/nginx/kabano.org-access.log.1) | goaccess --log-format=COMBINED --no-progress -o '.escapeshellarg($report).' 2>&1';
$output = shell_exec($command);
include ($config['views_folder']."d.admin.stats.html");

View File

@@ -13,9 +13,6 @@
<h3>Retour de l'execution de la commande :</h3><br>
<pre><?
print_r($output);
echo ini_get('disable_functions');
echo ini_get('open_basedir');
?></pre>
<? if (file_exists($report)) { ?>
<a href='/report.html' target='_blank'><i class="fas fa-chart-line"></i> Voir le rapport</a>