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

Class: Services_Amazon_S3_Resource_Bucket

Source Location: /Services_Amazon_S3-0.4.0/Services/Amazon/S3/Resource/Bucket.php

Class Overview

Services_Amazon_S3_Resource
   |
   --Services_Amazon_S3_Resource_Bucket

Services_Amazon_S3_Resource_Bucket represents an Amazon S3 bucket, i.e. a container for objects.


Author(s):

Version:

  • Release: @release-version@

Copyright:

  • 2008 Peytz & Co. A/S, 2010-2011 silverorange, Inc

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 76]
Services_Amazon_S3_Resource_Bucket represents an Amazon S3 bucket, i.e. a container for objects.


[ Top ]


Class Variables

$dnsStrict =  true

[line 166]

Whether or not DNS strict mode is enabled

Type:   boolean


[ Top ]

$endpoint =

[line 145]

The hostname of the endpoint used for requests done with REQUEST_STYLE_PATH and REQUEST_STYLE_VIRTUAL_HOST. This value is initialized from $this->s3->endpoint.

Type:   mixed


[ Top ]

$locationConstraint =

[line 127]

The geographical location constraint of this bucket.
  • Var: e.g. "EU", or false if no location constraint was specified for this bucket.
  • Access: public

Type:   string|bool


[ Top ]

$loggingStatus =

[line 154]

The logging status of this bucket



[ Top ]

$name =

[line 120]

The name of this bucket.

Type:   string


[ Top ]

$requestStyle =

[line 136]

Method for accessing this bucket. This value is initialized from $this->s3->requestStyle.

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 180]

Services_Amazon_S3_Resource_Bucket __construct( Services_Amazon_S3 $s3, string $name)

Constructor. This should only be used internally. New bucket instances should be created using $s3->getBucket($name) or $s3->getBuckets().

Parameters:

Services_Amazon_S3   $s3   —  the service instance
string   $name   —  the name of the bucket (UTF-8)

[ Top ]

getLogging   [line 469]

mixed getLogging( )

Get the logging information of this Bucket

Queries the server for a bucket and retrieves the logging status (?logging) for a bucket.

  • Return: bool|DOMNodeList Either a false if no logging information is found or a DOMNodeList of the targetbucket and the location of that logging file in the log
  • Throws: Services_Amazon_S3_Exception
  • Access: public

[ Top ]

getObject   [line 268]

Services_Amazon_S3_Resource_Object getObject( string $key)

Returns the object with the specified key. The object may or may not exist on the server. Use {@see Services_Amazon_S3_Resource_Object::load()} to query the server.
  • Access: public

Parameters:

string   $key   —  the object's key

[ Top ]

getObjects   [line 291]

Services_Amazon_S3_ObjectIterator getObjects( [string $prefix = false], [string $delimiter = false])

Returns an iterator over Services_Amazon_S3_Resource_Object and Services_Amazon_S3_Prefix instances in this bucket.

If $prefix is specified, only objects whose keys begin with this string are returned. If $delimiter is specified, keys that contain this string after the prefix are rolled up into a single Services_Amazon_S3_Prefix instance. If $delimiter is omitted, the iterator only returns Services_Amazon_S3_Resource_Object instances.

  • Return: an SPL RecursiveIterator
  • Access: public

Parameters:

string   $prefix   —  key prefix
string   $delimiter   —  delimiter, e.g. "/"

[ Top ]

getURL   [line 197]

string getURL( )

Returns the URL of this bucket.
  • Return: an absolute URL (with a trailing slash)
  • Throws: Services_Amazon_S3_Exception
  • Access: public

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

load   [line 335]

bool load( )

Loads this resource from the server and propagates relevant properties.
  • Return: true, if resource exists on server
  • Throws: Services_Amazon_S3_Exception
  • Access: public

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

loadLocationConstraint   [line 424]

void loadLocationConstraint( )

Queries the server for the location constraint for this bucket and propagates the locationConstraint property.
  • Throws: Services_Amazon_S3_Exception
  • Access: public

[ Top ]

loadLoggingStatus   [line 448]

void loadLoggingStatus( )

Loads this bucket's logging status from the server

Upon loading, the Services_Amazon_S3_Resource_Bucket::$loggingStatus property will be set to the loaded Services_Amazon_S3_LoggingStatus object.

  • Throws: Services_Amazon_S3_Exception
  • Access: public

[ Top ]

save   [line 369]

void save( )

Saves this bucket to the server

For existing buckets, only the ACL and logging status are saved. When saving an existing bucket, Services_Amazon_S3_Resource_Bucket::load() should be called in advance so as not to overwrite the existing bucket on save.

  • Throws: Services_Amazon_S3_Exception
  • Access: public

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

setDNSStrict   [line 320]

Services_Amazon_S3_Resource_Bucket setDNSStrict( boolean $strict)

Sets the DNS strict mode for this bucket

S3 can use a virtual-host style method of accessing buckets (i.e. mybucket.s3.amazonaws.com). When DNS strict mode is enabled (default) the name of buckets must conform to the suggested bucket name syntax. This means underscores are forbidden. When DNS strict mode is disabled, underscores can be used for bucket names.


Parameters:

boolean   $strict   —  whether or not to enable DNS strict mode for this bucket.

[ Top ]


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