Exemplo n.º 1
0
 /**
  * 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();
     }
 }
Exemplo n.º 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('');
 }