Grant Barrett <[EMAIL PROTECTED]> writes:
> Well, mine is working. And the reason why is this code (which you
> will find commented out in the default scripts):
> * <?php
> * include('phpweather.inc');
> * register_shutdown_function('update_metars_db');
> * ?>
> I ran into the same problem a couple of months ago. Martin (who I am
> sure will be replying to your comments with more accurate
> information) indicated I should add the above code at the end of my
> script. The result is that your script will check for new weather
> *after* a page is loaded, so as not to delay the loading of the rest
> of the page. It works well. The result is that you get a quick blank
> spot where your results shold be on the web page rather than a
> slooooow blank spot.
You're right - I think this is the best solution for people who can't
update the database with another process (a cron-script or something
But if you use the above code, you should also make sure that you use
get_metar($station, 1) as the 1-flag will make sure that get_metar()
always used the METAR it finds in the database, instead of trying the
web, even if it's too old.
In the CVS version, you should set this flag to true, in your
$this->properties['always_use_db'] = false; /* data_retrieval.php */
Checkout http://www.gimpster.com for:
PHP Weather => Shows the current weather on your webpages.
PHP Shell => A telnet-connection (almost :-) in a PHP page.