@@ -11,10 +11,21 @@  | 
                                                    ||
| 11 | 11 | <p>You can contribute to <?php print $globalName; ?> if you have an ADS-B receiver.</p>  | 
                                                        
| 12 | 12 | <h3>You need to : </h3>  | 
                                                        
| 13 | 13 | <ul>  | 
                                                        
| 14 | - <li>Create an account on <a href="<?php if (isset($globalContributeLogin)) print $globalContributeLogin.'">'.$globalContributeLogin; else print 'https://login.flightairmap.fr">login.flightairmap.fr'; ?></a></li>  | 
                                                        |
| 14 | +	<li>Create an account on <a href="<?php if (isset($globalContributeLogin)) { | 
                                                        |
| 15 | + print $globalContributeLogin.'">'.$globalContributeLogin;  | 
                                                        |
| 16 | +} else { | 
                                                        |
| 17 | + print 'https://login.flightairmap.fr">login.flightairmap.fr';  | 
                                                        |
| 18 | +}  | 
                                                        |
| 19 | +?></a></li>  | 
                                                        |
| 15 | 20 | <li>Download dump1090 fork from <a href="https://github.com/Ysurac/dump1090">https://github.com/Ysurac/dump1090</a></li>  | 
                                                        
| 16 | 21 | <li>Compile zfamup1090 with <em>make zfamup1090</em> (you need to have libcurl installed)</li>  | 
                                                        
| 17 | - <li>Run zfamup1090 : <em>./zfamup1090 --net-zfam-user YourUsername --net-zfam-pass YourPassword<?php if (isset($globalContributeURL)) print ' --net-zfam-addr '.$globalContributeURL; if (isset($globalContributePort)) print ' --net-zfam-port '.$globalContributePort; ?></em> (add <em>--net-bo-ipaddr ipofbeastsource --net-bo-port portofbeastsource</em> if needed, default to 127.0.0.1 and 30005)</li>  | 
                                                        |
| 22 | +	<li>Run zfamup1090 : <em>./zfamup1090 --net-zfam-user YourUsername --net-zfam-pass YourPassword<?php if (isset($globalContributeURL)) { | 
                                                        |
| 23 | + print ' --net-zfam-addr '.$globalContributeURL;  | 
                                                        |
| 24 | +}  | 
                                                        |
| 25 | +if (isset($globalContributePort)) { | 
                                                        |
| 26 | + print ' --net-zfam-port '.$globalContributePort;  | 
                                                        |
| 27 | +}  | 
                                                        |
| 28 | +?></em> (add <em>--net-bo-ipaddr ipofbeastsource --net-bo-port portofbeastsource</em> if needed, default to 127.0.0.1 and 30005)</li>  | 
                                                        |
| 18 | 29 | </ul>  | 
                                                        
| 19 | 30 | </div>  | 
                                                        
| 20 | 31 | <?php  | 
                                                        
@@ -21,7 +21,9 @@  | 
                                                    ||
| 21 | 21 | print '<fieldset class="form-group">';  | 
                                                        
| 22 | 22 |  print '<label for="acars_message">'._("ACARS Message").'</label>'; | 
                                                        
| 23 | 23 | print '<textarea class="form-control" name="acars_message" id="acars_message" rows="5">';  | 
                                                        
| 24 | -if ($message != '') print $message;  | 
                                                        |
| 24 | +if ($message != '') { | 
                                                        |
| 25 | + print $message;  | 
                                                        |
| 26 | +}  | 
                                                        |
| 25 | 27 | print '</textarea>';  | 
                                                        
| 26 | 28 | print '</fieldset>';  | 
                                                        
| 27 | 29 | print '<button type="submit" class="btn btn-primary">Submit</button>';  | 
                                                        
@@ -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 | }  | 
                                                        
@@ -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>';  | 
                                                        
@@ -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);  | 
                                                        
@@ -19,8 +19,7 @@  | 
                                                    ||
| 19 | 19 | $wkt = 'SRID=' . $srid . ';';  | 
                                                        
| 20 | 20 |        $wkt .= $geometry->out('wkt'); | 
                                                        
| 21 | 21 | return $wkt;  | 
                                                        
| 22 | - }  | 
                                                        |
| 23 | -    else { | 
                                                        |
| 22 | +    } else { | 
                                                        |
| 24 | 23 |        return $geometry->out('wkt'); | 
                                                        
| 25 | 24 | }  | 
                                                        
| 26 | 25 | }  |