public static function init(array $credentials, array $options): void
Creates a new S3 client instance with the options.
Option key | Description |
---|---|
credentials | AWS API credentials (key, secret) |
options | S3 options (e.g. region) |
public static function create($bucketName): string
Creates a new S3 bucket.
Option key | Description |
---|---|
bucketName | Bucket to create |
public static function delete($bucketName): string
Deletes the S3 bucket.
Option key | Description |
---|---|
bucketName | Name of the bucket to delete |
public static function list(): array
Returns a list of all buckets owned by the authenticated sender of the request.
public static function empty($bucketName): void
Efficiently deletes many objects from a single Amazon S3 bucket using an iterator that yields keys.
Option key | Description |
---|---|
bucketName | Name of the bucket to empty |
public static function put(string $bucketName, string $file, $path = NULL):string
Adds a file to a bucket
Option key | Description |
---|---|
bucketName | Name of the bucket to put the object |
file | File |
path (optional) | Path to put the file |
public static function downloadBucket(string $bucketName, string $localDir) :void
Downloads a bucket to the local filesystem
Option key | Description |
---|---|
bucketName | Name of the bucket to put the object |
localDir | Local directory to download to |
public static function download(string $bucketName, string $localDir, string $path): void
Path in the bucket to download
Option key | Description |
---|---|
bucketName | Name of the bucket to put the object |
localDir | Local directory to download to |
path | Path in the bucket to download |
public static function deleteObject($bucketName, $file): string
Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.
Option key | Description |
---|---|
bucketName | Name of the bucket to delete the object from |
file | File to delete |