setName("ot:site:clear-cache") ->setDescription("Clear the cache of an organization website") ->setHelp("This CLI command clears the cache of an existing organization's website") ->addArgument( 'organization_id', InputArgument::REQUIRED, "The organization's id in the opentalent DB" )->addOption( 'all', 'a', InputOption::VALUE_NONE, 'Use this option to clear all the typo3 caches, and not only the frontend one' ); } /** * -- This method is expected by Typo3, do not rename ou remove -- * * Executes the command for clearing the cache of the organization's website * * @param InputInterface $input * @param OutputInterface $output * @throws \Exception */ protected function execute(InputInterface $input, OutputInterface $output) { $org_id = $input->getArgument('organization_id'); $clearAll = $input->getOption('all'); $io = new SymfonyStyle($input, $output); $siteController = new SiteController(); $rootUid = $siteController->clearSiteCacheAction($org_id, $clearAll); $io->success(sprintf("The cache has been cleared for the website with root uid " . $rootUid . "")); } }