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.4.0/Services/Amazon/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: @release-version@

Copyright:

  • 2008 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 67]
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 161]

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

Type:   mixed


[ Top ]

$bucket =

[line 90]

The bucket containing this object.
  • Access: public

Type:   Services_Amazon_S3


[ Top ]

$contentType =

[line 109]

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

Type:   string


[ Top ]

$data =

[line 102]

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

Type:   string


[ Top ]

$eTag =

[line 129]

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

Type:   string


[ Top ]

$httpHeaders = array()

[line 152]

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 96]

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

Type:   string


[ Top ]

$lastModified =

[line 122]

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

Type:   int


[ Top ]

$size =

[line 116]

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 142]

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 178]

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 ]

copyFrom   [line 348]

void copyFrom( Services_Amazon_S3_Resource_Object $source, [boolean $copyMetadata = true])

Copies data to this object from another S3 object
  • Access: public

Parameters:

Services_Amazon_S3_Resource_Object   $source   —  the object from which to copy.
boolean   $copyMetadata   —  optional. Whether or not to copy the metadata from the $source or replace it with the metadata specified in this object. If true, the meta- data is copied from the source object. If false, the metadata set on this object is saved. Defaults to true.

[ Top ]

copyTo   [line 434]

void copyTo( Services_Amazon_S3_Resource_Object $target, [boolean $copyMetadata = true])

Copies data from this object to another S3 object
  • Access: public

Parameters:

Services_Amazon_S3_Resource_Object   $target   —  the object to which this object is copied.
boolean   $copyMetadata   —  optional. Whether or not to copy the metadata to the $target or use the metadata specified on this target. If true, the metadata is copied from this object. If false, the metadata set on the on target is used. Defaults to true.

[ Top ]

getTorrentURL   [line 208]

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 194]

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 227]

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 272]

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:49:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.