Changeset 4850
- Timestamp:
- Dec 26, 2007, 2:22:00 PM (15 years ago)
- Location:
- OpenPNE/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE/trunk/lib/include/Services/Amazon.php
r2 r4850 107 107 */ 108 108 var $_baseurl = null; 109 110 /** 111 * The proxy parameters to be used by HTTP_Request 112 * 113 * @access private 114 * @var string $_proxy_host 115 * @var int $_proxy_port 116 * @var string $_proxy_user 117 * @var string $_proxy_pass 118 */ 119 var $_proxy_host = null; 120 var $_proxy_port = null; 121 var $_proxy_user = null; 122 var $_proxy_pass = null; 109 123 110 124 /** … … 234 248 function getLocale() { 235 249 return $this->_locale; 250 } 251 252 /** 253 * Sets a proxy to be used by HTTP_Request 254 * 255 * @param string Proxy host 256 * @param int Proxy port 257 * @param string Proxy username 258 * @param string Proxy password 259 * @access public 260 */ 261 function setProxy($host, $port = 8080, $user = null, $pass = null) 262 { 263 $this->_proxy_host = $host; 264 $this->_proxy_port = $port; 265 $this->_proxy_user = $user; 266 $this->_proxy_pass = $pass; 236 267 } 237 268 … … 769 800 // request for the URL. 770 801 $http = &new HTTP_Request($url); 802 if ($this->_proxy_host) $http->setProxy($this->_proxy_host, $this->_proxy_port, $this->_proxy_user, $this->_proxy_pass); 771 803 $http->addHeader('User-Agent', 'Services_Amazon/' . $this->getApiVersion()); 772 804 $http->sendRequest(); -
OpenPNE/trunk/webapp/lib/db/review.php
r4272 r4850 97 97 include_once 'Services/Amazon.php'; 98 98 $amazon =& new Services_Amazon(AMAZON_TOKEN, AMAZON_AFFID, AMAZON_LOCALE, AMAZON_BASEURL); 99 $amazon->setLocale(AMAZON_LOCALE); 100 if (OPENPNE_USE_HTTP_PROXY) $amazon->setProxy(OPENPNE_HTTP_PROXY_HOST, OPENPNE_HTTP_PROXY_PORT); 99 101 $products = $amazon->searchKeyword($keyword, $category, $page); 100 102 if (PEAR::isError($products)) { … … 131 133 include_once 'Services/Amazon.php'; 132 134 $amazon =& new Services_Amazon(AMAZON_TOKEN, AMAZON_AFFID, AMAZON_LOCALE, AMAZON_BASEURL); 135 $amazon->setLocale(AMAZON_LOCALE); 136 if (OPENPNE_USE_HTTP_PROXY) $amazon->setProxy(OPENPNE_HTTP_PROXY_HOST, OPENPNE_HTTP_PROXY_PORT); 133 137 $keyword = mb_convert_encoding($keyword, "UTF-8", "auto"); 134 138
Note: See TracChangeset
for help on using the changeset viewer.