You are here

public function FileCopierFactory::create in Automatic Updates 8.2

File

package_manager/src/FileCopierFactory.php, line 68

Class

FileCopierFactory
A file copier factory which returns file copiers according to configuration.

Namespace

Drupal\package_manager

Code

public function create() : FileCopierInterface {
  $copier = $this->configFactory
    ->get('package_manager.settings')
    ->get('file_copier');
  switch ($copier) {
    case 'rsync':
      return $this->rsyncFileCopier;
    case 'php':
      return $this->phpFileCopier;
    default:
      return $this->decorated
        ->create();
  }
}