phpweather-checkins Mailing List for PHP Weather (Page 6)
Brought to you by:
iridium
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(7) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(1) |
Feb
(1) |
Mar
(184) |
Apr
(31) |
May
(45) |
Jun
(15) |
Jul
(11) |
Aug
(40) |
Sep
(19) |
Oct
(8) |
Nov
(6) |
Dec
(17) |
| 2003 |
Jan
(5) |
Feb
|
Mar
(12) |
Apr
(5) |
May
(2) |
Jun
(3) |
Jul
(3) |
Aug
(3) |
Sep
(17) |
Oct
(10) |
Nov
|
Dec
(4) |
| 2004 |
Jan
(21) |
Feb
(11) |
Mar
|
Apr
|
May
(3) |
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2005 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Martin G. <gim...@us...> - 2002-12-28 12:24:45
|
Update of /cvsroot/phpweather/phpweather/output In directory sc8-pr-cvs1:/tmp/cvs-serv30402 Modified Files: pw_text_nl.php Log Message: Update from Rudy Boedts. Index: pw_text_nl.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/output/pw_text_nl.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- pw_text_nl.php 27 Sep 2002 20:24:46 -0000 1.1 +++ pw_text_nl.php 28 Dec 2002 12:24:42 -0000 1.2 @@ -7,7 +7,8 @@ * output. * * @author Bas Elshof <ba...@el...> - * @link http://www.elshof.de/ My homepage. + * @author Rudy Boedts + * @link http://www.elshof.de/ * @version pw_text_nl.php,v 1.3 2002/09/26 21:13:40 gimpster Exp */ @@ -34,12 +35,12 @@ $this->strings['time_several_hours'] = '%s%s%s uur %s'; $this->strings['time_a_moment'] = 'een moment'; $this->strings['meters_per_second'] = ' meter per seconde'; - $this->strings['miles_per_hour'] = ' meil per uur'; + $this->strings['miles_per_hour'] = ' mijl per uur'; $this->strings['meter'] = ' meter'; $this->strings['meters'] = ' meter'; $this->strings['feet'] = ' voet'; $this->strings['kilometers'] = ' kilometer'; - $this->strings['miles'] = ' meil'; + $this->strings['miles'] = ' mijl'; $this->strings['and'] = ' en '; $this->strings['plus'] = ' plus '; $this->strings['with'] = ' met '; @@ -102,65 +103,65 @@ $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'De relative luchtvochtigheid was '; $this->strings['feelslike'] = 'De gevoelstemperatuur was '; - $this->strings['cloud_group_beg'] = 'Er was '; + $this->strings['cloud_group_beg'] = 'Het was '; $this->strings['cloud_group_end'] = '.'; - $this->strings['cloud_clear'] = 'De lucht was %sklaar%s.'; - $this->strings['cloud_height'] = ' bewolking op een hoogte van '; - $this->strings['cloud_overcast'] = 'De lucht was %sbewolkt%s vanaf een hoogte van '; + $this->strings['cloud_clear'] = 'De lucht was %shelder%s.'; + $this->strings['cloud_height'] = ' bewolkt op een hoogte van '; + $this->strings['cloud_overcast'] = 'De lucht was %sbetrokken%s vanaf een hoogte van '; $this->strings['cloud_vertical_visibility'] = 'het %svertikale zicht%s was '; $this->strings['cloud_condition'] = array( - 'SKC' => 'klaar', - 'CLR' => 'klaar', - 'FEW' => 'sporadische', - 'SCT' => 'verspreide', - 'BKN' => 'gebroken', - 'OVC' => 'bewolkt'); + 'SKC' => 'helder', + 'CLR' => 'helder', + 'FEW' => 'licht', + 'SCT' => 'half', + 'BKN' => 'zwaar', + 'OVC' => 'betrokken'); $this->strings['cumulonimbus'] = ' cumulonimbus'; $this->strings['towering_cumulus'] = ' stapelwolken'; $this->strings['cavok'] = ' geen wolken beneden %s en geen cumulonimbus wolken'; - $this->strings['currently'] = 'Momentaan '; + $this->strings['currently'] = 'Momenteel '; $this->strings['weather'] = array( - '-' => ' lichte', - ' ' => ' matige ', - '+' => ' zware ', - 'VC' => ' in de omgeving', - 'PR' => ' gedeeltelijk', - 'BC' => ' banken', - 'MI' => ' laaghangende', - 'DR' => ' laag opwaaiende', - 'BL' => ' hoog opwaaiende', - 'SH' => ' buien', - 'TS' => ' onweer', - 'FZ' => ' aanvriezende', - 'DZ' => ' motregen', - 'RA' => ' regen', - 'SN' => ' sneeuw', - 'SG' => ' motsneeuw', - 'IC' => ' ijsnaalden', - 'PL' => ' ijsregen', + '-' => ' lichte', + ' ' => ' matige ', + '+' => ' zware ', + 'VC' => ' in de omgeving', + 'PR' => ' gedeeltelijk', + 'BC' => ' banken', + 'MI' => ' laaghangende', + 'DR' => ' laag opwaaiende', + 'BL' => ' hoog opwaaiende', + 'SH' => ' buien', + 'TS' => ' onweer', + 'FZ' => ' aanvriezende', + 'DZ' => ' motregen', + 'RA' => ' regen', + 'SN' => ' sneeuw', + 'SG' => ' motsneeuw', + 'IC' => ' ijsnaalden', + 'PL' => ' ijsregen', -/* 'PE' => ' ijsregen', +/* 'PE' => ' ijsregen', change in the METAR code for ice pellets from "PE" to "PL." Observers will be directed to code ice pellets as "PE" prior to 00:00 coordinated universal time November 5, 1998, and "PL" thereafter. */ - 'GR' => ' hagel', - 'GS' => ' korrelhagel', - 'UP' => ' onbekend', - 'BR' => ' nevel', - 'FG' => ' mist', - 'FU' => ' rook', - 'VA' => ' vulkanische as', - 'DU' => ' verspreid stof', - 'SA' => ' zand', - 'HZ' => ' heiigheid', - 'PY' => ' opstuivend water', - 'PO' => ' goed ontwikkelde stof- of zandhoosjes', - 'SQ' => ' squalls', - 'FC' => ' slurf of lichte wind- of waterhoos', - 'SS' => ' zandstorm', - 'DS' => ' stofstorm'); /* added according to several infos on the www */ + 'GR' => ' hagel', + 'GS' => ' korrelhagel', + 'UP' => ' onbekend', + 'BR' => ' nevel', + 'FG' => ' mist', + 'FU' => ' rook', + 'VA' => ' vulkanische as', + 'DU' => ' verspreid stof', + 'SA' => ' zand', + 'HZ' => ' heiigheid', + 'PY' => ' opstuivend water', + 'PO' => ' goed ontwikkelde stof- of zandhoosjes', + 'SQ' => ' squalls', + 'FC' => ' slurf of lichte wind- of waterhoos', + 'SS' => ' zandstorm', + 'DS' => ' stofstorm'); /* added according to several infos on the www */ $this->strings['visibility'] = 'Het algemene zicht was '; $this->strings['visibility_greater_than'] = 'meer dan '; $this->strings['visibility_less_than'] = 'minder dan '; |
|
From: Martin G. <gim...@us...> - 2002-12-28 00:52:58
|
Update of /cvsroot/phpweather/phpweather/config
In directory sc8-pr-cvs1:/tmp/cvs-serv2218
Modified Files:
make_config.php pw_dependency.php pw_dependency_or.php
pw_option.php pw_option_select.php pw_optiongroup.php
reset_session.php
Log Message:
Updated to support PHP with register_globals turned off.
Index: make_config.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/make_config.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- make_config.php 10 Nov 2002 23:15:41 -0000 1.6
+++ make_config.php 28 Dec 2002 00:52:54 -0000 1.7
@@ -46,7 +46,8 @@
/* If $options isn't registered, then we should make the variable and
* register it: */
-if (!session_is_registered('options')) {
+if (empty($HTTP_SESSION_VARS)) {
+
/* Common dependencies: */
$db_dep = new pw_dependency_or('db_type', array('mysql', 'pgsql', 'dba'));
$sql_dep = new pw_dependency_or('db_type', array('mysql', 'pgsql'));
@@ -77,7 +78,7 @@
/* Next comes all the options: */
- $options['verbosity'] =
+ $HTTP_SESSION_VARS['verbosity'] =
new pw_option_select('verbosity',
"The setting of this variable controls the amount of " .
"errors, warnings, and debug-information PHP Weather " .
@@ -92,13 +93,13 @@
'6' => 'Warnings + debug information',
'7' => 'Everything'));
- $options['icao'] =
+ $HTTP_SESSION_VARS['icao'] =
new pw_option_text('icao',
'This will be the default station used by PHP Weather. ' .
'You should enter a valid four-letter ICAO.',
array(), $icao_validator, 'EKYT');
- $options['pref_units'] =
+ $HTTP_SESSION_VARS['pref_units'] =
new pw_option_select('pref_units',
'You may choose to display the data in several ' .
'formats. Please choose one that fits your need.',
@@ -108,15 +109,16 @@
'only_metric' => 'Only metric',
'only_imperial' => 'Only imperial'));
- $options['language'] =
+ $HTTP_SESSION_VARS['language'] =
new pw_option_select('language',
'PHP Weather can produce textual output using ' .
'in several languages - please select your default ' .
'from the list.',
array(),
- get_languages('text'));
+ get_languages('text'),
+ 'en');
- $options['offset'] =
+ $HTTP_SESSION_VARS['offset'] =
new pw_option_integer('offset',
"Due to a bug in PHP, on some systems the time reported may " .
"be incorrect. If you experience this, you specify the " .
@@ -125,7 +127,7 @@
"are), set this option to be +1.",
array(), false, 0);
- $options['use_proxy'] =
+ $HTTP_SESSION_VARS['use_proxy'] =
new pw_option_boolean('use_proxy',
"Set this option to 'Yes' to enable support for a " .
"proxy server.",
@@ -133,19 +135,19 @@
array('false' => 'No',
'true' => 'Yes'));
- $options['proxy_host'] =
+ $HTTP_SESSION_VARS['proxy_host'] =
new pw_option_text('proxy_host',
"This is the hostname of the proxy server.",
array($proxy_dep), $host_validator);
- $options['proxy_port'] =
+ $HTTP_SESSION_VARS['proxy_port'] =
new pw_option_integer('proxy_port',
"This is the port number of the proxy server. The " .
"default is what is used by the Squid proxy server. " .
"Another common port number is '8080'",
array($proxy_dep), $port_validator, 3128);
- $options['db_type'] =
+ $HTTP_SESSION_VARS['db_type'] =
new pw_option_select('db_type',
'PHP Weather can use several kinds of databases.',
array(),
@@ -155,7 +157,7 @@
'dba' => 'A DBA database',
'adodb' => 'The ADOdb wrapper library'));
- $options['db_adodb_path'] =
+ $HTTP_SESSION_VARS['db_adodb_path'] =
new pw_option_text('db_adodb_path',
"We need to know where we can find the ADOdb library. " .
"The default is for a Debian GNU/Linux system, but " .
@@ -164,7 +166,7 @@
false, // we could try to validate the path...
'/usr/share/adodb');
- $options['db_adodb_driver'] =
+ $HTTP_SESSION_VARS['db_adodb_driver'] =
new pw_option_text('db_adodb_driver',
"Please select a driver to use with the ADOdb " .
"wrapper library. You can get a list of drivers from " .
@@ -173,7 +175,7 @@
array($adodb_dep),
$not_empty_validator);
- $options['db_adodb_ext'] =
+ $HTTP_SESSION_VARS['db_adodb_ext'] =
new pw_option_boolean('db_adodb_ext',
"If you need to load an extension for ADOdb to work, " .
"then set this option to 'Yes'. PHP might have been " .
@@ -182,7 +184,7 @@
array($adodb_dep),
array('false' => 'No', 'true' => 'Yes'));
- $options['db_adodb_ext_name'] =
+ $HTTP_SESSION_VARS['db_adodb_ext_name'] =
new pw_option_text('db_adodb_ext_name',
"If you need to load an extension go get your database " .
"to work, then specify the name here. For example, if " .
@@ -192,7 +194,7 @@
array($adodb_ext_dep),
$not_empty_validator);
- $options['db_adodb_ext_file'] =
+ $HTTP_SESSION_VARS['db_adodb_ext_file'] =
new pw_option_text('db_adodb_ext_file',
"The name of the extension isn't enough to guess the " .
"filename to load. For example, if you're using the " .
@@ -202,7 +204,7 @@
array($adodb_ext_dep),
$not_empty_validator);
- $options['db_handler'] =
+ $HTTP_SESSION_VARS['db_handler'] =
new pw_option_select('db_handler',
"If you've chosen to use a Berkeley DB style database " .
"through the PHP database abstraction layer (DBA), then " .
@@ -215,7 +217,7 @@
'db2' => 'db2 - Sleepycat Softwares DB2',
'db3' => 'db3 - Sleepycat Softwares DB3'));
- $options['always_use_db'] =
+ $HTTP_SESSION_VARS['always_use_db'] =
new pw_option_boolean('always_use_db',
"If you set this option to 'Yes', then PHP Weather " .
"will always use the data it finds in the database, " .
@@ -224,7 +226,7 @@
array($db_dep),
array('false' => 'No', 'true' => 'Yes'));
- $options['cache_timeout'] =
+ $HTTP_SESSION_VARS['cache_timeout'] =
new pw_option_integer('cache_timeout',
"This specifies when a METAR in the cache is " .
"considered to be old. If a METAR is older than this " .
@@ -236,40 +238,40 @@
array(new pw_dependency('always_use_db', 'false'), $db_dep),
false, '3600');
- $options['db_pconnect'] =
+ $HTTP_SESSION_VARS['db_pconnect'] =
new pw_option_boolean('db_pconnect',
"If you want to make a persistent connection to the " .
"database, then set this option to 'Yes'.",
array($sql_dep),
array('false' => 'No', 'true' => 'Yes'));
- $options['db_port'] =
+ $HTTP_SESSION_VARS['db_port'] =
new pw_option_integer('db_port',
'If you have to use a non-standard port when ' .
'connecting to the database, then please specify it ' .
'here. If not, then just leave this field blank.',
array($sql_dep), $port_validator_empty);
- $options['db_hostname'] =
+ $HTTP_SESSION_VARS['db_hostname'] =
new pw_option_text('db_hostname',
'This is the hostname that PHP Weather will use, ' .
'if you choose to use a database-backend, that ' .
'supports network connections.',
array($sql_dep), $host_validator);
- $options['db_database'] =
+ $HTTP_SESSION_VARS['db_database'] =
new pw_option_text('db_database',
'This is the name of the database that PHP Weather ' .
'should use.',
array($sql_dep), $table_validator);
- $options['db_username'] =
+ $HTTP_SESSION_VARS['db_username'] =
new pw_option_text('db_username',
'This is the username that PHP Weather will use ' .
'for accessing the database.',
array($sql_dep));
- $options['db_password'] =
+ $HTTP_SESSION_VARS['db_password'] =
new pw_option_text('db_password',
'This is the password that PHP Weather will use when ' .
'trying to make a connection to the database. Please ' .
@@ -277,19 +279,19 @@
"password in it.",
array($sql_dep));
- $options['db_metars'] =
+ $HTTP_SESSION_VARS['db_metars'] =
new pw_option_text('db_metars',
'This is the name of the table that is used ' .
'to cache the METARs.',
array($db_dep), $table_validator, 'pw_metars');
- $options['db_stations'] =
+ $HTTP_SESSION_VARS['db_stations'] =
new pw_option_text('db_stations',
'This is the name of the database/table that is used ' .
'to store the names of the stations.',
array($db_dep), $table_validator, 'pw_stations');
- $options['db_countries'] =
+ $HTTP_SESSION_VARS['db_countries'] =
new pw_option_text('db_countries',
'This is the name of the database that is used to ' .
'store the names of the countries together with ' .
@@ -297,7 +299,7 @@
array($dba_dep), $table_validator, 'pw_countries');
- $options['mark_begin'] =
+ $HTTP_SESSION_VARS['mark_begin'] =
new pw_option_text('mark_begin',
'This string will be placed in front of all the ' .
"changable parts of the output. If you don't want " .
@@ -306,14 +308,14 @@
'color="red"></code>, etc.',
array(), false, '<b>');
- $options['mark_end'] =
+ $HTTP_SESSION_VARS['mark_end'] =
new pw_option_text('mark_end',
'This string is placed after all the changable parts. ' .
'You should make sure that it closes any tags ' .
"you've opened in <code>mark_begin</code>.",
array(), false, '</b>');
- $options['exclude'] =
+ $HTTP_SESSION_VARS['exclude'] =
new pw_option_multi_select('exclude',
'You can disable some of the output produced. If ' .
"you're not interested in information about " .
@@ -327,7 +329,7 @@
/* Finally - we register all the options with the session. */
- session_register('options');
+ //session_register('options');
}
/* The options should now be ready - they might come from a restored
@@ -335,10 +337,10 @@
/* We update the options with the latest information. We have to be
carefull when we do this, because we have to operate directly on the
- options in $options and not on a copy. */
-$keys = array_keys($options);
+ options in $HTTP_SESSION_VARS and not on a copy. */
+$keys = array_keys($HTTP_SESSION_VARS);
foreach ($keys as $option) {
- $options[$option]->update_value($HTTP_POST_VARS);
+ $HTTP_SESSION_VARS[$option]->update_value($HTTP_POST_VARS);
}
/* Grouping */
@@ -455,7 +457,7 @@
options might appear. Continue to change the options until they all
say <span style="color: green">Input accepted.</span></p>
-<form action="<? echo $PHP_SELF . '?' . SID ?>" method="post">
+<form action="<? echo $HTTP_SERVER_VARS['PHP_SELF'] . '?' . SID ?>" method="post">
<p>You can <input type="submit" name="download"
value="Download the Configuration" /> or <input type="reset"
Index: pw_dependency.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/pw_dependency.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- pw_dependency.php 13 Apr 2002 13:12:29 -0000 1.2
+++ pw_dependency.php 28 Dec 2002 00:52:54 -0000 1.3
@@ -44,7 +44,8 @@
* otherwise.
*/
function check() {
- return ($GLOBALS['options'][$this->option]->get_value() == $this->dep);
+ global $HTTP_SESSION_VARS;
+ return ($HTTP_SESSION_VARS[$this->option]->get_value() == $this->dep);
}
}
?>
Index: pw_dependency_or.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/pw_dependency_or.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- pw_dependency_or.php 13 Apr 2002 13:12:29 -0000 1.2
+++ pw_dependency_or.php 28 Dec 2002 00:52:54 -0000 1.3
@@ -28,7 +28,8 @@
}
function check() {
- $value = $GLOBALS['options'][$this->option]->get_value();
+ global $HTTP_SESSION_VARS;
+ $value = $HTTP_SESSION_VARS[$this->option]->get_value();
foreach ($this->dep as $d) {
if ($value == $d) return true;
}
Index: pw_option.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/pw_option.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- pw_option.php 13 Apr 2002 13:12:29 -0000 1.3
+++ pw_option.php 28 Dec 2002 00:52:54 -0000 1.4
@@ -15,7 +15,7 @@
*
* It's important that this name correspond to an object in a global
* array called $options. If this option is called 'icao', then the
- * object must be saved to $GLOBALS['options']['icao']
+ * object must be saved to $HTTP_SESSION_VARS['icao']
*
* @var string
*/
Index: pw_option_select.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/pw_option_select.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- pw_option_select.php 7 Apr 2002 18:38:20 -0000 1.1
+++ pw_option_select.php 28 Dec 2002 00:52:54 -0000 1.2
@@ -4,8 +4,13 @@
var $choices = array();
- function pw_option_select($name, $description, $dependencies, $choices) {
- $this->pw_option($name, $description, $dependencies, false, key($choices));
+ function pw_option_select($name, $description, $dependencies,
+ $choices, $default = false) {
+ if ($default && isset($choices[$default])) {
+ $this->pw_option($name, $description, $dependencies, false, $default);
+ } else {
+ $this->pw_option($name, $description, $dependencies, false, key($choices));
+ }
$this->choices = $choices;
}
Index: pw_optiongroup.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/pw_optiongroup.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- pw_optiongroup.php 29 May 2002 20:42:56 -0000 1.4
+++ pw_optiongroup.php 28 Dec 2002 00:52:54 -0000 1.5
@@ -75,6 +75,8 @@
* be inserted in their own description-list.
*/
function show() {
+ global $HTTP_SESSION_VARS;
+
if ($this->visible) {
$style = 'block';
$text = 'Hide options.';
@@ -93,7 +95,7 @@
echo "<dl id=\"$this->id\" style=\"display: $style\">\n";
foreach($this->options as $option) {
- $GLOBALS['options'][$option]->show();
+ $HTTP_SESSION_VARS[$option]->show();
}
echo "</dl>\n";
@@ -111,10 +113,11 @@
* @return string The configuration of the options in the group.
*/
function get_config() {
+ global $HTTP_SESSION_VARS;
$config = '';
foreach($this->options as $option) {
- $config .= $GLOBALS['options'][$option]->get_config();
+ $config .= $HTTP_SESSION_VARS[$option]->get_config();
}
$stars = "\n/*" . str_repeat('*', 64) . "*/\n";
Index: reset_session.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/reset_session.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- reset_session.php 7 Apr 2002 18:59:53 -0000 1.2
+++ reset_session.php 28 Dec 2002 00:52:54 -0000 1.3
@@ -6,7 +6,7 @@
session_start();
session_unset();
session_destroy();
-header('Location: http://' . $HTTP_HOST .
- dirname($PHP_SELF) . '/index.php');
+header('Location: http://' . $HTTP_SERVER_VARS['HTTP_HOST'] .
+ dirname($HTTP_SERVER_VARS['PHP_SELF']) . '/index.php');
exit();
?>
|
|
From: Martin G. <gim...@us...> - 2002-12-27 22:19:25
|
Update of /cvsroot/phpweather/phpweather/doc/src
In directory sc8-pr-cvs1:/tmp/cvs-serv27251/doc/src
Modified Files:
phpweather.texi
Log Message:
Old uncommitted edits...
Index: phpweather.texi
===================================================================
RCS file: /cvsroot/phpweather/phpweather/doc/src/phpweather.texi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- phpweather.texi 26 Aug 2002 12:46:57 -0000 1.1
+++ phpweather.texi 27 Dec 2002 22:19:21 -0000 1.2
@@ -324,21 +324,30 @@
@cindex Database backends, differences
@noindent
-PHP Weather works by retrieving weather reports called
-METARs. It takes some time to get the METARs, so
-you'll be interested in using a local database as a cache. PHP Weather
-supports several different databases:
+PHP Weather works by retrieving weather reports called METARs. It
+takes some time to get the METARs, so you'll be interested in using a
+local database as a cache. All database backends support the same
+features (see @ref{Required Backend Functions} for details) but differ
+in speed. Your version of PHP might also lack support for some of the
+backends. PHP Weather supports the following databases backends:
@table @code
@item null
-This is the default ``database'', but it isn't really a database. It
-pretends to cache the METARs, but in reallity it just throws
-them away. This means that PHP Weather will have to fetch them from
-the NWS again each time.
+This is the default ``database'' backend, but it isn't really a
+database. It pretends to cache the METARs, but in reallity it just
+throws them away. This means that PHP Weather will have to fetch them
+from the NWS again each time.
+
+This makes the @code{null} backend the slowest backend if you
+repeadaly need the same METAR, e.g. if you show the current weather
+for a fixed location on your homepage. But it's just as quick (or
+slow, depending on how you view things) as the other backends when it
+comes to showing the weather for a random station. So if that's your
+usage-pattern, then you might like this backend.
@item pw_mysql
-You can use the popular @uref{http://www.mysql.com/, MySQL} relational
+You can use the @uref{http://www.mysql.com/, MySQL} relational
database with PHP Weather.
@item pw_pgsql
@@ -391,7 +400,40 @@
files, please use that instead and tell us so that we can update the
manual.
-You can change the output produced by PHP Weather.
+@node Required Functions in a Backend
+@section Required Functions in a Backend
+@cindex database, functions
+
+@noindent
+All database backends have to support a common set of methods --- if
+PHP had support for @emph{interfaces}, then we would require them to
+implement a database interface. Because of the lack of interfaces in
+the PHP language we're left with this description of what a database
+backend has to satisfy.
+
+All database backends are defined in their own class which is a
+subclass of the @code{pw_db_common} class. If we pretend that we have
+a @code{pw_db_foo} database backend, then it must implement
+the following methods:
+
+@defmethod pw_db_foo get_type
+This should return the type of the backend, @samp{foo} in our case.
+@end defmethod
+
+@defmethod pw_db_foo connect
+This is called by every other method that wants to ensure that the
+database is up and running. The method should cache the result of this
+operation as it will be called several times.
+@end defmethod
+
+@defmethod pw_db_foo disconnect
+This disconnects from the database.
+@end defmethod
+
+@defmethod pw_db_foo insert_metar $station $metar $timestamp
+Inserts a METAR into the database.
+@end defmethod
+
@node Using PHP Weather
@chapter Using PHP Weather
|
|
From: Ondrej J. <ne...@us...> - 2002-12-19 01:07:29
|
Update of /cvsroot/phpweather/phpweather/output
In directory sc8-pr-cvs1:/tmp/cvs-serv8860
Modified Files:
pw_text_sk.php
Log Message:
Added method parse_runway_group() to have better handling of runway
visibilities in slovak translation.
Index: pw_text_sk.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text_sk.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- pw_text_sk.php 16 Dec 2002 00:15:52 -0000 1.4
+++ pw_text_sk.php 19 Dec 2002 01:07:24 -0000 1.5
@@ -272,6 +272,20 @@
return parent::parse_cloud_group($cloud_group);
}
+ function parse_runway_group($runway_group)
+ {
+ if (empty($runway_group) || !is_array($runway_group)) {
+ return;
+ }
+ // Supposing, that runway visibility will always greter than 4 metres.
+ // I cannot imagine airport runway with visibility under 5 metres. :-)
+ $old_meters = $this->strings['meters'];
+ $this->strings['meters'] = ' metrov';
+ $ret = parent::parse_runway_group($runway_group);
+ $this->strings['meters'] = $old_meters;
+ return $ret;
+ }
+
function print_pretty_time($time)
{
$minutes_old = round((time() - $time)/60);
|
|
From: Ondrej J. <ne...@us...> - 2002-12-16 00:15:57
|
Update of /cvsroot/phpweather/phpweather/output
In directory sc8-pr-cvs1:/tmp/cvs-serv4985
Modified Files:
pw_text_sk.php
Log Message:
Added proper snowing handling.
Removed some unneccessary comments at the end of file.
Index: pw_text_sk.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text_sk.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- pw_text_sk.php 5 Sep 2002 01:47:18 -0000 1.3
+++ pw_text_sk.php 16 Dec 2002 00:15:52 -0000 1.4
@@ -314,7 +314,8 @@
$this->strings['weather']['+'] = ' hustým ';
$this->strings['weather']['RA'] = ' da¾ïom';
$this->strings['with'] = ' a ';
- } elseif ($weather[$k]['precipitation'] == 'DZ') { // mrholenie
+ } elseif ($weather[$k]['precipitation'] == 'DZ' // mrholenie
+ || $weather[$k]['precipitation'] == 'SN') { // sne®enie
$this->strings['weather']['-'] = ' riedke ';
$this->strings['weather'][' '] = ' stredné ';
$this->strings['weather']['+'] = ' husté ';
@@ -345,26 +346,15 @@
/*
-NOTES:
-------
+Some advanced (problematic?) metars to test:
-Metars to test:
-+----+------+---------------------------------------------------------------------------------+
-| cc | icao | metar |
-+----+------+---------------------------------------------------------------------------------+
-| FI | EFKK | EFKK 281950Z 18008KT 150V220 9999 -SHRA FEW012 SCT016 BKN020 BKN075 12/12 Q0998 |
-| KH | VDPP | VDPP 281030Z 23008KT 9000 FEW015 FEW025CB SCT300 33/26 Q1008 CB:S/NW/E |
-+----+------+---------------------------------------------------------------------------------+
-
-Why is there backslash instead of slash in Airport name?
-cc=DJ&icao=HDAM
-
-Problematic metars:
+EFKK 281950Z 18008KT 150V220 9999 -SHRA FEW012 SCT016 BKN020 BKN075 12/12 Q0998
+VDPP 281030Z 23008KT 9000 FEW015 FEW025CB SCT300 33/26 Q1008 CB:S/NW/E
+LZIB 150730Z 10005MPS 1200 R31/P1500N R22/P1500N -SN BR OVC006 M03/M04 Q1026 NOSIG
201530Z VABB 24012KT 5000 FU FEW018 SCT025 28/22 Q1004 NOSIG
MWCR 2820000Z 12016KT 9999 HZ FEW016 BKN200 32/25 Q1015 NOSIG
CYZT 281900Z 10019G26KT 20SM VCSH FEW025 BKN050 OVC110 13/09 A2956 RMK SC1SC6AC2 SLP009
-
- */
+*/
?>
|
|
From: Martin G. <gim...@us...> - 2002-11-10 23:22:19
|
Update of /cvsroot/phpweather/phpweather-1.x In directory usw-pr-cvs1:/tmp/cvs-serv25821 Modified Files: demo.php locale_mt.inc Log Message: Updated Maltese translation thanks to Angelo Dalli. Index: demo.php =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/demo.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- demo.php 4 Oct 2002 21:31:40 -0000 1.9 +++ demo.php 10 Nov 2002 23:22:16 -0000 1.10 @@ -179,6 +179,7 @@ 'el' => 'Greek', 'hu' => 'Hungarian', 'it' => 'Italian', + 'mt' => 'Maltese', 'no' => 'Norwegian', 'es' => 'Spanish' ); Index: locale_mt.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/locale_mt.inc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- locale_mt.inc 2 Apr 2002 22:21:26 -0000 1.3 +++ locale_mt.inc 10 Nov 2002 23:22:16 -0000 1.4 @@ -40,7 +40,7 @@ 'wind_str_calm' => '<b>kalm</b>', 'wind_vrb_long' => 'direzzjoni varjabbli', 'wind_vrb_short' => 'VAR', - 'windchill' => ' the windchill was <b>%s</b> °C (<b>%s</b> °F) ', + 'windchill' => ' il-kesha minhabba r-rih kienet <b>%s</b> °C (<b>%s</b> °F) ', 'precip_last_hour' => 'fl-ahhar siegha. ', 'precip_last_6_hours' => 'fl-ahhar 3 sa 6 sieghat. ', 'precip_last_24_hours' => 'fl-ahhar 24 siegha. ', |
|
From: Martin G. <gim...@us...> - 2002-11-10 23:18:46
|
Update of /cvsroot/phpweather/phpweather/output
In directory usw-pr-cvs1:/tmp/cvs-serv24394
Modified Files:
pw_text_da.php pw_text_no.php
Log Message:
Removed extra space in Danish translation, and added missing string to
Norwegian translation, perhaps you could verify that this means what I
think it means in Norwegian, Sven-Erik?
Index: pw_text_da.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text_da.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- pw_text_da.php 20 Oct 2002 15:57:15 -0000 1.9
+++ pw_text_da.php 10 Nov 2002 23:18:43 -0000 1.10
@@ -120,7 +120,7 @@
array('-' => 'let ',
' ' => 'moderat ',
'+' => 'kraftig ',
- 'VC' => ' i nærheden',
+ 'VC' => ' i nærheden',
'PR' => ' delvis',
'BC' => ' banker af',
'MI' => ' lave',
Index: pw_text_no.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text_no.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- pw_text_no.php 20 Oct 2002 15:57:15 -0000 1.9
+++ pw_text_no.php 10 Nov 2002 23:18:43 -0000 1.10
@@ -120,6 +120,7 @@
'-' => 'lett ',
' ' => 'moderat ',
'+' => 'kraftig ',
+ 'VC' => ' i nærheden',
'PR' => 'delvis ',
'BC' => 'banker ',
'MI' => 'shallow ',
|
|
From: Martin G. <gim...@us...> - 2002-11-10 23:15:45
|
Update of /cvsroot/phpweather/phpweather/db In directory usw-pr-cvs1:/tmp/cvs-serv23055/db Added Files: pw_db_adodb.php Log Message: A new database backend: ADOdb. This is a wrapper library written in PHP that supports no less than 28(!) databases. So now there's no excuse for not using a database with PHP Weather. --- NEW FILE --- <?php require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_common.php'); /** * This class interfaces with the 'adodb' database wrapper library. * You'll need to install ADOdb from * * http://php.weblogs.com/adodb * * before you can use this backend with PHP Weather. * * It implements all the methods necessary to insert, update and * retrive METARs using a database wrapped in the ADOdb library. * * @author Martin Geisler <gim...@gi...> * @version $Id: pw_db_adodb.php,v 1.1 2002/11/10 23:15:42 gimpster Exp $ */ class pw_db_adodb extends pw_db_common { /** * This constructor just calls the parent constructor. * * @param array the initial properties of the object */ function pw_db_adodb($input) { $this->pw_db_common($input); } /** * Gets the type of the database. * * @return string The type of the database, 'adodb' in this case. * @access public */ function get_type() { return 'adodb'; } /** * Establishes a connection to the database. * * If there has already been made a connection to the database, this * function just returns true, and nothing will be changed. This * means that it is safe to call this instead of testing * $is_connected. If $properties['db_pconnect'] is true, then a * persistent connection will be established. * * @return boolean Returns true, if a connection were established, * false otherwise. * @access public * @see disconnect() */ function connect() { /* Connect to the server */ if ($this->is_connected) { return true; } if (!empty($this->properties['db_adodb_ext'])) { if (!extension_loaded($this->properties['db_adodb_ext_name'])) { dl($this->properties['db_adodb_ext_file']); } } include_once($this->properties['db_adodb_path'] . '/adodb.inc.php'); /* What to do about non-standard port numbers? */ $this->link_id = &ADONewConnection($this->properties['db_adodb_driver']); if ($this->properties['db_pconnect']) { $this->link_id->PConnect($this->properties['db_hostname'], $this->properties['db_username'], $this->properties['db_password'], $this->properties['db_database']); } else { $this->link_id->Connect($this->properties['db_hostname'], $this->properties['db_username'], $this->properties['db_password'], $this->properties['db_database']); } if ($this->link_id) { $this->is_connected = true; } else { $this->is_connected = false; } return $this->is_connected; } /** * Disconnects from the database. * * If we're already disconnected from the database, this function * will just return true. * * @return boolean If the disconnec was succesfull then it returns * true, otherwise it returns false. * @access public * @see connect() */ function disconnect() { if (!$this->is_connected || $this->link_id->Close()) { $this->is_connected = false; return true; } else { return false; } } /** * Selects a database. * * @return boolean Returns true, since this is already done in * connect(). * @access public */ function select_db() { return true; } /** * Executes a SQL-query. * * $result_id is updated as well * * @param string The SQL-statement. * @return boolean True on success, false otherwise. * @access public */ function query($query) { $this->result_id = &$this->link_id->Execute($query); if (!$this->result_id) { $this->error($this->link_id->ErrorMsg()); return false; } return true; } /** * Fetches a row as an array from the database. * * @return array The next row from the result-set. * @access public */ function fetch_row() { return $this->fetch_array(); } /** * Fetches a row as an associative array from the database. * * @return array The next row from the result-set, as an associative * array. * @access public */ function fetch_array() { if ($this->result_id->EOF) { return false; } else { $row = $this->result_id->fields; $this->result_id->MoveNext(); return $row; } } /** * Returns the number of rows in the result-set. * * @return integer The number of rows in the current result-set. * @access public */ function num_rows() { return $this->result_id->RecordCount(); } /** * Inserts a METAR into the database. * * @param string The ICAO of the station. * @param string The raw METAR. * @param integer A standard UNIX timestamp. * @access public * @see update_metar() */ function insert_metar($icao, $metar, $timestamp) { $this->query(sprintf('INSERT INTO %s SET icao = "%s", ' . 'metar = "%s", timestamp = FROM_UNIXTIME(%d)', $this->properties['db_metars'], $icao, addslashes($metar), intval($timestamp))); } /** * Updates an existing METAR in the database. * * @param string The ICAO of the station. * @param string The raw METAR. * @param integer A standard UNIX timestamp. * @access public * @see insert_metar() */ function update_metar($icao, $metar, $timestamp) { $this->query(sprintf('UPDATE %s' . ' SET metar = "%s", timestamp = FROM_UNIXTIME(%d)' . ' WHERE icao = "%s"', $this->properties['db_metars'], addslashes($metar), intval($timestamp), $icao)); } /** * Gets a METAR form the database. * * @param string The ICAO of the station. * @return string The raw METAR as an array from the database. * @access public */ function get_metar($icao) { $this->query(sprintf('SELECT metar, UNIX_TIMESTAMP(timestamp)' . ' FROM %s WHERE icao = "%s"', $this->properties['db_metars'], $icao)); return $this->fetch_row(); } /** * Creates the necessary tables in the database. * * @return bool Returns true if it could connect to the database, * false otherwise. * @access private */ function create_tables() { if (!$this->connect()) { return false; // Failure! } /* First we make a table for the METARs */ $this->query('DROP TABLE IF EXISTS ' . $this->properties['db_metars']); $this->query('CREATE TABLE ' . $this->properties['db_metars'] . '( icao char(4) NOT NULL, metar varchar(255) NOT NULL, timestamp timestamp(14), PRIMARY KEY (icao), UNIQUE icao (icao))'); /* Then we make a table for the stations. */ $this->query('DROP TABLE IF EXISTS ' . $this->properties['db_stations']); $this->query('CREATE TABLE ' . $this->properties['db_stations'] . '( icao char(4) NOT NULL, name varchar(255) NOT NULL, cc char(2) NOT NULL, country varchar(128) NOT NULL, PRIMARY KEY (icao), UNIQUE icao (icao), KEY cc (cc))'); return true; // Success! } /** * Fetches information about an ICAO. * * The array returned contains three entries: the name of the * station, the name of the country, the country code of the * country. * * @param string The ICAO one want's to translate. * @return array Information about the ICAO or false if no * information is available. * @access public */ function lookup_icao($icao) { $this->query(sprintf('SELECT name, country, cc FROM %s WHERE icao = "%s"', $this->properties['db_stations'], addslashes($icao))); if ($this->num_rows() == 1) { $this->debug("Found ICAO '$icao' in database."); return $this->fetch_row(); } else { $this->debug("Could not find ICAO '$icao' in database."); return false; } } /** * Inserts the stations into the database. * * It is assumed that create_tables() has been called previously * (and that it returned true), so that the necessary tables are * already created. * * @param array This three-dimensional array starts with a list of * contry-codes. For each country-code the ICAOs and corresponding * locations in that particular country are listed as key => value * pairs. * @param array An associative array with country-codes as the keys * and the names of the countries as the values. * @return bool * @access private */ function insert_stations($data, $countries) { if (!$this->connect()) { return false; } while(list($cc, $country) = each($countries)) { /* The country names might contain dangerous characters. */ $country = addslashes($country); while(list($icao, $location) = each($data[$cc])) { /* The station name might also be dangerous. */ $location = addslashes($location); $this->query(sprintf('INSERT INTO %s VALUES ("%s", "%s", "%s", "%s")', $this->properties['db_stations'], $icao, addslashes($location), addslashes($cc), addslashes($country))); } } return true; } /** * Returns a list of available countries. * * @return array An associative array with the country-codes as the * keys and the names of the countries as the values. * @access public */ function get_countries() { if (!$this->connect()) { return false; } $this->query('SELECT DISTINCT cc, country FROM ' . $this->properties['db_stations'] . ' ORDER BY country'); while($row = $this->fetch_row()) { $rows[$row[0]] = $row[1]; } return $rows; } /** * Returns an array of stations. * * @param string The country-code. * @param string This parameter is passed by reference. The name of * the country that corresponds to the country-code * is stored here. * @return array An associative array with the ICAO as the key and * the name of the station as the values. The name * of the country is not added to the name of the * station. * @access public */ function get_icaos($cc, &$country) { if (!$this->connect()) { return false; } $this->query(sprintf('SELECT icao, name, country FROM %s' .' WHERE cc = "%s" ORDER BY name', $this->properties['db_stations'], addslashes($cc))); /* We have to do this manually the first time, so that we can set $country */ list($icao, $name, $country) = $this->fetch_row(); $rows[$icao] = $name; while(list($icao, $name) = $this->fetch_row()) { $rows[$icao] = $name; } return $rows; } } ?> |
|
From: Martin G. <gim...@us...> - 2002-11-10 23:15:44
|
Update of /cvsroot/phpweather/phpweather/config
In directory usw-pr-cvs1:/tmp/cvs-serv23055/config
Modified Files:
make_config.php
Log Message:
A new database backend: ADOdb. This is a wrapper library written in
PHP that supports no less than 28(!) databases. So now there's no
excuse for not using a database with PHP Weather.
Index: make_config.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/config/make_config.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- make_config.php 2 Sep 2002 18:17:52 -0000 1.5
+++ make_config.php 10 Nov 2002 23:15:41 -0000 1.6
@@ -52,6 +52,11 @@
$sql_dep = new pw_dependency_or('db_type', array('mysql', 'pgsql'));
$dba_dep = new pw_dependency('db_type', 'dba');
$proxy_dep = new pw_dependency('use_proxy', 'true');
+ $adodb_dep = new pw_dependency('db_type', 'adodb');
+ $adodb_ext_dep = new pw_dependency('db_adodb_ext', 'true');
+
+ $not_empty_validator = new pw_validator_ereg("Sorry, the empty string '' cannot be " .
+ "used here", '^.+$');
$port_validator = new pw_validator_range("Sorry, '%s' is not a valid port-number " .
"because is't outside the range 1-65536",
@@ -147,7 +152,55 @@
array('null' => 'No database at all',
'mysql' => 'A MySQL database',
'pgsql' => 'A PostgreSQL database',
- 'dba' => 'A DBA database'));
+ 'dba' => 'A DBA database',
+ 'adodb' => 'The ADOdb wrapper library'));
+
+ $options['db_adodb_path'] =
+ new pw_option_text('db_adodb_path',
+ "We need to know where we can find the ADOdb library. " .
+ "The default is for a Debian GNU/Linux system, but " .
+ "you'll probably have to change it.",
+ array($adodb_dep),
+ false, // we could try to validate the path...
+ '/usr/share/adodb');
+
+ $options['db_adodb_driver'] =
+ new pw_option_text('db_adodb_driver',
+ "Please select a driver to use with the ADOdb " .
+ "wrapper library. You can get a list of drivers from " .
+ '<a href="http://php.weblogs.com/ADODB_Manual#drivers">' .
+ "the ADOdb Manual</a>.",
+ array($adodb_dep),
+ $not_empty_validator);
+
+ $options['db_adodb_ext'] =
+ new pw_option_boolean('db_adodb_ext',
+ "If you need to load an extension for ADOdb to work, " .
+ "then set this option to 'Yes'. PHP might have been " .
+ "compiled with support for MySQL, but the extension " .
+ "isn't necessarily loaded.",
+ array($adodb_dep),
+ array('false' => 'No', 'true' => 'Yes'));
+
+ $options['db_adodb_ext_name'] =
+ new pw_option_text('db_adodb_ext_name',
+ "If you need to load an extension go get your database " .
+ "to work, then specify the name here. For example, if " .
+ "you're using MySQL, then the extension is called " .
+ "'mysql', or if you're using PostgreSQL, then it's " .
+ "called 'pgsql'.",
+ array($adodb_ext_dep),
+ $not_empty_validator);
+
+ $options['db_adodb_ext_file'] =
+ new pw_option_text('db_adodb_ext_file',
+ "The name of the extension isn't enough to guess the " .
+ "filename to load. For example, if you're using the " .
+ "'mysql' extension with the MySQL database, then the " .
+ "file to load is either 'mysql.so' on a Unix based " .
+ "system, or 'mysql.dll' on a Windows based system.",
+ array($adodb_ext_dep),
+ $not_empty_validator);
$options['db_handler'] =
new pw_option_select('db_handler',
@@ -303,7 +356,9 @@
'retrieves. This is very nice, since it takes at ' .
'least a second or two to fetch a METAR from the ' .
'National Weather Service.',
- array('db_type', 'db_handler', 'db_pconnect', 'always_use_db',
+ array('db_type', 'db_adodb_path', 'db_adodb_driver',
+ 'db_adodb_ext', 'db_adodb_ext_name', 'db_adodb_ext_file',
+ 'db_handler', 'db_pconnect', 'always_use_db',
'cache_timeout', 'db_hostname', 'db_port',
'db_username', 'db_password', 'db_database',
'db_metars', 'db_stations', 'db_countries'),
|
|
From: Martin G. <gim...@us...> - 2002-11-10 23:15:44
|
Update of /cvsroot/phpweather/phpweather
In directory usw-pr-cvs1:/tmp/cvs-serv23055
Modified Files:
db_layer.php
Log Message:
A new database backend: ADOdb. This is a wrapper library written in
PHP that supports no less than 28(!) databases. So now there's no
excuse for not using a database with PHP Weather.
Index: db_layer.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/db_layer.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- db_layer.php 15 May 2002 22:23:26 -0000 1.13
+++ db_layer.php 10 Nov 2002 23:15:40 -0000 1.14
@@ -1,10 +1,6 @@
<?php
require_once(PHPWEATHER_BASE_DIR . '/base_object.php');
-require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_null.php');
-require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_dba.php');
-require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_mysql.php');
-require_once(PHPWEATHER_BASE_DIR . '/db/pw_db_pgsql.php');
/**
* This class is used to maintain the database-object.
@@ -49,18 +45,27 @@
*/
function set_db_type($type) {
$this->properties['db_type'] = $type;
+
switch ($type) {
case 'null':
+ include_once(PHPWEATHER_BASE_DIR . '/db/pw_db_null.php');
$this->db = new pw_db_null($this->properties);
break;
case 'mysql':
+ include_once(PHPWEATHER_BASE_DIR . '/db/pw_db_mysql.php');
$this->db = new pw_db_mysql($this->properties);
break;
case 'pgsql':
+ include_once(PHPWEATHER_BASE_DIR . '/db/pw_db_pgsql.php');
$this->db = new pw_db_pgsql($this->properties);
break;
case 'dba':
+ include_once(PHPWEATHER_BASE_DIR . '/db/pw_db_dba.php');
$this->db = new pw_db_dba($this->properties);
+ break;
+ case 'adodb':
+ include_once(PHPWEATHER_BASE_DIR . '/db/pw_db_adodb.php');
+ $this->db = new pw_db_adodb($this->properties);
break;
default:
$this->error('db_type not recognized: <code>' .
|
|
From: Martin G. <gim...@us...> - 2002-11-10 23:10:50
|
Update of /cvsroot/phpweather/phpweather
In directory usw-pr-cvs1:/tmp/cvs-serv22165
Modified Files:
test.php
Log Message:
Make this work with PHP 4.2.3.
Index: test.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/test.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- test.php 26 Aug 2002 15:55:53 -0000 1.5
+++ test.php 10 Nov 2002 23:10:46 -0000 1.6
@@ -19,6 +19,9 @@
<?php
error_reporting(E_ALL);
+/* We need the GET variables: */
+extract($HTTP_GET_VARS);
+
/* Load PHP Weather */
require('phpweather.php');
/* Load utilities to make forms */
@@ -33,7 +36,7 @@
<form action="test.php" method="GET">
<p>Metar: <input type="text" name="metar" size="60"
value="<?php if (!empty($metar)) echo $metar; ?>"></p>
-<p>Language: <?php echo get_languages_select($weather, $language); ?>
+<p>Language: <?php echo get_languages_select($language); ?>
<input type="submit"></p>
</form>
|
|
From: Max H. <ir...@us...> - 2002-10-29 08:52:50
|
Update of /cvsroot/phpweather/phpweather
In directory usw-pr-cvs1:/tmp/cvs-serv19480
Modified Files:
data_retrieval.php
Log Message:
Oops. I think this was my first contribution to the project, and it's taken this long to spot the problem with it :)
Index: data_retrieval.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/data_retrieval.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- data_retrieval.php 22 Sep 2002 09:53:12 -0000 1.29
+++ data_retrieval.php 29 Oct 2002 08:52:43 -0000 1.30
@@ -135,7 +135,7 @@
$request = "HTTP/1.1\r\n" .
"If-Modified-Since: Sat, 29 Oct 1994 09:00:00 GMT\r\n" .
"Pragma: no-cache\r\n".
- "Cache-Contol: no-cache\r\n";
+ "Cache-Control: no-cache\r\n";
if ($this->properties['use_proxy']) {
/* We use a proxy */
|
|
From: Martin G. <gim...@us...> - 2002-10-25 02:20:25
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv11925 Modified Files: AUTHORS Log Message: Cool - a French translation thanks to Guillaume Petit <gp...@fr...>! Index: AUTHORS =================================================================== RCS file: /cvsroot/phpweather/phpweather/AUTHORS,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- AUTHORS 27 Sep 2002 20:24:45 -0000 1.8 +++ AUTHORS 24 Oct 2002 15:54:46 -0000 1.9 @@ -98,3 +98,6 @@ Radoslava Fedáková <mor...@po...> Czech translation. + +Guillaume Petit <gp...@fr...> + Translated PHP Weather into French. |
|
From: Martin G. <gim...@us...> - 2002-10-25 02:20:25
|
Update of /cvsroot/phpweather/phpweather/output In directory usw-pr-cvs1:/tmp/cvs-serv11925/output Added Files: pw_text_fr.php Log Message: Cool - a French translation thanks to Guillaume Petit <gp...@fr...>! --- NEW FILE --- <?php require_once(PHPWEATHER_BASE_DIR . '/output/pw_text.php'); /** * Provides all the strings needed by pw_text to produce French * output. * Contient toutes les chaines nécessaires à pw_text * pour produire un texte en Français. * * @author Guillaume Petit <gp...@fr...> * @link http://gpetit.fr.st My homepage. * @version pw_text_fr.php,v 1.1 2002/10/23 16:53:40 gimpster Exp */ class pw_text_fr extends pw_text { /** * This constructor provides all the strings used. * * @param array This is just passed on to pw_text(). */ function pw_text_fr($weather, $input = array()) { $this->strings['charset'] = 'ISO-8859-1'; $this->strings['no_data'] = 'Désolé! Pas d\'infos disponibles pour %s%s%s.'; $this->strings['list_sentences_and'] = ' et '; $this->strings['list_sentences_comma'] = ', '; $this->strings['list_sentences_final_and'] = ', et '; $this->strings['location'] = 'Voici le bulletin pour %s%s%s.'; $this->strings['minutes'] = ' minutes'; $this->strings['time_format'] = 'Le bulletin a été fait il y a %s , à %s%s%s UTC.'; $this->strings['time_minutes'] = 'et %s%s%s minutes'; $this->strings['time_one_hour'] = '%sune%s heure %s'; $this->strings['time_several_hours'] = '%s%s%s heures %s'; $this->strings['time_a_moment'] = 'un moment'; $this->strings['meters_per_second'] = ' mètres par seconde'; $this->strings['miles_per_hour'] = ' miles par heure'; $this->strings['meter'] = ' mètres'; $this->strings['meters'] = ' mètres'; $this->strings['feet'] = ' pieds'; $this->strings['kilometers'] = ' kilomètres'; $this->strings['miles'] = ' miles'; $this->strings['and'] = ' et '; $this->strings['plus'] = ' plus '; $this->strings['with'] = ' avec '; $this->strings['wind_blowing'] = 'Le vent soufflait à la vitesse de '; $this->strings['wind_with_gusts'] = ' avec des rafales jusq\'à '; $this->strings['wind_from'] = ' de '; $this->strings['wind_variable'] = ' de direction %svariable%.'; $this->strings['wind_varying'] = ', variant entre %s%s%s (%s%s°%s) et %s%s%s (%s%s°%s)'; $this->strings['wind_calm'] = 'Le vent était %scalme%s'; $this->strings['wind_dir'] = array( 'Nord', 'Nord/Nord-est', 'Nord-est', 'Est/Nord-est', 'Est', 'Est/Sud-est', 'Sud-est', 'Sud/Sud-est', 'Sud', 'Sud/Sud-ouest', 'Sud-ouest', 'Ouest/Sud-ouest', 'Ouest', 'Ouest/Nord-ouest', 'Nord-ouest', 'Nord/Nord-ouest', 'Nord'); $this->strings['wind_dir_short'] = array( 'N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSO', 'SO', 'OSO', 'O', 'ONO', 'NO', 'NNO', 'N'); $this->strings['wind_dir_short_long'] = array( 'N' => 'nord', 'NE' => 'nord-est', 'E' => 'est', 'SE' => 'sud-est', 'S' => 'sud', 'SO' => 'sud-ouest', 'O' => 'ouest', 'NO' => 'nord-ouest' ); $this->strings['temperature'] = 'La température était de '; $this->strings['dew_point'] = ', avec un point de rosée à '; $this->strings['altimeter'] = 'La pression atmosphérique était de '; $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'L\'humidité relative était de '; $this->strings['feelslike'] = 'La température ressentie était de '; $this->strings['cloud_group_beg'] = 'Il y avait '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'Le ciel était %sclear%s.'; $this->strings['cloud_height'] = ' de nébulosité à une hauteur de '; $this->strings['cloud_overcast'] = 'Le ciel était %snuageux%s à partir d\'une hauteur de '; $this->strings['cloud_vertical_visibility'] = 'La %svisibilité verticale%s était de '; $this->strings['cloud_condition'] = array( 'SKC' => 'clair', 'CLR' => 'clair', 'FEW' => '1 à 2/8è', 'SCT' => '3 à 4/8è', 'BKN' => '5 à 7/8è', 'OVC' => '8/8è'); $this->strings['cumulonimbus'] = ' cumulonimbus'; $this->strings['towering_cumulus'] = ' cumulus congestus'; $this->strings['cavok'] = ' pas de nuages en-dessous de %s et pas de cumulonimbus'; $this->strings['currently'] = 'Actuellement '; $this->strings['weather'] = array( '-' => ' léger/legère', ' ' => ' moderé(e) ', '+' => ' fort(e) ', 'VC' => ' à proximité', 'PR' => ' partiel(le)', 'BC' => ' bancs', 'MI' => ' peu dense', 'DR' => ' dérivant', 'BL' => ' se développant', 'SH' => ' averses de', 'TS' => ' orage', 'FZ' => ' givrant', 'DZ' => ' bruine', 'RA' => ' pluie', 'SN' => ' neige', 'SG' => ' grésil', 'IC' => ' cristaux de glace', 'PL' => ' granules de glace', 'GR' => ' grêle', 'GS' => ' grêle fine', 'UP' => ' inconnu', 'BR' => ' brume', 'FG' => ' bruillard', 'FU' => ' fumée', 'VA' => ' cendre volcanique', 'DU' => ' poussière répandue', 'SA' => ' sable', 'HZ' => ' brume', 'PY' => ' gouttes', 'PO' => ' tourbillons de sable', 'SQ' => ' grains', 'FC' => ' tornade', 'SS' => ' tempête de sable/poussière'); $this->strings['visibility'] = 'La visibilité globale était de '; $this->strings['visibility_greater_than'] = 'supérieure à '; $this->strings['visibility_less_than'] = 'inférieure à '; $this->strings['visibility_to'] = ' à '; $this->strings['runway_upward_tendency'] = ' avec tendance à l\'%amélioration%s'; $this->strings['runway_downward_tendency'] = ' avec tendance à la %sdéterioration%s'; $this->strings['runway_no_tendency'] = ' sans tendance %sdistinctive%s'; $this->strings['runway_between'] = 'entre '; $this->strings['runway_left'] = ' gauche'; $this->strings['runway_central'] = ' centrale'; $this->strings['runway_right'] = ' droite'; $this->strings['runway_visibility'] = 'La visibilité était de '; $this->strings['runway_for_runway'] = ' pour la piste '; /* We run the parent constructor */ $this->pw_text($weather, $input); } } ?> |
|
From: Martin G. <gim...@us...> - 2002-10-20 15:57:21
|
Update of /cvsroot/phpweather/phpweather/output
In directory usw-pr-cvs1:/tmp/cvs-serv26239
Modified Files:
pw_text.php pw_text_da.php pw_text_en.php pw_text_no.php
Log Message:
Fix for a problem found by Sean <se...@ar...>. The problem
was, that the report said 'There were The sky was overcast...' when we
had a OVC cloud group. This should fix that problem.
I've also changed the translation of 'cloud_vertical_visibility' so
that it fits into the 'There was ...' part. I've updated the English,
Danish ans Norwegian translations.
Index: pw_text.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- pw_text.php 28 Aug 2002 21:12:16 -0000 1.15
+++ pw_text.php 20 Oct 2002 15:57:15 -0000 1.16
@@ -819,29 +819,42 @@
if (empty($clouds[0]) ||
$clouds[0]['condition'] == 'CLR' ||
$clouds[0]['condition'] == 'SKC') {
+ /* Nice, clear weather: */
return sprintf($this->strings['cloud_clear'],
$this->properties['mark_begin'],
$this->properties['mark_end']);
} else {
+ /* We have up to three cloud groups: */
+ $cloud_str0 = $cloud_str1 = $cloud_str2 = $ovc = '';
- $cloud_str1 = $this->parse_cloud_group($clouds[0]);
- if (!empty($clouds[1])) {
- $cloud_str2 = $this->parse_cloud_group($clouds[1]);
+
+ if ($clouds[0]['condition'] == 'OVC') {
+ /* The first layer is overcast so we can return
+ * immediately: */
+ return $this->parse_cloud_group($clouds[0]);
} else {
- $cloud_str2 = '';
+ $cloud_str0 = $this->parse_cloud_group($clouds[0]);
+ }
+
+ if (!empty($clouds[1])) {
+ if ($clouds[1]['condition'] == 'OVC') {
+ $ovc = $this->parse_cloud_group($clouds[1]);
+ } else {
+ $cloud_str1 = $this->parse_cloud_group($clouds[1]);
+ }
}
if (!empty($clouds[2])) {
- $cloud_str3 = $this->parse_cloud_group($clouds[2]);
- } else {
- $cloud_str3 = '';
+ if ($clouds[2]['condition'] == 'OVC') {
+ $ovc = $this->parse_cloud_group($clouds[2]);
+ } else {
+ $cloud_str2 = $this->parse_cloud_group($clouds[2]);
+ }
}
-
+
return $this->strings['cloud_group_beg'] .
- $this->list_sentences($cloud_str1,
- $cloud_str2,
- $cloud_str3) .
- $this->strings['cloud_group_end'];
+ $this->list_sentences($cloud_str0, $cloud_str1, $cloud_str2) .
+ $this->strings['cloud_group_end'] . ' ' . $ovc;
}
}
Index: pw_text_da.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text_da.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- pw_text_da.php 28 Aug 2002 21:13:40 -0000 1.8
+++ pw_text_da.php 20 Oct 2002 15:57:15 -0000 1.9
@@ -103,7 +103,7 @@
$this->strings['cloud_clear'] = 'Himlen var %sskyfri%s.';
$this->strings['cloud_height'] = ' skyer i en højde af ';
$this->strings['cloud_overcast'] = 'Himlen var %soverskyet%s i en højde af ';
- $this->strings['cloud_vertical_visibility'] = 'den %svertikale sigtbarhed%s var ';
+ $this->strings['cloud_vertical_visibility'] = 'en %svertikale sigtbarhed%s på ';
$this->strings['cloud_condition'] =
array(
'SKC' => 'skyfri',
Index: pw_text_en.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text_en.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- pw_text_en.php 28 Aug 2002 21:13:40 -0000 1.8
+++ pw_text_en.php 20 Oct 2002 15:57:15 -0000 1.9
@@ -104,7 +104,7 @@
$this->strings['cloud_clear'] = 'The sky was %sclear%s.';
$this->strings['cloud_height'] = ' clouds at a height of ';
$this->strings['cloud_overcast'] = 'The sky was %sovercast%s from a height of ';
- $this->strings['cloud_vertical_visibility'] = 'the %svertical visibility%s was ';
+ $this->strings['cloud_vertical_visibility'] = 'a %svertical visibility%s of ';
$this->strings['cloud_condition'] =
array(
'SKC' => 'clear',
Index: pw_text_no.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text_no.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- pw_text_no.php 28 Aug 2002 21:13:40 -0000 1.8
+++ pw_text_no.php 20 Oct 2002 15:57:15 -0000 1.9
@@ -103,7 +103,7 @@
$this->strings['cloud_clear'] = 'Himmelen var %sclear%s.';
$this->strings['cloud_height'] = ' skyer i en høyde av ';
$this->strings['cloud_overcast'] = 'himmelen var %sovercast%s fra en høyde av ';
- $this->strings['cloud_vertical_visibility'] = 'den %svertical visibility%s var ';
+ $this->strings['cloud_vertical_visibility'] = 'en %svertical visibility%s på ';
$this->strings['cloud_condition'] = array(
'SKC' => 'skyfri',
'CLR' => 'skyfri',
|
|
From: Martin G. <gim...@us...> - 2002-10-04 21:52:12
|
Update of /cvsroot/phpweather/phpweather-1.x In directory usw-pr-cvs1:/tmp/cvs-serv13147 Modified Files: ChangeLog Log Message: Added the latest entries. Index: ChangeLog =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/ChangeLog,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ChangeLog 29 Jun 2002 13:44:55 -0000 1.3 +++ ChangeLog 4 Oct 2002 21:52:09 -0000 1.4 @@ -1,3 +1,157 @@ +2002-10-04 21:50 Martin Geisler <gim...@gi...> + + * phpweather.inc: + + Bump the version number to 1.62. + +2002-10-04 21:31 Martin Geisler <gim...@gi...> + + * config-dist.inc, demo.php, phpweather.inc: + + Dave Yearke <ye...@en...> suggested that I should add an + $offset so that the user can correct the time on servers that + doesn't know their own timezone, etc. + + The demo-page was also updated so that it works with + register_globals turned off which is the default for a new + installation of PHP 4.2.0. + +2002-09-11 20:24 Martin Geisler <gim...@gi...> + + * phpweather.inc: + + This array must have been renamed somewhere along the way... Thanks + goes to CTomas <ct...@cl...> for finding this bug. + +2002-09-03 12:27 Martin Geisler <gim...@gi...> + + * AUTHORS: + + Added Pavlos Kallias <ka...@ci...>. + +2002-09-03 12:25 Martin Geisler <gim...@gi...> + + * demo.php, locale_el.inc: + + Another language joins the club! This time it's Greek thanks to P. + Kallias <ka...@ci...>. + +2002-09-03 12:23 Martin Geisler <gim...@gi...> + + * config-dist.inc, phpweather.inc: + + One can now specify $db_dir to place the databases somewhere else + than the current directory. The '/tmp' default should probably be + adapted for other platforms... + +2002-08-26 19:44 Martin Geisler <gim...@gi...> + + * config-dist.inc, phpweather.inc: + + This patch from Reini Urban <ru...@x-...> adds support for the + PHP database (dbm-style) abstraction layer. + + Also, the pretty_print_metar() function is now a wrapper around + get_pretty_print_metar() which ends by returning the pretty print + instead of printing it. + +2002-08-12 23:59 Martin Geisler <gim...@gi...> + + * phpweather.inc: + + Support for humidex thanks to Robin Senior + <8r...@ql...>. See this page for an explaination of + humidex: + + http://www.theweathernetwork.com/help/glossary/humidex.htm + +2002-08-11 11:38 Martin Geisler <gim...@gi...> + + * phpweather.inc: + + Ups! We've been lucky that most METARs fit on a single line... + +2002-08-08 17:46 Martin Geisler <gim...@gi...> + + * phpweather.inc: + + DBM databases now work again thanks to Stuart Henderson + <st...@sp...>. + +2002-07-17 18:07 Martin Geisler <gim...@gi...> + + * demo.php: + + Informed people, that they have to include images.inc before they + can use the functions get_temp_image($data), + get_winddir_image($data), and get_sky_image($data). + +2002-07-11 16:10 Martin Geisler <gim...@gi...> + + * AUTHORS: + + Entry for Fabio Parri <pa...@ut...>. + +2002-07-11 16:08 Martin Geisler <gim...@gi...> + + * pw_icons/: 0cloud.wbmp, 0cloud_fog.wbmp, 1cloud_fog.wbmp, + 1cloud_heavyrain.wbmp, 1cloud_lightrain.wbmp, 1cloud_modrain.wbmp, + 1cloud_norain.wbmp, 2cloud_fog.wbmp, 2cloud_hail.wbmp, + 2cloud_heavyrain.wbmp, 2cloud_lightrain.wbmp, 2cloud_modrain.wbmp, + 2cloud_norain.wbmp, 2cloud_snow.wbmp, 2cloud_thunders.wbmp, + 3cloud_fog.wbmp, 3cloud_hail.wbmp, 3cloud_heavyrain.wbmp, + 3cloud_lightrain.wbmp, 3cloud_modrain.wbmp, 3cloud_norain.wbmp, + 3cloud_snow.wbmp, 3cloud_thunders.wbmp, 4cloud_fog.wbmp, + 4cloud_heavyhail.wbmp, 4cloud_heavyrain.wbmp, + 4cloud_heavysnow.wbmp, 4cloud_lighthail.wbmp, + 4cloud_lightrain.wbmp, 4cloud_lightsnow.wbmp, 4cloud_modrain.wbmp, + 4cloud_norain.wbmp, 4cloud_thunders.wbmp, eee.wbmp, n_0cloud.wbmp, + n_0cloud_fog.wbmp, n_1cloud_fog.wbmp, n_1cloud_heavyrain.wbmp, + n_1cloud_lightrain.wbmp, n_1cloud_modrain.wbmp, + n_1cloud_norain.wbmp, n_2cloud_fog.wbmp, n_2cloud_hail.wbmp, + n_2cloud_heavyrain.wbmp, n_2cloud_lightrain.wbmp, + n_2cloud_modrain.wbmp, n_2cloud_norain.wbmp, n_2cloud_snow.wbmp, + n_2cloud_thunders.wbmp, n_3cloud_fog.wbmp, n_3cloud_hail.wbmp, + n_3cloud_heavyrain.wbmp, n_3cloud_lightrain.wbmp, + n_3cloud_modrain.wbmp, n_3cloud_norain.wbmp, n_3cloud_snow.wbmp, + n_3cloud_thunders.wbmp, ne.wbmp, nee.wbmp, nne.wbmp, nnn.wbmp, + nnw.wbmp, nodir.wbmp, nw.wbmp, nww.wbmp, se.wbmp, see.wbmp, + sse.wbmp, sss.wbmp, ssw.wbmp, sw.wbmp, sww.wbmp, temp_nodata.wbmp, + temphigh.wbmp, templow.wbmp, vrb.wbmp, wind_nodata.wbmp, www.wbmp: + + The WBMP files supplied by Fabio Parri <pa...@ut...> - thanks! + +2002-07-11 16:07 Martin Geisler <gim...@gi...> + + * images.inc, wap.php: + + Fabio Parri <pa...@ut...> has converted the images from GIF + format into WBMP format which can be used by WAP enabled phones. + + So the images.inc file has been changed so that the extension used + is configurable - this could be turned into a full-blown theming + system, but lets wait until someone submits another set of icons + before we do that... + +2002-07-11 15:57 Martin Geisler <gim...@gi...> + + * locale_it.inc: + + Missing space in comment. + +2002-07-01 21:40 Martin Geisler <gim...@gi...> + + * locale_it.inc: + + Fabio Parri <pa...@ut...> sent me this with some corrections - + thanks a lot! + +2002-06-29 13:44 Martin Geisler <gim...@gi...> + + * ChangeLog: + + Getting ready for release of version 1.61. + 2002-06-29 13:37 Martin Geisler <gim...@gi...> * AUTHORS, INSTALL, README: @@ -267,7 +421,7 @@ locale_it.inc, locale_mt.inc, locale_nl.inc, locale_no.inc, locale_po_br.inc, phpweather.inc, wap.php: - Initial revision + Initial import into CVS 2002-03-07 09:49 Martin Geisler <gim...@gi...> @@ -277,7 +431,7 @@ locale_it.inc, locale_mt.inc, locale_nl.inc, locale_no.inc, locale_po_br.inc, phpweather.inc, wap.php: - Initial import into CVS + Initial revision 2002-02-24 Martin Geisler <gim...@gi...> |
|
From: Martin G. <gim...@us...> - 2002-10-04 21:50:58
|
Update of /cvsroot/phpweather/phpweather-1.x
In directory usw-pr-cvs1:/tmp/cvs-serv12775
Modified Files:
phpweather.inc
Log Message:
Bump the version number to 1.62.
Index: phpweather.inc
===================================================================
RCS file: /cvsroot/phpweather/phpweather-1.x/phpweather.inc,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- phpweather.inc 4 Oct 2002 21:31:40 -0000 1.15
+++ phpweather.inc 4 Oct 2002 21:50:56 -0000 1.16
@@ -10,7 +10,7 @@
*/
/* This stores the version number in the variable $version. */
-$version = '1.61';
+$version = '1.62';
/* We start by loading the default configuration: */
require('config-dist.inc');
|
|
From: Martin G. <gim...@us...> - 2002-10-04 21:31:43
|
Update of /cvsroot/phpweather/phpweather-1.x In directory usw-pr-cvs1:/tmp/cvs-serv5220 Modified Files: config-dist.inc demo.php phpweather.inc Log Message: Dave Yearke <ye...@en...> suggested that I should add an $offset so that the user can correct the time on servers that doesn't know their own timezone, etc. The demo-page was also updated so that it works with register_globals turned off which is the default for a new installation of PHP 4.2.0. Index: config-dist.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/config-dist.inc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- config-dist.inc 3 Sep 2002 12:23:20 -0000 1.3 +++ config-dist.inc 4 Oct 2002 21:31:39 -0000 1.4 @@ -7,8 +7,13 @@ * file called 'config.php' and save your customizations there. The * 'config.php' file is loaded after this file so that you can * override the settings in this file. - * - * This $useXXX variables control the databaseformat PHP Weather uses. + */ + +/* Offset in hours to add to the time of a report. If all your times + * are 2 hours off, then set this to -2. */ +$offset = 0; + +/* The $useXXX variables control the databaseformat PHP Weather uses. * Set them all to 0 to turn database-support off. Then PHP Weather * will retrieve a new METAR everytime the script is called. It takes * about one second to retrieve a METAR, so you probably want to use a @@ -57,12 +62,13 @@ /* This lets you configure a proxy. If you want to use a proxy, set - the next variable to 1. */ + * the next variable to 1. */ $useProxy = 0; /* Then set this variable to the ip-number or hostname of the proxy. */ $proxy_host = 'proxy.your-isp.com'; /* Finally, change the port, if necessary. The popular Squid proxy - defaults to port 3128, but port 80 or 8080 is also commonly used. */ + * defaults to port 3128, but port 80 or 8080 is also commonly + * used. */ $proxy_port = 3128; ?> Index: demo.php =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/demo.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- demo.php 3 Sep 2002 12:25:05 -0000 1.8 +++ demo.php 4 Oct 2002 21:31:40 -0000 1.9 @@ -16,6 +16,18 @@ /* Support for including images: */ include('images.inc'); +/* We prepare some variables we'll need later. The variables might + * have been submitted by the user: */ +if (empty($HTTP_POST_VARS['city'])) + $city = 'BGTL'; +else + $city = $HTTP_POST_VARS['city']; + +if (empty($HTTP_POST_VARS['language'])) + $language = 'en'; +else + $language = $HTTP_POST_VARS['language']; + ?> <h1><a href="http://sourceforge.net/projects/phpweather/">PHP Weather</a></h1> @@ -171,10 +183,6 @@ 'es' => 'Spanish' ); -if (empty($language)) { - $language = 'en'; -} - while (list($lang_code, $locale) = each($languages)) { if ($lang_code == $language) { echo "<option selected value=\"$lang_code\">$locale</option>\n"; @@ -187,12 +195,13 @@ </form></p> <? -if (empty($city)) { - $city = 'BGTL'; -} + $metar = get_metar($city); + include('locale_' . $language . '.inc'); + pretty_print_metar($metar, $cities[$city]) ?> + <blockquote> <?php $decoded_metar = process_metar($metar); ?> <img src="<?php get_temp_image($decoded_metar) ?>" height="50" width="20" border="1"> Index: phpweather.inc =================================================================== RCS file: /cvsroot/phpweather/phpweather-1.x/phpweather.inc,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- phpweather.inc 11 Sep 2002 20:24:56 -0000 1.14 +++ phpweather.inc 4 Oct 2002 21:31:40 -0000 1.15 @@ -650,7 +650,7 @@ * array with entries like 'temp_c', 'visibility_miles' etc. */ global $strings, $wind_dir_text_short_array, $wind_dir_text_array, - $cloud_condition_array, $weather_array; + $cloud_condition_array, $weather_array, $offset; $temp_visibility_miles = ''; $cloud_layers = 0; @@ -696,12 +696,8 @@ * Date and Time of Report * We return a standard Unix UTC/GMT timestamp suitable for * gmdate() - * There has been a report about the time beeing wrong. If you - * experience this, then change the next line. You should - * add/subtract some hours to $regs[2], e.g. if all your times - * are 960 minutes off (16 hours) then add 16 to $regs[2]. */ - $decoded_metar['time'] = gmmktime($regs[2], $regs[3], 0, + $decoded_metar['time'] = gmmktime($regs[2] + $offset, $regs[3], 0, gmdate('m'), $regs[1], gmdate('Y')); } elseif (ereg('(AUTO|COR|RTD|CC[A-Z]|RR[A-Z])', $part, $regs)) { /* |
|
From: Ondrej J. <ne...@us...> - 2002-10-01 19:03:18
|
Update of /cvsroot/phpweather/phpweather/output
In directory usw-pr-cvs1:/tmp/cvs-serv16423
Modified Files:
pw_text_cs.php
Log Message:
Little fix in function parse_cloud_group($cloud_group).
Removed unneccessary test metars from the bottom of file.
Index: pw_text_cs.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/output/pw_text_cs.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- pw_text_cs.php 27 Sep 2002 20:24:46 -0000 1.1
+++ pw_text_cs.php 1 Oct 2002 19:03:15 -0000 1.2
@@ -249,7 +249,7 @@
if (isset($condition) && $condition == 'CAVOK') {
$this->strings['cloud_group_beg'] =
- str_replace(' byla ', ' nebyla ', $this->strings['cloud_group_beg']);
+ str_replace('Bylo ', 'Nebyla ', $this->strings['cloud_group_beg']);
}
return parent::parse_cloud_group($cloud_group);
@@ -295,29 +295,5 @@
return parent::print_pretty_weather($weather);
}
}
-
-/*
-
-NOTES:
-------
-
-Metars to test:
-+----+------+---------------------------------------------------------------------------------+
-| cc | icao | metar |
-+----+------+---------------------------------------------------------------------------------+
-| FI | EFKK | EFKK 281950Z 18008KT 150V220 9999 -SHRA FEW012 SCT016 BKN020 BKN075 12/12 Q0998 |
-| KH | VDPP | VDPP 281030Z 23008KT 9000 FEW015 FEW025CB SCT300 33/26 Q1008 CB:S/NW/E |
-+----+------+---------------------------------------------------------------------------------+
-
-Why is there backslash instead of slash in Airport name?
-cc=DJ&icao=HDAM
-
-Problematic metars:
-201530Z VABB 24012KT 5000 FU FEW018 SCT025 28/22 Q1004 NOSIG
-MWCR 2820000Z 12016KT 9999 HZ FEW016 BKN200 32/25 Q1015 NOSIG
-CYZT 281900Z 10019G26KT 20SM VCSH FEW025 BKN050 OVC110 13/09 A2956 RMK SC1SC6AC2 SLP009
-
-
- */
?>
|
|
From: Martin G. <gim...@us...> - 2002-09-27 20:24:48
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv20949 Modified Files: AUTHORS Log Message: Added Dutch and Czech translations and updated the AUTHORS file with Bas Elshof <ba...@el...>, Václav Ríkal <va...@ph...> and Radoslava Fedáková <mor...@po...>. Index: AUTHORS =================================================================== RCS file: /cvsroot/phpweather/phpweather/AUTHORS,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- AUTHORS 18 Sep 2002 13:24:33 -0000 1.7 +++ AUTHORS 27 Sep 2002 20:24:45 -0000 1.8 @@ -89,3 +89,12 @@ Paul Kairis <Pau...@sa...> Wrote the code that handles connections through a proxy server. + +Bas Elshof <ba...@el...> + Translated PHP Weather into Dutch. + +Václav Ríkal <va...@ph...> + Made a Czech translation. + +Radoslava Fedáková <mor...@po...> + Czech translation. |
|
From: Martin G. <gim...@us...> - 2002-09-27 20:24:48
|
Update of /cvsroot/phpweather/phpweather/output In directory usw-pr-cvs1:/tmp/cvs-serv20949/output Added Files: pw_text_cs.php pw_text_nl.php Log Message: Added Dutch and Czech translations and updated the AUTHORS file with Bas Elshof <ba...@el...>, Václav Ríkal <va...@ph...> and Radoslava Fedáková <mor...@po...>. --- NEW FILE --- <?php require_once(PHPWEATHER_BASE_DIR . '/output/pw_text.php'); /** * Provides all the strings needed by pw_text to produce Czech * output. * * @author Václav Øíkal <va...@ph...> * @author Ondrej Jombík <ne...@po...> * @author Radoslava Fedáková <mor...@po...> * @link http://vac.ath.cx/ * @link http://www.nepto.sk/ Nepto.SK - homepage * @link http://www.platon.sk/ Platon software development group * * @version pw_text_cs.php,v 1.0 2002/09/22 21:13:40 gimpster Exp */ /* ViM 6.0 indentation used */ class pw_text_cs extends pw_text { /** * This constructor provides all the strings used. * * @param array This is just passed on to pw_text(). */ function pw_text_cs($weather, $input = array()) { $this->strings['charset'] = 'ISO-8859-2'; $this->strings['no_data'] = 'Lituji, nejsou dostupné ¾ádné informace pro %s%s%s.'; $this->strings['list_sentences_and'] = ' a '; $this->strings['list_sentences_comma'] = ', '; $this->strings['list_sentences_final_and'] = ' a '; $this->strings['location'] = 'Toto je meterologická zpráva leti¹tì %s%s%s.'; $this->strings['minutes'] = ' minutami'; $this->strings['time_format'] = 'Zpráva byla sestavena pøed %s, v %s%s%s UTC.'; $this->strings['time_minutes'] = 'a %s%s%s minutami'; $this->strings['time_one_hour'] = '%sjednou%s hodinou %s'; $this->strings['time_several_hours'] = '%s%s%s hodinami %s'; $this->strings['time_a_moment'] = 'právì teï'; $this->strings['meters_per_second'] = ' metrù za sekundu'; $this->strings['miles_per_hour'] = ' mil za hodinu'; $this->strings['meter'] = ' metrù'; $this->strings['meters'] = ' metry'; $this->strings['feet'] = ' stop'; $this->strings['kilometers'] = ' kilometrù'; $this->strings['miles'] = ' mil'; $this->strings['and'] = ' a '; $this->strings['plus'] = ' plus '; $this->strings['with'] = ' s '; $this->strings['wind_blowing'] = 'Rychlost vìtru byla '; $this->strings['wind_with_gusts'] = ' se silnými nárazy od '; $this->strings['wind_from'] = ' z '; $this->strings['wind_variable'] = ' z %srùzných%s smìrù'; $this->strings['wind_varying'] = ', promìnlivý vítr od %s%s%s (%s%s°%s) a %s%s%s (%s%s°%s)'; $this->strings['wind_calm'] = 'Bylo %sbezvìtøí%s'; $this->strings['wind_dir'] = array('severu', 'severu/severovýchodu', 'severovýchodu', 'východu/severovýchodu', 'východu', 'východu/jihovýchodu', 'jihovýchodu', 'jihu/jihovýchodu', 'jihu', 'jihu/jihozápadu', 'jihozápadu', 'západu/jihozápadu', 'západu', 'západu/severozápadu', 'severozápadu', 'severu/severozápadu', 'severu'); $this->strings['wind_dir_short'] = array('S', 'SSV', 'SV', 'VSV', 'V', 'VJV', 'JV', 'JJV', 'J', 'JJZ', 'JZ', 'ZJZ', 'Z', 'ZSZ', 'SZ', 'SSZ', 'S'); $this->strings['wind_dir_short_long'] = array('S' => 'sever', 'SV' => 'severovýchod', 'V' => 'východ', 'JV' => 'jihovýchod', 'J' => 'jih', 'JZ' => 'jihozápad', 'Z' => 'západ', 'SZ' => 'severozápad'); $this->strings['temperature'] = 'Teplota byla '; $this->strings['dew_point'] = ' a rosný bod byl '; $this->strings['altimeter'] = 'Atmosférický tlak byl '; $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'Relativní vlhkost vzduchu byla '; $this->strings['feelslike'] = 'Teplota sa zdála být '; $this->strings['cloud_group_beg'] = 'Bylo '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'Obloha byla %sjasná%s.'; $this->strings['cloud_height'] = ' se základnou mrakù ve vý¹ce '; $this->strings['cloud_overcast'] = ' obloha byla %szata¾ená%s od vý¹ky '; $this->strings['cloud_vertical_visibility'] = '%svertikální viditelnost%s byla '; $this->strings['cloud_condition'] = array('SKC' => 'jasno', 'CLR' => 'jasno', 'FEW' => 'skorojasno', /*'niekoµko',*/ 'SCT' => 'polojasno', 'BKN' => 'oblaèno', 'OVC' => 'zata¾eno'); $this->strings['cumulonimbus'] = ' cumulonimbus'; $this->strings['towering_cumulus'] = ' kupovitá oblaènost'; /*tyèíci se nahromadìné - to je pøece blbost*/ $this->strings['cavok'] = ' ¾ádná oblaènost pod %s ani ¾ádná kupovitá oblaènost'; $this->strings['currently'] = 'Aktuální poèasí: '; $this->strings['weather'] = array(/* Intensity */ '-' => ' slabý ', ' ' => ' støední ', '+' => ' silný ', /* Proximity */ 'VC' => ' v blízkosti', /* Descriptor */ 'PR' => ' pøevá¾nì pokrývající leti¹tì', 'BC' => ' pásy', 'MI' => ' pøízemní', 'DR' => ' nízko zvíøený', 'BL' => ' zvíøený', 'SH' => ' pøehánky', 'TS' => ' bouøka', 'FZ' => ' námrzající', /* Precipitation */ 'DZ' => ' mrholení', 'RA' => ' dé¹»', /* ' da¾divo', */ 'SN' => ' sníh', 'SG' => ' zrnitý sníh', 'IC' => ' ledové krystalky', 'PL' => ' zmrzlý dé¹»', 'GR' => ' kroupy', 'GS' => ' slabé krupobití', 'UP' => ' neznámé', /* Obscuration */ 'BR' => ' kouømo', 'FG' => ' mlha', 'FU' => ' kouø', 'VA' => ' vulkanický popel', 'DU' => ' pra¹no', 'SA' => ' písek', /* píseèné */ 'HZ' => ' zákal', 'PY' => ' mrholení s malými kapkami', /* Other */ 'PO' => ' píseèné víry', 'SQ' => ' húlava', 'FC' => ' prùtr¾ mraèen', 'SS' => ' pra¹ná/píseèná bouøe'); $this->strings['visibility'] = 'Celková viditenost byla '; $this->strings['visibility_greater_than'] = 'vìt¹í ne¾ '; $this->strings['visibility_less_than'] = 'men¹í ne¾ '; $this->strings['visibility_to'] = ' do '; /* this is left untranslated, because I have no metar, that use * this text -- Nepto [14/07/2002] */ $this->strings['runway_upward_tendency'] = ' with an %supward%s tendency'; $this->strings['runway_downward_tendency'] = ' with a %sdownward%s tendency'; $this->strings['runway_no_tendency'] = ' with %sno distinct%s tendency'; $this->strings['runway_between'] = 'between '; $this->strings['runway_left'] = ' left'; $this->strings['runway_central'] = ' central'; $this->strings['runway_right'] = ' right'; $this->strings['runway_visibility'] = 'Viditeµnos» bola '; $this->strings['runway_for_runway'] = ' for runway '; /* We run the parent constructor */ $this->pw_text($weather, $input); } function print_pretty_wind($wind) { extract($wind); if (! empty($meters_per_second)) { switch ($meters_per_second) { case 1: $this->strings['meters_per_second'] = ' metr za sekundu'; break; case 2: case 3: case 4: $this->strings['meters_per_second'] = ' metrù za sekundu'; break; default: if ($meters_per_second - floor($meters_per_second) > 0) $this->strings['meters_per_second'] = ' metru za sekundu'; break; } } if (! empty($miles_per_hour)) { switch ($miles_per_hour) { case 1: $this->strings['miles_per_hour'] = ' míle za hodinu'; break; case 2: case 3: case 4: $this->strings['miles_per_hour'] = ' mil za hodinu'; break; } } /* * Z/ZO grammar handling * ze severu, z jihu, ze západu, z východu */ if (isset($deg)) { if ($deg == 'VRB') { } else { $idx = intval(round($deg / 22.5)); if ($idx <= 2 || $idx >= 11) { $this->strings['wind_from'] = str_replace(' z ', ' ze ', $this->strings['wind_from']); } } } if (isset($var_beg)) { $idx = intval(round($var_beg / 22.5)); if ($idx <= 2 || $idx >= 11) { $this->strings['wind_varying'] = str_replace(' z ', ' ze ', $this->strings['wind_varying']); } } return parent::print_pretty_wind($wind); } function parse_cloud_group($cloud_group) { extract($cloud_group); if (isset($condition) && $condition == 'CAVOK') { $this->strings['cloud_group_beg'] = str_replace(' byla ', ' nebyla ', $this->strings['cloud_group_beg']); } return parent::parse_cloud_group($cloud_group); } function print_pretty_time($time) { $minutes_old = round((time() - $time)/60); if ($minutes_old > 60) { $minutes = $minutes_old % 60; if ($minutes == 1) { $this->strings['time_minutes'] = 'a %s%s%s minutou'; } } else { if ($minutes_old < 5) { /* we must remove word 'pøed', because we wanted string: * 'Report bol zostavený prave teraz, ...' */ $this->strings['time_format'] = str_replace(' pøed ', ' ', $this->strings['time_format']); } } return parent::print_pretty_time($time); } function print_pretty_weather($weather) { if ($weather[0]['descriptor'] == 'SH') { $this->strings['currently'] = str_replace(' bylo ', ' byly ', $this->strings['currently']); if ($weather[0]['precipitation'] == 'RA') { $this->strings['weather']['-'] = ' slabého '; $this->strings['weather'][' '] = ' støedního '; $this->strings['weather']['+'] = ' hustého '; $this->strings['weather']['RA'] = ' de¹tì'; } } elseif ($weather[0]['precipitation'] == 'RA' || $weather[0]['obscuration'] == 'HZ') { $this->strings['currently'] = str_replace(' bylo ', ' byl ', $this->strings['currently']); } return parent::print_pretty_weather($weather); } } /* NOTES: ------ Metars to test: +----+------+---------------------------------------------------------------------------------+ | cc | icao | metar | +----+------+---------------------------------------------------------------------------------+ | FI | EFKK | EFKK 281950Z 18008KT 150V220 9999 -SHRA FEW012 SCT016 BKN020 BKN075 12/12 Q0998 | | KH | VDPP | VDPP 281030Z 23008KT 9000 FEW015 FEW025CB SCT300 33/26 Q1008 CB:S/NW/E | +----+------+---------------------------------------------------------------------------------+ Why is there backslash instead of slash in Airport name? cc=DJ&icao=HDAM Problematic metars: 201530Z VABB 24012KT 5000 FU FEW018 SCT025 28/22 Q1004 NOSIG MWCR 2820000Z 12016KT 9999 HZ FEW016 BKN200 32/25 Q1015 NOSIG CYZT 281900Z 10019G26KT 20SM VCSH FEW025 BKN050 OVC110 13/09 A2956 RMK SC1SC6AC2 SLP009 */ ?> --- NEW FILE --- <?php require_once(PHPWEATHER_BASE_DIR . '/output/pw_text.php'); /** * Provides all the strings needed by pw_text to produce Dutch * output. * * @author Bas Elshof <ba...@el...> * @link http://www.elshof.de/ My homepage. * @version pw_text_nl.php,v 1.3 2002/09/26 21:13:40 gimpster Exp */ /* ViM 6.0 indentation used */ class pw_text_nl extends pw_text { /** * This constructor provides all the strings used. * * @param array This is just passed on to pw_text(). */ function pw_text_nl($weather, $input = array()) { $this->strings['charset'] = 'ISO-8859-1'; $this->strings['no_data'] = 'Sorry! Er is geen informatie beschikbaar voor %s%s%s.'; $this->strings['list_sentences_and'] = ' en '; $this->strings['list_sentences_comma'] = ', '; $this->strings['list_sentences_final_and'] = ', en '; $this->strings['location'] = 'Dit is het bericht voor %s%s%s.'; $this->strings['minutes'] = ' minuten'; $this->strings['time_format'] = 'Dit bericht werd %s geleden gemaakt, om %s%s%s UTC.'; $this->strings['time_minutes'] = 'en %s%s%s minuten'; $this->strings['time_one_hour'] = '%seen%s uur %s'; $this->strings['time_several_hours'] = '%s%s%s uur %s'; $this->strings['time_a_moment'] = 'een moment'; $this->strings['meters_per_second'] = ' meter per seconde'; $this->strings['miles_per_hour'] = ' meil per uur'; $this->strings['meter'] = ' meter'; $this->strings['meters'] = ' meter'; $this->strings['feet'] = ' voet'; $this->strings['kilometers'] = ' kilometer'; $this->strings['miles'] = ' meil'; $this->strings['and'] = ' en '; $this->strings['plus'] = ' plus '; $this->strings['with'] = ' met '; $this->strings['wind_blowing'] = 'De wind waaide met een snelheid van '; $this->strings['wind_with_gusts'] = ' met rukwinden tot '; $this->strings['wind_from'] = ' uit het '; $this->strings['wind_variable'] = ' uit %sverschillende%s richtingen.'; $this->strings['wind_varying'] = ', varierend tussen het %s%s%s (%s%s°%s) en het %s%s%s (%s%s°%s)'; $this->strings['wind_calm'] = 'De wind was %rustig%s'; $this->strings['wind_dir'] = array( 'noorden', 'noord/noordoosten', 'noordoosten', 'oost/noordoosten', 'oosten', 'oost/zuidoosten', 'zuidoosten', 'zuid/zuidoosten', 'zuiden', 'zuid/zuidwesten', 'zuidwesten', 'west/zuidwesten', 'westen', 'west/noordwesten', 'noordwesten', 'noord/noordwesten', 'noorden'); $this->strings['wind_dir_short'] = array( 'N', 'NNO', 'NO', 'ONO', 'O', 'OZO', 'ZO', 'ZZO', 'Z', 'ZZW', 'ZW', 'WZW', 'W', 'WNW', 'NW', 'NNW', 'N'); $this->strings['wind_dir_short_long'] = array( 'N' => 'noord', 'NE' => 'noordoost', 'E' => 'oost', 'SE' => 'zuidoost', 'S' => 'zuid', 'SW' => 'zuidwest', 'W' => 'west', 'NW' => 'noordwest' ); $this->strings['temperature'] = 'De temperatuur was '; $this->strings['dew_point'] = ', met het dauwpunt bij '; $this->strings['altimeter'] = 'De atmosferische druk was '; $this->strings['hPa'] = ' hPa'; $this->strings['inHg'] = ' inHg'; $this->strings['rel_humidity'] = 'De relative luchtvochtigheid was '; $this->strings['feelslike'] = 'De gevoelstemperatuur was '; $this->strings['cloud_group_beg'] = 'Er was '; $this->strings['cloud_group_end'] = '.'; $this->strings['cloud_clear'] = 'De lucht was %sklaar%s.'; $this->strings['cloud_height'] = ' bewolking op een hoogte van '; $this->strings['cloud_overcast'] = 'De lucht was %sbewolkt%s vanaf een hoogte van '; $this->strings['cloud_vertical_visibility'] = 'het %svertikale zicht%s was '; $this->strings['cloud_condition'] = array( 'SKC' => 'klaar', 'CLR' => 'klaar', 'FEW' => 'sporadische', 'SCT' => 'verspreide', 'BKN' => 'gebroken', 'OVC' => 'bewolkt'); $this->strings['cumulonimbus'] = ' cumulonimbus'; $this->strings['towering_cumulus'] = ' stapelwolken'; $this->strings['cavok'] = ' geen wolken beneden %s en geen cumulonimbus wolken'; $this->strings['currently'] = 'Momentaan '; $this->strings['weather'] = array( '-' => ' lichte', ' ' => ' matige ', '+' => ' zware ', 'VC' => ' in de omgeving', 'PR' => ' gedeeltelijk', 'BC' => ' banken', 'MI' => ' laaghangende', 'DR' => ' laag opwaaiende', 'BL' => ' hoog opwaaiende', 'SH' => ' buien', 'TS' => ' onweer', 'FZ' => ' aanvriezende', 'DZ' => ' motregen', 'RA' => ' regen', 'SN' => ' sneeuw', 'SG' => ' motsneeuw', 'IC' => ' ijsnaalden', 'PL' => ' ijsregen', /* 'PE' => ' ijsregen', change in the METAR code for ice pellets from "PE" to "PL." Observers will be directed to code ice pellets as "PE" prior to 00:00 coordinated universal time November 5, 1998, and "PL" thereafter. */ 'GR' => ' hagel', 'GS' => ' korrelhagel', 'UP' => ' onbekend', 'BR' => ' nevel', 'FG' => ' mist', 'FU' => ' rook', 'VA' => ' vulkanische as', 'DU' => ' verspreid stof', 'SA' => ' zand', 'HZ' => ' heiigheid', 'PY' => ' opstuivend water', 'PO' => ' goed ontwikkelde stof- of zandhoosjes', 'SQ' => ' squalls', 'FC' => ' slurf of lichte wind- of waterhoos', 'SS' => ' zandstorm', 'DS' => ' stofstorm'); /* added according to several infos on the www */ $this->strings['visibility'] = 'Het algemene zicht was '; $this->strings['visibility_greater_than'] = 'meer dan '; $this->strings['visibility_less_than'] = 'minder dan '; $this->strings['visibility_to'] = ' tot de '; $this->strings['runway_upward_tendency'] = ' met een %ssteigende%s tendens'; $this->strings['runway_downward_tendency'] = ' met een %svallende%s tendens'; $this->strings['runway_no_tendency'] = ' met %sgeen waarneembare%s tendens'; $this->strings['runway_between'] = 'tussen '; $this->strings['runway_left'] = ' links'; $this->strings['runway_central'] = ' centraal'; $this->strings['runway_right'] = ' rechts'; $this->strings['runway_visibility'] = 'Het zicht was '; $this->strings['runway_for_runway'] = ' voor de start- landingsbaan '; /* We run the parent constructor */ $this->pw_text($weather, $input); } } ?> |
|
From: Martin G. <gim...@us...> - 2002-09-25 18:33:44
|
Update of /cvsroot/phpweather/phpweather/db/files In directory usw-pr-cvs1:/tmp/cvs-serv12985 Modified Files: EE.php stations.db Log Message: Updated ICAO for Tallinn/Estonia, thanks to a report from Kalle Volkov. This closes bug 612423. Index: EE.php =================================================================== RCS file: /cvsroot/phpweather/phpweather/db/files/EE.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- EE.php 28 May 2002 13:28:37 -0000 1.1 +++ EE.php 25 Sep 2002 18:33:40 -0000 1.2 @@ -4,7 +4,7 @@ $country = 'Estonia'; $icaos = array( - 'ULTT' => 'Tallinn' + 'EETN' => 'Tallinn' ); ?> Index: stations.db =================================================================== RCS file: /cvsroot/phpweather/phpweather/db/files/stations.db,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- stations.db 28 Aug 2002 10:05:55 -0000 1.4 +++ stations.db 25 Sep 2002 18:33:40 -0000 1.5 @@ -784,6 +784,7 @@ EDWD:Lemwerder:Germany:DE EDXW:Westerland / Sylt:Germany:DE EDZE:Essen:Germany:DE +EETN:Tallinn:Estonia:EE EFHA:Halli:Finland:FI EFHF:Helsinki-Malmi:Finland:FI EFHK:Helsinki-Vantaa:Finland:FI @@ -4697,7 +4698,6 @@ ULLI:St. Peterburg:Russian Federation:RU ULMM:Murmansk:Russian Federation:RU ULOL:Velikie Luki:Russian Federation:RU -ULTT:Tallinn:Estonia:EE ULWT:Tot'Ma:Russian Federation:RU ULWW:Vologda:Russian Federation:RU UMII:Vitebsk:Belarus:BY |
|
From: Martin G. <gim...@us...> - 2002-09-25 18:31:53
|
Update of /cvsroot/phpweather/phpweather In directory usw-pr-cvs1:/tmp/cvs-serv11701 Modified Files: stations.csv Log Message: Updated ICAO for Tallinn/Estonia, thanks to a report from Kalle Volkov. This closes bug 612423. Index: stations.csv =================================================================== RCS file: /cvsroot/phpweather/phpweather/stations.csv,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- stations.csv 27 Aug 2002 17:37:40 -0000 1.9 +++ stations.csv 25 Sep 2002 18:31:49 -0000 1.10 @@ -1444,7 +1444,7 @@ FGSL;Malabo/Fernando Poo ## EE;Estonia ## -ULTT;Tallinn +EETN;Tallinn ## ET;Ethiopia ## HAAB;Addis Ababa |
|
From: Martin G. <gim...@us...> - 2002-09-22 09:53:15
|
Update of /cvsroot/phpweather/phpweather
In directory usw-pr-cvs1:/tmp/cvs-serv32626
Modified Files:
data_retrieval.php
Log Message:
Stupid switch!
Index: data_retrieval.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/data_retrieval.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- data_retrieval.php 22 Sep 2002 09:51:54 -0000 1.28
+++ data_retrieval.php 22 Sep 2002 09:53:12 -0000 1.29
@@ -264,9 +264,11 @@
switch ($this->properties['fetch_method']) {
case 'file':
$metar_data = $this->get_metar_file($icao);
+ break;
case 'fsockopen':
default:
$metar_data = $this->get_metar_socket($icao);
+ break;
}
/* Here we test to see if we actually got a METAR. */
|
|
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'] = '';
|