Skip to content

Commit

Permalink
Don't fatal out if we don't pass a http_client object for Metar weather.
Browse files Browse the repository at this point in the history
If we pass local paths, we can omit the http_client object.
  • Loading branch information
mrubinsk committed Aug 12, 2016
1 parent 4dbe21d commit 6ffc72e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions framework/Service_Weather/lib/Horde/Service/Weather/Metar.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ class Horde_Service_Weather_Metar extends Horde_Service_Weather_Base
*/
public function __construct(array $params = array())
{
// Mini-hack to avoid passing a http_client object if
// we really don't need it.
if (empty($params['http_client']) &&
!empty($params['metar_path']) &&
!empty($params['taf_path'])) {
$params['http_client'] = true;
}

parent::__construct($params);
if (!empty($params['db'])) {
$this->_db = $params['db'];
Expand Down

0 comments on commit 6ffc72e

Please sign in to comment.