www - weather - easier debug and maintenance for files
This commit is contained in:
parent
e498262365
commit
27d15794e7
|
@ -11,13 +11,16 @@ function response_code($code, $why)
|
|||
function weather_cache_path($lat, $lon)
|
||||
{
|
||||
$t = time();
|
||||
$d = date('Y-m-d h', $t);
|
||||
$d = date('Y-m-d_h', $t);
|
||||
$m = date('i', $t);
|
||||
|
||||
// One per coord per 15 mins
|
||||
$file = md5(sprintf("%s Q%d:%.4f:%.4f", $d, $m/15, $lat, $lon));
|
||||
$ky = sprintf("%s-Q%d:%.4f:%.4f.json", $d, $m/15, $lat, $lon, $m);
|
||||
// Use the above filename directly for easier debug.maintenance
|
||||
//$fl = md5($ky);
|
||||
$fl = $ky;
|
||||
|
||||
$path = $_SERVER["DOCUMENT_ROOT"] .'/'. CACHE_PATH . '/'. $file;
|
||||
$path = $_SERVER["DOCUMENT_ROOT"] .'/'. CACHE_PATH . '/'. $fl;
|
||||
return $path;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue