/** * @param InputInterface $input * @param OutputInterface $output * @return int|null|void */ protected function execute(InputInterface $input, OutputInterface $output) { $forceInstall = $input->getOption('force'); $commandExecutor = new CommandExecutor($input->hasOption('env') ? $input->getOption('env') : null, $output, $this->getApplication()); $commandExecutor->setDefaultTimeout($input->getOption('timeout')); // if there is application is not installed or no --force option $isInstalled = $this->getContainer()->hasParameter('installed') && $this->getContainer()->getParameter('installed'); if ($isInstalled && !$forceInstall) { $output->writeln('<comment>ATTENTION</comment>: Chamilo is already installed.'); $output->writeln('To proceed with install - run command with <info>--force</info> option:'); $output->writeln(sprintf(' <info>%s --force</info>', $this->getName())); $output->writeln('To reinstall over existing database - run command with <info>--force --drop-database</info> options:'); $output->writeln(sprintf(' <info>%s --force --drop-database</info>', $this->getName())); $output->writeln('<comment>ATTENTION</comment>: All data will be lost. ' . 'Database backup is highly recommended before executing this command.'); $output->writeln(''); return; } if ($forceInstall) { // if --force option we have to clear cache and set installed to false $this->updateInstalledFlag(false); // See https://github.com/symfony/symfony/issues/12278 $commandExecutor->runCommand('cache:clear', array('--no-optional-warmers' => true, '--process-isolation' => true)); } $output->writeln('<info>Installing Chamilo.</info>'); $output->writeln(''); $this->checkStep($input, $output)->setupStep($commandExecutor, $input, $output)->finalStep($commandExecutor, $input, $output); $output->writeln(''); $output->writeln(sprintf('<info>Chamilo has been successfully installed in <comment>%s</comment> mode.</info>', $input->getOption('env'))); if ('prod' != $input->getOption('env')) { $output->writeln('<info>To run application in <comment>prod</comment> mode, ' . 'please run <comment>cache:clear</comment> command with <comment>--env prod</comment> parameter</info>'); } }
/** * @inheritdoc */ protected function execute(InputInterface $input, OutputInterface $output) { $force = $input->getOption('force'); if ($force) { $commandExecutor = new CommandExecutor($input->hasOption('env') ? $input->getOption('env') : null, $output, $this->getApplication()); $commandExecutor->setDefaultTimeout($input->getOption('timeout')); $commandExecutor->runCommand('oro:migration:load', array('--force' => true))->runCommand('oro:migration:data:load', array('--no-interaction' => true)); } else { $output->writeln('<comment>ATTENTION</comment>: Database backup is highly recommended before executing this command.'); $output->writeln(' Please make sure that application cache is up-to-date before run this command.'); $output->writeln(' Use <info>cache:clear</info> if needed.'); $output->writeln(''); $output->writeln('To force execution run command with <info>--force</info> option:'); $output->writeln(sprintf(' <info>%s --force</info>', $this->getName())); } }
/** * @inheritdoc */ protected function execute(InputInterface $input, OutputInterface $output) { $force = $input->getOption('force'); if ($force) { $commandExecutor = new CommandExecutor($input->hasOption('env') ? $input->getOption('env') : null, $output, $this->getApplication()); $commandExecutor->setDefaultTimeout($input->getOption('timeout')); $commandExecutor->runCommand('oro:migration:load', array('--process-isolation' => true, '--force' => true))->runCommand('oro:migration:data:load', array('--process-isolation' => true))->runCommand('assets:install')->runCommand('assetic:dump'); //->runCommand('fos:js-routing:dump', array('--target' => 'web/js/routes.js')) //->runCommand('oro:localization:dump') //->runCommand('oro:translation:dump') //->runCommand('oro:requirejs:build', array('--ignore-errors' => true)); } else { $output->writeln('<comment>ATTENTION</comment>: Database backup is highly recommended before executing this command.'); $output->writeln(' Please make sure that application cache is up-to-date before run this command.'); $output->writeln(' Use <info>cache:clear</info> if needed.'); $output->writeln(''); $output->writeln('To force execution run command with <info>--force</info> option:'); $output->writeln(sprintf(' <info>%s --force</info>', $this->getName())); } }