Properties

$units

$units : integer

Units to display results in.

Type

integer

$logo

$logo : string

URL to a logo for this provider

Type

string

$link

$link : string

URL to the provider's site

Type

string

$title

$title : string

Title for the provider

Type

string

$iconMap

$iconMap : array

Driver spcific icon map for condition icons. Made public so icons can be overridden in client code if desired.

Type

array

$_params

$_params : array

Parameters

Type

array

$_cache

$_cache : \Horde_Cache

Cache object

Type

\Horde_Cache

$_cache_lifetime

$_cache_lifetime : integer

Lifetime for cached data.

Type

integer

$_http

$_http : \Horde_Http_Client

The http client

Type

\Horde_Http_Client

$_current

$_current : 

Local cache of current conditions

Type

$_lastLocation

$_lastLocation : string

Last location requested.

Type

string

$_lastLength

$_lastLength : integer

Last requested forecast length.

Type

integer

$_alerts

$_alerts : 

Type

$_radar

$_radar : 

Type

Methods

__construct()

__construct(array  $params = array()) 

Constructor.

Parameters

array $params

Parameters:

  • cache: (Horde_Cache) Optional Horde_Cache object.
  • cache_lifetime: (integer) Lifetime of cached data, if caching.
  • http_client: (Horde_Http_Client) Required http client object.

getCurrentConditions()

getCurrentConditions(string  $location) : \Horde_Service_Weather_Current_Base

Returns the current observations.

Parameters

string $location

The location string.

Returns

\Horde_Service_Weather_Current_Base

getForecast()

getForecast(string  $location, integer  $length = \Horde_Service_Weather::FORECAST_3DAY, integer  $type = \Horde_Service_Weather::FORECAST_TYPE_STANDARD) : \Horde_Service_Weather_Forecast_Base

Returns the forecast for the current location.

Parameters

string $location

The location code.

integer $length

The forecast length, a Horde_ServiceWeather::FORECAST* constant.

integer $type

The type of forecast to return, a Horde_Service_Weather::FORECASTTYPE* constant

Returns

\Horde_Service_Weather_Forecast_Base

searchLocations()

searchLocations(string  $location, integer  $type = \Horde_Service_Weather::SEARCHTYPE_STANDARD) : \Horde_Service_Weather_Station

Searches locations.

Parameters

string $location

The location string to search.

integer $type

The type of search to perform, a Horde_ServiceWeather::SEARCHTYPE* constant.

Throws

\Horde_Service_Weather_Exception

Returns

\Horde_Service_Weather_Station

The search location suitable to use directly in a weather request.

getSupportedForecastLengths()

getSupportedForecastLengths() : array

Get array of supported forecast lengths.

Returns

array —

The array of supported lengths.

getAlerts()

getAlerts(  $location) : array

Return array of weather alerts, if available.

Parameters

$location

Returns

array

getRadarImageUrl()

getRadarImageUrl(string  $location) : string|boolean

Return the URL to a (possibly animated) radar image.

Parameters

string $location

The location

Returns

string|boolean —

The Url, or false if not available.

getTileServerUrl()

getTileServerUrl(string  $location, string  $type = null) : string|boolean

Return the URL a OpenLayers suitable tile server.

Parameters

string $location

The location.

string $type

The optional layer type.

Returns

string|boolean —

The Url, or false if not available.

autocompleteLocation()

autocompleteLocation(string  $search) : array

Searches for locations that begin with the text in $search.

Parameters

string $search

The text to search.

Throws

\Horde_Service_Weather_Exception

Returns

array —

An array of stdClass objects with 'name' and 'code' properties.

getUnits()

getUnits(integer  $type = null) : array

Returns a mapping of units for each UNIT type.

Parameters

integer $type

The units for measurement. A Horde_ServiceWeather::UNITS* constant.

Returns

array —

The mapping of measurements (as keys) and units (as values).

getStation()

getStation() : \Horde_Service_Weather_Station

Returns the station information associated with the last request.

Throws

\Horde_Service_Weather_Exception

if not request has yet been made.

Returns

\Horde_Service_Weather_Station

_ipIsUnique()

_ipIsUnique(string  $ip) : boolean

Check if an IP address is a globally unique address and not in RFC1918 or RFC3330 address space.

Parameters

string $ip

The IPv4 IP address to check.

Returns

boolean —

True if the IP address is globally unique, otherwise false.