PHP Класс Scalr\Service\Aws\S3\Handler\BucketHandler

С версии: 12.11.2012
Автор: Vitaliy Demidov ([email protected])
Наследование: extends Scalr\Service\Aws\S3\AbstractS3Handler
Показать файл Открыть проект

Открытые методы

Метод Описание
addObject ( BucketData | string $bucketName, string $objectName, string | SplFileInfo $contentFile, array $requestHeaders = null ) : Scalr\Service\Aws\Client\ClientResponseInterface PUT Object action
create ( string $bucketName, string $bucketRegion = null, array $requestHeaders = null ) : BucketData Create Bucket action
delete ( string $bucketName ) : boolean DELETE Bucket
deleteCors ( BucketData | string $bucketName ) : boolean DELETE Bucket cors action
deleteLifecycle ( BucketData | string $bucketName ) : boolean DELETE Bucket lifecycle action
deleteObject ( BucketData | string $bucketName, string $objectName, string $versionId = null, string $xAmfMfa = null ) : Scalr\Service\Aws\Client\ClientResponseInterface DELETE Object action.
deletePolicy ( BucketData | string $bucketName ) : boolean DELETE Bucket policy action
deleteTagging ( BucketData | string $bucketName ) : boolean DELETE Bucket tagging action
deleteWebsite ( BucketData | string $bucketName ) : boolean DELETE Bucket website action
get ( string $bucketName ) : BucketData Gets BucketData from Entity Storage.
getAcl ( string $bucketName ) : Scalr\Service\Aws\S3\DataType\AccessControlPolicyData Gets a bucket ACL action.
getCors ( BucketData | string $bucketName ) : string Returns the cors configuration information set for the bucket.
getLifecycle ( BucketData | string $bucketName ) : string GET Bucket lifecycle action
getList ( ) : Scalr\Service\Aws\S3\DataType\BucketList GET Service (ListAllMyBuckets) action
getLocation ( BucketData | string $bucketName ) : string GET Bucket location action
getLogging ( string $bucketName ) : string GET Bucket logging action
getNotification ( BucketData | string $bucketName ) : string GET Bucket notification action
getObjectsFromStorage ( string $bucketName ) : ArrayObject Gets Objects list from an Entity Storage that belong to specified bucket
getPolicy ( BucketData | string $bucketName ) : string GET Bucket policy action
getRequestPayment ( BucketData | string $bucketName ) : string GET Bucket requestPayment action
getTagging ( string $bucketName ) : string GET Bucket tagging action
getWebsite ( BucketData | string $bucketName ) : string Returns the web configuration information for the bucket.
isAllowed ( string $bucketName ) : boolean HEAD Bucket action
isExist ( string $bucketName ) : boolean HEAD Bucket action
listObjects ( string $bucketName, string $delimiter = null, string $marker = null, string $maxKeys = null, string $prefix = null ) : Scalr\Service\Aws\S3\DataType\ObjectList GET Bucket (List Objects) action
setAcl ( string $bucketName, Scalr\Service\Aws\S3\DataType\AccessControlPolicyData | DOMDocument | string | array $aclset ) : boolean PUT Bucket ACL action.
setCors ( BucketData | string $bucketName, string $cors ) : boolean PUT Bucket cors action
setLifecycle ( BucketData | string $bucketName, string $lifecycle ) : boolean PUT Bucket lifecycle action
setLogging ( BucketData | string $bucketName, string $bucketLoggingStatus ) : boolean PUT Bucket logging action
setNotification ( BucketData | string $bucketName, string $notification ) : boolean PUT Bucket notification action
setPolicy ( BucketData | string $bucketName, string $policy ) : boolean PUT Bucket policy action
setRequestPayment ( BucketData | string $bucketName, string $requestPayment ) : boolean PUT Bucket requestPayment action
setTagging ( BucketData | string $bucketName, string $tagging ) : boolean PUT Bucket tagging action
setWebsite ( BucketData | string $bucketName, string $website ) : boolean PUT Bucket website action

Описание методов

addObject() публичный Метод

This implementation of the PUT operation adds an object to a bucket.You must have WRITE permissions on a bucket to add an object to it.
public addObject ( BucketData | string $bucketName, string $objectName, string | SplFileInfo $contentFile, array $requestHeaders = null ) : Scalr\Service\Aws\Client\ClientResponseInterface
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$objectName string An object name.
$contentFile string | SplFileInfo File content of file that should be uploaded. If you provide a path to the file you should pass SplFileInfo object.
$requestHeaders array optional Request headers
Результат Scalr\Service\Aws\Client\ClientResponseInterface Returns response on success or throws an exception

create() публичный Метод

Creates a new bucket belonging to the account of the authenticated request sender.
public create ( string $bucketName, string $bucketRegion = null, array $requestHeaders = null ) : BucketData
$bucketName string A bucket name.
$bucketRegion string optional AWS Region where bucket have to be located.
$requestHeaders array optional Additional request headers. x-amz-acl|x-amz-grant-read|x-amz-grant-write|x-amz-grant-read-acp| x-amz-grant-write-acp|x-amz-grant-full-control
Результат Scalr\Service\Aws\S3\DataType\BucketData Returns BucketData object on success or throws an exception.

delete() публичный Метод

This implementation of the DELETE operation deletes the bucket named in the URI. All objects (including all object versions and Delete Markers) in the bucket must be deleted before the bucket itself can be deleted.
public delete ( string $bucketName ) : boolean
$bucketName string A bucket name.
Результат boolean Returns true on success or throws an exception.

deleteCors() публичный Метод

Deletes the cors configuration information set for the bucket.
public deleteCors ( BucketData | string $bucketName ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name or BucketData object
Результат boolean Returns true on success or throws an exception.

deleteLifecycle() публичный Метод

Deletes the lifecycle configuration from the specified bucket. Amazon S3 removes all the lifecycle configuration rules in the lifecycle subresource associated with the bucket. Your objects never expire, and Amazon S3 no longer automatically deletes any objects on the basis of rules contained in the deleted lifecycle configuration. To use this operation, you must have permission to perform the s3:PutLifecycleConfiguration action. By default, the bucket owner has this permission and the bucket owner can grant this permission to others. There is usually some time lag before lifecycle configuration deletion is fully propagated to all the Amazon S3 systems.
public deleteLifecycle ( BucketData | string $bucketName ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат boolean Returns true on success or throws an exception.

deleteObject() публичный Метод

The DELETE operation removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object. If there isn't a null version, Amazon S3 does not remove any objects To remove a specific version, you must be the bucket owner and you must use the versionId subresource. Using this subresource permanently deletes the version. If the object deleted is a Delete Marker, Amazon S3 sets the response header, x-amz-delete-marker, to true. If the object you want to delete is in a bucket where the bucket versioning configuration is MFA Delete enabled, you must include the x-amz-mfa request header in the DELETE versionId request. Requests that include x-amz-mfa must use HTTPS.
public deleteObject ( BucketData | string $bucketName, string $objectName, string $versionId = null, string $xAmfMfa = null ) : Scalr\Service\Aws\Client\ClientResponseInterface
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$objectName string A object name.
$versionId string optional To remove a specific version of the object it must be used.
$xAmfMfa string optional The value is the concatenation of the authentication device's serial number, a space, and the value displayed on your authentication device.
Результат Scalr\Service\Aws\Client\ClientResponseInterface Returns response on success or throws an exception

deletePolicy() публичный Метод

This implementation of the DELETE operation uses the policy subresource to delete the policy on a specified bucket. To use the operation, you must have DeletePolicy permissions on the specified bucket and be the bucket owner.
public deletePolicy ( BucketData | string $bucketName ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат boolean Returns true on success or throws an exception.

deleteTagging() публичный Метод

This implementation of the DELETE operation uses the tagging subresource to remove a tag set from the specified bucket. To use this operation, you must have permission to perform the s3:PutBucketTagging action. By default, the bucket owner has this permission and can grant this permission to others.
public deleteTagging ( BucketData | string $bucketName ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат boolean Returns true on success or throws an exception.

deleteWebsite() публичный Метод

This operation removes the website configuration for a bucket. Amazon S3 returns a 200 OK response upon successfully deleting a website configuration on the specified bucket. You will get a 200 OK response if the website configuration you are trying to delete does not exist on the bucket. Amazon S3 returns a 404 response if the bucket specified in the request does not exist.
public deleteWebsite ( BucketData | string $bucketName ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат boolean Returns true on success or throws an exception.

get() публичный Метод

You should be aware of the fact that the entity manager is turned off by default.
public get ( string $bucketName ) : BucketData
$bucketName string A bucket name.
Результат Scalr\Service\Aws\S3\DataType\BucketData Returns BucketData from entity storage if it exists or null otherwise.

getAcl() публичный Метод

This implementation of the GET operation uses the acl subresource to return the access control list (ACL) of a bucket. To use GET to return the ACL of the bucket, you must have READ_ACP access to the bucket. If READ_ACP permission is granted to the anonymous user, you can return the ACL of the bucket without using an authorization header.
public getAcl ( string $bucketName ) : Scalr\Service\Aws\S3\DataType\AccessControlPolicyData
$bucketName string A bucket name
Результат Scalr\Service\Aws\S3\DataType\AccessControlPolicyData Returns object which describes ACL for the bucket.

getCors() публичный Метод

Returns the cors configuration information set for the bucket.
public getCors ( BucketData | string $bucketName ) : string
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат string Returns CORSConfiguration XML Document

getLifecycle() публичный Метод

Returns the lifecycle configuration information set on the bucket.
public getLifecycle ( BucketData | string $bucketName ) : string
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат string Returns LifecycleConfiguration XML Document

getList() публичный Метод

This implementation of the GET operation returns a list of all buckets owned by the authenticated sender of the request.
public getList ( ) : Scalr\Service\Aws\S3\DataType\BucketList
Результат Scalr\Service\Aws\S3\DataType\BucketList Returns BucketList

getLocation() публичный Метод

This implementation of the GET operation uses the location subresource to return a bucket's Region. You set the bucket's Region using the LocationContraint request parameter in a PUT Bucket request.
public getLocation ( BucketData | string $bucketName ) : string
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат string Returns bucket location Valid Values: EU | eu-west-1 | eu-central-1 | us-west-1 | us-west-2 | ap-southeast-1 | ap-northeast-1 | ap-northeast-2 | sa-east-1 | empty string (for the US Classic Region)

getLogging() публичный Метод

This implementation of the GET operation uses the logging subresource to return the logging status of a bucket and the permissions users have to view and modify that status. To use GET, you must be the bucket owner.
public getLogging ( string $bucketName ) : string
$bucketName string A bucket name.
Результат string Returns XML document

getNotification() публичный Метод

This implementation of the GET operation uses the notification subresource to return the notification configuration of a bucket.
public getNotification ( BucketData | string $bucketName ) : string
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат string Returns XML document

getObjectsFromStorage() публичный Метод

Gets Objects list from an Entity Storage that belong to specified bucket
public getObjectsFromStorage ( string $bucketName ) : ArrayObject
$bucketName string
Результат ArrayObject Returns list of ObjectData

getPolicy() публичный Метод

This implementation of the GET operation uses the policy subresource to return the policy of a specified bucket. To use this operation, you must have GetPolicy permissions on the specified bucket, and you must be the bucket owner.
public getPolicy ( BucketData | string $bucketName ) : string
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат string Returns bucket policy string (json encoded)

getRequestPayment() публичный Метод

This implementation of the GET operation uses the requestPayment subresource to return the request payment configuration of a bucket.
public getRequestPayment ( BucketData | string $bucketName ) : string
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат string Returns XML document

getTagging() публичный Метод

This implementation of the GET operation uses the tagging subresource to return the tag set associated with the bucket.
public getTagging ( string $bucketName ) : string
$bucketName string A bucket name.
Результат string Returns XML document

getWebsite() публичный Метод

Returns the web configuration information for the bucket.
public getWebsite ( BucketData | string $bucketName ) : string
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат string Returns CORSConfiguration XML Document

isAllowed() публичный Метод

Cheks whether the bucket exists and it is allowed for user.
public isAllowed ( string $bucketName ) : boolean
$bucketName string A bucket name.
Результат boolean Returns TRUE if bucket does exist and user has permission to access it or false if not.

isExist() публичный Метод

Cheks whether the bucket exists.
public isExist ( string $bucketName ) : boolean
$bucketName string A bucket name.
Результат boolean Returns TRUE if bucket does exist or false if not.

listObjects() публичный Метод

This implementation of the GET operation returns some or all (up to 1000) of the objects in a bucket. You can use the request parameters as selection criteria to return a subset of the objects in a bucket. To use this implementation of the operation, you must have READ access to the bucket.
public listObjects ( string $bucketName, string $delimiter = null, string $marker = null, string $maxKeys = null, string $prefix = null ) : Scalr\Service\Aws\S3\DataType\ObjectList
$bucketName string A bucket Name.
$delimiter string optional A delimiter is a character you use to group keys. All keys that contain the same string between the prefix, if specified, and the first occurrence of the delimiter after the prefix are grouped under a single result element, CommonPrefixes. If you don't specify the prefix parameter, then the substring starts at the beginning of the key. The keys that are grouped under CommonPrefixes result element are not returned elsewhere in the response.
$marker string optional Specifies the key to start with when listing objects in a bucket. Amazon S3 lists objects in alphabetical order.
$maxKeys string optional Sets the maximum number of keys returned in the response body. The response might contain fewer keys but will never contain more. If there are additional keys that satisfy the search criteria but were not returned because max-keys was exceeded, the response contains true.To return the additional keys.
$prefix string optional Limits the response to keys that begin with the specified prefix. You can use prefixes to separate a bucket into different groupings of keys. (You can think of using prefix to make groups in the same way you'd use a folder in a file system.)
Результат Scalr\Service\Aws\S3\DataType\ObjectList Returns list of Objects

setAcl() публичный Метод

Sets bucket's ACL.
public setAcl ( string $bucketName, Scalr\Service\Aws\S3\DataType\AccessControlPolicyData | DOMDocument | string | array $aclset ) : boolean
$bucketName string A bucket name.
$aclset Scalr\Service\Aws\S3\DataType\AccessControlPolicyData | DOMDocument | string | array AccessControlPolicyData object or XML Document or array of x-amz headers
Результат boolean Returns True on success of false if failures.

setCors() публичный Метод

Sets the cors configuration for your bucket. If the configuration exists, Amazon S3 replaces it.
public setCors ( BucketData | string $bucketName, string $cors ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$cors string A XML document that defines Cors configuration.
Результат boolean Returns true on succes or false if failure.

setLifecycle() публичный Метод

Sets the lifecycle configuration for your bucket. If the configuration exists, Amazon S3 replaces it.
public setLifecycle ( BucketData | string $bucketName, string $lifecycle ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$lifecycle string A XML document that defines lifecycle configuration.
Результат boolean Returns true on succes or false if failure.

setLogging() публичный Метод

PUT Bucket logging action
public setLogging ( BucketData | string $bucketName, string $bucketLoggingStatus ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$bucketLoggingStatus string A XML Document which describes configuration
Результат boolean Returns true on succes or false if failure.

setNotification() публичный Метод

This implementation of the PUT operation uses the notification subresource to enable notifications of specified events for a bucket
public setNotification ( BucketData | string $bucketName, string $notification ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$notification string A XML Document which describes configuration
Результат boolean Returns true on succes or false if failure.

setPolicy() публичный Метод

This implementation of the GET operation uses the policy subresource to return the policy of a specified bucket. To use this operation, you must have GetPolicy permissions on the specified bucket, and you must be the bucket owner.
public setPolicy ( BucketData | string $bucketName, string $policy ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$policy string A JSON document that defines policy configuration.
Результат boolean Returns true on succes or false if failure.

setRequestPayment() публичный Метод

This implementation of the PUT operation uses the requestPayment subresource to set the request payment configuration of a bucket.
public setRequestPayment ( BucketData | string $bucketName, string $requestPayment ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$requestPayment string A XML Document which defines configuration
Результат boolean Returns true on succes or false if failure.

setTagging() публичный Метод

This implementation of the PUT operation uses the tagging subresource to add a set of tags to an existing bucket.
public setTagging ( BucketData | string $bucketName, string $tagging ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$tagging string A XML Document which defines configuration
Результат boolean Returns true on succes or false if failure.

setWebsite() публичный Метод

This implementation of the PUT operation uses the website subresource to set the request website configuration of a bucket.
public setWebsite ( BucketData | string $bucketName, string $website ) : boolean
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
$website string A XML Document which defines configuration
Результат boolean Returns true on succes or false if failure.