Moodle  2.2.1
http://www.collinsharper.com
Zend_Service_Amazon_S3 Class Reference
Inheritance diagram for Zend_Service_Amazon_S3:
Collaboration diagram for Zend_Service_Amazon_S3:

Public Member Functions

 setEndpoint ($endpoint)
 getEndpoint ()
 __construct ($accessKey=null, $secretKey=null, $region=null)
 _validBucketName ($bucket)
 createBucket ($bucket, $location=null)
 isBucketAvailable ($bucket)
 isObjectAvailable ($object)
 removeBucket ($bucket)
 getInfo ($object)
 getBuckets ()
 cleanBucket ($bucket)
 getObjectsByBucket ($bucket, $params=array())
 getObject ($object, $paidobject=false)
 getObjectStream ($object, $streamfile=null, $paidobject=false)
 putObject ($object, $data, $meta=null)
 putFile ($path, $object, $meta=null)
 putFileStream ($path, $object, $meta=null)
 removeObject ($object)
 _makeRequest ($method, $path='', $params=null, $headers=array(), $data=null)
 registerAsClient ($name)
 unregisterAsClient ($name)
 registerStreamWrapper ($name='s3')
 unregisterStreamWrapper ($name='s3')

Static Public Member Functions

static getMimeType ($path)
static getWrapperClient ($name)

Data Fields

const S3_ENDPOINT = 's3.amazonaws.com'
const S3_ACL_PRIVATE = 'private'
const S3_ACL_PUBLIC_READ = 'public-read'
const S3_ACL_PUBLIC_WRITE = 'public-read-write'
const S3_ACL_AUTH_READ = 'authenticated-read'
const S3_REQUESTPAY_HEADER = 'x-amz-request-payer'
const S3_ACL_HEADER = 'x-amz-acl'
const S3_CONTENT_TYPE_HEADER = 'Content-Type'

Protected Member Functions

 _fixupObjectName ($object)
 addSignature ($method, $path, &$headers)

Protected Attributes

 $_endpoint

Static Protected Attributes

static $_wrapperClients = array()

Detailed Description

Definition at line 43 of file S3.php.


Constructor & Destructor Documentation

__construct ( accessKey = null,
secretKey = null,
region = null 
)

Constructor

Parameters:
string$accessKey
string$secretKey
string$region

Definition at line 109 of file S3.php.

Here is the call graph for this function:


Member Function Documentation

_fixupObjectName ( object) [protected]

Make sure the object name is valid

Parameters:
string$object
Returns:
string

Definition at line 322 of file S3.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_makeRequest ( method,
path = '',
params = null,
headers = array(),
data = null 
)

Make a request to Amazon S3

Parameters:
string$methodRequest method
string$pathPath to requested object
array$paramsRequest parameters
array$headersHTTP headers
string | resource$dataRequest data
Returns:
Zend_Http_Response
See also:
Zend_Service_Amazon_S3_Exception

Definition at line 515 of file S3.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validBucketName ( bucket)

Verify if the bucket name is valid

Parameters:
string$bucket
Returns:
boolean
See also:
Zend_Service_Amazon_S3_Exception
Zend_Service_Amazon_S3_Exception
Zend_Service_Amazon_S3_Exception

Definition at line 122 of file S3.php.

Here is the caller graph for this function:

addSignature ( method,
path,
&$  headers 
) [protected]

Add the S3 Authorization signature to the request headers

Parameters:
string$method
string$path
array&$headers
Returns:
string

Definition at line 610 of file S3.php.

Here is the call graph for this function:

Here is the caller graph for this function:

cleanBucket ( bucket)

Remove all objects in the bucket.

Parameters:
string$bucket
Returns:
boolean

Definition at line 268 of file S3.php.

Here is the call graph for this function:

createBucket ( bucket,
location = null 
)

Add a new bucket

Parameters:
string$bucket
Returns:
boolean

Definition at line 157 of file S3.php.

Here is the call graph for this function:

List the S3 buckets

Returns:
array|false

Definition at line 244 of file S3.php.

Here is the call graph for this function:

Get current S3 endpoint

Returns:
Zend_Uri_Http

Definition at line 97 of file S3.php.

getInfo ( object)

Get metadata information for a given object

Parameters:
string$object
Returns:
array|false

Definition at line 219 of file S3.php.

Here is the call graph for this function:

static getMimeType ( path) [static]

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

Parameters:
string$path
Returns:
string

Definition at line 681 of file S3.php.

Here is the caller graph for this function:

getObject ( object,
paidobject = false 
)

Get an object

Parameters:
string$object
bool$paidobjectThis is "requestor pays" object
Returns:
string|false

Definition at line 343 of file S3.php.

Here is the call graph for this function:

getObjectsByBucket ( bucket,
params = array() 
)

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.

Parameters:
string$bucket
array$paramsS3 GET Bucket Paramater
Returns:
array|false

Definition at line 294 of file S3.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getObjectStream ( object,
streamfile = null,
paidobject = false 
)

Get an object using streaming

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

Parameters:
string$objectObject path
string$streamfileFile to write the stream to
bool$paidobjectThis is "requestor pays" object
Returns:
Zend_Http_Response_Stream|false

Definition at line 370 of file S3.php.

Here is the call graph for this function:

static getWrapperClient ( name) [static]

Get wrapper client for stream type

Parameters:
string$name
Returns:
Zend_Service_Amazon_S3

Definition at line 867 of file S3.php.

Here is the caller graph for this function:

isBucketAvailable ( bucket)

Checks if a given bucket name is available

Parameters:
string$bucket
Returns:
boolean

Definition at line 178 of file S3.php.

Here is the call graph for this function:

isObjectAvailable ( object)

Checks if a given object exists

Parameters:
string$object
Returns:
boolean

Definition at line 191 of file S3.php.

Here is the call graph for this function:

putFile ( path,
object,
meta = null 
)

Put file to S3 as object

Parameters:
string$pathFile name
string$objectObject name
array$metaMetadata
Returns:
boolean
See also:
Zend_Service_Amazon_S3_Exception

Definition at line 434 of file S3.php.

Here is the call graph for this function:

putFileStream ( path,
object,
meta = null 
)

Put file to S3 as object, using streaming

Parameters:
string$pathFile name
string$objectObject name
array$metaMetadata
Returns:
boolean
See also:
Zend_Service_Amazon_S3_Exception

Definition at line 464 of file S3.php.

Here is the call graph for this function:

putObject ( object,
data,
meta = null 
)

Upload an object by a PHP string

Parameters:
string$objectObject name
string | resource$dataObject data (can be string or stream)
array$metaMetadata
Returns:
boolean

Definition at line 397 of file S3.php.

Here is the call graph for this function:

Here is the caller graph for this function:

registerAsClient ( name)

Register this object as stream wrapper client

Parameters:
string$name
Returns:
Zend_Service_Amazon_S3

Definition at line 843 of file S3.php.

Here is the caller graph for this function:

registerStreamWrapper ( name = 's3')

Register this object as stream wrapper

Parameters:
string$name
Returns:
Zend_Service_Amazon_S3
See also:
Zend_Service_Amazon_S3_Stream

Definition at line 878 of file S3.php.

Here is the call graph for this function:

removeBucket ( bucket)

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

Parameters:
string$bucket
Returns:
boolean

Definition at line 205 of file S3.php.

Here is the call graph for this function:

removeObject ( object)

Remove a given object

Parameters:
string$object
Returns:
boolean

Definition at line 496 of file S3.php.

Here is the call graph for this function:

Here is the caller graph for this function:

setEndpoint ( endpoint)

Set S3 endpoint to use

Parameters:
string | Zend_Uri_Http$endpoint
Returns:
Zend_Service_Amazon_S3
See also:
Zend_Service_Amazon_S3_Exception

Definition at line 76 of file S3.php.

Here is the call graph for this function:

Here is the caller graph for this function:

unregisterAsClient ( name)

Unregister this object as stream wrapper client

Parameters:
string$name
Returns:
Zend_Service_Amazon_S3

Definition at line 855 of file S3.php.

Here is the caller graph for this function:

unregisterStreamWrapper ( name = 's3')

Unregister this object as stream wrapper

Parameters:
string$name
Returns:
Zend_Service_Amazon_S3

Definition at line 895 of file S3.php.

Here is the call graph for this function:


Field Documentation

$_endpoint [protected]

Definition at line 57 of file S3.php.

$_wrapperClients = array() [static, protected]

Definition at line 50 of file S3.php.

const S3_ACL_AUTH_READ = 'authenticated-read'

Definition at line 64 of file S3.php.

const S3_ACL_HEADER = 'x-amz-acl'

Definition at line 67 of file S3.php.

const S3_ACL_PRIVATE = 'private'

Definition at line 61 of file S3.php.

const S3_ACL_PUBLIC_READ = 'public-read'

Definition at line 62 of file S3.php.

const S3_ACL_PUBLIC_WRITE = 'public-read-write'

Definition at line 63 of file S3.php.

const S3_CONTENT_TYPE_HEADER = 'Content-Type'

Definition at line 68 of file S3.php.

const S3_ENDPOINT = 's3.amazonaws.com'

Definition at line 59 of file S3.php.

const S3_REQUESTPAY_HEADER = 'x-amz-request-payer'

Definition at line 66 of file S3.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations