setDescription('Empties session cache in redis, ends sessions for all users'); return $this; } protected function doExecute(InputInterface $input, OutputInterface $output) { /** @var Factory $cacheFactory */ $cacheFactory = $this->container['phraseanet.cache-factory']; $cache = $cacheFactory->create('redis', ['host' => 'redis-session', 'port' => '6379']); $flushOK = $cache->removeByPattern('PHPREDIS_SESSION*'); if ($flushOK) { $output->writeln('session cache in redis successfully flushed!'); } else { $output->writeln('flush failed!'); } return 0; } }