Przeglądaj źródła

ZF-8860 Zend_Service_WindowsAzure requires cURL

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20400 44c647ce-9c0f-0410-b52a-842ac1e357ba
maartenba 16 lat temu
rodzic
commit
b753f485c3
1 zmienionych plików z 9 dodań i 8 usunięć
  1. 9 8
      library/Zend/Service/WindowsAzure/Storage.php

+ 9 - 8
library/Zend/Service/WindowsAzure/Storage.php

@@ -209,16 +209,17 @@ class Zend_Service_WindowsAzure_Storage
 		}
 		
 		// Setup default Zend_Http_Client channel
-		$this->_httpClientChannel = new Zend_Http_Client(
-			null,
-			array(
-				'adapter' => 'Zend_Http_Client_Adapter_Proxy',
-				'curloptions' => array(
+		$options = array(
+			'adapter' => 'Zend_Http_Client_Adapter_Proxy'
+		);
+		if (function_exists('curl_init')) {
+			// Set cURL options if cURL is used afterwards
+			$options['curloptions'] = array(
 					CURLOPT_FOLLOWLOCATION => true,
 					CURLOPT_TIMEOUT => 120,
-				)
-			)
-		);
+			);
+		}
+		$this->_httpClientChannel = new Zend_Http_Client(null, $options);
 	}
 	
 	/**