You are here

public static function S3Client::factory in AmazonS3 7.2

Same name in this branch
  1. 7.2 src/S3Client.php \Drupal\amazons3\S3Client::factory()
  2. 7.2 tests/Stub/S3Client.php \Drupal\amazons3Test\Stub\S3Client::factory()

Create a new S3Client using aws_key / aws_secret $conf variables.

Parameters

array|Collection $config: An array of configuration options to pass to \Aws\S3\S3Client::factory(). If 'credentials' are set they will be used instead of aws_key and aws_secret.

string $bucket: (optional) The bucket to associate this client with. If empty, the client will default to $config['region'], and then the us-east-1 region.

Return value

\Aws\S3\S3Client

Overrides S3Client::factory

3 calls to S3Client::factory()
S3ClientTest::testCurlOptions in tests/S3ClientTest.php
@covers \Drupal\amazons3\S3Client::factory
S3ClientTest::testFactory in tests/S3ClientTest.php
@covers Drupal\amazons3\S3Client::factory
S3ClientTest::testValidateBucketExistsFail in tests/S3ClientTest.php
@covers \Drupal\amazons3\S3Client::validateBucketExists @expectedException \Drupal\amazons3\Exception\S3ConnectValidationException

File

tests/Stub/S3Client.php, line 49

Class

S3Client
Stub bootstrap functions.

Namespace

Drupal\amazons3Test\Stub

Code

public static function factory($config = array(), $bucket = NULL) {
  static::$factoryCalled = TRUE;
  return parent::factory($config, $bucket);
}