PHP 인터페이스 Webiny\Component\Amazon\S3\S3ClientInterface

파일 보기 프로젝트 열기: Webiny/Framework

공개 메소드들

메소드 설명
__construct ( $accessKeyId, $secretAccessKey, $region, $endpoint = null ) Amazon S3 constructor
clearBucket ( string $bucket ) : integer Helper used to clear the contents of a bucket. Use the {@see ClearBucket} object directly for more advanced options and control.
copyObject ( string $sourceBucket, string $sourceKey, string $targetBucket, string $targetKey, array $params = [] ) : mixed Creates a copy of an object that is already stored in Amazon S3.
createBucket ( string $bucket, array $params = [] ) : mixed Creates a new bucket.
deleteBucket ( $bucket ) : mixed Deletes the bucket.
deleteMatchingObjects ( string $bucket, string $prefix = '', string $regex = '', array $options = [] ) : integer Deletes objects from Amazon S3 that match the result of a ListObjects operation. For example, this allows you to do things like delete all objects that match a specific key prefix.
deleteObject ( string $bucket, string $key, array $params = [] ) : mixed Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.
deleteObjects ( string $bucket, array $objects ) : mixed This operation enables you to delete multiple objects from a bucket using a single HTTP request.
doesBucketExist ( string $bucket, boolean $accept403 = true, array $params = [] ) : boolean Determines whether or not a bucket exists by name
doesObjectExist ( string $bucket, string $key, array $params = [] ) : boolean Determines whether or not an object exists by name
downloadBucket ( string $directory, string $bucket, string $keyPrefix = '', array $options = [] ) Downloads a bucket to the local filesystem
getBucketAcl ( string $bucket ) : mixed Get access control policy for the bucket
getBucketLocation ( string $bucket ) : mixed Returns the region the bucket resides in.
getBucketPolicy ( string $bucket ) : mixed Returns the policy of a specified bucket.
getListBucketsIterator ( ) : mixed Get array of buckets Available keys: Name, CreationDate
getListObjectsIterator ( string $bucket, array $params = [] ) : mixed Get objects iterator
getObject ( string $bucket, string $key, array $params = [] ) : mixed Get object identified by bucket and key
getObjectAcl ( $bucket, $key ) : mixed Returns the access control list (ACL) of an object.
getObjectUrl ( string $bucket, string $key, mixed $expires = null, array $args = [] ) : string Returns the URL to an object identified by its bucket and key. If an expiration time is provided, the URL will be signed and set to expire at the provided time.
listBuckets ( ) : mixed Returns a list of all buckets owned by the authenticated sender of the request.
listObjects ( string $bucket, array $params = [] ) : mixed Returns some or all (up to 1000) of the objects in a bucket.
multipartUpload ( $bucket, $key, $sourcePath, integer $concurrency = 1 ) : mixed In case of large files, use the multipartUpload method, so the file is sent in chunks to S3, without the need to read the complete file in memory.
putBucketAcl ( string $bucket, string $acl ) : mixed Sets the permissions on a bucket using access control lists (ACL).
putObject ( string $bucket, string $key, string $content, array $params = [] ) : mixed Adds an object to a bucket.
putObjectAcl ( string $bucket, string $key, string $acl ) : mixed Set the access control list (ACL) permissions for an object that already exists in a bucket
restoreObject ( string $bucket, string $key, integer $days ) : mixed Restores an archived copy of an object back into Amazon S3
uploadDirectory ( string $directory, string $bucket, string $keyPrefix = null, array $options = [] ) Recursively uploads all files in a given directory to a given bucket.

메소드 상세

__construct() 공개 메소드

Amazon S3 constructor
public __construct ( $accessKeyId, $secretAccessKey, $region, $endpoint = null )
$accessKeyId
$secretAccessKey
$region
$endpoint

clearBucket() 공개 메소드

Helper used to clear the contents of a bucket. Use the {@see ClearBucket} object directly for more advanced options and control.
public clearBucket ( string $bucket ) : integer
$bucket string Name of the bucket to clear.
리턴 integer Returns the number of deleted keys

copyObject() 공개 메소드

Creates a copy of an object that is already stored in Amazon S3.
public copyObject ( string $sourceBucket, string $sourceKey, string $targetBucket, string $targetKey, array $params = [] ) : mixed
$sourceBucket string
$sourceKey string
$targetBucket string
$targetKey string
$params array
리턴 mixed

createBucket() 공개 메소드

Creates a new bucket.
public createBucket ( string $bucket, array $params = [] ) : mixed
$bucket string
$params array
리턴 mixed

deleteBucket() 공개 메소드

All objects (including all object versions and Delete Markers) in the bucket must be deleted before the bucket itself can be deleted.
public deleteBucket ( $bucket ) : mixed
$bucket
리턴 mixed

deleteMatchingObjects() 공개 메소드

Deletes objects from Amazon S3 that match the result of a ListObjects operation. For example, this allows you to do things like delete all objects that match a specific key prefix.
또한 보기: Aws\S3\S3Client::listObjects
또한 보기: Aws\S3\Model\ClearBucket For more options or customization
public deleteMatchingObjects ( string $bucket, string $prefix = '', string $regex = '', array $options = [] ) : integer
$bucket string Bucket that contains the object keys
$prefix string Optionally delete only objects under this key prefix
$regex string Delete only objects that match this regex
$options array Options used when deleting the object: - before_delete: Callback to invoke before each delete. The callback will receive a Guzzle\Common\Event object with context.
리턴 integer Returns the number of deleted keys

deleteObject() 공개 메소드

If there isn't a null version, Amazon S3 does not remove any objects.
public deleteObject ( string $bucket, string $key, array $params = [] ) : mixed
$bucket string
$key string
$params array
리턴 mixed

deleteObjects() 공개 메소드

You may specify up to 1000 keys.
public deleteObjects ( string $bucket, array $objects ) : mixed
$bucket string
$objects array
리턴 mixed

doesBucketExist() 공개 메소드

Determines whether or not a bucket exists by name
public doesBucketExist ( string $bucket, boolean $accept403 = true, array $params = [] ) : boolean
$bucket string The name of the bucket
$accept403 boolean Set to true if 403s are acceptable
$params array Additional options to add to the executed command
리턴 boolean

doesObjectExist() 공개 메소드

Determines whether or not an object exists by name
public doesObjectExist ( string $bucket, string $key, array $params = [] ) : boolean
$bucket string The name of the bucket
$key string The key of the object
$params array Additional options to add to the executed command
리턴 boolean

downloadBucket() 공개 메소드

Downloads a bucket to the local filesystem
public downloadBucket ( string $directory, string $bucket, string $keyPrefix = '', array $options = [] )
$directory string Directory to download to
$bucket string Bucket to download from
$keyPrefix string Only download objects that use this key prefix
$options array Associative array of download options - params: Array of parameters to use with each GetObject operation performed during the transfer - base_dir: Base directory to remove from each object key when storing in the local filesystem - force: Set to true to download every file, even if the file is already on the local filesystem and has not changed - concurrency: Maximum number of parallel downloads (defaults to 10) - debug: Set to true or a fopen resource to enable debug mode to print information about each download - allow_resumable: Set to true to allow previously interrupted downloads to be resumed using a Range GET

getBucketAcl() 공개 메소드

Get access control policy for the bucket
public getBucketAcl ( string $bucket ) : mixed
$bucket string
리턴 mixed

getBucketLocation() 공개 메소드

Returns the region the bucket resides in.
public getBucketLocation ( string $bucket ) : mixed
$bucket string
리턴 mixed

getBucketPolicy() 공개 메소드

Returns the policy of a specified bucket.
public getBucketPolicy ( string $bucket ) : mixed
$bucket string
리턴 mixed

getListBucketsIterator() 공개 메소드

Get array of buckets Available keys: Name, CreationDate
public getListBucketsIterator ( ) : mixed
리턴 mixed

getListObjectsIterator() 공개 메소드

Get objects iterator
public getListObjectsIterator ( string $bucket, array $params = [] ) : mixed
$bucket string
$params array
리턴 mixed

getObject() 공개 메소드

Get object identified by bucket and key
public getObject ( string $bucket, string $key, array $params = [] ) : mixed
$bucket string
$key string
$params array
리턴 mixed

getObjectAcl() 공개 메소드

Returns the access control list (ACL) of an object.
public getObjectAcl ( $bucket, $key ) : mixed
$bucket
$key
리턴 mixed

getObjectUrl() 공개 메소드

Returns the URL to an object identified by its bucket and key. If an expiration time is provided, the URL will be signed and set to expire at the provided time.
public getObjectUrl ( string $bucket, string $key, mixed $expires = null, array $args = [] ) : string
$bucket string The name of the bucket where the object is located
$key string The key of the object
$expires mixed The time at which the URL should expire
$args array Arguments to the GetObject command. Additionally you can specify a "Scheme" if you would like the URL to use a different scheme than what the client is configured to use
리턴 string The URL to the object

listBuckets() 공개 메소드

Available keys: Name, CreationDate
public listBuckets ( ) : mixed
리턴 mixed

listObjects() 공개 메소드

You can use the request parameters as selection criteria to return a subset of the objects in a bucket.
public listObjects ( string $bucket, array $params = [] ) : mixed
$bucket string
$params array
리턴 mixed

multipartUpload() 공개 메소드

In case of large files, use the multipartUpload method, so the file is sent in chunks to S3, without the need to read the complete file in memory.
public multipartUpload ( $bucket, $key, $sourcePath, integer $concurrency = 1 ) : mixed
$bucket
$key
$sourcePath
$concurrency integer
리턴 mixed

putBucketAcl() 공개 메소드

Sets the permissions on a bucket using access control lists (ACL).
public putBucketAcl ( string $bucket, string $acl ) : mixed
$bucket string
$acl string private | public-read | public-read-write | authenticated-read
리턴 mixed

putObject() 공개 메소드

Adds an object to a bucket.
public putObject ( string $bucket, string $key, string $content, array $params = [] ) : mixed
$bucket string
$key string
$content string
$params array
리턴 mixed

putObjectAcl() 공개 메소드

Set the access control list (ACL) permissions for an object that already exists in a bucket
public putObjectAcl ( string $bucket, string $key, string $acl ) : mixed
$bucket string
$key string
$acl string private | public-read | public-read-write | authenticated-read | bucket-owner-read | bucket-owner-full-control
리턴 mixed

restoreObject() 공개 메소드

Restores an archived copy of an object back into Amazon S3
public restoreObject ( string $bucket, string $key, integer $days ) : mixed
$bucket string
$key string
$days integer
리턴 mixed

uploadDirectory() 공개 메소드

Recursively uploads all files in a given directory to a given bucket.
또한 보기: Aws\S3\S3Sync\S3Sync for more options and customization
public uploadDirectory ( string $directory, string $bucket, string $keyPrefix = null, array $options = [] )
$directory string Full path to a directory to upload
$bucket string Name of the bucket
$keyPrefix string Virtual directory key prefix to add to each upload
$options array Associative array of upload options - params: Array of parameters to use with each PutObject operation performed during the transfer - base_dir: Base directory to remove from each object key - force: Set to true to upload every file, even if the file is already in Amazon S3 and has not changed - concurrency: Maximum number of parallel uploads (defaults to 10) - debug: Set to true or an fopen resource to enable debug mode to print information about each upload - multipart_upload_size: When the size of a file exceeds this value, the file will be uploaded using a multipart upload.