CVS: phpweather data_retrieval.php,1.27,1.28 defaults-dist.php,1.14,1...
Brought to you by:
iridium
From: Martin G. <gim...@us...> - 2002-09-22 09:51:57
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv32094 Modified Files: data_retrieval.php defaults-dist.php Log Message: Is fetch_method better than fetch_function? I hope so. The value is now also chacked before we call the relevant function. Index: data_retrieval.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/data_retrieval.php,v retrieving revision 1.27 retrieving revision 1.28 diff -u -3 -r1.27 -r1.28 --- data_retrieval.php 20 Sep 2002 20:44:02 -0000 1.27 +++ data_retrieval.php 22 Sep 2002 09:51:54 -0000 1.28 @@ -260,8 +260,14 @@ function get_metar_from_web($new_station) { $metar = ''; $icao = $this->get_icao(); - $func = $this->properties['fetch_function']; - $metar_data = $this->$func($icao); + + switch ($this->properties['fetch_method']) { + case 'file': + $metar_data = $this->get_metar_file($icao); + case 'fsockopen': + default: + $metar_data = $this->get_metar_socket($icao); + } /* Here we test to see if we actually got a METAR. */ if (!empty($metar_data)) { Index: defaults-dist.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/defaults-dist.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- defaults-dist.php 22 Sep 2002 09:43:37 -0000 1.14 +++ defaults-dist.php 22 Sep 2002 09:51:54 -0000 1.15 @@ -1,5 +1,5 @@ <?php -/* $Id$ */ +/* $Id$ */ /* This file holds the original defaults used by PHP Weather. If you * want to change something, you should follow these procedures: @@ -24,7 +24,7 @@ $this->properties['use_proxy'] = false; $this->properties['proxy_host'] = ''; $this->properties['proxy_port'] = 3128; -$this->properties['fetch_function'] = 'get_metar_socket'; +$this->properties['fetch_method'] = 'fsockopen'; $this->properties['db_hostname'] = ''; /* pw_db_common.php */ $this->properties['db_database'] = ''; |