@@ -215,14 +215,7 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | $r = null; |
| 217 | 217 | |
| 218 | - if( $code == "select" ) { $r = $this->test_select(); } |
|
| 219 | - elseif( $code == "constant_as" ) { $r = $this->test_constant_as(); } |
|
| 220 | - elseif( $code == "math_as" ) { $r = $this->test_math_as(); } |
|
| 221 | - elseif( $code == "count" ) { $r = $this->test_count(); } |
|
| 222 | - elseif( $code == "max" ) { $r = $this->test_max(); } |
|
| 223 | - elseif( $code == "load" ) { $r = $this->test_load(); } |
|
| 224 | - elseif( $code == "sample" ) { $r = $this->test_sample(); } |
|
| 225 | - else { print "<p>Unknown capability code: '$code'</p>"; return false; } |
|
| 218 | + if( $code == "select" ) { $r = $this->test_select(); } elseif( $code == "constant_as" ) { $r = $this->test_constant_as(); } elseif( $code == "math_as" ) { $r = $this->test_math_as(); } elseif( $code == "count" ) { $r = $this->test_count(); } elseif( $code == "max" ) { $r = $this->test_max(); } elseif( $code == "load" ) { $r = $this->test_load(); } elseif( $code == "sample" ) { $r = $this->test_sample(); } else { print "<p>Unknown capability code: '$code'</p>"; return false; } |
|
| 226 | 219 | $this->caps[$code] = $r; |
| 227 | 220 | if( isset( $this->caps_cache ) ) |
| 228 | 221 | { |
@@ -231,8 +224,7 @@ discard block |
||
| 231 | 224 | if( $was_cached ) |
| 232 | 225 | { |
| 233 | 226 | dba_replace( $db_key, $db_val, $this->caps_cache ); |
| 234 | - } |
|
| 235 | - else |
|
| 227 | + } else |
|
| 236 | 228 | { |
| 237 | 229 | dba_insert( $db_key, $db_val, $this->caps_cache ); |
| 238 | 230 | } |
@@ -164,15 +164,21 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
| 166 | 166 | $_SESSION['install'] = 'vatsim'; |
| 167 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 168 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 167 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 168 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 169 | + } else { |
|
| 170 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 171 | + } |
|
| 169 | 172 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
| 170 | 173 | $_SESSION['install'] = 'vatsim'; |
| 171 | 174 | $_SESSION['next'] = 'Insert VATSIM data'; |
| 172 | 175 | } elseif (isset($globalIVAO) && $globalIVAO) { |
| 173 | 176 | $_SESSION['install'] = 'vatsim'; |
| 174 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 175 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 177 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 178 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 179 | + } else { |
|
| 180 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 181 | + } |
|
| 176 | 182 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
| 177 | 183 | $_SESSION['install'] = 'vatsim'; |
| 178 | 184 | $_SESSION['next'] = 'Insert phpVMS data'; |
@@ -303,7 +309,9 @@ discard block |
||
| 303 | 309 | $Source = new Source(); |
| 304 | 310 | $Source->deleteAllLocation(); |
| 305 | 311 | foreach ($sources as $src) { |
| 306 | - if (isset($src['latitude']) && $src['latitude'] != '') $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
| 312 | + if (isset($src['latitude']) && $src['latitude'] != '') { |
|
| 313 | + $Source->addLocation($src['name'],$src['latitude'],$src['longitude'],$src['altitude'],$src['city'],$src['country'],$src['source'],'antenna.png'); |
|
| 314 | + } |
|
| 307 | 315 | } |
| 308 | 316 | $_SESSION['done'] = array_merge($_SESSION['done'],array('Insert data in source table')); |
| 309 | 317 | unset($_SESSION['sources']); |
@@ -314,15 +322,21 @@ discard block |
||
| 314 | 322 | */ |
| 315 | 323 | if ((isset($globalVATSIM) && $globalVATSIM) && (isset($globalIVAO) && $globalIVAO)) { |
| 316 | 324 | $_SESSION['install'] = 'vatsim'; |
| 317 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 318 | - else $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 325 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 326 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 327 | + } else { |
|
| 328 | + $_SESSION['next'] = 'Insert VATSIM data'; |
|
| 329 | + } |
|
| 319 | 330 | } elseif (isset($globalVATSIM) && $globalVATSIM) { |
| 320 | 331 | $_SESSION['install'] = 'vatsim'; |
| 321 | 332 | $_SESSION['next'] = 'Insert VATSIM data'; |
| 322 | 333 | } elseif (isset($globalIVAO) && $globalIVAO) { |
| 323 | 334 | $_SESSION['install'] = 'vatsim'; |
| 324 | - if (file_exists('tmp/ivae_feb2013.zip')) $_SESSION['next'] = 'Insert IVAO data'; |
|
| 325 | - else $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 335 | + if (file_exists('tmp/ivae_feb2013.zip')) { |
|
| 336 | + $_SESSION['next'] = 'Insert IVAO data'; |
|
| 337 | + } else { |
|
| 338 | + $_SESSION['next'] = 'Insert VATSIM data (IVAO not found)'; |
|
| 339 | + } |
|
| 326 | 340 | } elseif (isset($globalphpVMS) && $globalphpVMS) { |
| 327 | 341 | $_SESSION['install'] = 'vatsim'; |
| 328 | 342 | $_SESSION['next'] = 'Insert phpVMS data'; |
@@ -23,7 +23,9 @@ |
||
| 23 | 23 | print '<fieldset class="form-group">'; |
| 24 | 24 | print '<label for="notam_message">'._("NOTAM Message").'</label>'; |
| 25 | 25 | print '<textarea class="form-control" name="notam_message" id="notam_message" rows="5">'; |
| 26 | -if ($message != '') print $message; |
|
| 26 | +if ($message != '') { |
|
| 27 | + print $message; |
|
| 28 | +} |
|
| 27 | 29 | print '</textarea>'; |
| 28 | 30 | print '</fieldset>'; |
| 29 | 31 | print '<button type="submit" class="btn btn-primary">Submit</button>'; |
@@ -15,8 +15,12 @@ discard block |
||
| 15 | 15 | } else if($_GET['start_date'] == "" && $_GET['end_date'] != ""){ |
| 16 | 16 | $end_date = date("Y-m-d H:i:s", strtotime("2014-04-12")).",".$_GET['end_date'].":00"; |
| 17 | 17 | $sql_date = $end_date; |
| 18 | - } else $sql_date = ''; |
|
| 19 | -} else $sql_date = ''; |
|
| 18 | + } else { |
|
| 19 | + $sql_date = ''; |
|
| 20 | + } |
|
| 21 | + } else { |
|
| 22 | + $sql_date = ''; |
|
| 23 | +} |
|
| 20 | 24 | |
| 21 | 25 | if (isset($_GET['highest_altitude'])) { |
| 22 | 26 | //for altitude manipulation |
@@ -30,8 +34,12 @@ discard block |
||
| 30 | 34 | } else if($_GET['highest_altitude'] == "" && $_GET['lowest_altitude'] != ""){ |
| 31 | 35 | $start_altitude = $_GET['lowest_altitude'].",60000"; |
| 32 | 36 | $sql_altitude = $start_altitude; |
| 33 | - } else $sql_altitude = ''; |
|
| 34 | -} else $sql_altitude = ''; |
|
| 37 | + } else { |
|
| 38 | + $sql_altitude = ''; |
|
| 39 | + } |
|
| 40 | + } else { |
|
| 41 | + $sql_altitude = ''; |
|
| 42 | +} |
|
| 35 | 43 | |
| 36 | 44 | //calculuation for the pagination |
| 37 | 45 | if(!isset($_GET['limit'])) |
@@ -49,7 +57,7 @@ discard block |
||
| 49 | 57 | $limit_end = $_GET['number_results']; |
| 50 | 58 | $absolute_difference = $_GET['number_results']; |
| 51 | 59 | } |
| 52 | -} else { |
|
| 60 | +} else { |
|
| 53 | 61 | $limit_explode = explode(",", $_GET['limit']); |
| 54 | 62 | $limit_start = $limit_explode[0]; |
| 55 | 63 | $limit_end = $limit_explode[1]; |
@@ -67,8 +75,11 @@ discard block |
||
| 67 | 75 | |
| 68 | 76 | header("Content-type: text/csv"); |
| 69 | 77 | |
| 70 | -if (isset($_GET['sort'])) $sort = $_GET['sort']; |
|
| 71 | -else $sort = ''; |
|
| 78 | +if (isset($_GET['sort'])) { |
|
| 79 | + $sort = $_GET['sort']; |
|
| 80 | +} else { |
|
| 81 | + $sort = ''; |
|
| 82 | +} |
|
| 72 | 83 | $q = filter_input(INPUT_GET,'q',FILTER_SANITIZE_STRING); |
| 73 | 84 | $registration = filter_input(INPUT_GET,'registratrion',FILTER_SANITIZE_STRING); |
| 74 | 85 | $aircraft = filter_input(INPUT_GET,'aircraft',FILTER_SANITIZE_STRING); |
@@ -86,7 +86,9 @@ discard block |
||
| 86 | 86 | return $result; |
| 87 | 87 | } |
| 88 | 88 | $handle = @opendir('./locale'); |
| 89 | - if ($handle === false) return $result; |
|
| 89 | + if ($handle === false) { |
|
| 90 | + return $result; |
|
| 91 | + } |
|
| 90 | 92 | while (false !== ($file = readdir($handle))) { |
| 91 | 93 | $path = './locale'.'/'.$file.'/LC_MESSAGES/fam.mo'; |
| 92 | 94 | if ($file != "." && $file != ".." && @file_exists($path)) { |
@@ -112,7 +114,9 @@ discard block |
||
| 112 | 114 | $available = $this->listLocaleDir(); |
| 113 | 115 | $allAvailableLanguages = array(); |
| 114 | 116 | foreach ($available as $lang) { |
| 115 | - if (isset($this->all_languages[$lang])) $allAvailableLanguages[$lang] = $this->all_languages[$lang]; |
|
| 117 | + if (isset($this->all_languages[$lang])) { |
|
| 118 | + $allAvailableLanguages[$lang] = $this->all_languages[$lang]; |
|
| 119 | + } |
|
| 116 | 120 | } |
| 117 | 121 | return $allAvailableLanguages; |
| 118 | 122 | } |
@@ -183,8 +183,7 @@ |
||
| 183 | 183 | if ( mt_rand( 0, 1 ) == 0 ) |
| 184 | 184 | { |
| 185 | 185 | $ver = mt_rand( 4, 5 ) . '.' . mt_rand( 0, 1 ); |
| 186 | - } |
|
| 187 | - else |
|
| 186 | + } else |
|
| 188 | 187 | { |
| 189 | 188 | $ver = mt_rand( 4, 5 ) . '.0.' . mt_rand( 1, 5 ); |
| 190 | 189 | } |
@@ -290,7 +290,9 @@ |
||
| 290 | 290 | |
| 291 | 291 | function _methods_tester_with_geos($geometry) { |
| 292 | 292 | // Cannot test methods if GEOS is not intstalled |
| 293 | - if (!geoPHP::geosInstalled()) return; |
|
| 293 | + if (!geoPHP::geosInstalled()) { |
|
| 294 | + return; |
|
| 295 | + } |
|
| 294 | 296 | |
| 295 | 297 | $methods = array( |
| 296 | 298 | //'boundary', //@@TODO: Uncomment this and fix errors |
@@ -32,7 +32,9 @@ |
||
| 32 | 32 | |
| 33 | 33 | // Test to make sure adapter work the same wether GEOS is ON or OFF |
| 34 | 34 | // Cannot test methods if GEOS is not intstalled |
| 35 | - if (!geoPHP::geosInstalled()) return; |
|
| 35 | + if (!geoPHP::geosInstalled()) { |
|
| 36 | + return; |
|
| 37 | + } |
|
| 36 | 38 | |
| 37 | 39 | foreach (geoPHP::getAdapterMap() as $adapter_key => $adapter_class) { |
| 38 | 40 | if ($adapter_key != 'google_geocode') { //Don't test google geocoder regularily. Uncomment to test |
@@ -12,8 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | if (geoPHP::geosInstalled()) { |
| 14 | 14 | print "GEOS is installed.\n"; |
| 15 | - } |
|
| 16 | - else { |
|
| 15 | + } else { |
|
| 17 | 16 | print "GEOS is not installed.\n"; |
| 18 | 17 | } |
| 19 | 18 | |
@@ -125,8 +124,7 @@ discard block |
||
| 125 | 124 | if ($test_geom_1->out('wkt') != $test_geom_2->out('wkt')) { |
| 126 | 125 | print "Mismatched adapter output in ".$adapter_class."\n"; |
| 127 | 126 | } |
| 128 | - } |
|
| 129 | - else { |
|
| 127 | + } else { |
|
| 130 | 128 | print "Empty output on " . $adapter_key . "\n"; |
| 131 | 129 | } |
| 132 | 130 | } |
@@ -134,7 +132,9 @@ discard block |
||
| 134 | 132 | |
| 135 | 133 | // Test to make sure adapter work the same wether GEOS is ON or OFF |
| 136 | 134 | // Cannot test methods if GEOS is not intstalled |
| 137 | - if (!geoPHP::geosInstalled()) return; |
|
| 135 | + if (!geoPHP::geosInstalled()) { |
|
| 136 | + return; |
|
| 137 | + } |
|
| 138 | 138 | |
| 139 | 139 | foreach (geoPHP::getAdapterMap() as $adapter_key => $adapter_class) { |
| 140 | 140 | if ($adapter_key != 'google_geocode') { //Don't test google geocoder regularily. Uncomment to test |
@@ -167,7 +167,9 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | function test_methods($geometry) { |
| 169 | 169 | // Cannot test methods if GEOS is not intstalled |
| 170 | - if (!geoPHP::geosInstalled()) return; |
|
| 170 | + if (!geoPHP::geosInstalled()) { |
|
| 171 | + return; |
|
| 172 | + } |
|
| 171 | 173 | |
| 172 | 174 | $methods = array( |
| 173 | 175 | //'boundary', //@@TODO: Uncomment this and fix errors |
@@ -237,8 +239,11 @@ discard block |
||
| 237 | 239 | function test_detection($value, $format, $file) { |
| 238 | 240 | $detected = geoPHP::detectFormat($value); |
| 239 | 241 | if ($detected != $format) { |
| 240 | - if ($detected) print 'detected as ' . $detected . "\n"; |
|
| 241 | - else print "not detected\n"; |
|
| 242 | + if ($detected) { |
|
| 243 | + print 'detected as ' . $detected . "\n"; |
|
| 244 | + } else { |
|
| 245 | + print "not detected\n"; |
|
| 246 | + } |
|
| 242 | 247 | } |
| 243 | 248 | // Make sure it loads using auto-detect |
| 244 | 249 | geoPHP::load($value); |