public static function database($database, $storage, $backup_file, $compression, $parts) { // Execute the restore task. try { $database_provider = new BackupDatabase(); $database_provider->restore($database, $storage, $backup_file, $compression, $parts); } catch (\Exception $e) { return parent::consoleFormattedError($e->getMessage()); } // If we get till here, it means there were no exceptions, so the restore process was successful. return " Restore process completed <fg=green>successfully</>!\n"; }
public static function database($database, $storage, $compression, $storage_directory) { try { $database_provider = new BackupDatabase(); $backup = $database_provider->backup($database, $storage, $compression, $storage_directory); } catch (\Exception $e) { return parent::consoleFormattedError($e->getMessage()); } // Get storage config. $storage_config = Config::getStorage($backup['storage']); // If we get till here, it means there were no exceptions, so the backup process was successful. return " Backup <fg=green>successfully</> saved on <fg=blue>{$backup['storage']}</> (<fg=yellow>{$storage_config['root']}</>) storage\n Backup path: <fg=yellow>{$backup['directory']}/{$backup['file']}</>\n"; }