PHP Класс Scalr\Service\Aws\S3\V20060301\S3Api

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

Защищенные свойства (Protected)

Свойство Тип Описание
$rangeHeaders
$s3 Scalr\Service\Aws\S3
$versiondate string
$xamzAclAllowedHeaders array List allowed x-amz headers for the ACL requests

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

Метод Описание
__construct ( Scalr\Service\Aws\S3 $s3, Scalr\Service\Aws\Client\QueryClient\S3QueryClient $client ) Constructor
addObject ( string $bucketName, string $objectName, string | SplFileInfo $contentFile, array $requestHeaders = null ) : Scalr\Service\Aws\Client\ClientResponseInterface PUT Object action
copyObject ( string $scrBucketName, string $srcObject, string $destBucketName, string $destObject, array $requestHeaders = null, string $versionId = null ) : CopyObjectResponseData Copy Object action
createBucket ( string $bucketName, string $bucketRegion, array $requestHeaders = null ) : BucketData Create Bucket action
deleteBucket ( string $bucketName ) : boolean DELETE Bucket
deleteBucketCors ( string $bucketName ) : boolean DELETE Bucket cors action
deleteBucketLifecycle ( string $bucketName ) : boolean DELETE Bucket lifecycle action
deleteBucketPolicy ( string $bucketName ) : boolean DELETE Bucket policy action
deleteBucketSubresource ( string $bucketName, string $subresource ) : boolean Deletes the specified subresource for the bucket.
deleteBucketTagging ( string $bucketName ) : boolean DELETE Bucket tagging action
deleteBucketWebsite ( string $bucketName ) : boolean DELETE Bucket website action
deleteObject ( string $bucketName, string $objectName, string $versionId = null, string $xAmfMfa = null ) : Scalr\Service\Aws\Client\ClientResponseInterface DELETE Object action.
getBucketAcl ( string $bucketName ) : Scalr\Service\Aws\S3\DataType\AccessControlPolicyData Gets a bucket ACL action.
getBucketCors ( string $bucketName ) : string GET Bucket cors action
getBucketLifecycle ( string $bucketName ) : string GET Bucket lifecycle action
getBucketLocation ( string $bucketName ) : string GET Bucket location action
getBucketLogging ( string $bucketName ) : string GET Bucket logging action
getBucketNotification ( string $bucketName ) : string GET Bucket notification action
getBucketPolicy ( string $bucketName ) : string GET Bucket policy action
getBucketRequestPayment ( string $bucketName ) : string GET Bucket requestPayment action
getBucketSubresource ( string $bucketName, string $subresource ) : Scalr\Service\Aws\Client\ClientResponseInterface Gets a specified bucket subresource
getBucketTagging ( string $bucketName ) : string GET Bucket tagging action
getBucketWebsite ( BucketData | string $bucketName ) : string Returns the web configuration information for the bucket.
getEntityManager ( ) : Scalr\Service\Aws\EntityManager Gets an entity manager
getObject ( string $bucketName, string $objectName, array $requestPars = null, array $requestHeaders = null ) : Scalr\Service\Aws\Client\ClientResponseInterface Gets an object
getObjectAcl ( string $bucketName, string $objectName ) : Scalr\Service\Aws\S3\DataType\AccessControlPolicyData Gets a object ACL action.
getObjectMetadata ( string $bucketName, string $objectName, array $requestHeaders = null ) : Scalr\Service\Aws\Client\ClientResponseInterface HEAD Object action
headBucket ( string $bucketName ) : integer HEAD Bucket action.
listAllMyBuckets ( ) : Scalr\Service\Aws\S3\DataType\BucketList GET Service (ListAllMyBuckets) 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
setBucketAcl ( string $bucketName, string | array $aclset ) : boolean PUT Bucket ACL action.
setBucketCors ( string $bucketName, string $cors ) : boolean PUT Bucket cors action
setBucketLifecycle ( string $bucketName, string $lifecycle ) : boolean PUT Bucket lifecycle action
setBucketLogging ( string $bucketName, string $bucketLoggingStatus ) : boolean PUT Bucket logging action
setBucketNotification ( string $bucketName, string $notification ) : boolean PUT Bucket notification action
setBucketPolicy ( string $bucketName, string $policy ) : boolean PUT Bucket policy action
setBucketRequestPayment ( string $bucketName, string $requestPayment ) : boolean PUT Bucket requestPayment action
setBucketSubresource ( string $bucketName, string $subresource, string $putData ) : boolean Puts bucket subresource
setBucketTagging ( string $bucketName, string $tagging ) : boolean PUT Bucket tagging action
setBucketWebsite ( string $bucketName, string $website ) : boolean PUT Bucket website action
setObjectAcl ( string $bucketName, string $objectName, string | array $aclset ) : boolean PUT Object ACL action.

Защищенные методы

Метод Описание
_getBucketLocationXml ( string $bucketRegion ) : string Gets Location XML string
escapeObjectName ( string $objectName ) : string Escapes object name
getFilteredArray ( array $allowedKeys, array $values, boolean $caseInsensitive = true ) : array Filter values with allowed keys.
getFormattedXml ( string $xml ) : string Formats output for the given xml document

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

__construct() публичный метод

Constructor
public __construct ( Scalr\Service\Aws\S3 $s3, Scalr\Service\Aws\Client\QueryClient\S3QueryClient $client )
$s3 Scalr\Service\Aws\S3 S3 instance
$client Scalr\Service\Aws\Client\QueryClient\S3QueryClient Client Interface

_getBucketLocationXml() защищенный метод

Gets Location XML string
protected _getBucketLocationXml ( string $bucketRegion ) : string
$bucketRegion string A bucket region
Результат string Returns Location XML

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 ( string $bucketName, string $objectName, string | SplFileInfo $contentFile, array $requestHeaders = null ) : Scalr\Service\Aws\Client\ClientResponseInterface
$bucketName 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

copyObject() публичный метод

This implementation of the PUT operation creates a copy of an object that is already stored in Amazon S3. A PUT copy operation is the same as performing a GET and then a PUT
public copyObject ( string $scrBucketName, string $srcObject, string $destBucketName, string $destObject, array $requestHeaders = null, string $versionId = null ) : CopyObjectResponseData
$scrBucketName string Source bucket name.
$srcObject string Source object name.
$destBucketName string Destination bucket name.
$destObject string Destination object name.
$requestHeaders array optional Request headers array looks like array(header => value)
$versionId string optional Specifies source version id.
Результат Scalr\Service\Aws\S3\DataType\CopyObjectResponseData Returns CopyObjectResponseData

createBucket() публичный метод

Creates a new bucket belonging to the account of the authenticated request sender.
public createBucket ( string $bucketName, string $bucketRegion, array $requestHeaders = null ) : BucketData
$bucketName string A bucket name.
$bucketRegion string 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.

deleteBucket() публичный метод

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 deleteBucket ( string $bucketName ) : boolean
$bucketName string A bucket name.
Результат boolean Returns true on success or throws an exception.

deleteBucketCors() публичный метод

Deletes the cors configuration information set for the bucket.
public deleteBucketCors ( string $bucketName ) : boolean
$bucketName string A bucket name.
Результат boolean Returns true on success or throws an exception.

deleteBucketLifecycle() публичный метод

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 deleteBucketLifecycle ( string $bucketName ) : boolean
$bucketName string A bucket name.
Результат boolean Returns true on success or throws an exception.

deleteBucketPolicy() публичный метод

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 deleteBucketPolicy ( string $bucketName ) : boolean
$bucketName string A bucket name.
Результат boolean Returns true on success or throws an exception.

deleteBucketSubresource() публичный метод

Deletes the specified subresource for the bucket.
public deleteBucketSubresource ( string $bucketName, string $subresource ) : boolean
$bucketName string A bucket name.
$subresource string A subresource name.
Результат boolean Returns true on success or throws an exception.

deleteBucketTagging() публичный метод

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 deleteBucketTagging ( string $bucketName ) : boolean
$bucketName string A bucket name.
Результат boolean Returns true on success or throws an exception.

deleteBucketWebsite() публичный метод

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 deleteBucketWebsite ( string $bucketName ) : boolean
$bucketName 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 ( string $bucketName, string $objectName, string $versionId = null, string $xAmfMfa = null ) : Scalr\Service\Aws\Client\ClientResponseInterface
$bucketName 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

escapeObjectName() защищенный статический метод

Escapes object name
protected static escapeObjectName ( string $objectName ) : string
$objectName string
Результат string Returns objectName without leading slash and url encoded

getBucketAcl() публичный метод

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 getBucketAcl ( 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.

getBucketCors() публичный метод

Returns the cors configuration information set for the bucket.
public getBucketCors ( string $bucketName ) : string
$bucketName string A bucket name.
Результат string Returns CORSConfiguration XML Document

getBucketLifecycle() публичный метод

Returns the lifecycle configuration information set on the bucket.
public getBucketLifecycle ( string $bucketName ) : string
$bucketName string A bucket name.
Результат string Returns LifecycleConfiguration XML Document

getBucketLocation() публичный метод

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 getBucketLocation ( string $bucketName ) : string
$bucketName 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)

getBucketLogging() публичный метод

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 getBucketLogging ( string $bucketName ) : string
$bucketName string A bucket name.
Результат string Returns XML document

getBucketNotification() публичный метод

This implementation of the GET operation uses the notification subresource to return the notification configuration of a bucket.
public getBucketNotification ( string $bucketName ) : string
$bucketName string A bucket name.
Результат string Returns XML document

getBucketPolicy() публичный метод

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 getBucketPolicy ( string $bucketName ) : string
$bucketName string A bucket name.
Результат string Returns bucket policy string (json encoded)

getBucketRequestPayment() публичный метод

This implementation of the GET operation uses the requestPayment subresource to return the request payment configuration of a bucket.
public getBucketRequestPayment ( string $bucketName ) : string
$bucketName string A bucket name.
Результат string Returns XML document

getBucketSubresource() публичный метод

Gets a specified bucket subresource
public getBucketSubresource ( string $bucketName, string $subresource ) : Scalr\Service\Aws\Client\ClientResponseInterface
$bucketName string A bucket name.
$subresource string A bucket subresource name.
Результат Scalr\Service\Aws\Client\ClientResponseInterface Returns response

getBucketTagging() публичный метод

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

getBucketWebsite() публичный метод

This implementation of the GET operation returns the website configuration associated with a bucket. To host website on Amazon S3, you can configure a bucket as website by adding a website configuration.
public getBucketWebsite ( BucketData | string $bucketName ) : string
$bucketName Scalr\Service\Aws\S3\DataType\BucketData | string A bucket name.
Результат string Returns CORSConfiguration XML Document

getEntityManager() публичный метод

Gets an entity manager
public getEntityManager ( ) : Scalr\Service\Aws\EntityManager
Результат Scalr\Service\Aws\EntityManager

getFilteredArray() защищенный статический метод

Filter values with allowed keys.
protected static getFilteredArray ( array $allowedKeys, array $values, boolean $caseInsensitive = true ) : array
$allowedKeys array An list of allowed keys.
$values array An associative array of the values looks like array(key => val).
$caseInsensitive boolean optional Case Insencitive comparison
Результат array Returns filtered array.

getFormattedXml() защищенный статический метод

Formats output for the given xml document
protected static getFormattedXml ( string $xml ) : string
$xml string XML Document
Результат string Returns formatted xml document

getObject() публичный метод

This implementation of the GET operation retrieves objects from Amazon S3. To use GET, you must have READ access to the object. If you grant READ access to the anonymous user, you can return the object without using an authorization header.
public getObject ( string $bucketName, string $objectName, array $requestPars = null, array $requestHeaders = null ) : Scalr\Service\Aws\Client\ClientResponseInterface
$bucketName string An bucket name.
$objectName string An object key name.
$requestPars array optional An additional request query parameters. It accepts only allowed params.
$requestHeaders array opitional An optional request headers. It accepts only allowed headers.
Результат Scalr\Service\Aws\Client\ClientResponseInterface Returns response

getObjectAcl() публичный метод

This implementation of the GET operation uses the acl subresource to return the access control list (ACL) of an object. To use this operation, you must have READ_ACP access to the object.
public getObjectAcl ( string $bucketName, string $objectName ) : Scalr\Service\Aws\S3\DataType\AccessControlPolicyData
$bucketName string A bucket name.
$objectName string An object name.
Результат Scalr\Service\Aws\S3\DataType\AccessControlPolicyData Returns object which describes ACL for the object.

getObjectMetadata() публичный метод

The HEAD operation retrieves metadata from an object without returning the object itself. This operation is useful if you're only interested in an object's metadata. To use HEAD, you must have READ access to the object. A HEAD request has the same options as a GET operation on an object. The response is identical to the GET response, except that there is no response body.
public getObjectMetadata ( string $bucketName, string $objectName, array $requestHeaders = null ) : Scalr\Service\Aws\Client\ClientResponseInterface
$bucketName string A bucket name.
$objectName string An object name.
$requestHeaders array optional Range headers looks like array(header => value)
Результат Scalr\Service\Aws\Client\ClientResponseInterface Returns response object on success or throws an exception

headBucket() публичный метод

This operation is useful to determine if a bucket exists and you have permission to access it. The operation returns a 200 OK if the bucket exists and you have permission to access it. Otherwise, the operation might return responses such as 404 Not Found and 403 Forbidden.
public headBucket ( string $bucketName ) : integer
$bucketName string A bucket name.
Результат integer Returns 200, 404 or 403 depends on bucket state.

listAllMyBuckets() публичный метод

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

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

setBucketAcl() публичный метод

PUT Bucket ACL action.
public setBucketAcl ( string $bucketName, string | array $aclset ) : boolean
$bucketName string A bucket name.
$aclset string | array XML Document or array of x-amz headers
Результат boolean Returns True on success of false if failures.

setBucketCors() публичный метод

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

setBucketLifecycle() публичный метод

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

setBucketLogging() публичный метод

PUT Bucket logging action
public setBucketLogging ( string $bucketName, string $bucketLoggingStatus ) : boolean
$bucketName string A bucket name.
$bucketLoggingStatus string A XML Document which describes configuration
Результат boolean Returns true on succes or false if failure.

setBucketNotification() публичный метод

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

setBucketPolicy() публичный метод

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 setBucketPolicy ( string $bucketName, string $policy ) : boolean
$bucketName string A bucket name.
$policy string A JSON document that defines policy configuration.
Результат boolean Returns true on succes or false if failure.

setBucketRequestPayment() публичный метод

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

setBucketSubresource() публичный метод

Puts bucket subresource
public setBucketSubresource ( string $bucketName, string $subresource, string $putData ) : boolean
$bucketName string A bucket name.
$subresource string A subresource name.
$putData string Put data. (xml or json formatted string, depends on subresource configuration)
Результат boolean Returns true on success or false if failure

setBucketTagging() публичный метод

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

setBucketWebsite() публичный метод

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

setObjectAcl() публичный метод

PUT Object ACL action.
public setObjectAcl ( string $bucketName, string $objectName, string | array $aclset ) : boolean
$bucketName string A bucket name.
$objectName string A bucket name.
$aclset string | array XML Document or array of x-amz headers
Результат boolean Returns True on success of false if failures.

Описание свойств

$rangeHeaders защищенное статическое свойство

protected static $rangeHeaders

$s3 защищенное свойство

protected S3,Scalr\Service\Aws $s3
Результат Scalr\Service\Aws\S3

$versiondate защищенное свойство

protected string $versiondate
Результат string

$xamzAclAllowedHeaders защищенное статическое свойство

List allowed x-amz headers for the ACL requests
protected static array $xamzAclAllowedHeaders
Результат array