protected function execute(InputInterface $input, OutputInterface $output) { $rc = 0; try { if (!$input->getOption('force')) { if (!$input->isInteractive()) { throw new Exception("You have to specify the --force option in order to run this command"); } $confirmQuestion = new ConfirmationQuestion('Are you sure you want to update this concrete5 installation?'); if (!$this->getHelper('question')->ask($input, $output, $confirmQuestion)) { throw new Exception("Operation aborted."); } } $configuration = new \Concrete\Core\Updater\Migrations\Configuration(); $output = new ConsoleOutput(); $configuration->setOutputWriter(new OutputWriter(function ($message) use($output) { $output->writeln($message); })); Update::updateToCurrentVersion($configuration); } catch (Exception $x) { $output->writeln('<error>' . $x->getMessage() . '</error>'); $rc = 1; } return $rc; }
public function submit() { if ($this->validateAction()) { try { Update::updateToCurrentVersion(); $this->set('success', t('Upgrade to <b>%s</b> complete!', APP_VERSION)); } catch (\Exception $e) { $this->set('error', $e); } } }
public function handleAutomaticUpdates() { $config = $this['config']; if ($config->get('concrete.updates.enable_auto_update_core')) { $installed = $config->get('concrete.version_installed'); $core = $config->get('concrete.version'); if ($core && $installed && version_compare($installed, $core, '<')) { Update::updateToCurrentVersion(); } } }
public function handleAutomaticUpdates() { $config = $this['config']; $installed = $config->get('concrete.version_db_installed'); $core = $config->get('concrete.version_db'); if ($installed < $core) { Update::updateToCurrentVersion(); } }