/**
  * Asks environment (e.g. user over console) if he wants to restore partially backup.
  *
  * @param PreRestoreEvent $event
  */
 public function onPreRestore(PreRestoreEvent $event)
 {
     $systemDatabase = $event->getSystemDatabase();
     if ($systemDatabase->getWithDefault('state', BackupStatus::STATE_SUCCESS) === BackupStatus::STATE_PARTIALLY && !$this->environment->restorePartiallyBackup()) {
         $event->cancel();
     }
 }
Exemple #2
0
 /**
  * Print info for pre-restore to output.
  *
  * @param PreRestoreEvent $event
  */
 public function onPreRestore(PreRestoreEvent $event)
 {
     $systemDatabase = $event->getSystemDatabase();
     $this->output->writeln(sprintf('Backup "%s" started will be restored:', $this->name));
     $this->output->writeln(sprintf(' * label:   %s', $systemDatabase->get('label')));
     $this->output->writeln(sprintf(' * message: %s', $systemDatabase->get('message')));
     $this->output->writeln(sprintf(' * started: %s', $systemDatabase->get('started')));
     $this->output->writeln('');
 }
Exemple #3
0
 /**
  * Extend configuration with preset.
  *
  * @param PreRestoreEvent $event
  */
 public function onPreRestore(PreRestoreEvent $event)
 {
     $event->setBackup($this->extend($event->getBackup()));
 }