![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /home/fdshops/public_html/vendor/arcanedev/log-viewer/src/Commands/ |
<?php declare(strict_types=1); namespace Arcanedev\LogViewer\Commands; use Arcanedev\LogViewer\Tables\StatsTable; /** * Class StatsCommand * * @author ARCANEDEV <arcanedev.maroc@gmail.com> */ class StatsCommand extends Command { /* ----------------------------------------------------------------- | Properties | ----------------------------------------------------------------- */ /** * The console command name. * * @var string */ protected $name = 'log-viewer:stats'; /** * The console command description. * * @var string */ protected $description = 'Display stats of all logs.'; /** * The name and signature of the console command. * * @var string */ protected $signature = 'log-viewer:stats'; /* ----------------------------------------------------------------- | Main Methods | ----------------------------------------------------------------- */ /** * Execute the console command. */ public function handle() { // Load Data $stats = $this->logViewer->statsTable('en'); $rows = $stats->rows(); $rows[] = $this->tableSeparator(); $rows[] = $this->prepareFooter($stats); // Display Data $this->displayLogViewer(); $this->table($stats->header(), $rows); return static::SUCCESS; } /* ----------------------------------------------------------------- | Other Methods | ----------------------------------------------------------------- */ /** * Prepare footer. * * @param \Arcanedev\LogViewer\Tables\StatsTable $stats * * @return array */ private function prepareFooter(StatsTable $stats) { $files = [ 'count' => count($stats->rows()).' log file(s)' ]; return $files + $stats->footer(); } }