Amazon S3 PHP connection class
category | Zend |
---|---|
package | Zend_Service |
subpackage | Amazon_S3 |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
see | |
inherited_from | \Zend_Service_Amazon_Abstract |
__construct(string $accessKey= null
, string $secretKey= null
, string $region= null
)
inherited_from | \Zend_Service_Amazon_Abstract::__construct() |
---|
string
string
string
__construct($accessKey= null
, $secretKey= null
) : void
_makeRequest(string $method, string $path= ''
, array $params= null
, array $headers= array()
, string|resource $data= null
) : \Zend_Http_Response
string
Request method
string
Path to requested object
array
Request parameters
array
HTTP headers
string
resource
Request data
\Zend_Http_Response
_validBucketName(string $bucket) : boolean
string
boolean
cleanBucket(string $bucket) : boolean
string
boolean
copyObject(string $sourceObject, string $destObject, array $meta = null
) : boolean
string
Source object name
string
Destination object name
array
(OPTIONAL) Metadata to apply to desination object. Set to null to copy metadata from source object.
boolean
createBucket(string $bucket, $location = null
) : boolean
string
boolean
getBuckets() : array | false
array
false
getEndpoint() : \Zend_Uri_Http
\Zend_Uri_Http
getHttpClient() : \Zend_Http_Client
\Zend_Http_Client
getInfo(string $object) : array | false
string
array
false
getMimeType(string $path) : string
string
string
getObject(string $object, boolean $paidobject = false
) : string | false
string
boolean
This is "requestor pays" object
string
false
getObjectStream(string $object, string $streamfile= null
, boolean $paidobject= false
) : \Zend_Http_Response_Stream | false
Can use either provided filename for storage or create a temp file if none provided.
string
Object path
string
File to write the stream to
boolean
This is "requestor pays" object
\Zend_Http_Response_Stream
false
getObjectsAndPrefixesByBucket(string $bucket, array $params = array()
) : array | false
Provides the list of object keys and common prefixes that are contained in the bucket. Valid params include the following. prefix - Limits the response to keys which begin with the indicated prefix. You can use prefixes to separate a bucket into different sets of keys in a way similar to how a file system uses folders. marker - Indicates where in the bucket to begin listing. The list will only include keys that occur lexicographically after marker. This is convenient for pagination: To get the next page of results use the last key of the current page as the marker. max-keys - The maximum number of keys you'd like to see in the response body. The server might return fewer than this many keys, but will not return more. delimiter - Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response.
see |
---|
string
array
S3 GET Bucket Paramater
array
false
getObjectsByBucket(string $bucket, array $params = array()
) : array | false
Provides the list of object keys that are contained in the bucket. Valid params include the following. prefix - Limits the response to keys which begin with the indicated prefix. You can use prefixes to separate a bucket into different sets of keys in a way similar to how a file system uses folders. marker - Indicates where in the bucket to begin listing. The list will only include keys that occur lexicographically after marker. This is convenient for pagination: To get the next page of results use the last key of the current page as the marker. max-keys - The maximum number of keys you'd like to see in the response body. The server might return fewer than this many keys, but will not return more. delimiter - Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response.
string
array
S3 GET Bucket Paramater
array
false
getWrapperClient(string $name) : \Zend_Service_Amazon_S3
string
\Zend_Service_Amazon_S3
isBucketAvailable(string $bucket) : boolean
string
boolean
isObjectAvailable(string $object) : boolean
string
boolean
moveObject(string $sourceObject, string $destObject, array $meta = null
)
Performs a copy to dest + verify + remove source
string
Source object name
string
Destination object name
array
(OPTIONAL) Metadata to apply to destination object. Set to null to retain existing metadata.
putFile(string $path, string $object, array $meta = null
) : boolean
string
File name
string
Object name
array
Metadata
boolean
putFileStream(string $path, string $object, array $meta = null
) : boolean
string
File name
string
Object name
array
Metadata
boolean
putObject(string $object, string|resource $data, array $meta = null
) : boolean
string
Object name
string
resource
Object data (can be string or stream)
array
Metadata
boolean
registerAsClient(string $name) : \Zend_Service_Amazon_S3
string
\Zend_Service_Amazon_S3
registerStreamWrapper(string $name = 's3'
) : \Zend_Service_Amazon_S3
string
\Zend_Service_Amazon_S3
removeBucket(string $bucket) : boolean
string
boolean
removeObject(string $object) : boolean
string
boolean
setEndpoint(string|\Zend_Uri_Http $endpoint) : \Zend_Service_Amazon_S3
string
\Zend_Uri_Http
\Zend_Service_Amazon_S3
setHttpClient(\Zend_Http_Client $httpClient)
\Zend_Http_Client
setKeys($accessKey, $secretKey) : void
unregisterAsClient(string $name) : \Zend_Service_Amazon_S3
string
\Zend_Service_Amazon_S3
unregisterStreamWrapper(string $name = 's3'
) : \Zend_Service_Amazon_S3
string
\Zend_Service_Amazon_S3
_fixupObjectName(string $object) : string
string
string
_getAccessKey() : string
string
_getSecretKey() : string
string
addSignature(string $method, string $path, $headers) : string
string
string
string
$_accessKey : string
$_defaultAccessKey : string
null
$_defaultSecretKey : string
null
$_endpoint : \Zend_Uri_Http
$_httpClient : \Zend_Http_Client
null
$_secretKey : string
$_wrapperClients : array
array()
S3_ACL_AUTH_READ = 'authenticated-read'
S3_ACL_HEADER = 'x-amz-acl'
S3_ACL_PRIVATE = 'private'
S3_ACL_PUBLIC_READ = 'public-read'
S3_ACL_PUBLIC_WRITE = 'public-read-write'
S3_CONTENT_TYPE_HEADER = 'Content-Type'
S3_ENDPOINT = 's3.amazonaws.com'
S3_REQUESTPAY_HEADER = 'x-amz-request-payer'