A PHP API to parse weather data and weather history from OpenWeatherMap.org.
psr/cache
versions 1, 2, and 3, #178psr/http-factory
had always been required, but was missing from composer.json
. This was fixed by @erickskrauch in #159This release fixes an issue where the timezone parsing logic was unable to handle SimpleXMLElements.
Thank you @ChrisB9 for fixing this in #154!
This release fixes an issue where OWMNotFoundException
was never thrown, even when it should have been.
Thank you @robjuz for raising (#150) and fixing (#151) this issue!
This release brings better support for json_encode
ing data returned by this library and minor documentation updates.
Unit
class now includes its values in its JSON representation (thank you @1Franck!):$unit = new Unit(42.5, "°C", "hot", "2.5");
$this->assertEquals(json_encode($unit), '{"value":42.5,"unit":"\u00b0C","description":"hot","precision":2.5}');
This release brings a small new feature as well as an all-new documentation!
docs
folder of this repository.City
s now have a timezone
property that indicates the cities' timezone. Thank you @hennell-git for working on this in #140!This release brings support for OpenWeatherMap's air pollution APIs (currently in beta):
Big thanks to @tomtomklima for kicking this off by working on the carbon monoxide API in #138!
We also fixed a bug related to missing wind directions when using the weather group API reported by @KarelWintersky in #137.
Version 3 comes with a few bug fixes and new and removed features.
Cmfcmf\OpenWeatherMap\AbstractCache
) but instead PSR-6 compatible caches.Cmfcmf\OpenWeatherMap\Fetcher\FetcherInterface
classes dropped in favor of PSR-18 compatible HTTP clients. You now need to pass a PSR-18 compatible HTTP client as well as a PSR-17 compatible HTTP request factory to the OpenWeatherMap
constructor. You will need to choose and install two additional dependencies separately:
Example for Guzzle (php-http/guzzle6-adapter
, http-interop/http-factory-guzzle
):
use Http\Factory\Guzzle\RequestFactory;
use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
$httpRequestFactory = new RequestFactory();
$httpClient = GuzzleAdapter::createWithConfig([]);
$owm = new OpenWeatherMap($myApiKey, $httpClient, $httpRequestFactory);
getRawData()
method. Use getRawWeatherData
instead.K
, °C
and F
. Now they are K
, °C
and °F
.getCurrentUVIndex
, getForecastUVIndex
and getHistoricUVIndex
(thanks to @roelvanhintum).ext-json
, ext-libxml
and ext-simplexml
have always been implicitly required, but are now explicitly required in composer.json
(thanks to @gloomy).