Author Topic: Advforecast2.php Question  (Read 516 times)

0 Members and 1 Guest are viewing this topic.

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Advforecast2.php Question
« on: June 01, 2015, 12:28:41 PM »
Ken,

I was looking at the advforecast2.php script v3.16 this morning and it raised a question. Around line 304 is the following comment:
Code: [Select]
// The number 1800 below is the number of seconds the cache will be used instead of pulling a new file
// 1800 = 60s x 30m so it retreives every 30 minutes.

However, in the IF statement on the following line, it appears you are testing for the cache file to be older than 10 minutes, not 30 minutes:
Code: [Select]
if (file_exists($cacheName) and filemtime($cacheName) + 600 > time()) {  // 1800

Am I reading that correctly? Should the 600 be 1800 if I want 30 minutes on my cache test?

Thanks,

Steve

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Advforecast2.php Question
« Reply #1 on: June 01, 2015, 12:30:40 PM »
Correct.. the comment is wrong.  The 600 in the executable statement makes it 10 minutes.  Good eyes :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP