Service/Amazon/S3.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Service
- Subpackage
- Amazon_S3
- Version
- $Id$
\Zend_Service_Amazon_S3
- Parent(s)
- \Zend_Service_Amazon_Abstract < \Zend_Service_Abstract
- See
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties
Methods
__construct(string $accessKey = null, string $secretKey = null, string $region = null) : void
Constructor
Name | Type | Description |
---|---|---|
$accessKey | string | |
$secretKey | string | |
$region | string |
_fixupObjectName(string $object) : string
Make sure the object name is valid
Name | Type | Description |
---|---|---|
$object | string |
Type | Description |
---|---|
string |
_makeRequest(string $method, string $path = '', array $params = null, array $headers = array(), string | resource $data = null) : \Zend_Http_Response
Make a request to Amazon S3
Name | Type | Description |
---|---|---|
$method | string | Request method |
$path | string | Path to requested object |
$params | array | Request parameters |
$headers | array | HTTP headers |
$data | string | resource | Request data |
Type | Description |
---|---|
\Zend_Http_Response |
_validBucketName(string $bucket) : boolean
Verify if the bucket name is valid
Name | Type | Description |
---|---|---|
$bucket | string |
Type | Description |
---|---|
boolean |
addSignature(string $method, string $path, $headers) : string
Add the S3 Authorization signature to the request headers
Name | Type | Description |
---|---|---|
$method | string | |
$path | string | |
$headers |
Type | Description |
---|---|
string |
cleanBucket(string $bucket) : boolean
Remove all objects in the bucket.
Name | Type | Description |
---|---|---|
$bucket | string |
Type | Description |
---|---|
boolean |
copyObject(string $sourceObject, string $destObject, array $meta = null) : boolean
Copy an object
Name | Type | Description |
---|---|---|
$sourceObject | string | Source object name |
$destObject | string | Destination object name |
$meta | array | (OPTIONAL) Metadata to apply to desination object.
|
Type | Description |
---|---|
boolean |
createBucket(string $bucket, $location = null) : boolean
Add a new bucket
Name | Type | Description |
---|---|---|
$bucket | string | |
$location |
Type | Description |
---|---|
boolean |
getInfo(string $object) : array | false
Get metadata information for a given object
Name | Type | Description |
---|---|---|
$object | string |
Type | Description |
---|---|
array | false |
getMimeType(string $path) : string
Attempt to get the content-type of a file based on the extension
Name | Type | Description |
---|---|---|
$path | string |
Type | Description |
---|---|
string |
getObject(string $object, bool $paidobject = false) : string | false
Get an object
Name | Type | Description |
---|---|---|
$object | string | |
$paidobject | bool | This is "requestor pays" object |
Type | Description |
---|---|
string | false |
getObjectStream(string $object, string $streamfile = null, bool $paidobject = false) : \Zend_Http_Response_Stream | false
Get an object using streaming
Name | Type | Description |
---|---|---|
$object | string | Object path |
$streamfile | string | File to write the stream to |
$paidobject | bool | This is "requestor pays" object |
Type | Description |
---|---|
\Zend_Http_Response_Stream | false |
getObjectsAndPrefixesByBucket(string $bucket, array $params = array()) : array | false
List the objects and common prefixes in a bucket.
Name | Type | Description |
---|---|---|
$bucket | string | |
$params | array | S3 GET Bucket Paramater |
Type | Description |
---|---|
array | false |
getObjectsByBucket(string $bucket, array $params = array()) : array | false
List the objects in a bucket.
Name | Type | Description |
---|---|---|
$bucket | string | |
$params | array | S3 GET Bucket Paramater |
Type | Description |
---|---|
array | false |
getWrapperClient(string $name) : \Zend_Service_Amazon_S3
Get wrapper client for stream type
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_Service_Amazon_S3 |
isBucketAvailable(string $bucket) : boolean
Checks if a given bucket name is available
Name | Type | Description |
---|---|---|
$bucket | string |
Type | Description |
---|---|
boolean |
isObjectAvailable(string $object) : boolean
Checks if a given object exists
Name | Type | Description |
---|---|---|
$object | string |
Type | Description |
---|---|
boolean |
moveObject(string $sourceObject, string $destObject, array $meta = null) : void
Move an object
Name | Type | Description |
---|---|---|
$sourceObject | string | Source object name |
$destObject | string | Destination object name |
$meta | array | (OPTIONAL) Metadata to apply to destination object.
|
putFile(string $path, string $object, array $meta = null) : boolean
Put file to S3 as object
Name | Type | Description |
---|---|---|
$path | string | File name |
$object | string | Object name |
$meta | array | Metadata |
Type | Description |
---|---|
boolean |
putFileStream(string $path, string $object, array $meta = null) : boolean
Put file to S3 as object, using streaming
Name | Type | Description |
---|---|---|
$path | string | File name |
$object | string | Object name |
$meta | array | Metadata |
Type | Description |
---|---|
boolean |
putObject(string $object, string | resource $data, array $meta = null) : boolean
Upload an object by a PHP string
Name | Type | Description |
---|---|---|
$object | string | Object name |
$data | string | resource | Object data (can be string or stream) |
$meta | array | Metadata |
Type | Description |
---|---|
boolean |
registerAsClient(string $name) : \Zend_Service_Amazon_S3
Register this object as stream wrapper client
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_Service_Amazon_S3 |
registerStreamWrapper(string $name = 's3') : \Zend_Service_Amazon_S3
Register this object as stream wrapper
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_Service_Amazon_S3 |
removeBucket(string $bucket) : boolean
Remove a given bucket. All objects in the bucket must be removed prior to removing the bucket.
Name | Type | Description |
---|---|---|
$bucket | string |
Type | Description |
---|---|
boolean |
removeObject(string $object) : boolean
Remove a given object
Name | Type | Description |
---|---|---|
$object | string |
Type | Description |
---|---|
boolean |
setEndpoint(string | \Zend_Uri_Http $endpoint) : \Zend_Service_Amazon_S3
Set S3 endpoint to use
Name | Type | Description |
---|---|---|
$endpoint | string | \Zend_Uri_Http |
Type | Description |
---|---|
\Zend_Service_Amazon_S3 |
unregisterAsClient(string $name) : \Zend_Service_Amazon_S3
Unregister this object as stream wrapper client
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_Service_Amazon_S3 |
unregisterStreamWrapper(string $name = 's3') : \Zend_Service_Amazon_S3
Unregister this object as stream wrapper
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_Service_Amazon_S3 |