data . '/status.json'))->read(); if ($stats === null) { $output->writeln('No server running with the data folder ' . $this->data . '.'); $output->writeln('Permanent rooms:'); foreach ((new RoomStore($this->data . '/rooms.json'))->load() as $room) { $output->writeln(' - ' . $room->name . ' (' . count($room->history) . ' sentences kept)'); } return Command::SUCCESS; } $output->writeln(sprintf('Server running (pid %d): %d connections, %d members', $stats['pid'] ?? 0, $stats['clients'] ?? 0, $stats['users'] ?? 0)); $table = new Table($output); $table->setHeaders(['Room', 'Kind', 'Members']); foreach ((array)($stats['rooms'] ?? []) as $room) { $table->addRow([$room['name'], $room['permanent'] ? 'permanent' : ($room['type'] ? 'private' : 'public'), $room['members']]); } $table->render(); return Command::SUCCESS; } }