Example #1
0
 public static function files($storage, $backup_file, $destination, $compression, $parts)
 {
     // Files backup.
     try {
         $file_provider = new BackupFile();
         $file_provider->restore($storage, $backup_file, $destination, $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";
 }
Example #2
0
 public static function files($directory, $storage, $storage_directory, $compression, $exclude)
 {
     try {
         $file_provider = new BackupFile();
         $backup = $file_provider->backup($directory, $storage, $storage_directory, $compression, $exclude);
     } 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";
 }