本文整理汇总了PHP中CFRuntime类的典型用法代码示例。如果您正苦于以下问题:PHP CFRuntime类的具体用法?PHP CFRuntime怎么用?PHP CFRuntime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CFRuntime类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($options)
{
\CFRuntime::init($options['key'], $options['secret_key'], $options['account_id'], $options['assoc_id']);
}
示例2: __construct
/**
* 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);
}
示例3: __construct
/**
* 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);
}
示例4: __construct
/**
* 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);
}
示例5: __construct
/**
* 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);
}
示例6: __construct
/**
* 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;
}
示例7: __construct
/**
* 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: __construct
/**
* 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);
}
示例9: __construct
/**
* 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);
}
示例10: __construct
/**
* 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);
}
示例11: __construct
/**
* 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);
}
示例12: __construct
/**
* 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);
}
示例13: __construct
/**
* 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);
}
示例14: authenticate
/**
* This overwrites the default authenticate method in sdk.class.php to address SQS queue URLs.
*
* @return CFResponse Object containing a parsed HTTP response.
*/
public function authenticate($operation, $payload)
{
// Save the current hostname
$hostname = $this->hostname;
if (isset($payload['QueueUrl'])) {
// Change the hostname to the queue URL
$this->hostname = $payload['QueueUrl'];
// Remove "QueueURL" from the payload
unset($payload['QueueUrl']);
}
// Perform the request
$response = parent::authenticate($operation, $payload);
// Restore the hostname
$this->hostname = $hostname;
return $response;
}
示例15: __construct
/**
* 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;
}