| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace Opentalent\OtAdmin\Command;
- use Opentalent\OtAdmin\Controller\SiteController;
- use Opentalent\OtCore\Exception\NoSuchOrganizationException;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputArgument;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Input\InputOption;
- use Symfony\Component\Console\Output\OutputInterface;
- use Symfony\Component\Console\Style\SymfonyStyle;
- use TYPO3\CMS\Core\Database\ConnectionPool;
- use TYPO3\CMS\Core\Utility\GeneralUtility;
- use TYPO3\CMS\Extbase\Object\ObjectManager;
- /**
- * This CLI command create or update the organization config file, and update the identifier field in ot_websites table
- * This is a light alternative to the update command, designed to be executed on a development env, just after
- * the databases cloning.
- *
- * @package Opentalent\OtAdmin\Command
- */
- class RegenConfigFilesCommand extends Command
- {
- /**
- * -- This method is expected by Typo3, do not rename ou remove --
- *
- * Allows to configure the command.
- * Allows to add a description, a help text, and / or define arguments.
- *
- */
- protected function configure()
- {
- $this
- ->setName("ot:regen-config-files")
- ->setDescription("Recreate all of the website config files with the Db data");
- }
- /**
- * -- This method is expected by Typo3, do not rename ou remove --
- *
- * @param InputInterface $input
- * @param OutputInterface $output
- * @throws \Exception
- */
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $io = new SymfonyStyle($input, $output);
- $siteController = GeneralUtility::makeInstance(ObjectManager::class)->get(SiteController::class);
- $siteController->regenConfigFilesAction();
- $io->success(sprintf("The config files were recreated"));
- }
- }
|