Beispiel #1
0
 public function restore($filePath)
 {
     SGBackupLog::writeAction('restore database', SG_BACKUP_LOG_POS_START);
     $this->backupFilePath = $filePath;
     $this->resetRestoreProgress();
     $this->import();
     SGBackupLog::writeAction('restore database', SG_BACKUP_LOG_POS_END);
 }
Beispiel #2
0
 public function restore($filePath)
 {
     SGBackupLog::writeAction('restore files', SG_BACKUP_LOG_POS_START);
     $this->filePath = $filePath;
     $this->resetRestoreProgress(dirname($filePath));
     $this->warningsFound = false;
     $this->extractArchive($filePath);
     SGBackupLog::writeAction('restore files', SG_BACKUP_LOG_POS_END);
 }
Beispiel #3
0
 private function didFinishRestore()
 {
     $action = $this->didFindWarnings() ? SG_ACTION_STATUS_FINISHED_WARNINGS : SG_ACTION_STATUS_FINISHED;
     self::changeActionStatus($this->actionId, $action);
     SGBackupLog::writeAction('restore', SG_BACKUP_LOG_POS_END);
     if (SGBoot::isFeatureAvailable('NOTIFICATIONS')) {
         SGBackupMailNotification::sendRestoreNotification(true);
     }
     SGBackupLog::write('Total duration: ' . formattedDuration($this->actionStartTs, time()));
     $this->cleanUp();
 }
Beispiel #4
0
 /**
  * Exports all the tables selected from database
  *
  * @return null
  */
 private function exportTables($data)
 {
     // Exporting tables one by one
     foreach ($this->tables as $table) {
         if (in_array($table, $this->dumpSettings['exclude-tables'], true)) {
             continue;
         }
         if (empty($data)) {
             SGBackupLog::writeAction('backup table: ' . $table, SG_BACKUP_LOG_POS_START);
         }
         $this->getTableStructure($table, !empty($data));
         if (false === $this->dumpSettings['no-data']) {
             $this->listValues($table, $data);
             $data = array();
         }
         SGBackupLog::writeAction('backup table: ' . $table, SG_BACKUP_LOG_POS_END);
         $this->excludeTables[] = $table;
     }
 }