Files
service_wopi/lib/Console/CleanupCommand.php
T
2026-09-07 21:58:35 -04:00

22 lines
786 B
PHP

<?php
declare(strict_types=1);
namespace KTXM\ServiceWopi\Console;
use KTXM\ServiceWopi\Host\SessionStore;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
#[AsCommand(name: 'wopi:cleanup', description: 'Remove expired WOPI sessions and discovery cache records')]
class CleanupCommand extends Command
{
public function __construct(private readonly SessionStore $store) { parent::__construct(); }
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->store->cleanup(time());
$output->writeln('Expired WOPI records removed.');
return Command::SUCCESS;
}
}