You are here

public function S3::getAdapter in Flysystem - S3 2.0.x

Same name and namespace in other branches
  1. 8 src/Flysystem/S3.php \Drupal\flysystem_s3\Flysystem\S3::getAdapter()

File

src/Flysystem/S3.php, line 176

Class

S3
Drupal plugin for the "S3" Flysystem adapter.

Namespace

Drupal\flysystem_s3\Flysystem

Code

public function getAdapter() {
  try {
    $adapter = new S3Adapter($this->client, $this->bucket, $this->prefix, $this->options);
    return $adapter;
  } catch (S3Exception $e) {
    $message = $e
      ->getMessage();
    \Drupal::logger('flysystem_s3')
      ->error($message);
  }
}