/usr/share/php/Horde/Service/Weather/Forecast/Wwov2.php is in php-horde-service-weather 2.5.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | <?php
/**
* This file contains the Horde_Service_Weather_Forecast class for abstracting
* access to forecast data from WorldWideWeather using the V2 API.
*
* Copyright 2011-2016 Horde LLC (http://www.horde.org/)
*
* @author Michael J Rubinsky <mrubinsk@horde.org>
* @license http://www.horde.org/licenses/bsd BSD
* @category Horde
* @package Service_Weather
*/
/**
* Horde_Service_Weather_Forecast_Wwo
*
* @author Michael J Rubinsky <mrubinsk@horde.org>
* @category Horde
* @package Service_Weather
*/
class Horde_Service_Weather_Forecast_Wwov2 extends Horde_Service_Weather_Forecast_Wwo
{
/**
* @see Horde_Service_Weather_Forecast_Base::$fields
*/
public $fields = array(
Horde_Service_Weather::FORECAST_FIELD_WIND,
Horde_Service_Weather::FORECAST_FIELD_HUMIDITY,
Horde_Service_Weather::FORECAST_FIELD_PRECIPITATION);
/**
* Parse a stdRequest
*
* @throws Horde_Service_Weather_Exception
*/
protected function _parseStd()
{
if (empty($this->_properties)) {
throw new Horde_Service_Weather_Exception('No forecast data to parse.');
}
// @todo Need to refactor this when we support hourly data.
foreach ($this->_properties as $period => $values) {
$data = new stdClass();
foreach ($values as $k => $v) {
if ($k != 'hourly') {
$data->{$k} = $v;
}
}
foreach ($values->hourly[0] as $k => $v) {
$data->{$k} = $v;
}
$period = new Horde_Service_Weather_Period_Wwov2($data, $this);
$this->_periods[] = $period;
}
}
}
|