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); }
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); }
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(); }
/** * 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; } }