Download the PHP package horde/service_weather without Composer
On this page you can find all versions of the php package horde/service_weather. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download horde/service_weather
More information about horde/service_weather
Files in horde/service_weather
Package service_weather
Short Description Weather service library
License BSD-2-Clause
Homepage https://www.horde.org/libraries/Horde_Service_Weather
Informations about the package service_weather
Horde Service_Weather
Modern weather service library for PHP 8.1+ with support for multiple weather providers.
Features
- ✅ Multiple Providers: Open-Meteo, OpenWeatherMap, WeatherAPI.com, US National Weather Service
- ✅ PSR-4 Architecture: Modern, autoloadable namespace structure
- ✅ Type Safety: Full PHP 8.1+ type declarations and readonly properties
- ✅ Immutable Value Objects: Temperature, Speed, Pressure with automatic unit conversion
- ✅ No API Key Required: Use Open-Meteo or NWS without registration
- ✅ Standardized Data: All providers return consistent domain objects
- ✅ HTTP via horde/http: PSR-7/18 compatible HTTP client
- ✅ Backward Compatible: Legacy PSR-0 providers still work (METAR, WWO, Wunderground)
Installation
Quick Start
Open-Meteo (No API Key Required)
OpenWeatherMap
WeatherAPI.com
US National Weather Service
Using Location Objects
Unit Conversions
All value objects support automatic unit conversion:
Temperature
Wind Speed
Pressure
Configuration
Customize provider behavior with WeatherConfig:
Provider Comparison
| Provider | Free Tier | API Key | Coverage | Current | Forecast |
|---|---|---|---|---|---|
| Open-Meteo | Unlimited | No | Global | ✅ | ✅ 16-day |
| OpenWeatherMap | 1K/day | Yes | Global | ✅ | ✅ 5-day |
| WeatherAPI.com | 1M/month | Yes | Global | ✅ | ✅ 14-day |
| NWS | Unlimited | No | US only | ✅ | ✅ 7-day |
Domain Objects
CurrentWeather
Forecast
ForecastPeriod
Weather Conditions
Standardized conditions across all providers:
Error Handling
Advanced Usage
Custom HTTP Client
Direct Provider Access
Legacy PSR-0 Support
The legacy PSR-0 API (Horde_Service_Weather) is still available for backward compatibility:
Upgrading from PSR-0 (Horde 5)
Migrating from the legacy Horde_Service_Weather API? See doc/UPGRADING.md for a complete migration guide including:
- Side-by-side code comparisons
- Provider migration paths
- Common patterns and gotchas
- Testing strategies
- Troubleshooting tips
Quick example:
Testing
Requirements
- PHP 8.1 or higher
- horde/http
- horde/date
- horde/exception
- horde/translation
- horde/url
License
BSD License. See LICENSE file for details.
Links
- Documentation: https://www.horde.org/
- Repository: https://github.com/horde/Service_Weather
- Provider APIs:
Contributing
Contributions are welcome! Please follow the Horde coding standards and include tests for new features.
All versions of service_weather with dependencies
php Version ^7.4 || ^8
horde/date Version ^3 || dev-FRAMEWORK_6_0
horde/exception Version ^3 || dev-FRAMEWORK_6_0
horde/http Version ^3 || dev-FRAMEWORK_6_0
horde/translation Version ^3 || dev-FRAMEWORK_6_0
horde/url Version ^3 || dev-FRAMEWORK_6_0