summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-03-18 12:16:55 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-03-18 12:16:55 +0000
commit27d15794e745d51fff4c4d0f87a1b32a87ad1028 (patch)
tree996fe64113b923f69f60daf3a584aacddaa82f8b
parente498262365006bc79b89550ba7e55701bb993e16 (diff)
www - weather - easier debug and maintenance for files
-rw-r--r--public_html/weather.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/public_html/weather.php b/public_html/weather.php
index 48090da2..20ffc770 100644
--- a/public_html/weather.php
+++ b/public_html/weather.php
@@ -11,13 +11,16 @@ function response_code($code, $why)
11function weather_cache_path($lat, $lon) 11function weather_cache_path($lat, $lon)
12{ 12{
13 $t = time(); 13 $t = time();
14 $d = date('Y-m-d h', $t); 14 $d = date('Y-m-d_h', $t);
15 $m = date('i', $t); 15 $m = date('i', $t);
16 16
17 // One per coord per 15 mins 17 // One per coord per 15 mins
18 $file = md5(sprintf("%s Q%d:%.4f:%.4f", $d, $m/15, $lat, $lon)); 18 $ky = sprintf("%s-Q%d:%.4f:%.4f.json", $d, $m/15, $lat, $lon, $m);
19 // Use the above filename directly for easier debug.maintenance
20 //$fl = md5($ky);
21 $fl = $ky;
19 22
20 $path = $_SERVER["DOCUMENT_ROOT"] .'/'. CACHE_PATH . '/'. $file; 23 $path = $_SERVER["DOCUMENT_ROOT"] .'/'. CACHE_PATH . '/'. $fl;
21 return $path; 24 return $path;
22} 25}
23 26