summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2017-09-09 16:07:44 +0200
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2017-09-09 16:07:44 +0200
commit5a8c1819d963bc78c317b98dd2e77be68bad1549 (patch)
tree73966b5e6016238a81c3a1e3aa47ff223ed8be30
parentab8c11e9983c5d80fcc2c30abd953fa29f606589 (diff)
downloadskin-flatplus-5a8c1819d963bc78c317b98dd2e77be68bad1549.tar.gz
skin-flatplus-5a8c1819d963bc78c317b98dd2e77be68bad1549.tar.bz2
fix weather widget php7
-rw-r--r--widgets/weather/update_weather.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/widgets/weather/update_weather.php b/widgets/weather/update_weather.php
index fba7de9e..31d1df0b 100644
--- a/widgets/weather/update_weather.php
+++ b/widgets/weather/update_weather.php
@@ -1,6 +1,11 @@
<?php
$config = dirname(__FILE__)."/update_weather.config";
+if( !file_exists( $config ) )
+{
+ echo "ERROR: config file <$config> does not exist!\n";
+ return 1;
+}
$ini_array = parse_ini_file($config);
$latitude = $ini_array['Latitude'];
@@ -27,7 +32,7 @@ $forecast = new ForecastIO($api_key);
$condition = $forecast->getCurrentConditions($latitude, $longitude, $units, $lang);
if( !$handle = fopen($OUTPUTFLDRTEMP."/weather.0.temp", "w") ) {
print "can't create file!\n";
- continue;
+ return 2;
}
$temp = round($condition->getTemperature(), 1);
if( $convertPoint == 1 )