Services_Amazon_S3
[ class tree: Services_Amazon_S3 ] [ index: Services_Amazon_S3 ] [ all elements ]

Class: Services_Amazon_S3_Resource_Object

Source Location: /Services_Amazon_S3-0.2.0/S3/Resource/Object.php

Class Overview

Services_Amazon_S3_Resource
   |
   --Services_Amazon_S3_Resource_Object

Services_Amazon_S3_Resource_Object represents an Amazon S3 object, i.e. a file stored in the S3 storage service.


Author(s):

Version:

  • Release: 0.2.0

Copyright:

  • 2008-2009 Peytz & Co. A/S

Variables

Methods


Inherited Variables

Inherited Methods

Class: Services_Amazon_S3_Resource

Services_Amazon_S3_Resource::delete()
Deletes this resource from the server.
Services_Amazon_S3_Resource::getSignedUrl()
Returns an URL with credentials included in the query string. This will allow access to private resources without further authentication, e.g.
Services_Amazon_S3_Resource::getURL()
Returns the URL of this resource.
Services_Amazon_S3_Resource::load()
Loads this resource from the server and propagates relevant properties.
Services_Amazon_S3_Resource::loadACL()
Loads this resource's access control list from the server and propagates the acl property.
Services_Amazon_S3_Resource::save()
Saves this resource to the server (including its access control list).

Class Details

[line 65]
Services_Amazon_S3_Resource_Object represents an Amazon S3 object, i.e. a file stored in the S3 storage service.


[ Top ]


Class Variables

$allowedHeaders = array(
        'cache-control', 'content-md5', 'content-disposition',
        'content-encoding', 'expires')

[line 154]

Additional allowed header field names that may be used as keys in the $this->httpHeaders array.

Type:   mixed


[ Top ]

$bucket =

[line 83]

The bucket containing this object.
  • Access: public

Type:   Services_Amazon_S3


[ Top ]

$contentType =

[line 102]

The media of the object, e.g. "image/gif" or "text/html; charset=UTF-8".

Type:   string


[ Top ]

$data =

[line 95]

The object data.
  • Var: a (possibly very long) string
  • Access: public

Type:   string


[ Top ]

$eTag =

[line 122]

The ETag of the resource. This property is read-only.

Type:   string


[ Top ]

$httpHeaders = array()

[line 145]

Additional HTTP headers that are returned when resource is fetching using the rest API. Only the field names listed self::$allowedHeaders are allowed. Field names are transferred and returned in lowercase for easier comparison.

Type:   array


[ Top ]

$key =

[line 89]

This object's identifier within the bucket
  • Var: (UTF-8)
  • Access: public

Type:   string


[ Top ]

$lastModified =

[line 115]

The last modified timestamp of the file. This property is read-only.
  • Var: a Unix timestamp
  • Access: public

Type:   int


[ Top ]

$size =

[line 109]

The size of the object (excluding metadata) in bytes. This is property is read-only.
  • Var: a positive integer
  • Access: public

Type:   int


[ Top ]

$userMetadata = array()

[line 135]

The user metadata as key-value pairs.

Metadata keys should match the definition of "token" in RFC 2616 section 2.2. This includes letters a-z, digits 0-9 and hyphen (-). Keys are are case-insensitive and are always returned in lowercase. Keys should not include the "x-amz-meta-" prefix used by the S3 REST API. Values may consist of all ISO-8859-1 characters, except control characters (0-31). Leading and trailing space is stripped.


Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 168]

Services_Amazon_S3_Resource_Object __construct( Services_Amazon_S3_Resource_Bucket $bucket, string $key)

Constructor. This should only be used internally. New object instances should be created using $bucket->getObject($name) or $bucket->getObjects().
  • Access: public

Parameters:

Services_Amazon_S3_Resource_Bucket   $bucket   —  the bucket containing this object
string   $key   —  the key within the bucket (UTF-8)

[ Top ]

getTorrentURL   [line 192]

string getTorrentURL( )

Returns a URL of a .torrent file for this object.
  • Return: an absolute URL
  • Throws: Services_Amazon_S3_Exception
  • Access: public

[ Top ]

getURL   [line 181]

string getURL( )

Returns the URL of this object.
  • Return: an absolute URL
  • Throws: Services_Amazon_S3_Exception
  • Access: public

Overrides Services_Amazon_S3_Resource::getURL() (Returns the URL of this resource.)
[ Top ]

load   [line 208]

bool load( [string $what = self::LOAD_DATA])

Loads this object from the server.

If the file is found, the properties contentType, size, lastModified, eTag and userMetadata are propagated. If $fetchBody is true, the property data is propagated as well.

  • Return: true if the object exists on the server
  • Throws: Services_Amazon_S3_Exception
  • Access: public

Overrides Services_Amazon_S3_Resource::load() (Loads this resource from the server and propagates relevant properties.)

Parameters:

string   $what   —  a self::LOAD_xxx constant

[ Top ]

save   [line 253]

void save( )

Saves this object to the server.
  • Access: public

Overrides Services_Amazon_S3_Resource::save() (Saves this resource to the server (including its access control list).)
[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:31:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.