From: <var...@us...> - 2016-02-08 15:16:55
|
Revision: 9784 http://sourceforge.net/p/phpwiki/code/9784 Author: vargenau Date: 2016-02-08 15:16:52 +0000 (Mon, 08 Feb 2016) Log Message: ----------- No space at end of line Modified Paths: -------------- trunk/lib/phpweather-2.2.2/base_object.php trunk/lib/phpweather-2.2.2/config/connectivity_test.php trunk/lib/phpweather-2.2.2/config/index.php trunk/lib/phpweather-2.2.2/config/make_config.php trunk/lib/phpweather-2.2.2/config/make_db.php trunk/lib/phpweather-2.2.2/config/make_stations.php trunk/lib/phpweather-2.2.2/config/pw_dependency.php trunk/lib/phpweather-2.2.2/config/pw_dependency_not.php trunk/lib/phpweather-2.2.2/config/pw_option.php trunk/lib/phpweather-2.2.2/config/pw_option_select.php trunk/lib/phpweather-2.2.2/config/pw_option_text.php trunk/lib/phpweather-2.2.2/config/pw_optiongroup.php trunk/lib/phpweather-2.2.2/config/pw_validator_ereg.php trunk/lib/phpweather-2.2.2/config/pw_validator_range.php trunk/lib/phpweather-2.2.2/config/speed_test.php trunk/lib/phpweather-2.2.2/currentimage.php trunk/lib/phpweather-2.2.2/data_retrieval.php trunk/lib/phpweather-2.2.2/db/pw_db_adodb.php trunk/lib/phpweather-2.2.2/db/pw_db_common.php trunk/lib/phpweather-2.2.2/db/pw_db_dba.php trunk/lib/phpweather-2.2.2/db/pw_db_mysql.php trunk/lib/phpweather-2.2.2/db/pw_db_null.php trunk/lib/phpweather-2.2.2/db/pw_db_pgsql.php trunk/lib/phpweather-2.2.2/db_layer.php trunk/lib/phpweather-2.2.2/images-test.php trunk/lib/phpweather-2.2.2/index.php trunk/lib/phpweather-2.2.2/output/pw_images.php trunk/lib/phpweather-2.2.2/output/pw_output.php trunk/lib/phpweather-2.2.2/output/pw_text.php trunk/lib/phpweather-2.2.2/output/pw_text_cs.php trunk/lib/phpweather-2.2.2/output/pw_text_da.php trunk/lib/phpweather-2.2.2/output/pw_text_de.php trunk/lib/phpweather-2.2.2/output/pw_text_en_GB.php trunk/lib/phpweather-2.2.2/output/pw_text_en_US.php trunk/lib/phpweather-2.2.2/output/pw_text_fi.php trunk/lib/phpweather-2.2.2/output/pw_text_hu.php trunk/lib/phpweather-2.2.2/output/pw_text_it.php trunk/lib/phpweather-2.2.2/output/pw_text_nl.php trunk/lib/phpweather-2.2.2/output/pw_text_no.php trunk/lib/phpweather-2.2.2/output/pw_text_pl.php trunk/lib/phpweather-2.2.2/output/pw_text_sk.php trunk/lib/phpweather-2.2.2/output/pw_text_sv.php trunk/lib/phpweather-2.2.2/output/pw_text_tr.php trunk/lib/phpweather-2.2.2/phpweather.php trunk/lib/phpweather-2.2.2/pw_utilities.php Modified: trunk/lib/phpweather-2.2.2/base_object.php =================================================================== --- trunk/lib/phpweather-2.2.2/base_object.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/base_object.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -4,8 +4,8 @@ * Provides some basic capabilities like error-handling and handling * of defaults. * - * This class handles various messages. By using this class, you'll - * get a set of standard methods to generate messages. You can make + * This class handles various messages. By using this class, you'll + * get a set of standard methods to generate messages. You can make * error-messages, notices and print debug-information. * * @author Martin Geisler <gim...@gi...> @@ -13,7 +13,7 @@ * @package PHP Weather */ class base_object { - + /** * All the objects properties are stored in this array. * @@ -33,10 +33,10 @@ * Sets up the properties by overriding the defaults with the actual input. * * First it includes the file 'defaults-dist.php'. Next it includes - * 'defaults.php'. You should place your local customizations in - * 'defaults.php' file, since it will never be overridden. + * 'defaults.php'. You should place your local customizations in + * 'defaults.php' file, since it will never be overridden. * Finally it runs through $input and overrides the properties defined there. - * + * * @param $input array The initial properties of the object * @see $properties */ @@ -47,13 +47,13 @@ if(file_exists(PHPWEATHER_BASE_DIR . '/defaults.php')) { include(PHPWEATHER_BASE_DIR . '/defaults.php'); } - + /* Then we override the defaults with the actual properties */ while (list($key, $value) = each($input)) { $this->properties[$key] = $value; } } - + /** * Changed the verbosity level. * @@ -74,7 +74,7 @@ function get_verbosity() { return $this->verbosity; } - + /** * Prints an error-message and halts execution. * @@ -97,7 +97,7 @@ echo "<p><b>Fatal error:</b> $msg.</p>\n"; } exit; - } + } } @@ -122,17 +122,17 @@ } else { die("<p><b>Warning:</b> $msg.</p>\n"); } - } + } } - + /** * Prints a message for debugging. * * The message is only printed if the third bit is set in * $this->properties['verbosity']. The word 'Debug:' in bold will be * prefixed the message. - * + * * @param string The debug-message. * @param string The name of the file where the message comes from. * @param string The line where the message comes from. @@ -144,13 +144,13 @@ } else { echo "<p><b>Debug:</b> $msg.</p>\n"; } - } + } } /** * Prints properties. * - * This method prints all the properties, of this object. It is only + * This method prints all the properties, of this object. It is only * used as a tool for debugging. */ function print_properties() { @@ -158,7 +158,7 @@ print_r($this->properties); echo "</pre>\n"; } - + } ?> Modified: trunk/lib/phpweather-2.2.2/config/connectivity_test.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/connectivity_test.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/connectivity_test.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -1,4 +1,4 @@ -<!DOCTYPE html +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> @@ -9,7 +9,7 @@ <body> <?php - + function success($msg) { echo "<p><b><span style=\"color: green\">Success</span>:</b> $msg</p>\n"; } Modified: trunk/lib/phpweather-2.2.2/config/index.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/index.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/index.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -1,4 +1,4 @@ -<!DOCTYPE html +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> @@ -28,20 +28,20 @@ <dl> <dt><a href="make_config.php">Configuration Builder</a></dt> - + <dd> <p>Use this page to build a custom configuration-file for PHP Weather.</p> </dd> - + <dt><a href="make_db.php">Database Builder</a></dt> - + <dd> <p>After you've made a custom configuration using the link above, you'll need to use this page to create the database and fill it with data.</p> </dd> - + <dt><a href="make_stations.php">Regenerate Stations Database</a></dt> <dd> @@ -51,7 +51,7 @@ href="make_db.php">Database Builder</a> to populate the database with data.</p> </dd> - + <dt><a href="speed_test.php">Speed Test</a></dt> <dd><p>If you've configured PHP Weather to use a database, then you @@ -59,7 +59,7 @@ data in the database. This is what this page is for, it will meassure the time it takes for PHP Weather to retrieve and display a large number of METARs.</p> - + <p>If you have several different databases available to you, then you can compare them using this page.</p> </dd> Modified: trunk/lib/phpweather-2.2.2/config/make_config.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/make_config.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/make_config.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -4,7 +4,7 @@ /* Sorry, no configuration builder for you... */ ?> -<!DOCTYPE html +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> @@ -62,7 +62,7 @@ /* We have to strip slashes from the GPC variables. */ if (get_magic_quotes_gpc() == 1) { - + function recursive_stripslashes(&$array) { $keys = array_keys($array); foreach($keys as $key) { @@ -83,13 +83,13 @@ /* If $options isn't registered, then we should make the variable and * register it: */ if (empty($HTTP_SESSION_VARS)) { - + /* Common dependencies: */ $sql_dep = new pw_dependency_or(new pw_dependency_equal('db_type', 'mysql'), new pw_dependency_equal('db_type', 'pgsql')); $dba_dep = new pw_dependency_equal('db_type', 'dba'); $db_dep = new pw_dependency_or($sql_dep, $dba_dep); - + $fsockopen_dep = new pw_dependency_equal('fetch_method', 'fsockopen'); $proxy_dep = new pw_dependency_equal('use_proxy', 'true'); @@ -109,7 +109,7 @@ /* This just catches the most obvious errors. */ $table_validator = new pw_validator_ereg("Sorry, '%s' is not a valid name.", '^[^./]+$'); - $icao_validator = new pw_validator_ereg("Sorry, '%s' is not a valid ICAO.", + $icao_validator = new pw_validator_ereg("Sorry, '%s' is not a valid ICAO.", '^[a-zA-Z0-9]{4}$'); /* This just catches the most obvious errors. */ @@ -117,7 +117,7 @@ '^[^/#?~]+$'); /* Next comes all the options: */ - + $HTTP_SESSION_VARS['verbosity'] = new pw_option_select('verbosity', "The setting of this variable controls the amount of " . @@ -132,13 +132,13 @@ '5' => 'Errors + debug information', '6' => 'Warnings + debug information', '7' => 'Everything')); - + $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.', false, $icao_validator, 'EKYT'); - + $HTTP_SESSION_VARS['pref_units'] = new pw_option_select('pref_units', 'You may choose to display the data in several ' . @@ -148,7 +148,7 @@ 'both_imperial' => 'Imperial first, then metric', 'only_metric' => 'Only metric', 'only_imperial' => 'Only imperial')); - + $HTTP_SESSION_VARS['language'] = new pw_option_select('language', 'PHP Weather can produce textual output using ' . @@ -157,7 +157,7 @@ false, get_languages('text'), 'en'); - + $HTTP_SESSION_VARS['offset'] = new pw_option_integer('offset', "Due to a bug in PHP, on some systems the time reported may " . @@ -177,7 +177,7 @@ false, array('file' => 'Use the file() function', 'fsockopen' => 'Use the fsockopen() function')); - + $HTTP_SESSION_VARS['use_proxy'] = new pw_option_boolean('use_proxy', "Set this option to 'Yes' to enable support for a " . @@ -185,19 +185,19 @@ $fsockopen_dep, array('false' => 'No', 'true' => 'Yes')); - + $HTTP_SESSION_VARS['proxy_host'] = new pw_option_text('proxy_host', "This is the hostname of the proxy server.", $proxy_dep, $host_validator); - + $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'", $proxy_dep, $port_validator, 3128); - + $HTTP_SESSION_VARS['db_type'] = new pw_option_select('db_type', 'PHP Weather can use several kinds of databases.', @@ -216,7 +216,7 @@ $adodb_dep, false, // we could try to validate the path... '/usr/share/adodb'); - + $HTTP_SESSION_VARS['db_adodb_driver'] = new pw_option_text('db_adodb_driver', "Please select a driver to use with the ADOdb " . @@ -267,7 +267,7 @@ 'gdbm' => 'gdbm - The GNU database manager', 'db2' => 'db2 - Sleepycat Softwares DB2', 'db3' => 'db3 - Sleepycat Softwares DB3')); - + $HTTP_SESSION_VARS['always_use_db'] = new pw_option_boolean('always_use_db', "If you set this option to 'Yes', then PHP Weather " . @@ -276,7 +276,7 @@ "it will still fetch new data from the Internet.", $db_dep, array('false' => 'No', 'true' => 'Yes')); - + $HTTP_SESSION_VARS['cache_timeout'] = new pw_option_integer('cache_timeout', "This specifies when a METAR in the cache is " . @@ -289,40 +289,40 @@ new pw_dependency_and(new pw_dependency_equal('always_use_db', 'false'), $db_dep), false, '3600'); - + $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'.", $sql_dep, array('false' => 'No', 'true' => 'Yes')); - + $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.', $sql_dep, $port_validator_empty); - + $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.', $sql_dep, $host_validator); - + $HTTP_SESSION_VARS['db_database'] = new pw_option_text('db_database', 'This is the name of the database that PHP Weather ' . 'should use.', $sql_dep, $table_validator); - + $HTTP_SESSION_VARS['db_username'] = new pw_option_text('db_username', 'This is the username that PHP Weather will use ' . 'for accessing the database.', $sql_dep); - + $HTTP_SESSION_VARS['db_password'] = new pw_option_text('db_password', 'This is the password that PHP Weather will use when ' . @@ -330,7 +330,7 @@ "remember to protect the file after you've stored the " . "password in it.", $sql_dep); - + $HTTP_SESSION_VARS['db_metars'] = new pw_option_text('db_metars', 'This is the name of the table that is used ' . @@ -348,15 +348,15 @@ 'This is the name of the database/table that is used ' . 'to store the names of the stations.', $db_dep, $table_validator, 'pw_stations'); - + $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 ' . 'country-codes.', $dba_dep, $table_validator, 'pw_countries'); - - + + $HTTP_SESSION_VARS['mark_begin'] = new pw_option_text('mark_begin', 'This string will be placed in front of all the ' . @@ -365,14 +365,14 @@ "Other good choices include <code><i></code>, <code><font " . 'color="red"></code>, etc.', false, false, '<b>'); - + $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>.", false, false, '</b>'); - + $HTTP_SESSION_VARS['icons_path'] = new pw_option_text('icons_path', 'The path to the directory that stores the icons used in the ' . @@ -414,8 +414,8 @@ $HTTP_SESSION_VARS[$option]->update_value($HTTP_POST_VARS); } -/* Grouping */ -$general_group = +/* Grouping */ +$general_group = new pw_optiongroup('general_group', 'General Options', 'This is some general options for PHP Weather.', array('verbosity', 'icao', 'pref_units', 'language', 'offset', @@ -444,7 +444,7 @@ array('mark_begin', 'mark_end', 'icons_path', 'reverse_dir', 'exclude'), !empty($HTTP_POST_VARS['rendering_group_visible'])); -/* We can now generate a configuration file with the options selected so far: */ +/* We can now generate a configuration file with the options selected so far: */ $timestamp = date ('dS of F, Y H:i:s'); $config = "<?php @@ -464,7 +464,7 @@ ?> -<!DOCTYPE html +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> Modified: trunk/lib/phpweather-2.2.2/config/make_db.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/make_db.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/make_db.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -1,4 +1,4 @@ -<!DOCTYPE html +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> @@ -47,7 +47,7 @@ echo "<blockquote>\n"; define('PHPWEATHER_BASE_DIR', realpath(dirname(__FILE__) . '/..')); require_once(PHPWEATHER_BASE_DIR . '/db_layer.php'); - + $db = new db_layer(); if ($db->db->create_tables()) { $num_rows = 0; @@ -72,11 +72,11 @@ } } $db->db->insert_stations($data, $countries); - + echo "<p>Data about <b>$num_rows</b> stations from " . "<b>$num_countries</b> countries were inserted.</p>\n"; } else { - echo "<p>There was a problem with the creation of the tables!</p>\n"; + echo "<p>There was a problem with the creation of the tables!</p>\n"; } echo "</blockquote>\n"; } Modified: trunk/lib/phpweather-2.2.2/config/make_stations.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/make_stations.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/make_stations.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -7,7 +7,7 @@ define('PHPWEATHER_BASE_DIR', dirname(__FILE__) . '/..'); require_once(PHPWEATHER_BASE_DIR . '/db_layer.php'); - + $db = new db_layer(); $countries = $db->db->get_countries(); @@ -29,14 +29,14 @@ foreach ($icaos as $icao => $name) { echo "$icao;$name\n"; } - + } - + exit(); } ?> -<!DOCTYPE html +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> Modified: trunk/lib/phpweather-2.2.2/config/pw_dependency.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/pw_dependency.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/pw_dependency.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -17,7 +17,7 @@ * other dependencies, a string to match or something else. */ var $dep; - + /** * Constructs a new dependency. * @@ -37,4 +37,4 @@ trigger_error('Abstract method', E_USER_ERROR); } } -?> \ No newline at end of file +?> Modified: trunk/lib/phpweather-2.2.2/config/pw_dependency_not.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/pw_dependency_not.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/pw_dependency_not.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -33,4 +33,4 @@ return !$this->dep->check(); } } -?> \ No newline at end of file +?> Modified: trunk/lib/phpweather-2.2.2/config/pw_option.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/pw_option.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/pw_option.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -23,7 +23,7 @@ /** * A description of the option. - * + * * This should be a note that explains what this option does. * * @var string @@ -188,4 +188,4 @@ } -?> \ No newline at end of file +?> Modified: trunk/lib/phpweather-2.2.2/config/pw_option_select.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/pw_option_select.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/pw_option_select.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -21,9 +21,9 @@ function show() { if ($this->is_ready()) { - echo "<dt>Option <code>$this->name</code>: "; + echo "<dt>Option <code>$this->name</code>: "; echo '<select name="' . $this->name . '_value">'; - + foreach ($this->choices as $choice => $label) { if ($choice == $this->value) { echo '<option selected="selected" value="' . @@ -43,7 +43,7 @@ echo "\n</dd>\n"; } } - + } -?> \ No newline at end of file +?> Modified: trunk/lib/phpweather-2.2.2/config/pw_option_text.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/pw_option_text.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/pw_option_text.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -14,7 +14,7 @@ '_value" value="' . htmlentities($this->value) . '" onkeyup="' . $this->validator->get_javascript($this->name) . "\" /></dt>\n"; - + echo '<dd><p>' . $this->description . "</p>\n"; if ($this->is_valid()) { echo '<p id="' . $this->name . '"><font color="green">Input accepted.</font></p>'; @@ -27,4 +27,4 @@ } } -?> \ No newline at end of file +?> Modified: trunk/lib/phpweather-2.2.2/config/pw_optiongroup.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/pw_optiongroup.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/pw_optiongroup.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -21,7 +21,7 @@ /** * Is this group visible? - * + * * @var boolean true if the group is visible, false otherwise. */ var $visible; @@ -93,11 +93,11 @@ echo "<p><a href=\"javascript:toggle_group('$this->id')\" id=\"" . $this->id . "_text\">$text</a></p>\n"; echo "<dl id=\"$this->id\" style=\"display: $style\">\n"; - + foreach($this->options as $option) { $HTTP_SESSION_VARS[$option]->show(); } - + echo "</dl>\n"; echo "</dd>\n"; @@ -133,4 +133,4 @@ } -?> \ No newline at end of file +?> Modified: trunk/lib/phpweather-2.2.2/config/pw_validator_ereg.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/pw_validator_ereg.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/pw_validator_ereg.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -26,7 +26,7 @@ $this->pw_validator($error); $this->regex = $regex; } - + /** * Validates input agains a regular expression. * @@ -60,4 +60,4 @@ } -?> \ No newline at end of file +?> Modified: trunk/lib/phpweather-2.2.2/config/pw_validator_range.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/pw_validator_range.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/pw_validator_range.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -31,7 +31,7 @@ * @access private */ var $empty_ok; - + /** * Constructs a new validator. * @@ -59,7 +59,7 @@ */ function validate($value) { $this->value = $value; - + if ($this->empty_ok && empty($value)) return true; return (ereg('^[-+]?[0-9]+$', $value) && $this->low <= $value && $value <= $this->high); @@ -81,4 +81,4 @@ } } -?> \ No newline at end of file +?> Modified: trunk/lib/phpweather-2.2.2/config/speed_test.php =================================================================== --- trunk/lib/phpweather-2.2.2/config/speed_test.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/config/speed_test.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -1,4 +1,4 @@ -<!DOCTYPE html +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> @@ -115,7 +115,7 @@ number_format($diff * 1000, 0) . " ms</b>.</p>\n"; echo '<p>Time used per METAR: <b>' . - number_format($diff * 1000 / ($batches*32), 1) . " ms</b>.</p>\n"; + number_format($diff * 1000 / ($batches*32), 1) . " ms</b>.</p>\n"; ?> Modified: trunk/lib/phpweather-2.2.2/currentimage.php =================================================================== --- trunk/lib/phpweather-2.2.2/currentimage.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/currentimage.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -1,8 +1,8 @@ <?php /* * currentimage.php - * Return the current weather icon directly. - Can be used from - * HTML rather than PHP files. + * Return the current weather icon directly. - Can be used from + * HTML rather than PHP files. * * Use: <img src="currentimage.php?icao=abcd" /> in your html * @@ -22,5 +22,5 @@ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Pragma: no-cache"); // HTTP/1.0 -readfile($icons->get_sky_image()); -?> \ No newline at end of file +readfile($icons->get_sky_image()); +?> Modified: trunk/lib/phpweather-2.2.2/data_retrieval.php =================================================================== --- trunk/lib/phpweather-2.2.2/data_retrieval.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/data_retrieval.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -62,7 +62,7 @@ function data_retrieval($input = array()) { /* We start by calling the parent constructor. */ $this->db_layer($input); - + /* Then we set the station. */ $this->set_icao($this->properties['icao']); @@ -83,7 +83,7 @@ function get_icao() { return $this->properties['icao']; } - + /** * Sets the station or rather the ICAO. * @@ -95,7 +95,7 @@ * @param string The ICAO of the new station. */ function set_icao($new_icao) { - + /* We start by adding slashes, since $new_icao might come directly * from the user. */ @@ -179,7 +179,7 @@ "Pragma: no-cache\r\n". "Cache-Control: no-cache\r\n"; - if ($this->properties['use_proxy']) { + if ($this->properties['use_proxy']) { /* We use a proxy */ $fp = @fsockopen($this->properties['proxy_host'], $this->properties['proxy_port']); @@ -279,7 +279,7 @@ } $tmp_metar = false; - + if ($data = $this->db->get_metar($this->get_icao())) { /* found station */ $this->debug('get_metar_from_db(): Found the METAR in the database'); list($metar, $timestamp, $time) = end($data); @@ -292,7 +292,7 @@ $tmp_metar = $metar; $this->metar = $metar; $this->metar_time = $time; - + if ($this->properties['always_use_db'] || $timestamp > time() - $this->properties['cache_timeout']) { /* We have asked explicit for a cached METAR, or the METAR is @@ -307,12 +307,12 @@ } else { /* The METAR is too old, so we fetch new */ $this->debug('get_metar_from_db(): The METAR for <code>' . - $this->get_location() . '</code> was ' . + $this->get_location() . '</code> was ' . (time() - $this->properties['cache_timeout'] - $timestamp) . ' seconds too old.'); $tmp_metar = $this->get_metar_from_web(false); } - + } else { /* We need to get a new METAR from the web. */ $this->debug('get_metar_from_db(): New station <code>' . @@ -325,9 +325,9 @@ if ($this->time_from !== false) { if ($data = $this->db->get_metar($this->get_icao(), $this->time_from, - $this->time_to)) { + $this->time_to)) { for($i = 0; $i < count($data); $i++) { - $this->metar_arch[$i] = array('metar' => $data[$i][0], + $this->metar_arch[$i] = array('metar' => $data[$i][0], 'time' => $data[$i][2]); } } @@ -335,8 +335,8 @@ return $tmp_metar; } - + /** * Fetches a METAR from the Internet. * @@ -353,7 +353,7 @@ function get_metar_from_web($new_station) { $metar = ''; $icao = $this->get_icao(); - + switch ($this->properties['fetch_method']) { case 'file': $metar_data = $this->get_metar_file($icao); @@ -373,7 +373,7 @@ * remaining lines into one line by removing new-lines: */ $metar = ereg_replace("[\n\r ]+", ' ', trim(implode(' ', $metar_data))); - + $date = explode(':', strtr($date, '/ ', '::')); if ($date[2] > gmdate('j')) { /* The day is greater that the current day of month. This @@ -387,7 +387,7 @@ $timestamp = gmmktime($date[3], $date[4], 0, $date[1], $date[2], $date[0]); $metar_time = $timestamp; - + if (!ereg('[0-9]{6}Z', $metar)) { /* Some reports don't even have a time-part, so we insert the * current time. This might not be the time of the report, but @@ -539,7 +539,7 @@ if (!$this->db->connect()) { return false; } - + if ($data = $this->db->get_taf($this->get_icao())) { /* found station */ $this->debug('get_taf_from_db(): Found the TAF in the database'); list($taf, $timestamp) = $data; @@ -551,7 +551,7 @@ $this->taf = $taf; if ($this->properties['always_use_db'] || $timestamp > time() - $this->properties['cache_timeout']) { - + /* We have asked explicit for a cached TAF, or the TAF is * still fresh. Either way - we return the TAF we found in * the database. @@ -564,7 +564,7 @@ } else { /* The TAF is too old, so we fetch new */ $this->debug('get_taf_from_db(): The TAF for <code>' . - $this->get_location() . '</code> was ' . + $this->get_location() . '</code> was ' . (time() - $this->properties['cache_timeout'] - $timestamp) . ' seconds too old.'); return $this->get_taf_from_web(false); @@ -592,10 +592,10 @@ * @return string The raw TAF. */ function get_taf_from_web($new_station) { - + $taf = ''; $icao = $this->get_icao(); - + switch ($this->properties['fetch_method']) { case 'file': $taf_data = $this->get_taf_file($icao); @@ -605,7 +605,7 @@ $taf_data = $this->get_taf_socket($icao); break; } - + /* Here we test to see if we actually got a TAF. */ if (!empty($taf_data) && count($taf_data)>0) { /* The first line in the file is the date */ @@ -624,7 +624,7 @@ } $timestamp = gmmktime($date[3], $date[4], 0, $date[1], $date[2], $date[0]); - + if (!ereg('[0-9]{6}Z', $taf)) { /* Some reports don't even have a time-part, so we insert the * current time. This might not be the time of the report, but @@ -653,7 +653,7 @@ } $timestamp = time() - $this->properties['cache_timeout'] + 600; } - + $taf_time = $date[0].$date[1].$date[2].$date[3].$date[4]."00"; /* We then cache the TAF in our database */ @@ -779,7 +779,7 @@ } - + } ?> Modified: trunk/lib/phpweather-2.2.2/db/pw_db_adodb.php =================================================================== --- trunk/lib/phpweather-2.2.2/db/pw_db_adodb.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/db/pw_db_adodb.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -17,7 +17,7 @@ * @version pw_db_adodb.php,v 1.2 2003/10/02 22:54:46 etienne_t Exp */ class pw_db_adodb extends pw_db_common { - + /** * This constructor just calls the parent constructor. * @@ -71,7 +71,7 @@ $this->link_id = &ADONewConnection($this->properties['db_adodb_driver']); $this->link_id->SetFetchMode(ADODB_FETCH_BOTH); - + if ($this->properties['db_pconnect']) { $this->link_id->PConnect($this->properties['db_hostname'], $this->properties['db_username'], @@ -91,7 +91,7 @@ return $this->is_connected; } - + /** * Disconnects from the database. * @@ -140,7 +140,7 @@ $this->error($this->link_id->ErrorMsg()); return false; } - + return true; } @@ -198,7 +198,7 @@ function insert_metar($icao, $metar, $timestamp, $time) { $this->query(sprintf('INSERT INTO %s SET icao = "%s", time = "%s", ' . 'metar = "%s", timestamp = FROM_UNIXTIME(%d)', - $this->properties['db_metars'], $icao, $time, + $this->properties['db_metars'], $icao, $time, addslashes($metar), intval($timestamp))); $this->insert_metar_arch($icao, $metar, $time); } @@ -233,14 +233,14 @@ * @access public */ function insert_metar_arch($icao, $metar, $time) { - if(isset($this->properties['archive_metars']) && + if(isset($this->properties['archive_metars']) && $this->properties['archive_metars']==true) { $this->query(sprintf('SHOW TABLES LIKE "%s"', $this->properties['db_metars_arch'])); if ($this->num_rows()==1) { $this->query(sprintf('DELETE FROM %s WHERE icao = "%s" AND ' . 'time = "%s"' , - $this->properties['db_metars_arch'], + $this->properties['db_metars_arch'], $icao,$time)); $this->query(sprintf('INSERT IGNORE INTO %s SET icao = "%s", ' . 'time = "%s", ' . @@ -300,7 +300,7 @@ /* Set old fetch mode */ $this->link_id->SetFetchMode($tmp_fetch_mode); - + return $metar_array; } @@ -341,7 +341,7 @@ intval($timestamp), $icao)); $this->insert_taf_arch($icao, $taf, $time); } - + /** * Inserts an archive TAF into the database. * @@ -351,14 +351,14 @@ * @access public */ function insert_taf_arch($icao, $taf, $time) { - if(isset($this->properties['archive_tafs']) && + if(isset($this->properties['archive_tafs']) && $this->properties['archive_tafs']==true) { $this->query(sprintf('SHOW TABLES LIKE "%s"', $this->properties['db_tafs_arch'])); if ($this->num_rows()==1) { $this->query(sprintf('DELETE FROM %s WHERE icao = "%s" AND ' . 'time = "%s"' , - $this->properties['db_tafs_arch'], + $this->properties['db_tafs_arch'], $icao,$time)); $this->query(sprintf('INSERT IGNORE INTO %s SET icao = "%s", ' . 'time = "%s", ' . @@ -396,7 +396,7 @@ 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'] . '( @@ -416,7 +416,7 @@ PRIMARY KEY (icao)'); /* We make the archival databases */ - $this->query('DROP TABLE IF EXISTS ' . $this->properties['db_metars_arch']); + $this->query('DROP TABLE IF EXISTS ' . $this->properties['db_metars_arch']); $this->query('CREATE TABLE ' . $this->properties['db_metars_arch'] . '( icao char(4) NOT NULL, time timestamp(14) NOT NULL, @@ -439,9 +439,9 @@ PRIMARY KEY (icao), UNIQUE icao (icao), KEY cc (cc))'); - + return true; // Success! - + } /** @@ -494,7 +494,7 @@ $country = addslashes($country); while(list($icao, $location) = each($data[$cc])) { /* The station name might also be dangerous. */ - $location = addslashes($location); + $location = addslashes($location); $this->query(sprintf('INSERT INTO %s VALUES ("%s", "%s", "%s", "%s")', $this->properties['db_stations'], $icao, addslashes($location), @@ -517,7 +517,7 @@ if (!$this->connect()) { return false; } - + $this->query('SELECT DISTINCT cc, country FROM ' . $this->properties['db_stations'] . ' ORDER BY country'); while($row = $this->fetch_row()) { @@ -525,8 +525,8 @@ } return $rows; } - + /** * Returns an array of stations. * @@ -544,7 +544,7 @@ if (!$this->connect()) { return false; } - + $this->query(sprintf('SELECT icao, name, country FROM %s' .' WHERE cc = "%s" ORDER BY name', $this->properties['db_stations'], Modified: trunk/lib/phpweather-2.2.2/db/pw_db_common.php =================================================================== --- trunk/lib/phpweather-2.2.2/db/pw_db_common.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/db/pw_db_common.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -54,7 +54,7 @@ * @access private */ var $link_id; - + /** * Contains the result ID used when fetching rows from a result-set * if the database backend knows about a result ID. @@ -69,14 +69,14 @@ * * $is_connected, $link_id and $result_id is set to false, to * indicate that we're not connected. - * + * * @param array the initial properties of the object * @see $is_connected, $link_id, $result_id */ function pw_db_common($input) { /* We start by calling the parent constructor. */ $this->base_object($input); - + /* We're not connected at first, so we set these variables to indicate that. */ $this->is_connected = false; @@ -99,7 +99,7 @@ * Or would it be better, if it was relative to PHPWEATHER_BASE_DIR? * * @see insert_metar(), update_metar() - */ + */ function update_all_metars($file) { $fp = fopen($file, 'r'); @@ -109,24 +109,24 @@ $skipped = 0; while (!feof($fp)) { - + $line = trim(fgets($fp, 256)); if ($line == '') { continue; } - + /* We have now moved past one or more blank lines, next is the * date: */ $date = explode(':', strtr($line, '/ ', '::')); $timestamp = gmmktime($date[3], $date[4], 0, $date[1], $date[2], $date[0]); - + /* The next lines are the METAR: */ $metar = trim(fgets($fp, 256)); while (!feof($fp) && ($line = trim(fgets($fp, 256))) != '') { $metar .= ' ' . $line; } - + /* The ICAO is always the first four characters in the METAR: */ $icao = substr($metar, 0, 4); @@ -155,7 +155,7 @@ printf("Inserted: %5d, Updated: %5d, Skipped: %5d\n", $inserted, $updated, $skipped); - + fclose($fp); } @@ -213,8 +213,8 @@ return $data[2]; } } - + } ?> Modified: trunk/lib/phpweather-2.2.2/db/pw_db_dba.php =================================================================== --- trunk/lib/phpweather-2.2.2/db/pw_db_dba.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/db/pw_db_dba.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -31,7 +31,7 @@ * A link ID to the countries database. * * We have to maintain a different link ID for each database used. - * + * * @var integer * @access private */ @@ -95,12 +95,12 @@ $this->properties['db_metars'] . '.dba', 'w', $this->properties['db_handler']); - $this->link_stations_id = + $this->link_stations_id = dba_open(PHPWEATHER_BASE_DIR . '/db/files/' . $this->properties['db_stations'] . '.dba', 'r', $this->properties['db_handler']); - $this->link_countries_id = + $this->link_countries_id = dba_open(PHPWEATHER_BASE_DIR . '/db/files/' . $this->properties['db_countries'] . '.dba', 'r', @@ -111,12 +111,12 @@ $this->properties['db_metars'] . '.dba', 'w', $this->properties['db_handler']); - $this->link_stations_id = + $this->link_stations_id = dba_popen(PHPWEATHER_BASE_DIR . '/db/files/' . $this->properties['db_stations'] . '.dba', 'r', $this->properties['db_handler']); - $this->link_countries_id = + $this->link_countries_id = dba_popen(PHPWEATHER_BASE_DIR . '/db/files/' . $this->properties['db_countries'] . '.dba', 'r', @@ -124,7 +124,7 @@ } return $this->is_connected; } - + /** * Disconnects from the database. * @@ -244,12 +244,12 @@ $this->properties['db_metars'] . '.dba', 'n', $this->properties['db_handler']); - $this->link_stations_id = + $this->link_stations_id = dba_open(PHPWEATHER_BASE_DIR . '/db/files/' . $this->properties['db_stations'] . '.dba', 'n', $this->properties['db_handler']); - $this->link_countries_id = + $this->link_countries_id = dba_open(PHPWEATHER_BASE_DIR . '/db/files/' . $this->properties['db_countries'] . '.dba', 'n', @@ -260,12 +260,12 @@ $this->properties['db_metars'] . '.dba', 'n', $this->properties['db_handler']); - $this->link_stations_id = + $this->link_stations_id = dba_popen(PHPWEATHER_BASE_DIR . '/db/files/' . $this->properties['db_stations'] . '.dba', 'n', $this->properties['db_handler']); - $this->link_countries_id = + $this->link_countries_id = dba_popen(PHPWEATHER_BASE_DIR . '/db/files/' . $this->properties['db_countries'] . '.dba', 'n', @@ -363,7 +363,7 @@ if (!$this->connect()) { return false; } - + /* The name of the country is seperated from the list of ICAOs by * PW_FIELD_SEPERATOR (:). The name is followed by a list of ICAOs * which are also seperated by PW_FIELD_SEPERATOR. */ @@ -380,7 +380,7 @@ dba_fetch($icao, $this->link_stations_id)); $locations[$icao] = $name; } - + asort($locations); return $locations; Modified: trunk/lib/phpweather-2.2.2/db/pw_db_mysql.php =================================================================== --- trunk/lib/phpweather-2.2.2/db/pw_db_mysql.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/db/pw_db_mysql.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -13,7 +13,7 @@ * @version pw_db_mysql.php,v 1.12 2004/01/30 20:46:36 etienne_t Exp */ class pw_db_mysql extends pw_db_common { - + /** * This constructor makes sure that the MySQL extension is loaded * and then calls the parent constructor. @@ -62,14 +62,14 @@ if ($this->is_connected) { return true; } - + if (empty($this->properties['db_port'])) /* Default MySQL port: */ $port = 3306; else $port = $this->properties['db_port']; - + if (!$this->properties['db_pconnect']) { $this->link_id = mysql_connect($this->properties['db_hostname'] . ':' . $port, @@ -90,7 +90,7 @@ return $this->is_connected; } - + /** * Disconnects from the database. * @@ -208,7 +208,7 @@ tms_unix2date($time), tms_unix2date($timestamp), $icao)); $this->insert_metar_arch($icao, $metar, $time); } - + /** * Inserts an archive METAR into the database. * @@ -218,14 +218,14 @@ * @access public */ function insert_metar_arch($icao, $metar, $time) { - if(isset($this->properties['archive_metars']) && + if(isset($this->properties['archive_metars']) && $this->properties['archive_metars']==true) { $this->query(sprintf('SHOW TABLES LIKE "%s"', $this->properties['db_metars_arch'])); if ($this->num_rows()==1) { $this->query(sprintf('DELETE FROM %s WHERE icao = "%s" AND ' . 'time = "%s"' , - $this->properties['db_metars_arch'], + $this->properties['db_metars_arch'], $icao, tms_unix2date($time))); $this->query(sprintf('INSERT IGNORE INTO %s SET icao = "%s", ' . 'time = "%s", ' . @@ -282,7 +282,7 @@ $metar_array[] = $row; } } - + return $metar_array; } @@ -320,7 +320,7 @@ intval($timestamp), $icao)); $this->insert_taf_arch($icao, $taf, $time); } - + /** * Inserts an archive TAF into the database. * @@ -330,14 +330,14 @@ * @access public */ function insert_taf_arch($icao, $taf, $time) { - if(isset($this->properties['archive_tafs']) && + if(isset($this->properties['archive_tafs']) && $this->properties['archive_tafs']==true) { $this->query(sprintf('SHOW TABLES LIKE "%s"', $this->properties['db_tafs_arch'])); if ($this->num_rows()==1) { $this->query(sprintf('DELETE FROM %s WHERE icao = "%s" AND ' . 'time = "%s"' , - $this->properties['db_tafs_arch'], + $this->properties['db_tafs_arch'], $icao,$time)); $this->query(sprintf('INSERT IGNORE INTO %s SET icao = "%s", ' . 'time = "%s", ' . @@ -375,7 +375,7 @@ 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'] . '( @@ -395,7 +395,7 @@ PRIMARY KEY (icao))'); /* We make the archival databases */ - $this->query('DROP TABLE IF EXISTS ' . $this->properties['db_metars_arch']); + $this->query('DROP TABLE IF EXISTS ' . $this->properties['db_metars_arch']); $this->query('CREATE TABLE ' . $this->properties['db_metars_arch'] . '( icao char(4) NOT NULL, time timestamp(14) NOT NULL, @@ -417,9 +417,9 @@ country varchar(128) NOT NULL, PRIMARY KEY (icao), KEY cc (cc))'); - + return true; // Success! - + } /** @@ -470,7 +470,7 @@ $country = addslashes($country); while(list($icao, $location) = each($data[$cc])) { /* The station name might also be dangerous. */ - $location = addslashes($location); + $location = addslashes($location); $this->query(sprintf('INSERT INTO %s VALUES ("%s", "%s", "%s", "%s")', $this->properties['db_stations'], $icao, addslashes($location), @@ -493,7 +493,7 @@ if (!$this->connect()) { return false; } - + $this->query('SELECT DISTINCT cc, country FROM ' . $this->properties['db_stations'] . ' ORDER BY country'); while($row = $this->fetch_row()) { @@ -501,8 +501,8 @@ } return $rows; } - + /** * Returns an array of stations. * @@ -520,7 +520,7 @@ if (!$this->connect()) { return false; } - + $this->query(sprintf('SELECT icao, name, country FROM %s' .' WHERE cc = "%s" ORDER BY name', $this->properties['db_stations'], Modified: trunk/lib/phpweather-2.2.2/db/pw_db_null.php =================================================================== --- trunk/lib/phpweather-2.2.2/db/pw_db_null.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/db/pw_db_null.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -166,13 +166,13 @@ $result = false; // Default result. $left = 0; $right = $size / PW_LINE_LENGTH; - + /* We make a binary search for the right ICAO. The search * terminates when $right >= $left: */ while ($left < $right) { - + fseek($fp, PW_LINE_LENGTH * round(($left+$right)/2)); - + /* Each line contains four fields seperated by * PW_FIELD_SEPERATOR. The fields are: the ICAO, name of * station, name of country, and country code. */ @@ -234,7 +234,7 @@ list($icao, $location) = each($data[$cc]); fputs($fp, " '$icao' => '" . addslashes($location) . "'"); $stations[$icao] = array($location, $countries[$cc], $cc); - + while(list($icao, $location) = each($data[$cc])) { fputs($fp, ",\n '$icao' => '" . addslashes($location) . "'"); $stations[$icao] = array($location, $countries[$cc], $cc); Modified: trunk/lib/phpweather-2.2.2/db/pw_db_pgsql.php =================================================================== --- trunk/lib/phpweather-2.2.2/db/pw_db_pgsql.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/db/pw_db_pgsql.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -101,7 +101,7 @@ return $this->is_connected; } - + /** * Disconnects from the database. * @@ -152,7 +152,7 @@ pg_errormessage()); /* The next row is the first row: */ $this->next_row = 0; - + return $this->result_id; } @@ -278,7 +278,7 @@ ' country varchar(128) NOT NULL)'); $this->query('CREATE INDEX cc_key ON ' . $this->properties['db_stations'] . '(cc)'); - + return true; // Success! } @@ -331,9 +331,9 @@ $country = addslashes($country); while(list($icao, $location) = each($data[$cc])) { /* The station name might also be dangerous. */ - $location = addslashes($location); + $location = addslashes($location); $this->query('INSERT INTO ' . $this->properties['db_stations'] . - '(icao, name, cc, country) VALUES ' . + '(icao, name, cc, country) VALUES ' . "('$icao', '$location', '$cc', '$country')"); } } @@ -360,8 +360,8 @@ } return $rows; } - + /** * Returns an array of stations. * @@ -377,7 +377,7 @@ if (!$this->connect()) { return false; } - + $this->query('SELECT icao, name, country FROM ' . $this->properties['db_stations'] . " WHERE cc = '$cc' ORDER BY name"); Modified: trunk/lib/phpweather-2.2.2/db_layer.php =================================================================== --- trunk/lib/phpweather-2.2.2/db_layer.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/db_layer.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -10,7 +10,7 @@ */ class db_layer extends base_object { - /** + /** * Variable containing the database-object. * * The database-object handles all communication with the @@ -30,7 +30,7 @@ function db_layer($input = array()) { /* We call the parent constructor. */ $this->base_object($input); - + /* We then create our db object */ $this->set_db_type($this->properties['db_type']); } @@ -86,7 +86,7 @@ function get_db_type() { return $this->properties['db_type']; } - + } Modified: trunk/lib/phpweather-2.2.2/images-test.php =================================================================== --- trunk/lib/phpweather-2.2.2/images-test.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/images-test.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -161,7 +161,7 @@ 'thickness' of the fog and to blend out sun light. I'm not sure that the skycover is being used as an indication of the 'fogginess'. Anyone?</li> -</ul> +</ul> </p> <?php $images->set_time('day'); ?> Modified: trunk/lib/phpweather-2.2.2/index.php =================================================================== --- trunk/lib/phpweather-2.2.2/index.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/index.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -9,7 +9,7 @@ $weather = new phpweather(); -$output = '<!DOCTYPE html +$output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> @@ -95,10 +95,10 @@ require(PHPWEATHER_BASE_DIR . "/output/pw_text_$language.php"); $type = 'pw_text_' . $language; $text = new $type($weather); - + require(PHPWEATHER_BASE_DIR . "/output/pw_images.php"); $icons = new pw_images($weather); - + $output .= '<p>This is the current weather in ' . $weather->get_location() . ":</p>\n<blockquote>\n" . $text->print_pretty() . "\n</blockquote>\n" . Modified: trunk/lib/phpweather-2.2.2/output/pw_images.php =================================================================== --- trunk/lib/phpweather-2.2.2/output/pw_images.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/output/pw_images.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -23,10 +23,10 @@ // ======================================================================= // This section contains user configurable items: The user can // configure the image filenames to be generated by the script. - + // An array to convert the weather group codes to an index of the // $images and $n_images array. - + var $phenomena_array = array ('#' => 'None', 'TS' => 'Thun', 'RA' => 'Rain', @@ -39,10 +39,10 @@ 'IC' => 'Hail', 'BR' => 'Fog', 'FG' => 'Fog'); - + // An array to convert the cloud coverage codes to an index of the // $images and $n_images array. - + var $coverage = array ('CLR' => '0', 'SKC' => '0', 'FEW' => '1', @@ -50,9 +50,9 @@ 'BKN' => '3', 'OVC' => '4', 'VV' => '4'); - + var $sky_nodata_image = 'sky_nodata.png'; - + // Define a lot of images for daylight weather-group/cloud // condition. It's a 2-dimensional array, indexed by the: // - Precipitation (first index) @@ -168,7 +168,7 @@ '3' => 'n_3cloud_fog.png', '4' => '4cloud_fog.png') ); - + // Define image filenames for: // - 16 wind directions, // - 'no wind direction data' @@ -201,7 +201,7 @@ // - 'no data' condition, // - 'temperature zero or below zero degrees Celcius // - 'temperature above zero degrees Celcius - + var $temp_nodata_image = 'temp_nodata.png'; var $temp_low_image = 'templow.png'; var $temp_high_image = 'temphigh.png'; @@ -212,7 +212,7 @@ // [m/s] to [Bft] (beaufort). var $wind_speeds = array ( - 'beaufort' => array (0, 1, 2, 3, 4, 5, + 'beaufort' => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), 'ms' => array (0.3, 1.6, 3.4, 5.5, 8.0, 10.8, 13.9, 17.2, 20.8, 24.5, 28.5, 32.7, 999)); @@ -250,7 +250,7 @@ for ($i = 0; $i < $num_parts; $i++) { $part = $parts[$i]; - + if (ereg('RMK|TEMPO|BECMG', $part)) { /* The rest of the METAR is either a remark or temporary information. We skip the rest of the METAR. */ @@ -263,10 +263,10 @@ elseif (ereg('^(-|\+|VC)?(TS|SH|FZ|BL|DR|MI|BC|PR|RA|DZ|SN|SG|GR|GS|PE|IC|UP|BR|FG|FU|VA|DU|SA|HZ|PY|PO|SQ|FC|SS|DS)+$', $part)) { /* * Is this the current weather group? - */ + */ // Get the intensity and get rid of it in the $part string - $intensity = ''; + $intensity = ''; if (ereg('^(-|\+|VC)(..)*$',$part)) { if ($part[0] == '-') { $intensity = '-'; @@ -280,7 +280,7 @@ } } - + // Now, take only the precipitation types that have images. // Ignore the others In case more then one exist, take only the // first one (highest predominance). @@ -305,20 +305,20 @@ $intensity = '-'; } } - + if (ereg('^(Rain|Snow|Hail)$',$this->phenomena_array[$phenomena])) { $phenomena_group = $intensity . $this->phenomena_array[$phenomena]; } else { $phenomena_group = $this->phenomena_array[$phenomena]; - } + } - } - + } + // Now check the cloud coverage. There could be three cloud // layers, so check for all of them. Iconize the most covered // clouds, thus find the highest cloudcoverage layer, by // maximizing the $maxcoverage param - + elseif (ereg('(SKC|CLR)(...)', $part, $regs)) { $maxcoverage = max($maxcoverage,$this->coverage[$regs[1]]); // if ($maxcoverage < $this->coverage[$regs[1]]) { @@ -339,7 +339,7 @@ $phenomena = '#'; $phenomena_group = $this->phenomena_array[$phenomena]; } - + // At this point, the $phenomena_group variable contains the one // index of the $this->images array, while the $maxcoverage // variable contains the other index of the $this->images array. @@ -348,11 +348,11 @@ if (($night == 1) || ($this->itime == 'nite')) { return $this->properties['icons_path'] . $this->n_images[$phenomena_group][$maxcoverage]; - } else { + } else { return $this->properties['icons_path'] . $this->images[$phenomena_group][$maxcoverage]; } - + } // ------------------------------------------------------------------------ @@ -407,7 +407,7 @@ if (!empty($processed_metar_data['temperature'])) { if (!empty($processed_metar_data['windchill'])) { - return $this->properties['icons_path'] . $this->temp_windchilled_image; + return $this->properties['icons_path'] . $this->temp_windchilled_image; } elseif ($processed_metar_data['temperature']['temp_c'] > 0) { return $this->properties['icons_path'] . $this->temp_high_image; } else { @@ -448,7 +448,7 @@ $this->itime = $ntime; } // ------------------------------------------------------------------------ - + } ?> Modified: trunk/lib/phpweather-2.2.2/output/pw_output.php =================================================================== --- trunk/lib/phpweather-2.2.2/output/pw_output.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/output/pw_output.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -17,7 +17,7 @@ function pw_output($weather, $input = array()) { $this->weather = $weather; - + $this->properties = $weather->properties; while (list($key, $value) = each($input)) { @@ -32,4 +32,4 @@ } -?> \ No newline at end of file +?> Modified: trunk/lib/phpweather-2.2.2/output/pw_text.php =================================================================== --- trunk/lib/phpweather-2.2.2/output/pw_text.php 2016-02-08 12:48:14 UTC (rev 9783) +++ trunk/lib/phpweather-2.2.2/output/pw_text.php 2016-02-08 15:16:52 UTC (rev 9784) @@ -60,7 +60,7 @@ function get_charset() { ... [truncated message content] |