diff -u /usr/share/pear/Services/Weather/Common.php Weather/Common.php --- /usr/share/pear/Services/Weather/Common.php 2005-10-31 11:22:15.000000000 +0100 +++ Weather/Common.php 2005-10-31 15:46:12.000000000 +0100 @@ -72,13 +72,14 @@ "rain" => "in" ); - /** - * Timeout for HTTP requests - * - * @var int $_httpTimeout - * @access private - */ - var $_httpTimeout = 60; + /** + * HTTP-Options for HTTP_Request + * + * @var array $_httpOptions + * @access private + */ + var $_httpOptions = array(); + /** * Format of the used dates @@ -173,6 +174,18 @@ if (isset($options["httpTimeout"])) { $this->setHttpTimeout($options["httpTimeout"]); } + if (isset($options["proxy_host"])) { + $this->_setHttpOption('proxy_host',$options["proxy_host"]); + } + if (isset($options["proxy_port"])) { + $this->_setHttpOption('proxy_port',$options["proxy_port"]); + } + if (isset($options["proxy_user"])) { + $this->_setHttpOption('proxy_user',$options["proxy_user"]); + } + if (isset($options["proxy_pass"])) { + $this->_setHttpOption('proxy_pass',$options["proxy_pass"]); + } if (isset($options["dateFormat"])) { $this->setDateTimeFormat($options["dateFormat"], ""); @@ -261,11 +274,25 @@ function setHttpTimeout($httpTimeout) { if (is_int($httpTimeout)) { - $this->_httpTimeout = $httpTimeout; + $this->setHttpOption('timeout',$httpTimeout); } } // }}} + // {{{ setHttpOption() + /** + * Sets HTTP Options + * + * @param string $key + * @param mixed $value + * @access private + */ + function _setHttpOption($key,$value) + { + $this->_httpOptions[$key]=$value; + } + // }}} + // {{{ getUnitsFormat() /** * Returns the selected units format diff -u /usr/share/pear/Services/Weather/Ejse.php Weather/Ejse.php --- /usr/share/pear/Services/Weather/Ejse.php 2005-10-31 11:22:15.000000000 +0100 +++ Weather/Ejse.php 2005-10-31 15:47:01.000000000 +0100 @@ -89,7 +89,7 @@ } include_once "SOAP/Client.php"; - $this->_wsdl = new SOAP_WSDL("http://www.ejse.com/WeatherService/Service.asmx?WSDL", array("timeout" => $this->_httpTimeout)); + $this->_wsdl = new SOAP_WSDL("http://www.ejse.com/WeatherService/Service.asmx?WSDL", $this->_httpOptions); if (isset($this->_wsdl->fault) && Services_Weather::isError($this->_wsdl->fault)) { $error = Services_Weather::raiseError(SERVICES_WEATHER_ERROR_WRONG_SERVER_DATA, __FILE__, __LINE__); return; diff -u /usr/share/pear/Services/Weather/Globalweather.php Weather/Globalweather.php --- /usr/share/pear/Services/Weather/Globalweather.php 2005-10-31 11:22:15.000000000 +0100 +++ Weather/Globalweather.php 2005-10-31 15:47:29.000000000 +0100 @@ -102,7 +102,7 @@ } include_once "SOAP/Client.php"; - $this->_wsdl = new SOAP_WSDL("http://live.capescience.com/wsdl/GlobalWeather.wsdl", array("timeout" => $this->_httpTimeout)); + $this->_wsdl = new SOAP_WSDL("http://live.capescience.com/wsdl/GlobalWeather.wsdl", $this->_httpOptions); if (isset($this->_wsdl->fault) && Services_Weather::isError($this->_wsdl->fault)) { $error = Services_Weather::raiseError(SERVICES_WEATHER_ERROR_WRONG_SERVER_DATA, __FILE__, __LINE__); return; diff -u /usr/share/pear/Services/Weather/Weatherdotcom.php Weather/Weatherdotcom.php --- /usr/share/pear/Services/Weather/Weatherdotcom.php 2005-10-31 11:22:15.000000000 +0100 +++ Weather/Weatherdotcom.php 2005-10-31 15:49:05.000000000 +0100 @@ -193,7 +193,7 @@ function _parseWeatherData($id, $url) { // Get data from URL... - $request = &new HTTP_Request($url, array("timeout" => $this->_httpTimeout)); + $request = &new HTTP_Request($url,$this->_httpOptions); $status = $request->sendRequest(); if (Services_Weather::isError($status)) { return Services_Weather::raiseError(SERVICES_WEATHER_ERROR_WRONG_SERVER_DATA, __FILE__, __LINE__); @@ -268,7 +268,10 @@ { // Get search data from server and unserialize $searchURL = "http://xoap.weather.com/search/search?where=".urlencode(trim($location)); - $status = $this->_unserializer->unserialize($searchURL, true, array("overrideOptions" => true, "complexType" => "array", "keyAttribute" => "id")); + $request = &new HTTP_Request($searchURL,$this->_httpOptions); + $status = $request->sendRequest(); + $data = $request->getResponseBody(); + $status = $this->_unserializer->unserialize($data, false, array("overrideOptions" => true, "complexType" => "array", "keyAttribute" => "id")); if (Services_Weather::isError($status)) { return Services_Weather::raiseError(SERVICES_WEATHER_ERROR_WRONG_SERVER_DATA, __FILE__, __LINE__); --- /usr/share/pear/Services/Weather.php 2005-10-31 11:22:15.000000000 +0100 +++ Weather.php 2005-10-31 15:43:20.000000000 +0100 @@ -83,6 +83,10 @@ * o unitsFormat use (US)-standard, metric or custom units * o customUnitsFormat defines the customized units format * o httpTimeout sets timeout for HTTP requests + * o proxy_host sets Proxy-Hostname for HTTP requests + * o proxy_port sets Proxy-Port for HTTP requests + * o proxy_user sets Proxy-User for HTTP requests + * o proxy_pass sets Proxy-Pass for HTTP requests * o dateFormat string to use for date output * o timeFormat string to use for time output * --- EJSE Options