當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CFRuntime::session_based_auth方法代碼示例

本文整理匯總了PHP中CFRuntime::session_based_auth方法的典型用法代碼示例。如果您正苦於以下問題:PHP CFRuntime::session_based_auth方法的具體用法?PHP CFRuntime::session_based_auth怎麽用?PHP CFRuntime::session_based_auth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CFRuntime的用法示例。


在下文中一共展示了CFRuntime::session_based_auth方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __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);
 }
開發者ID:ChrstnMgcn,項目名稱:revolution,代碼行數:29,代碼來源:ec2.class.php

示例2: __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);
 }
開發者ID:jervy-ez,項目名稱:magic-members-test,代碼行數:37,代碼來源:s3.class.php


注:本文中的CFRuntime::session_based_auth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。