You are here

protected function CompressionFilter::_defaultCompressionAlgorithm in Backup and Migrate 8.4

Get the default compression algorithm based on those available.

Return value

string The machine name of the algorithm.

1 call to CompressionFilter::_defaultCompressionAlgorithm()
CompressionFilter::configDefaults in lib/backup_migrate_core/src/Filter/CompressionFilter.php
Get the default values for the plugin.

File

lib/backup_migrate_core/src/Filter/CompressionFilter.php, line 376

Class

CompressionFilter
Class CompressionFilter.

Namespace

BackupMigrate\Core\Filter

Code

protected function _defaultCompressionAlgorithm() {
  $available = array_keys($this
    ->_availableCompressionAlgorithms());

  // Remove the 'none' option.
  array_shift($available);
  $out = array_shift($available);

  // Return the first available algorithm or 'none' of none other exist.
  return $out ? $out : 'none';
}