X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/e0961fc632262aeb9c981c323deca0df7850fdce..57198b462928673e15458d19756577f5f83e56bf:/Command/RekeyCommand.php diff --git a/Command/RekeyCommand.php b/Command/RekeyCommand.php new file mode 100644 index 0000000..91d7967 --- /dev/null +++ b/Command/RekeyCommand.php @@ -0,0 +1,53 @@ +setName('rapsysair:rekey') + //Set description shown with bin/console list + ->setDescription('Rekey sessions') + //Set description shown with bin/console --help airlibre:attribute + ->setHelp('This command rekey sessions in chronological order'); + } + + ///Process the attribution + protected function execute(InputInterface $input, OutputInterface $output) { + //Fetch doctrine + $doctrine = $this->getDoctrine(); + + //Rekey sessions + if (!$doctrine->getRepository(Session::class)->rekey()) { + //Return failure + return self::FAILURE; + } + + //Return success + return self::SUCCESS; + } + + /** + * Return the bundle alias + * + * {@inheritdoc} + */ + public function getAlias(): string { + return 'rapsys_air'; + } +}