Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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);
         }
     }
 }
Exemplo n.º 3
0
 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();
         }
     }
 }
Exemplo n.º 4
0
 public function handleAutomaticUpdates()
 {
     $config = $this['config'];
     $installed = $config->get('concrete.version_db_installed');
     $core = $config->get('concrete.version_db');
     if ($installed < $core) {
         Update::updateToCurrentVersion();
     }
 }