__construct ( $options )

Constructs a new instance of AmazonS3.

Access

public

Parameters

Parameter

Type

Required

Description

$options

array

Optional

An associative array of parameters that can have the following keys:

  • certificate_authority - boolean - Optional - Determines which Cerificate Authority file to use. A value of boolean false will use the Certificate Authority file available on the system. A value of boolean true will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to 0755) will use that. Leave this set to false if you’re not sure.
  • credentials - string - Optional - The name of the credential set to use for authentication.
  • default_cache_config - string - Optional - This option allows a preferred storage type to be configured for long-term caching. This can be changed later using the set_cache_config() method. Valid values are: apc, xcache, or a file system path such as ./cache or /tmp/cache/.
  • key - string - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.
  • secret - string - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.
  • token - string - Optional - An AWS session token.

Source

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

public function __construct(array $options = array())
{
    $this->vhost = null;
    $this->api_version = '2006-03-01';
    $this->hostname = self::DEFAULT_URL;

    $this->base_acp_xml             = '<?xml version="1.0" encoding="UTF-8"?><AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/latest/"/>';
    $this->base_location_constraint = '<?xml version="1.0" encoding="UTF-8"?><CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '/"><LocationConstraint/></CreateBucketConfiguration>';
    $this->base_logging_xml         = '<?xml version="1.0" encoding="utf-8"?><BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/' . $this->api_version . '"/>';
    $this->base_notification_xml    = '<?xml version="1.0" encoding="utf-8"?><NotificationConfiguration/>';
    $this->base_versioning_xml      = '<?xml version="1.0" encoding="utf-8"?><VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '/"/>';
    $this->complete_mpu_xml         = '<?xml version="1.0" encoding="utf-8"?><CompleteMultipartUpload/>';
    $this->website_config_xml       = '<?xml version="1.0" encoding="utf-8"?><WebsiteConfiguration xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '/"><IndexDocument><Suffix>index.html</Suffix></IndexDocument><ErrorDocument><Key>error.html</Key></ErrorDocument></WebsiteConfiguration>';
    $this->multi_object_delete_xml  = '<?xml version="1.0" encoding="utf-8"?><Delete/>';
    $this->object_expiration_xml    = '<?xml version="1.0" encoding="utf-8"?><LifecycleConfiguration/>';
    $this->bucket_tagging_xml       = '<?xml version="1.0" encoding="utf-8"?><Tagging><TagSet/></Tagging>';
    $this->cors_config_xml          = '<?xml version="1.0" encoding="utf-8"?><CORSConfiguration />';
    $this->restore_request_xml      = '<?xml version="1.0" encoding="utf-8"?><RestoreRequest xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '"/>';

    parent::__construct($options);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback