set_region ( $region )

Sets the region to use for subsequent Amazon S3 operations. This will also reset any prior use of enable_path_style().

Access

public

Parameters

Parameter

Type

Required

Description

$region

string

Required

The region to use for subsequent Amazon S3 operations. For a complete list of REGION constants, see the AmazonS3 Constants page in the API reference.

Returns

Type

Description

$this

A reference to the current instance.

Related Methods

Source

Method defined in services/s3.class.php | Toggle source view (24 lines) | View on GitHub

public function set_region($region)
{
    // @codeCoverageIgnoreStart
    $this->set_hostname($region);

    switch ($region)
    {
        case self::REGION_US_E1: // Northern Virginia
            $this->enable_path_style(false);
            break;

        case self::REGION_EU_W1: // Ireland
            $this->enable_path_style(); // Always use path-style access for EU endpoint.
            break;

        default:
            $this->enable_path_style(false);
            break;

    }
    // @codeCoverageIgnoreEnd

    return $this;
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback