Hi there,
I like your library, but if you put in current_forecast.php the following line:
$yr = Yr\Yr::create("Croatia/Istria/Medulin/", "/tmp");
There are notice and warnings like this:
Notice: Trying to get property of non-object in /var/www/tester/yr-php-library/Yr/Yr.php on line 138
Warning: Invalid argument supplied for foreach() in /var/www/tester/yr-php-library/Yr/Yr.php on line 148
Line 138 in Yr.php is:
foreach($xml_hourly->forecast->text->location->time as $forecast) {
which expects to have forecast->text while on several xml data (tried to put Berlin, Gothenburg, Pula) there is no <forecast><text> in forecast.xml
but <forecast><tabular>
Also, there is no <observations> at the end of same xml, as demand the weather_stations section.
xml for Norway cities aren't completely the same as for another countries.
However, at the end, the proper data are retrieved.
Best regards,
Franko
Thanks for your bug report! :)
I added some code to check if textual and weather stations exists in the xml. They are now simply ignored if they are not located in the xml file.
Hi there, I like your library, but if you put in current_forecast.php the following line:
$yr = Yr\Yr::create("Croatia/Istria/Medulin/", "/tmp");
There are notice and warnings like this:Line 138 in Yr.php is:
foreach($xml_hourly->forecast->text->location->time as $forecast) {
which expects to have forecast->text while on several xml data (tried to put Berlin, Gothenburg, Pula) there is no<forecast><text>
in forecast.xml but<forecast><tabular>
Also, there is no
<observations>
at the end of same xml, as demand the weather_stations section. xml for Norway cities aren't completely the same as for another countries.However, at the end, the proper data are retrieved. Best regards, Franko