Exemplo n.º 1
0
 protected function createStorageInstance()
 {
     $storageClient = null;
     if (TESTS_ZEND_SERVICE_WINDOWSAZURE_BLOB_RUNONPROD) {
         $storageClient = new Blob(TESTS_ZEND_SERVICE_WINDOWSAZURE_BLOB_HOST_PROD, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_ACCOUNT_PROD, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_KEY_PROD, false, AbstractRetryPolicy::retryN(10, 250));
     } else {
         $storageClient = new Blob(TESTS_ZEND_SERVICE_WINDOWSAZURE_BLOB_HOST_DEV, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_ACCOUNT_DEV, TESTS_ZEND_SERVICE_WINDOWSAZURE_STORAGE_KEY_DEV, true, AbstractRetryPolicy::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;
 }
Exemplo n.º 2
0
 /**
  * Delete container
  *
  * @return void
  */
 public function deleteContainer()
 {
     try {
         $this->_storageClient->deleteContainer($this->_container);
     } catch (WindowsAzureException\ExceptionInterface $e) {
         throw new Exception\RuntimeException('Error on delete: ' . $e->getMessage(), $e->getCode(), $e);
     }
 }
Exemplo n.º 3
0
 /**
  * Retrieve storage client for this stream type
  *
  * @param string $path
  * @throws RuntimeException
  * @throws DomainException
  * @return Blob
  */
 protected function _getStorageClient($path = '')
 {
     if ($this->_storageClient === null) {
         $url = explode(':', $path);
         if (!$url) {
             throw new DomainException('Could not parse path "' . $path . '".');
         }
         $this->_storageClient = Blob::getWrapperClient($url[0]);
         if (!$this->_storageClient) {
             throw new RuntimeException('No storage client registered for stream type "' . $url[0] . '://".');
         }
     }
     return $this->_storageClient;
 }