Class Zend_Service_Amazon_S3

Description

Amazon S3 PHP connection class

Located in /Service/Amazon/S3.php (line 43)

Zend_Service_Abstract
   |
   --Zend_Service_Amazon_Abstract
      |
      --Zend_Service_Amazon_S3
Class Constant Summary
 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'
Variable Summary
Method Summary
 static string getMimeType (string $path)
 static Zend_Service_Amazon_S3 getWrapperClient (string $name)
 Zend_Service_Amazon_S3 __construct ([string $accessKey = null], [string $secretKey = null], [string $region = null])
 string addSignature (string $method, string $path, array &$headers)
 boolean cleanBucket (string $bucket)
 boolean createBucket (string $bucket, [ $location = null])
 array|false getBuckets ()
 array|false getInfo (string $object)
 string|false getObject (string $object, [bool $paidobject = false])
 array|false getObjectsByBucket (string $bucket, [array $params = array()])
 Zend_Http_Response_Stream|false getObjectStream (string $object, [string $streamfile = null], [bool $paidobject = false])
 boolean isBucketAvailable (string $bucket)
 boolean isObjectAvailable (string $object)
 boolean putFile (string $path, string $object, [array $meta = null])
 boolean putFileStream (string $path, string $object, [array $meta = null])
 boolean putObject (string $object, string|resource $data, [array $meta = null])
 boolean removeBucket (string $bucket)
 boolean removeObject (string $object)
 string _fixupObjectName (string $object)
 Zend_Http_Response _makeRequest (string $method, [string $path = ''], [array $params = null], [array $headers = array()], [string|resource $data = null])
 boolean _validBucketName (string $bucket)
Variables
static array $_wrapperClients = array() (line 50)

Store for stream wrapper clients

  • access: protected
Zend_Uri_Http $_endpoint (line 57)

Endpoint for the service

  • access: protected

Inherited Variables

Inherited from Zend_Service_Amazon_Abstract

Zend_Service_Amazon_Abstract::$_accessKey
Zend_Service_Amazon_Abstract::$_defaultAccessKey
Zend_Service_Amazon_Abstract::$_defaultSecretKey
Zend_Service_Amazon_Abstract::$_secretKey

Inherited from Zend_Service_Abstract

Zend_Service_Abstract::$_httpClient
Methods
static getMimeType (line 681)

Attempt to get the content-type of a file based on the extension

  • access: public
static string getMimeType (string $path)
  • string $path
static getWrapperClient (line 867)

Get wrapper client for stream type

  • access: public
static Zend_Service_Amazon_S3 getWrapperClient (string $name)
  • string $name
Constructor __construct (line 109)

Constructor

  • access: public
Zend_Service_Amazon_S3 __construct ([string $accessKey = null], [string $secretKey = null], [string $region = null])
  • string $accessKey
  • string $secretKey
  • string $region

Redefinition of:
Zend_Service_Amazon_Abstract::__construct()
Create Amazon client.
addSignature (line 610)

Add the S3 Authorization signature to the request headers

  • access: protected
string addSignature (string $method, string $path, array &$headers)
  • string $method
  • string $path
  • array &$headers
cleanBucket (line 268)

Remove all objects in the bucket.

  • access: public
boolean cleanBucket (string $bucket)
  • string $bucket
createBucket (line 157)

Add a new bucket

  • access: public
boolean createBucket (string $bucket, [ $location = null])
  • string $bucket
  • $location
getBuckets (line 244)

List the S3 buckets

  • access: public
array|false getBuckets ()
getEndpoint (line 97)

Get current S3 endpoint

  • access: public
Zend_Uri_Http getEndpoint ()
getInfo (line 219)

Get metadata information for a given object

  • access: public
array|false getInfo (string $object)
  • string $object
getObject (line 343)

Get an object

  • access: public
string|false getObject (string $object, [bool $paidobject = false])
  • string $object
  • bool $paidobject: This is "requestor pays" object
getObjectsByBucket (line 294)

List the objects in a bucket.

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.

  • access: public
array|false getObjectsByBucket (string $bucket, [array $params = array()])
  • string $bucket
  • array $params: S3 GET Bucket Paramater
getObjectStream (line 370)

Get an object using streaming

Can use either provided filename for storage or create a temp file if none provided.

  • access: public
Zend_Http_Response_Stream|false getObjectStream (string $object, [string $streamfile = null], [bool $paidobject = false])
  • string $object: Object path
  • string $streamfile: File to write the stream to
  • bool $paidobject: This is "requestor pays" object
isBucketAvailable (line 178)

Checks if a given bucket name is available

  • access: public
boolean isBucketAvailable (string $bucket)
  • string $bucket
isObjectAvailable (line 191)

Checks if a given object exists

  • access: public
boolean isObjectAvailable (string $object)
  • string $object
putFile (line 434)

Put file to S3 as object

  • access: public
boolean putFile (string $path, string $object, [array $meta = null])
  • string $path: File name
  • string $object: Object name
  • array $meta: Metadata
putFileStream (line 464)

Put file to S3 as object, using streaming

  • access: public
boolean putFileStream (string $path, string $object, [array $meta = null])
  • string $path: File name
  • string $object: Object name
  • array $meta: Metadata
putObject (line 397)

Upload an object by a PHP string

  • access: public
boolean putObject (string $object, string|resource $data, [array $meta = null])
  • string $object: Object name
  • string|resource $data: Object data (can be string or stream)
  • array $meta: Metadata
registerAsClient (line 843)

Register this object as stream wrapper client

  • access: public
Zend_Service_Amazon_S3 registerAsClient (string $name)
  • string $name
registerStreamWrapper (line 878)

Register this object as stream wrapper

  • access: public
Zend_Service_Amazon_S3 registerStreamWrapper ([string $name = 's3'])
  • string $name
removeBucket (line 205)

Remove a given bucket. All objects in the bucket must be removed prior to removing the bucket.

  • access: public
boolean removeBucket (string $bucket)
  • string $bucket
removeObject (line 496)

Remove a given object

  • access: public
boolean removeObject (string $object)
  • string $object
setEndpoint (line 76)

Set S3 endpoint to use

  • access: public
Zend_Service_Amazon_S3 setEndpoint (string|Zend_Uri_Http $endpoint)
unregisterAsClient (line 855)

Unregister this object as stream wrapper client

  • access: public
Zend_Service_Amazon_S3 unregisterAsClient (string $name)
  • string $name
unregisterStreamWrapper (line 895)

Unregister this object as stream wrapper

  • access: public
Zend_Service_Amazon_S3 unregisterStreamWrapper ([string $name = 's3'])
  • string $name
_fixupObjectName (line 322)

Make sure the object name is valid

  • access: protected
string _fixupObjectName (string $object)
  • string $object
_makeRequest (line 515)

Make a request to Amazon S3

  • access: public
Zend_Http_Response _makeRequest (string $method, [string $path = ''], [array $params = null], [array $headers = array()], [string|resource $data = null])
  • string $method: Request method
  • string $path: Path to requested object
  • array $params: Request parameters
  • array $headers: HTTP headers
  • string|resource $data: Request data
_validBucketName (line 122)

Verify if the bucket name is valid

  • access: public
boolean _validBucketName (string $bucket)
  • string $bucket

Inherited Methods

Inherited From Zend_Service_Amazon_Abstract

 Zend_Service_Amazon_Abstract::__construct()
 Zend_Service_Amazon_Abstract::setKeys()
 Zend_Service_Amazon_Abstract::_getAccessKey()
 Zend_Service_Amazon_Abstract::_getSecretKey()

Inherited From Zend_Service_Abstract

 Zend_Service_Abstract::getHttpClient()
 Zend_Service_Abstract::setHttpClient()
Class Constants
S3_ACL_AUTH_READ = 'authenticated-read' (line 64)
S3_ACL_HEADER = 'x-amz-acl' (line 67)
S3_ACL_PRIVATE = 'private' (line 61)
S3_ACL_PUBLIC_READ = 'public-read' (line 62)
S3_ACL_PUBLIC_WRITE = 'public-read-write' (line 63)
S3_CONTENT_TYPE_HEADER = 'Content-Type' (line 68)
S3_ENDPOINT = 's3.amazonaws.com' (line 59)
S3_REQUESTPAY_HEADER = 'x-amz-request-payer' (line 66)

Documentation generated on Mon, 21 Jun 2010 15:43:22 -0400 by phpDocumentor 1.4.3