本文整理汇总了PHP中Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract类的具体用法?PHP Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract怎么用?PHP Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testRetryN
/**
* Test retry policy - retryN
*/
public function testRetryN()
{
$this->_executedRetries = 0;
$this->_exceptionCount = 9;
$policy = Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract::retryN(10, 100);
$retries = $policy->execute(array($this, '_countRetriesAndThrowExceptions'));
$this->assertEquals(10, $retries);
}
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:11,代码来源:RetryPolicyTest.php
示例2: createStorageInstance
protected function createStorageInstance()
{
$storageClient = null;
if (TESTS_ZEND_SERVICE_WINDOWSAZURE_SESSIONHANDLER_RUNONPROD) {
$storageClient = new Zend_Service_WindowsAzure_Storage_Table(TESTS_ZEND_SERVICE_WINDOWSAZURE_TABLE_HOST_PROD, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_ACCOUNT_PROD, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_KEY_PROD, false, Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract::retryN(10, 250));
} else {
$storageClient = new Zend_Service_WindowsAzure_Storage_Table(TESTS_ZEND_SERVICE_WINDOWSAZURE_TABLE_HOST_DEV, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_ACCOUNT_DEV, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_KEY_DEV, true, Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract::retryN(10, 250));
}
if (TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_USEPROXY) {
$storageClient->setProxy(TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_USEPROXY, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_PROXY, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_PROXY_PORT, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_PROXY_CREDENTIALS);
}
return $storageClient;
}
开发者ID:travisj,项目名称:zf,代码行数:13,代码来源:SessionHandlerTest.php
示例3: createStorageInstance
protected function createStorageInstance()
{
return new Zend_Service_WindowsAzure_Storage_Blob(TESTS_ZEND_SERVICE_WINDOWSAZURE_BLOB_HOST_PROD, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_ACCOUNT_PROD, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_KEY_PROD, false, Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract::retryN(10, 250));
}
开发者ID:sasezaki,项目名称:mirror-zf1-tests,代码行数:4,代码来源:ManagementClientTest.php
示例4: _performRequest
/**
* Perform request using Zend_Http_Client channel
*
* @param string $path Path
* @param string $queryString Query string
* @param string $httpVerb HTTP verb the request will use
* @param array $headers x-ms headers to add
* @param boolean $forTableStorage Is the request for table storage?
* @param mixed $rawData Optional RAW HTTP data to be sent over the wire
* @param string $resourceType Resource type
* @param string $requiredPermission Required permission
* @return Zend_Http_Response
*/
protected function _performRequest($path = '/', $queryString = '', $httpVerb = Zend_Http_Client::GET, $headers = array(), $forTableStorage = false, $rawData = null, $resourceType = Zend_Service_WindowsAzure_Storage::RESOURCE_UNKNOWN, $requiredPermission = Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ)
{
// Clean path
if (strpos($path, '/') !== 0) {
$path = '/' . $path;
}
// Clean headers
if (is_null($headers)) {
$headers = array();
}
// Ensure cUrl will also work correctly:
// - disable Content-Type if required
// - disable Expect: 100 Continue
if (!isset($headers["Content-Type"])) {
$headers["Content-Type"] = '';
}
$headers["Expect"] = '';
// Add version header
$headers['x-ms-version'] = $this->_apiVersion;
// URL encoding
$path = self::urlencode($path);
$queryString = self::urlencode($queryString);
// Generate URL and sign request
$requestUrl = $this->_credentials->signRequestUrl($this->getBaseUrl() . $path . $queryString, $resourceType, $requiredPermission);
$requestHeaders = $this->_credentials->signRequestHeaders($httpVerb, $path, $queryString, $headers, $forTableStorage, $resourceType, $requiredPermission, $rawData);
// Prepare request
$this->_httpClientChannel->resetParameters(true);
$this->_httpClientChannel->setUri($requestUrl);
$this->_httpClientChannel->setHeaders($requestHeaders);
$this->_httpClientChannel->setRawData($rawData);
// Execute request
$response = $this->_retryPolicy->execute(array($this->_httpClientChannel, 'request'), array($httpVerb));
return $response;
}
开发者ID:Cryde,项目名称:sydney-core,代码行数:47,代码来源:Storage.php
示例5: _performRequest
/**
* Perform request using Zend_Http_Client channel
*
* @param string $path Path
* @param string $queryString Query string
* @param string $httpVerb HTTP verb the request will use
* @param array $headers x-ms headers to add
* @param mixed $rawData Optional RAW HTTP data to be sent over the wire
* @return Zend_Http_Response
*/
protected function _performRequest($path = '/', $queryString = '', $httpVerb = Zend_Http_Client::GET, $headers = array(), $rawData = null)
{
// Clean path
if (strpos($path, '/') !== 0) {
$path = '/' . $path;
}
// Clean headers
if (is_null($headers)) {
$headers = array();
}
// Ensure cUrl will also work correctly:
// - disable Content-Type if required
// - disable Expect: 100 Continue
if (!isset($headers["Content-Type"])) {
$headers["Content-Type"] = '';
}
//$headers["Expect"] = '';
// Add version header
$headers['x-ms-version'] = $this->_apiVersion;
// URL encoding
$path = self::urlencode($path);
$queryString = self::urlencode($queryString);
// Generate URL and sign request
$requestUrl = $this->getBaseUrl() . $path . $queryString;
$requestHeaders = $headers;
// Prepare request
$this->_httpClientChannel->resetParameters(true);
$this->_httpClientChannel->setUri($requestUrl);
$this->_httpClientChannel->setHeaders($requestHeaders);
$this->_httpClientChannel->setRawData($rawData);
// Execute request
$response = $this->_retryPolicy->execute(array($this->_httpClientChannel, 'request'), array($httpVerb));
// Store request id
$this->_lastRequestId = $response->getHeader('x-ms-request-id');
return $response;
}
开发者ID:Cryde,项目名称:sydney-core,代码行数:46,代码来源:Client.php
注:本文中的Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论