示例#1
0
 /**
  * Constructs a new instance of <AmazonIAM>.
  *
  * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  * 	<li><code>default_cache_config</code> - <code>string</code> - 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: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  * @return void
  */
 public function __construct(array $options = array())
 {
     $this->api_version = '2010-05-08';
     $this->hostname = self::DEFAULT_URL;
     $this->auth_class = 'AuthV2Query';
     return parent::__construct($options);
 }
示例#2
0
 /**
  * Constructs a new instance of <AmazonIAM>.
  *
  * @param string $key (Optional) Your Amazon API Key. If blank, it will look for the <code>AWS_KEY</code> constant.
  * @param string $secret_key (Optional) Your Amazon API Secret Key. If blank, it will look for the <code>AWS_SECRET_KEY</code> constant.
  * @return boolean false if no valid values are set, otherwise true.
  */
 public function __construct($key = null, $secret_key = null)
 {
     $this->api_version = '2010-05-08';
     $this->hostname = self::DEFAULT_URL;
     if (!$key && !defined('AWS_KEY')) {
         throw new IAM_Exception('No account key was passed into the constructor, nor was it set in the AWS_KEY constant.');
     }
     if (!$secret_key && !defined('AWS_SECRET_KEY')) {
         throw new IAM_Exception('No account secret was passed into the constructor, nor was it set in the AWS_SECRET_KEY constant.');
     }
     return parent::__construct($key, $secret_key);
 }
 /**
  * Constructs a new instance of this class.
  *
  * @param string $key (Optional) Your Amazon API Key. If blank, it will look for the <AWS_KEY> constant.
  * @param string $secret_key (Optional) Your Amazon API Secret Key. If blank, it will look for the <AWS_SECRET_KEY> constant.
  * @return boolean A value of <code>false</code> if no valid values are set, otherwise <code>true</code>.
  */
 public function __construct($key = null, $secret_key = null)
 {
     $this->api_version = '2011-05-05';
     $this->hostname = self::DEFAULT_URL;
     $this->base_xml = '<?xml version="1.0" encoding="UTF-8"?><%s xmlns="https://route53.amazonaws.com/doc/' . $this->api_version . '/"></%1$s>';
     if (!$key && !defined('AWS_KEY')) {
         throw new Route53_Exception('No account key was passed into the constructor, nor was it set in the AWS_KEY constant.');
     }
     if (!$secret_key && !defined('AWS_SECRET_KEY')) {
         throw new Route53_Exception('No account secret was passed into the constructor, nor was it set in the AWS_SECRET_KEY constant.');
     }
     return parent::__construct($key, $secret_key);
 }
 /**
  * Constructs a new instance of <AmazonImportExport>.
  *
  * @param string $key (Optional) Your Amazon API Key. If blank, it will look for the <code>AWS_KEY</code> constant.
  * @param string $secret_key (Optional) Your Amazon API Secret Key. If blank, it will look for the <code>AWS_SECRET_KEY</code> constant.
  * @return boolean false if no valid values are set, otherwise true.
  */
 public function __construct($key = null, $secret_key = null)
 {
     $this->api_version = '2010-06-01';
     $this->hostname = self::DEFAULT_URL;
     if (!$key && !defined('AWS_KEY')) {
         // @codeCoverageIgnoreStart
         throw new ImportExport_Exception('No account key was passed into the constructor, nor was it set in the AWS_KEY constant.');
         // @codeCoverageIgnoreEnd
     }
     if (!$secret_key && !defined('AWS_SECRET_KEY')) {
         // @codeCoverageIgnoreStart
         throw new ImportExport_Exception('No account secret was passed into the constructor, nor was it set in the AWS_SECRET_KEY constant.');
         // @codeCoverageIgnoreEnd
     }
     return parent::__construct($key, $secret_key);
 }
示例#5
0
 /**
  * Method: __construct()
  * 	Constructs a new instance of <AmazonS3>.
  *
  * Access:
  * 	public
  *
  * Parameters:
  * 	$key - _string_ (Optional) Amazon API Key. If blank, the <AWS_KEY> constant is used.
  * 	$secret_key - _string_ (Optional) Amazon API Secret Key. If blank, the <AWS_SECRET_KEY> constant is used.
  *
  * Returns:
  * 	_boolean_ A value of `false` if no valid values are set, otherwise `true`.
  */
 public function __construct($key = null, $secret_key = null)
 {
     $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/"></AccessControlPolicy>';
     $this->base_location_constraint = '<?xml version="1.0" encoding="UTF-8"?><CreateBucketConfiguration><LocationConstraint></LocationConstraint></CreateBucketConfiguration>';
     $this->base_logging_xml = '<?xml version="1.0" encoding="utf-8"?><BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/' . $this->api_version . '"></BucketLoggingStatus>';
     $this->base_notification_xml = '<?xml version="1.0" encoding="utf-8"?><NotificationConfiguration></NotificationConfiguration>';
     $this->base_versioning_xml = '<?xml version="1.0" encoding="utf-8"?><VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"></VersioningConfiguration>';
     if (!$key && !defined('AWS_KEY')) {
         throw new S3_Exception('No account key was passed into the constructor, nor was it set in the AWS_KEY constant.');
     }
     if (!$secret_key && !defined('AWS_SECRET_KEY')) {
         throw new S3_Exception('No account secret was passed into the constructor, nor was it set in the AWS_SECRET_KEY constant.');
     }
     return parent::__construct($key, $secret_key);
 }
示例#6
0
 /**
  * Constructs a new instance of <AmazonCloudFront>.
  *
  * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  * 	<li><code>default_cache_config</code> - <code>string</code> - 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: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  * @return void
  */
 public function __construct(array $options = array())
 {
     $this->api_version = '2012-03-15';
     $this->hostname = self::DEFAULT_URL;
     $this->auth_class = 'AuthV2REST';
     $this->base_xml = '<?xml version="1.0" encoding="UTF-8"?><%s xmlns="http://cloudfront.amazonaws.com/doc/' . $this->api_version . '/"></%1$s>';
     parent::__construct($options);
     // Set a default key pair ID and private key
     $this->key_pair_id = $this->credentials->cloudfront_keypair;
     $this->private_key = $this->credentials->cloudfront_pem;
 }
 /**
  * Constructs a new instance of <AmazonDynamoDB>.
  *
  * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  * 	<li><code>default_cache_config</code> - <code>string</code> - 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: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  * @return void
  */
 public function __construct(array $options = array())
 {
     $this->api_version = '2011-12-05';
     $this->hostname = self::DEFAULT_URL;
     $this->auth_class = 'AuthV3JSON';
     $this->operation_prefix = 'x-amz-target:DynamoDB_20111205.';
     parent::__construct($options);
     // Default caching mechanism is required
     if (!$this->credentials->default_cache_config) {
         // @codeCoverageIgnoreStart
         throw new DynamoDB_Exception('The DynamoDB class requires the "default_cache_config" configuration to be set in the config.inc.php file.');
         // @codeCoverageIgnoreEnd
     }
     // Configure cache
     $this->set_cache_config($this->credentials->default_cache_config);
     $cache_id = $this->key . '_sts_credentials_' . sha1(serialize($options));
     // Instantiate and invoke the cache
     $cache = new $this->cache_class($cache_id, $this->cache_location, 0, $this->cache_compress);
     if ($data = $cache->read()) {
         $cache->expire_in((strtotime($data['expires']) - time()) * 0.85);
     }
     $sts_credentials = $cache->response_manager(array($this, 'cache_sts_credentials'), array($cache, $options));
     // Store the credentials inside the class
     $this->key = $sts_credentials['key'];
     $this->secret_key = $sts_credentials['secret'];
     $this->auth_token = $sts_credentials['token'];
 }
示例#8
0
 /**
  * Constructs a new instance of <AmazonSWF>.
  *
  * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  * 	<li><code>default_cache_config</code> - <code>string</code> - 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: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  * @return void
  */
 public function __construct(array $options = array())
 {
     $this->api_version = '2012-01-25';
     $this->hostname = self::DEFAULT_URL;
     $this->auth_class = 'AuthV3JSON';
     $this->operation_prefix = "x-amz-target:SimpleWorkflowService.";
     return parent::__construct($options);
 }
 /**
  * Constructs a new instance of <AmazonCloudFront>.
  *
  * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  * 	<li><code>default_cache_config</code> - <code>string</code> - 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: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  * @return void
  */
 public function __construct(array $options = array())
 {
     $this->api_version = '2010-11-01';
     $this->hostname = self::DEFAULT_URL;
     $this->auth_class = 'AuthV2REST';
     $this->base_xml = '<?xml version="1.0" encoding="UTF-8"?><%s xmlns="http://cloudfront.amazonaws.com/doc/' . $this->api_version . '/"></%1$s>';
     // Set a default key pair ID and private key
     if (isset($options['credentials'])) {
         $this->key_pair_id = CFCredentials::get($options['credentials'])->cloudfront_keypair;
         $this->private_key = CFCredentials::get($options['credentials'])->cloudfront_pem;
     } else {
         $this->key_pair_id = CFCredentials::get()->cloudfront_keypair;
         $this->private_key = CFCredentials::get()->cloudfront_pem;
     }
     return parent::__construct($options);
 }
 /**
  * Constructs a new instance of <AmazonDynamoDB>.
  *
  * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  * 	<li><code>default_cache_config</code> - <code>string</code> - 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: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  * @return void
  */
 public function __construct(array $options = array())
 {
     $this->api_version = '2011-12-05';
     $this->hostname = self::DEFAULT_URL;
     $this->auth_class = 'AuthV3JSON';
     $this->operation_prefix = 'x-amz-target:DynamoDB_20111205.';
     parent::__construct($options);
     // Default caching mechanism is required
     if (!$this->credentials->default_cache_config) {
         // @codeCoverageIgnoreStart
         throw new DynamoDB_Exception('The DynamoDB class requires the "default_cache_config" configuration to be set in the config.inc.php file.');
         // @codeCoverageIgnoreEnd
     }
     $token = new AmazonSTS($options);
     $token->set_cache_config($this->credentials->default_cache_config);
     $response = $token->cache(3600)->get_session_token();
     $this->key = (string) $response->body->GetSessionTokenResult->Credentials->AccessKeyId;
     $this->secret_key = (string) $response->body->GetSessionTokenResult->Credentials->SecretAccessKey;
     $this->auth_token = (string) $response->body->GetSessionTokenResult->Credentials->SessionToken;
 }
示例#11
0
 /**
  * Constructs a new instance of <AmazonEC2>. If the <code>AWS_DEFAULT_CACHE_CONFIG</code> configuration
  * option is set, requests will be authenticated using a session token. Otherwise, requests will use
  * the older authentication method.
  *
  * @param string $key (Optional) Your AWS key, or a session key. If blank, it will look for the <code>AWS_KEY</code> constant.
  * @param string $secret_key (Optional) Your AWS secret key, or a session secret key. If blank, it will look for the <code>AWS_SECRET_KEY</code> constant.
  * @param string $token (optional) An AWS session token. If blank, a request will be made to the AWS Secure Token Service to fetch a set of session credentials.
  * @return boolean A value of <code>false</code> if no valid values are set, otherwise <code>true</code>.
  */
 public function __construct($key = null, $secret_key = null, $token = null)
 {
     $this->api_version = '2011-02-28';
     $this->hostname = self::DEFAULT_URL;
     if (!$key && !defined('AWS_KEY')) {
         // @codeCoverageIgnoreStart
         throw new EC2_Exception('No account key was passed into the constructor, nor was it set in the AWS_KEY constant.');
         // @codeCoverageIgnoreEnd
     }
     if (!$secret_key && !defined('AWS_SECRET_KEY')) {
         // @codeCoverageIgnoreStart
         throw new EC2_Exception('No account secret was passed into the constructor, nor was it set in the AWS_SECRET_KEY constant.');
         // @codeCoverageIgnoreEnd
     }
     if (defined('AWS_DEFAULT_CACHE_CONFIG') && AWS_DEFAULT_CACHE_CONFIG) {
         return parent::session_based_auth($key, $secret_key, $token);
     }
     return parent::__construct($key, $secret_key);
 }
 /**
  * Method: __construct()
  * 	Constructs a new instance of <AmazonCloudFront>.
  *
  * Access:
  * 	public
  *
  * Parameters:
  * 	$key - _string_ (Optional) Your Amazon API Key. If blank, it will look for the <AWS_KEY> constant.
  * 	$secret_key - _string_ (Optional) Your Amazon API Secret Key. If blank, it will look for the <AWS_SECRET_KEY> constant.
  *
  * Returns:
  * 	_boolean_ A value of `false` if no valid values are set, otherwise `true`.
  */
 public function __construct($key = null, $secret_key = null)
 {
     $this->api_version = '2010-08-01';
     $this->hostname = self::DEFAULT_URL;
     $this->base_xml = '<?xml version="1.0" encoding="UTF-8"?><%s xmlns="http://cloudfront.amazonaws.com/doc/' . $this->api_version . '/"></%1$s>';
     if (!$key && !defined('AWS_KEY')) {
         throw new CloudFront_Exception('No account key was passed into the constructor, nor was it set in the AWS_KEY constant.');
     }
     if (!$secret_key && !defined('AWS_SECRET_KEY')) {
         throw new CloudFront_Exception('No account secret was passed into the constructor, nor was it set in the AWS_SECRET_KEY constant.');
     }
     // Set a default key pair ID
     if (defined('AWS_CLOUDFRONT_KEYPAIR_ID')) {
         $this->key_pair_id = AWS_CLOUDFRONT_KEYPAIR_ID;
     }
     // Set a default private key
     if (defined('AWS_CLOUDFRONT_PRIVATE_KEY_PEM')) {
         $this->private_key = AWS_CLOUDFRONT_PRIVATE_KEY_PEM;
     }
     return parent::__construct($key, $secret_key);
 }
 /**
  * Constructs a new instance of <AmazonStorageGateway>.
  *
  * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  * 	<li><code>default_cache_config</code> - <code>string</code> - 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: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  * @return void
  */
 public function __construct(array $options = array())
 {
     $this->api_version = '2012-06-30';
     $this->hostname = self::DEFAULT_URL;
     $this->auth_class = 'AuthV4JSON';
     $this->operation_prefix = "x-amz-target:StorageGateway_20120630.";
     parent::__construct($options);
 }
示例#14
0
 /**
  * Constructs a new instance of <AmazonS3>. If the <code>AWS_DEFAULT_CACHE_CONFIG</code> configuration
  * option is set, requests will be authenticated using a session token. Otherwise, requests will use
  * the older authentication method.
  *
  * @param string $key (Optional) Your AWS key, or a session key. If blank, it will look for the <code>AWS_KEY</code> constant.
  * @param string $secret_key (Optional) Your AWS secret key, or a session secret key. If blank, it will look for the <code>AWS_SECRET_KEY</code> constant.
  * @param string $token (optional) An AWS session token. If blank, a request will be made to the AWS Secure Token Service to fetch a set of session credentials.
  * @return boolean A value of <code>false</code> if no valid values are set, otherwise <code>true</code>.
  */
 public function __construct($key = null, $secret_key = null, $token = null)
 {
     $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/"></AccessControlPolicy>';
     $this->base_location_constraint = '<?xml version="1.0" encoding="UTF-8"?><CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '/"><LocationConstraint></LocationConstraint></CreateBucketConfiguration>';
     $this->base_logging_xml = '<?xml version="1.0" encoding="utf-8"?><BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/' . $this->api_version . '"></BucketLoggingStatus>';
     $this->base_notification_xml = '<?xml version="1.0" encoding="utf-8"?><NotificationConfiguration></NotificationConfiguration>';
     $this->base_versioning_xml = '<?xml version="1.0" encoding="utf-8"?><VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '/"></VersioningConfiguration>';
     $this->complete_mpu_xml = '<?xml version="1.0" encoding="utf-8"?><CompleteMultipartUpload></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>';
     if (!$key && !defined('AWS_KEY')) {
         // @codeCoverageIgnoreStart
         throw new S3_Exception('No account key was passed into the constructor, nor was it set in the AWS_KEY constant.');
         // @codeCoverageIgnoreEnd
     }
     if (!$secret_key && !defined('AWS_SECRET_KEY')) {
         // @codeCoverageIgnoreStart
         throw new S3_Exception('No account secret was passed into the constructor, nor was it set in the AWS_SECRET_KEY constant.');
         // @codeCoverageIgnoreEnd
     }
     if (defined('AWS_DEFAULT_CACHE_CONFIG') && AWS_DEFAULT_CACHE_CONFIG) {
         return parent::session_based_auth($key, $secret_key, $token);
     }
     return parent::__construct($key, $secret_key);
 }
示例#15
0
 /**
  * Constructs a new instance of <AmazonDynamoDB>.
  *
  * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  * 	<li><code>default_cache_config</code> - <code>string</code> - 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: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  * @return void
  */
 public function __construct(array $options = array())
 {
     $this->api_version = '2011-12-05';
     $this->hostname = self::DEFAULT_URL;
     $this->auth_class = 'AuthV4JSON';
     $this->operation_prefix = 'x-amz-target:DynamoDB_20111205.';
     parent::__construct($options);
 }
示例#16
0
 /**
  * Constructs a new instance of <AmazonS3>.
  *
  * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  * 	<li><code>default_cache_config</code> - <code>string</code> - 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: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  * @return void
  */
 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/"></AccessControlPolicy>';
     $this->base_location_constraint = '<?xml version="1.0" encoding="UTF-8"?><CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '/"><LocationConstraint></LocationConstraint></CreateBucketConfiguration>';
     $this->base_logging_xml = '<?xml version="1.0" encoding="utf-8"?><BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/' . $this->api_version . '"></BucketLoggingStatus>';
     $this->base_notification_xml = '<?xml version="1.0" encoding="utf-8"?><NotificationConfiguration></NotificationConfiguration>';
     $this->base_versioning_xml = '<?xml version="1.0" encoding="utf-8"?><VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '/"></VersioningConfiguration>';
     $this->complete_mpu_xml = '<?xml version="1.0" encoding="utf-8"?><CompleteMultipartUpload></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></Delete>';
     $this->object_expiration_xml = '<?xml version="1.0" encoding="utf-8"?><LifecycleConfiguration></LifecycleConfiguration>';
     parent::__construct($options);
 }
示例#17
0
 /**
  * Constructs a new instance of <AmazonDynamoDB>.
  *
  * @param array $options (Optional) An associative array of parameters that can have the following keys: <ul>
  * 	<li><code>certificate_authority</code> - <code>boolean</code> - Optional - Determines which Cerificate Authority file to use. A value of boolean <code>false</code> will use the Certificate Authority file available on the system. A value of boolean <code>true</code> will use the Certificate Authority provided by the SDK. Passing a file system path to a Certificate Authority file (chmodded to <code>0755</code>) will use that. Leave this set to <code>false</code> if you're not sure.</li>
  * 	<li><code>credentials</code> - <code>string</code> - Optional - The name of the credential set to use for authentication.</li>
  * 	<li><code>default_cache_config</code> - <code>string</code> - 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: <code>apc</code>, <code>xcache</code>, or a file system path such as <code>./cache</code> or <code>/tmp/cache/</code>.</li>
  * 	<li><code>key</code> - <code>string</code> - Optional - Your AWS key, or a session key. If blank, the default credential set will be used.</li>
  * 	<li><code>secret</code> - <code>string</code> - Optional - Your AWS secret key, or a session secret key. If blank, the default credential set will be used.</li>
  * 	<li><code>token</code> - <code>string</code> - Optional - An AWS session token.</li></ul>
  * @return void
  */
 public function __construct(array $options = array())
 {
     $this->api_version = '2011-12-05';
     $this->hostname = self::DEFAULT_URL;
     $this->auth_class = 'AuthV3JSON';
     $this->operation_prefix = 'x-amz-target:DynamoDB_20111205.';
     parent::__construct($options);
     // Default caching mechanism is required
     if (!$this->credentials->default_cache_config) {
         // @codeCoverageIgnoreStart
         throw new DynamoDB_Exception('The DynamoDB class requires the "default_cache_config" configuration to be set in the config.inc.php file.');
         // @codeCoverageIgnoreEnd
     }
     $this->refresh_sts_credentials_options = $options;
     $this->refresh_sts_credentials();
 }