Completed
Push — master ( f037be...aee2fd )
by Yannick
37:44
created
live-czml.php 1 patch
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
     $s3 = sin($bank/2);
67 67
     $c1c2 = $c1*$c2;
68 68
     $s1s2 = $s1*$s2;
69
-    $w =$c1c2*$c3 - $s1s2*$s3;
70
-    $x =$c1c2*$s3 + $s1s2*$c3;
71
-    $y =$s1*$c2*$c3 + $c1*$s2*$s3;
72
-    $z =$c1*$s2*$c3 - $s1*$c2*$s3;
73
-    return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
69
+    $w = $c1c2*$c3 - $s1s2*$s3;
70
+    $x = $c1c2*$s3 + $s1s2*$c3;
71
+    $y = $s1*$c2*$c3 + $c1*$s2*$s3;
72
+    $z = $c1*$s2*$c3 - $s1*$c2*$s3;
73
+    return array('x' => $x, 'y' => $y, 'z' => $z, 'w' => $w);
74 74
 //    return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365');
75 75
 
76 76
 }
@@ -92,22 +92,22 @@  discard block
 block discarded – undo
92 92
 $allhistory = false;
93 93
 $filter['source'] = array();
94 94
 $limit = 0;
95
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
96
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
97
-if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
98
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
99
-if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
100
-if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
101
-if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
102
-if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
103
-if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
104
-if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
105
-if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
106
-if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT);
95
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'], array('vatsimtxt'));
96
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'], array('whazzup'));
97
+if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'], array('phpvmacars'));
98
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'], array('sbs', 'famaprs'));
99
+if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'], array('aprs'));
100
+if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'], FILTER_SANITIZE_STRING);
101
+if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'], FILTER_SANITIZE_STRING);
102
+if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',', $_COOKIE['filter_Airlines']), FILTER_SANITIZE_STRING);
103
+if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',', $_COOKIE['filter_Sources']), FILTER_SANITIZE_STRING);
104
+if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'], FILTER_SANITIZE_STRING);
105
+if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'], FILTER_SANITIZE_STRING);
106
+if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'], FILTER_SANITIZE_NUMBER_INT);
107 107
 if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') $filter['blocked'] = true;
108 108
 
109 109
 if (isset($_COOKIE['map_3d_limit'])) {
110
-	$limit = filter_var($_COOKIE['map_3d_limit'],FILTER_SANITIZE_NUMBER_INT);
110
+	$limit = filter_var($_COOKIE['map_3d_limit'], FILTER_SANITIZE_NUMBER_INT);
111 111
 }
112 112
 
113 113
 /*
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 	$from_archive = true;
157 157
 //	$begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
158 158
 //	$enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
159
-	$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
160
-	$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
161
-	$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
162
-	$begindate = date('Y-m-d H:i:s',$begindate);
163
-	$enddate = date('Y-m-d H:i:s',$enddate);
159
+	$begindate = filter_input(INPUT_GET, 'begindate', FILTER_SANITIZE_NUMBER_INT);
160
+	$enddate = filter_input(INPUT_GET, 'enddate', FILTER_SANITIZE_NUMBER_INT);
161
+	$archivespeed = filter_input(INPUT_GET, 'speed', FILTER_SANITIZE_NUMBER_INT);
162
+	$begindate = date('Y-m-d H:i:s', $begindate);
163
+	$enddate = date('Y-m-d H:i:s', $enddate);
164 164
 	if ($tracker) {
165
-		$spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate,$enddate,$filter);
165
+		$spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate, $enddate, $filter);
166 166
 	} elseif ($marine) {
167
-		$spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate,$enddate,$filter);
167
+		$spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate, $enddate, $filter);
168 168
 	} else {
169
-		$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter);
169
+		$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate, $enddate, $filter);
170 170
 	}
171 171
 } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) {
172 172
 	$from_archive = true;
@@ -183,36 +183,36 @@  discard block
 block discarded – undo
183 183
 	}
184 184
 	$enddate = $_COOKIE['archive_end'];
185 185
 	$enddateinitial = $_COOKIE['archive_end'];
186
-	$archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT);
187
-	$begindate = date('Y-m-d H:i:s',$begindate);
188
-	$enddate = date('Y-m-d H:i:s',$enddate);
186
+	$archivespeed = filter_var($_COOKIE['archive_speed'], FILTER_SANITIZE_NUMBER_INT);
187
+	$begindate = date('Y-m-d H:i:s', $begindate);
188
+	$enddate = date('Y-m-d H:i:s', $enddate);
189 189
 	//echo 'Begin : '.$begindate.' - End : '.$enddate."\n";
190 190
 	if ($tracker) {
191
-		$spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter);
191
+		$spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate, $enddate, $filter);
192 192
 	} elseif ($marine) {
193
-		$spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter);
193
+		$spotter_array = $MarineArchive->getMinLiveMarineData($begindate, $enddate, $filter);
194 194
 	} else {
195
-		$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
195
+		$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate, $enddate, $filter);
196 196
 	}
197 197
 } elseif ($tracker) {
198 198
 	$coord = array();
199 199
 	if (isset($_GET['coord']) && $_GET['coord'] != '') {
200
-		$coord = explode(',',$_GET['coord']);
201
-		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
200
+		$coord = explode(',', $_GET['coord']);
201
+		if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
202 202
 		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
203 203
 			$coord = array();
204 204
 		}
205 205
 	}
206 206
 	$previous_filter = $filter;
207 207
 	if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackTracker']) && $_COOKIE['MapTrackTracker'] != '')) {
208
-		$filter = array_merge($filter,array('id' => $_COOKIE['MapTrackTracker']));
209
-		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false);
208
+		$filter = array_merge($filter, array('id' => $_COOKIE['MapTrackTracker']));
209
+		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, false);
210 210
 	/*
211 211
 	} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) {
212 212
 		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true,$_COOKIE['MapTrack']);
213 213
 	*/
214 214
 	} elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') {
215
-		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false);
215
+		$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord, $filter, false);
216 216
 	} else {
217 217
 		$spotter_array = array();
218 218
 	}
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
 	$coord = array();
222 222
 	//if (isset($_GET['coord']) && $_GET['coord'] != '') {
223 223
 	if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') {
224
-		$coord = explode(',',$_GET['coord']);
225
-		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
224
+		$coord = explode(',', $_GET['coord']);
225
+		if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
226 226
 		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
227 227
 			$coord = array();
228 228
 		}
@@ -231,11 +231,11 @@  discard block
 block discarded – undo
231 231
 	if (((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') || (!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) {
232 232
 		//$filter = array_merge($filter,array('id' => $_COOKIE['MapTrackMarine']));
233 233
 		//$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false);
234
-		$spotter_array = $MarineLive->getMinLastLiveMarineDataByID($_COOKIE['MapTrackMarine'],$filter,false);
234
+		$spotter_array = $MarineLive->getMinLastLiveMarineDataByID($_COOKIE['MapTrackMarine'], $filter, false);
235 235
 	} elseif (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '' && !empty($coord)) {
236
-		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false,$_COOKIE['MapTrack']);
236
+		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, false, $_COOKIE['MapTrack']);
237 237
 	} elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') {
238
-		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false);
238
+		$spotter_array = $MarineLive->getMinLastLiveMarineData($coord, $filter, false);
239 239
 	} else {
240 240
 		$spotter_array = array();
241 241
 	}
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
 } else {
244 244
 	$coord = array();
245 245
 	if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') {
246
-		$coord = explode(',',$_GET['coord']);
247
-		if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT) && filter_var($coord[1],FILTER_VALIDATE_FLOAT) && filter_var($coord[2],FILTER_VALIDATE_FLOAT) && filter_var($coord[3],FILTER_VALIDATE_FLOAT) 
246
+		$coord = explode(',', $_GET['coord']);
247
+		if (!(filter_var($coord[0], FILTER_VALIDATE_FLOAT) && filter_var($coord[1], FILTER_VALIDATE_FLOAT) && filter_var($coord[2], FILTER_VALIDATE_FLOAT) && filter_var($coord[3], FILTER_VALIDATE_FLOAT) 
248 248
 		    && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
249 249
 			$coord = array();
250 250
 		}
@@ -252,14 +252,14 @@  discard block
 block discarded – undo
252 252
 	$previous_filter = $filter;
253 253
 	if (((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') || (!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) {
254 254
 		//$filter = array_merge($filter,array('id' => $_COOKIE['MapTrack']));
255
-		$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,$limit);
255
+		$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'], $filter, $limit);
256 256
 		//$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false);
257 257
 	} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '') {
258 258
 		//$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,false);
259 259
 		//if (empty($spotter_array)) $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false,$_COOKIE['MapTrack']);
260
-		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,$limit,$_COOKIE['MapTrack']);
260
+		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, $limit, $_COOKIE['MapTrack']);
261 261
 	} elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') {
262
-		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,$limit);
262
+		$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord, $filter, $limit);
263 263
 	} else {
264 264
 		$spotter_array = array();
265 265
 	}
@@ -269,19 +269,19 @@  discard block
 block discarded – undo
269 269
 if (!empty($spotter_array) && isset($coord)) {
270 270
 	if ($tracker) {
271 271
 		if (isset($_GET['archive'])) {
272
-			$flightcnt = $TrackerArchive->getLiveTrackerCount($begindate,$enddate,$filter);
272
+			$flightcnt = $TrackerArchive->getLiveTrackerCount($begindate, $enddate, $filter);
273 273
 		} else {
274 274
 			$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
275 275
 		}
276 276
 	} elseif ($marine) {
277 277
 		if (isset($_GET['archive'])) {
278
-			$flightcnt = $MarineArchive->getLiveMarineCount($begindate,$enddate,$filter);
278
+			$flightcnt = $MarineArchive->getLiveMarineCount($begindate, $enddate, $filter);
279 279
 		} else {
280 280
 			$flightcnt = $MarineLive->getLiveMarineCount($filter);
281 281
 		}
282 282
 	} else {
283 283
 		if (isset($_GET['archive'])) {
284
-			$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
284
+			$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate, $enddate, $filter);
285 285
 		} else {
286 286
 			$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
287 287
 		}
@@ -289,17 +289,17 @@  discard block
 block discarded – undo
289 289
 	if ($flightcnt == '') $flightcnt = 0;
290 290
 } else $flightcnt = 0;
291 291
 
292
-$sqltime = round(microtime(true)-$begintime,2);
292
+$sqltime = round(microtime(true) - $begintime, 2);
293 293
 $minitime = time();
294 294
 $minitracktime_begin = time();
295 295
 $minitracktime = $minitracktime_begin;
296 296
 $maxitime = 0;
297
-$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT);
297
+$lastupdate = filter_input(INPUT_GET, 'update', FILTER_SANITIZE_NUMBER_INT);
298 298
 $modelsdb = array();
299 299
 if (file_exists(dirname(__FILE__).'/models/modelsdb')) {
300
-	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) {
301
-		while (($row = fgetcsv($handle,1000)) !== FALSE) {
302
-			if (isset($row[1]) ){
300
+	if (($handle = fopen(dirname(__FILE__).'/models/modelsdb', 'r')) !== FALSE) {
301
+		while (($row = fgetcsv($handle, 1000)) !== FALSE) {
302
+			if (isset($row[1])) {
303 303
 				$model = $row[0];
304 304
 				$modelsdb[$model] = $row[1];
305 305
 			}
@@ -309,9 +309,9 @@  discard block
 block discarded – undo
309 309
 }
310 310
 $modelsdb2 = array();
311 311
 if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) {
312
-	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) {
313
-		while (($row = fgetcsv($handle,1000)) !== FALSE) {
314
-			if (isset($row[1]) ){
312
+	if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb', 'r')) !== FALSE) {
313
+		while (($row = fgetcsv($handle, 1000)) !== FALSE) {
314
+			if (isset($row[1])) {
315 315
 				$model = $row[0];
316 316
 				$glb = $row[1];
317 317
 				if (isset($row[2])) {
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 if (!empty($spotter_array) && is_array($spotter_array))
358 358
 {
359 359
 	$nblatlong = 0;
360
-	foreach($spotter_array as $spotter_item)
360
+	foreach ($spotter_array as $spotter_item)
361 361
 	{
362 362
 		$j++;
363 363
 		//if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND';
@@ -411,17 +411,17 @@  discard block
 block discarded – undo
411 411
 			}
412 412
 			if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
413 413
 			if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",';
414
-			if (isset($spotter_item['ident'])) $output.= '"ident": '.json_encode($spotter_item['ident']).',';
414
+			if (isset($spotter_item['ident'])) $output .= '"ident": '.json_encode($spotter_item['ident']).',';
415 415
 			if ($tracker) {
416 416
 				if (isset($spotter_item['type'])) $output .= '"tracker_type": '.json_encode($spotter_item['type']).',';
417
-				$output.= '"type": "tracker"';
417
+				$output .= '"type": "tracker"';
418 418
 			} elseif ($marine) {
419 419
 				if (isset($spotter_item['type'])) $output .= '"marine_type": '.json_encode($spotter_item['type']).',';
420 420
 				if (isset($spotter_item['captain_name'])) $output .= '"captain": '.json_encode($spotter_item['captain_name']).',';
421 421
 				if (isset($spotter_item['race_id'])) $output .= '"raceid": '.$spotter_item['race_id'].',';
422 422
 				if (isset($spotter_item['race_name'])) $output .= '"race": '.json_encode($spotter_item['race_name']).',';
423 423
 				if (isset($spotter_item['race_rank'])) $output .= '"rank": "'.$spotter_item['race_rank'].'",';
424
-				$output.= '"type": "marine"';
424
+				$output .= '"type": "marine"';
425 425
 			} else {
426 426
 				if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) {
427 427
 					$aircraft_icao = $spotter_item['aircraft_icao'];
@@ -435,14 +435,14 @@  discard block
 block discarded – undo
435 435
 						if (isset($airline_icao)) {
436 436
 							$imagefile = $aircraft_icao.'-'.$airline_icao.'.png';
437 437
 							if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) {
438
-								$output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
438
+								$output .= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
439 439
 							}
440 440
 						}
441 441
 					}
442 442
 					//if ($ident != '') $output.= '"ident": "'.$ident.'",';
443 443
 				}
444
-				$output.= '"gltf2": %gltf2%,';
445
-				$output.= '"type": "flight"';
444
+				$output .= '"gltf2": %gltf2%,';
445
+				$output .= '"type": "flight"';
446 446
 			}
447 447
 			$output .= '},';
448 448
 
@@ -817,8 +817,8 @@  discard block
 block discarded – undo
817 817
 					$output .= '},';
818 818
 				}
819 819
 			}
820
-			if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output);
821
-			else $output = str_replace('%onground%','false',$output);
820
+			if (isset($onground) && $onground) $output = str_replace('%onground%', 'true', $output);
821
+			else $output = str_replace('%onground%', 'false', $output);
822 822
 
823 823
 	//		$output .= '"heightReference": "CLAMP_TO_GROUND",';
824 824
 			//$output .= '"heightReference": "'.$heightrelative.'",';
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 			if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']);
835 835
 			if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']);
836 836
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
837
-			$output .= '"'.date("c",strtotime($spotter_item['date'])).'", ';
837
+			$output .= '"'.date("c", strtotime($spotter_item['date'])).'", ';
838 838
 			$output .= $spotter_item['longitude'].', ';
839 839
 			$output .= $spotter_item['latitude'];
840 840
 			$prevlong = $spotter_item['longitude'];
@@ -862,8 +862,8 @@  discard block
 block discarded – undo
862 862
 			//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
863 863
 			//$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
864 864
 		} else {
865
-			$nblatlong = $nblatlong+1;
866
-			$output .= ',"'.date("c",strtotime($spotter_item['date'])).'", ';
865
+			$nblatlong = $nblatlong + 1;
866
+			$output .= ',"'.date("c", strtotime($spotter_item['date'])).'", ';
867 867
 			if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
868 868
 			if ($spotter_item['ground_speed'] == 0) {
869 869
 				$output .= $prevlong.', ';
@@ -904,26 +904,26 @@  discard block
 block discarded – undo
904 904
 $output .= ']';
905 905
 if (isset($globalArchive) && $globalArchive === TRUE) {
906 906
 	if (isset($begindateinitial)) {
907
-		$output = str_replace('%minitime%',date("c",$begindateinitial),$output);
908
-	} elseif ((time()-$globalLiveInterval) > $minitime) {
909
-		if (time()-$globalLiveInterval > $maxitime) {
910
-			$output = str_replace('%minitime%',date("c",$maxitime),$output);
907
+		$output = str_replace('%minitime%', date("c", $begindateinitial), $output);
908
+	} elseif ((time() - $globalLiveInterval) > $minitime) {
909
+		if (time() - $globalLiveInterval > $maxitime) {
910
+			$output = str_replace('%minitime%', date("c", $maxitime), $output);
911 911
 		} else {
912
-			$output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output);
912
+			$output = str_replace('%minitime%', date("c", time() - $globalLiveInterval), $output);
913 913
 		}
914 914
 	}
915
-	else $output = str_replace('%minitime%',date("c",$minitime),$output);
915
+	else $output = str_replace('%minitime%', date("c", $minitime), $output);
916 916
 } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) {
917
-	$output = str_replace('%minitime%',date("c",$minitracktime),$output);
917
+	$output = str_replace('%minitime%', date("c", $minitracktime), $output);
918 918
 } else {
919
-	$output = str_replace('%minitime%',date("c",$minitime),$output);
919
+	$output = str_replace('%minitime%', date("c", $minitime), $output);
920 920
 }
921 921
 if (isset($enddateinitial)) {
922
-	$output = str_replace('%maxitime%',date("c",$enddateinitial),$output);
922
+	$output = str_replace('%maxitime%', date("c", $enddateinitial), $output);
923 923
 } else {
924
-	$output = str_replace('%maxitime%',date("c",$maxitime),$output);
924
+	$output = str_replace('%maxitime%', date("c", $maxitime), $output);
925 925
 }
926
-if ($gltf2) $output = str_replace('%gltf2%','true',$output);
927
-else $output = str_replace('%gltf2%','false',$output);
926
+if ($gltf2) $output = str_replace('%gltf2%', 'true', $output);
927
+else $output = str_replace('%gltf2%', 'false', $output);
928 928
 print $output;
929 929
 ?>
Please login to merge, or discard this patch.
aircraft-detailed.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -5,16 +5,16 @@  discard block
 block discarded – undo
5 5
 require_once('require/class.Language.php');
6 6
 $Spotter = new Spotter();
7 7
 
8
-if (!isset($_GET['aircraft_type'])){
8
+if (!isset($_GET['aircraft_type'])) {
9 9
 	header('Location: '.$globalURL.'/aircraft');
10 10
 } else {
11 11
 	//calculuation for the pagination
12
-	if(!isset($_GET['limit']) || count(explode(",", $_GET['limit'])) < 2)
12
+	if (!isset($_GET['limit']) || count(explode(",", $_GET['limit'])) < 2)
13 13
 	{
14 14
 		$limit_start = 0;
15 15
 		$limit_end = 25;
16 16
 		$absolute_difference = 25;
17
-	}  else {
17
+	} else {
18 18
 		$limit_explode = explode(",", $_GET['limit']);
19 19
 		$limit_start = $limit_explode[0];
20 20
 		$limit_end = $limit_explode[1];
@@ -28,19 +28,19 @@  discard block
 block discarded – undo
28 28
 	$limit_previous_1 = $limit_start - $absolute_difference;
29 29
 	$limit_previous_2 = $limit_end - $absolute_difference;
30 30
 	
31
-	$aircraft_type = filter_input(INPUT_GET,'aircraft_type',FILTER_SANITIZE_STRING);
31
+	$aircraft_type = filter_input(INPUT_GET, 'aircraft_type', FILTER_SANITIZE_STRING);
32 32
 	$page_url = $globalURL.'/aircraft/'.$aircraft_type;
33 33
 	
34
-	$sort = htmlspecialchars(filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING));
35
-	$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type,$limit_start.",".$absolute_difference, $sort);
34
+	$sort = htmlspecialchars(filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING));
35
+	$spotter_array = $Spotter->getSpotterDataByAircraft($aircraft_type, $limit_start.",".$absolute_difference, $sort);
36 36
 	
37 37
 	$aircraft_info = $Spotter->getAllAircraftInfo($aircraft_type);
38 38
 	if (!empty($spotter_array) || !empty($aircraft_info))
39 39
 	{
40 40
 		if (!empty($aircraft_info)) {
41
-			$title = sprintf(_("Detailed View for %s (%s)"),$aircraft_info[0]['type'],$aircraft_info[0]['icao']);
41
+			$title = sprintf(_("Detailed View for %s (%s)"), $aircraft_info[0]['type'], $aircraft_info[0]['icao']);
42 42
 		} else {
43
-			$title = sprintf(_("Detailed View for %s (%s)"),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']);
43
+			$title = sprintf(_("Detailed View for %s (%s)"), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']);
44 44
 		}
45 45
 		require_once('header.php');
46 46
 	    
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
 		$Stats = new Stats();
52 52
 		$aircraft_types = $Stats->getAllAircraftTypes();
53 53
 		if (empty($aircraft_types)) $aircraft_types = $Spotter->getAllAircraftTypes();
54
-		foreach($aircraft_types as $aircrafttype)
54
+		foreach ($aircraft_types as $aircrafttype)
55 55
 		{
56
-			if($aircraft_type == $aircrafttype['aircraft_icao'])
56
+			if ($aircraft_type == $aircrafttype['aircraft_icao'])
57 57
 			{
58 58
 				print '<option value="'.$aircrafttype['aircraft_icao'].'" selected="selected">'.$aircrafttype['aircraft_manufacturer'].' '.$aircrafttype['aircraft_name'].' ('.$aircrafttype['aircraft_icao'].')</option>';
59 59
 			} else {
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		if (!empty($spotter_array)) {
91 91
 			include('aircraft-sub-menu.php');
92 92
 			print '<div class="table column">';
93
-			print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s (%s)</strong>."),$spotter_array[0]['aircraft_name'],$spotter_array[0]['aircraft_type']).'</p>';
93
+			print '<p>'.sprintf(_("The table below shows the detailed information of all flights from <strong>%s (%s)</strong>."), $spotter_array[0]['aircraft_name'], $spotter_array[0]['aircraft_type']).'</p>';
94 94
 			include('table-output.php');
95 95
 			print '<div class="pagination">';
96 96
 			if ($limit_previous_1 >= 0)
Please login to merge, or discard this patch.
airport-detailed.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,17 +5,17 @@  discard block
 block discarded – undo
5 5
 require_once('require/class.Stats.php');
6 6
 require_once('require/class.METAR.php');
7 7
 
8
-if (!isset($_GET['airport'])){
8
+if (!isset($_GET['airport'])) {
9 9
 	header('Location: '.$globalURL.'/airport');
10 10
 } else {
11 11
 	$Spotter = new Spotter();
12 12
 	//calculation for the pagination
13
-	if(!isset($_GET['limit']))
13
+	if (!isset($_GET['limit']))
14 14
 	{
15 15
 		$limit_start = 0;
16 16
 		$limit_end = 25;
17 17
 		$absolute_difference = 25;
18
-	}  else {
18
+	} else {
19 19
 		$limit_explode = explode(",", $_GET['limit']);
20 20
 		$limit_start = $limit_explode[0];
21 21
 		$limit_end = $limit_explode[1];
@@ -28,18 +28,18 @@  discard block
 block discarded – undo
28 28
 	$limit_next = $limit_end + $absolute_difference;
29 29
 	$limit_previous_1 = $limit_start - $absolute_difference;
30 30
 	$limit_previous_2 = $limit_end - $absolute_difference;
31
-	$airport_icao = filter_input(INPUT_GET,'airport',FILTER_SANITIZE_STRING);
31
+	$airport_icao = filter_input(INPUT_GET, 'airport', FILTER_SANITIZE_STRING);
32 32
 	$airport = $airport_icao;
33 33
 	$page_url = $globalURL.'/airport/'.$airport_icao;
34 34
 	
35
-	$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
35
+	$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
36 36
 	$airport_array = $Spotter->getAllAirportInfo($airport_icao);
37 37
 	if (!empty($airport_array))
38 38
 	{
39 39
 		if ($sort != '') {
40
-			$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, $sort);
40
+			$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, $sort);
41 41
 		} else {
42
-			$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao,$limit_start.",".$absolute_difference, '');
42
+			$spotter_array = $Spotter->getSpotterDataByAirport($airport_icao, $limit_start.",".$absolute_difference, '');
43 43
 		}
44 44
 		
45 45
 		if (isset($globalMETAR) && $globalMETAR) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             		//print_r($metar_parse);
51 51
 		}
52 52
 		
53
-		$title = sprintf(_("Detailed View for %s, %s (%s)"),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']);
53
+		$title = sprintf(_("Detailed View for %s, %s (%s)"), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']);
54 54
 
55 55
 		require_once('header.php');
56 56
 		
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 		$airport_names = $Stats->getAllAirportNames();
63 63
 		if (empty($airport_names)) $airport_names = $Spotter->getAllAirportNames();
64 64
 		ksort($airport_names);
65
-		foreach($airport_names as $airport_name)
65
+		foreach ($airport_names as $airport_name)
66 66
 		{
67
-			if($airport_icao == $airport_name['airport_icao'])
67
+			if ($airport_icao == $airport_name['airport_icao'])
68 68
 			{
69 69
 				print '<option value="'.$airport_name['airport_icao'].'" selected="selected">'.$airport_name['airport_city'].', '.$airport_name['airport_name'].', '.$airport_name['airport_country'].' ('.$airport_name['airport_icao'].')</option>';
70 70
 			} else {
@@ -114,15 +114,15 @@  discard block
 block discarded – undo
114 114
 				$date_data = '';
115 115
 				$departure_data = '';
116 116
 				$arrival_data = '';
117
-				foreach($all_data as $data)
117
+				foreach ($all_data as $data)
118 118
 				{
119 119
 					$date_data .= '"'.$data['date'].'",';
120 120
 					$departure_data .= $data['departure'].',';
121 121
 					$arrival_data .= $data['arrival'].',';
122 122
 				}
123
-				$date_data = "['x',".substr($date_data,0,-1)."]";
124
-				$departure_data = "['departure',".substr($departure_data,0,-1)."]";
125
-				$arrival_data = "['arrival',".substr($arrival_data,0,-1)."]";
123
+				$date_data = "['x',".substr($date_data, 0, -1)."]";
124
+				$departure_data = "['departure',".substr($departure_data, 0, -1)."]";
125
+				$arrival_data = "['arrival',".substr($arrival_data, 0, -1)."]";
126 126
 				print 'c3.generate({
127 127
 				    bindto: "#chart",
128 128
 				    data: {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 					print _("Dew point:").' '.$metar_parse['dew'].' °C'." - ";
180 180
 				}
181 181
 				if (isset($metar_parse['temperature']) && isset($metar_parse['dew'])) {
182
-					$humidity = round(100 * pow((112 - (0.1 * $metar_parse['temperature']) + $metar_parse['dew']) / (112 + (0.9 * $metar_parse['temperature'])), 8),1);
182
+					$humidity = round(100*pow((112 - (0.1*$metar_parse['temperature']) + $metar_parse['dew'])/(112 + (0.9*$metar_parse['temperature'])), 8), 1);
183 183
 					print _("Humidity:").' '.$humidity.'%'." - ";
184 184
 				}
185 185
 				if (isset($metar_parse['QNH'])) {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 			print '<div class="table column">';
197 197
 			if ($airport_array[0]['iata'] != "NA")
198 198
 			{
199
-				print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."),$airport_array[0]['city'],$airport_array[0]['name'],$airport_array[0]['icao']).'</p>';
199
+				print '<p>'.sprintf(_("The table below shows the detailed information of all flights to/from <strong>%s, %s (%s)</strong>."), $airport_array[0]['city'], $airport_array[0]['name'], $airport_array[0]['icao']).'</p>';
200 200
 			}
201 201
 			include('table-output.php');  
202 202
 			print '<div class="pagination">';
Please login to merge, or discard this patch.
require/libs/Predict/Predict/SGPSDP.php 1 patch
Spacing   +499 added lines, -499 removed lines patch added patch discarded remove patch
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
 
43 43
     /* orbit_type_t struct */
44 44
     const ORBIT_TYPE_UNKNOWN = 0;
45
-    const ORBIT_TYPE_LEO     = 1;            /*!< Low Earth orbit, up to 1200 km. */
46
-    const ORBIT_TYPE_ICO     = 2;            /*!< Intermediate Circular Orbit, up to 1400 km. */
47
-    const ORBIT_TYPE_GEO     = 3;            /*!< Geostationary. */
48
-    const ORBIT_TYPE_GSO     = 4;            /*!< Geosynchronuous. */
45
+    const ORBIT_TYPE_LEO     = 1; /*!< Low Earth orbit, up to 1200 km. */
46
+    const ORBIT_TYPE_ICO     = 2; /*!< Intermediate Circular Orbit, up to 1400 km. */
47
+    const ORBIT_TYPE_GEO     = 3; /*!< Geostationary. */
48
+    const ORBIT_TYPE_GSO     = 4; /*!< Geosynchronuous. */
49 49
     const ORBIT_TYPE_MOLNIYA = 5;
50 50
     const ORBIT_TYPE_TUNDRA  = 6;
51 51
     const ORBIT_TYPE_POLAR   = 7;
@@ -75,24 +75,24 @@  discard block
 block discarded – undo
75 75
 
76 76
             /* Recover original mean motion (xnodp) and   */
77 77
             /* semimajor axis (aodp) from input elements. */
78
-            $a1 = pow(Predict::xke / $sat->tle->xno, Predict::tothrd);
78
+            $a1 = pow(Predict::xke/$sat->tle->xno, Predict::tothrd);
79 79
             $sat->sgps->cosio = cos($sat->tle->xincl);
80
-            $theta2 = $sat->sgps->cosio * $sat->sgps->cosio;
81
-            $sat->sgps->x3thm1 = 3 * $theta2 - 1.0;
82
-            $eosq = $sat->tle->eo * $sat->tle->eo;
80
+            $theta2 = $sat->sgps->cosio*$sat->sgps->cosio;
81
+            $sat->sgps->x3thm1 = 3*$theta2 - 1.0;
82
+            $eosq = $sat->tle->eo*$sat->tle->eo;
83 83
             $betao2 = 1 - $eosq;
84 84
             $betao = sqrt($betao2);
85
-            $del1 = 1.5 * Predict::ck2 * $sat->sgps->x3thm1 / ($a1 * $a1 * $betao * $betao2);
86
-            $ao = $a1 * (1 - $del1 * (0.5 * Predict::tothrd + $del1 * (1 + 134.0 / 81.0 * $del1)));
87
-            $delo = 1.5 * Predict::ck2 * $sat->sgps->x3thm1 / ($ao * $ao * $betao * $betao2);
88
-            $sat->sgps->xnodp = $sat->tle->xno / (1.0 + $delo);
89
-            $sat->sgps->aodp = $ao / (1.0 - $delo);
85
+            $del1 = 1.5*Predict::ck2*$sat->sgps->x3thm1/($a1*$a1*$betao*$betao2);
86
+            $ao = $a1*(1 - $del1*(0.5*Predict::tothrd + $del1*(1 + 134.0/81.0*$del1)));
87
+            $delo = 1.5*Predict::ck2*$sat->sgps->x3thm1/($ao*$ao*$betao*$betao2);
88
+            $sat->sgps->xnodp = $sat->tle->xno/(1.0 + $delo);
89
+            $sat->sgps->aodp = $ao/(1.0 - $delo);
90 90
 
91 91
             /* For perigee less than 220 kilometers, the "simple" flag is set */
92 92
             /* and the equations are truncated to linear variation in sqrt a  */
93 93
             /* and quadratic variation in mean anomaly.  Also, the c3 term,   */
94 94
             /* the delta omega term, and the delta m term are dropped.        */
95
-            if (($sat->sgps->aodp * (1.0 - $sat->tle->eo) / Predict::ae) < (220.0 / Predict::xkmper + Predict::ae)) {
95
+            if (($sat->sgps->aodp*(1.0 - $sat->tle->eo)/Predict::ae) < (220.0/Predict::xkmper + Predict::ae)) {
96 96
                 $sat->flags |= self::SIMPLE_FLAG;
97 97
             } else {
98 98
                 $sat->flags &= ~self::SIMPLE_FLAG;
@@ -102,121 +102,121 @@  discard block
 block discarded – undo
102 102
             /* values of s and qoms2t are altered. */
103 103
             $s4 = Predict::__s__;
104 104
             $qoms24 = Predict::qoms2t;
105
-            $perige = ($sat->sgps->aodp * (1 - $sat->tle->eo) - Predict::ae) * Predict::xkmper;
105
+            $perige = ($sat->sgps->aodp*(1 - $sat->tle->eo) - Predict::ae)*Predict::xkmper;
106 106
             if ($perige < 156.0) {
107 107
                 if ($perige <= 98.0) {
108 108
                     $s4 = 20.0;
109 109
                 } else {
110 110
                     $s4 = $perige - 78.0;
111 111
                 }
112
-                $qoms24 = pow((120.0 - $s4) * Predict::ae / Predict::xkmper, 4);
113
-                $s4 = $s4 / Predict::xkmper + Predict::ae;
112
+                $qoms24 = pow((120.0 - $s4)*Predict::ae/Predict::xkmper, 4);
113
+                $s4 = $s4/Predict::xkmper + Predict::ae;
114 114
             }; /* FIXME FIXME: End of if(perige <= 98) NO WAY!!!! */
115 115
 
116
-            $pinvsq = 1.0 / ($sat->sgps->aodp * $sat->sgps->aodp * $betao2 * $betao2);
117
-            $tsi = 1.0 / ($sat->sgps->aodp - $s4);
118
-            $sat->sgps->eta = $sat->sgps->aodp * $sat->tle->eo * $tsi;
119
-            $etasq = $sat->sgps->eta * $sat->sgps->eta;
120
-            $eeta = $sat->tle->eo * $sat->sgps->eta;
116
+            $pinvsq = 1.0/($sat->sgps->aodp*$sat->sgps->aodp*$betao2*$betao2);
117
+            $tsi = 1.0/($sat->sgps->aodp - $s4);
118
+            $sat->sgps->eta = $sat->sgps->aodp*$sat->tle->eo*$tsi;
119
+            $etasq = $sat->sgps->eta*$sat->sgps->eta;
120
+            $eeta = $sat->tle->eo*$sat->sgps->eta;
121 121
             $psisq = abs(1.0 - $etasq);
122
-            $coef = $qoms24 * pow($tsi, 4);
123
-            $coef1 = $coef / pow($psisq, 3.5);
124
-            $c2 = $coef1 * $sat->sgps->xnodp * ($sat->sgps->aodp *
125
-                            (1.0 + 1.5 * $etasq + $eeta * (4.0 + $etasq)) +
126
-                            0.75 * Predict::ck2 * $tsi / $psisq * $sat->sgps->x3thm1 *
127
-                            (8.0 + 3.0 * $etasq * (8 + $etasq)));
128
-            $sat->sgps->c1 = $c2 * $sat->tle->bstar;
122
+            $coef = $qoms24*pow($tsi, 4);
123
+            $coef1 = $coef/pow($psisq, 3.5);
124
+            $c2 = $coef1*$sat->sgps->xnodp*($sat->sgps->aodp*
125
+                            (1.0 + 1.5*$etasq + $eeta*(4.0 + $etasq)) +
126
+                            0.75*Predict::ck2*$tsi/$psisq*$sat->sgps->x3thm1*
127
+                            (8.0 + 3.0*$etasq*(8 + $etasq)));
128
+            $sat->sgps->c1 = $c2*$sat->tle->bstar;
129 129
             $sat->sgps->sinio = sin($sat->tle->xincl);
130
-            $a3ovk2 = -Predict::xj3 / Predict::ck2 * pow(Predict::ae, 3);
131
-            $c3 = $coef * $tsi * $a3ovk2 * $sat->sgps->xnodp * Predict::ae * $sat->sgps->sinio / $sat->tle->eo;
130
+            $a3ovk2 = -Predict::xj3/Predict::ck2*pow(Predict::ae, 3);
131
+            $c3 = $coef*$tsi*$a3ovk2*$sat->sgps->xnodp*Predict::ae*$sat->sgps->sinio/$sat->tle->eo;
132 132
             $sat->sgps->x1mth2 = 1.0 - $theta2;
133
-            $sat->sgps->c4 = 2.0 * $sat->sgps->xnodp * $coef1 * $sat->sgps->aodp * $betao2 *
134
-                ($sat->sgps->eta * (2.0 + 0.5 * $etasq) +
135
-                 $sat->tle->eo * (0.5 + 2.0 * $etasq) -
136
-                 2.0 * Predict::ck2 * $tsi / ($sat->sgps->aodp * $psisq) *
137
-                 (-3.0 * $sat->sgps->x3thm1 * (1.0 - 2.0 * $eeta + $etasq * (1.5 - 0.5 * $eeta)) +
138
-                  0.75 * $sat->sgps->x1mth2 * (2.0 * $etasq - $eeta * (1.0 + $etasq)) *
139
-                  cos(2.0 * $sat->tle->omegao)));
140
-            $sat->sgps->c5 = 2.0 * $coef1 * $sat->sgps->aodp * $betao2 *
141
-                (1.0 + 2.75 * ($etasq + $eeta) + $eeta * $etasq);
142
-            $theta4 = $theta2 * $theta2;
143
-            $temp1 = 3.0 * Predict::ck2 * $pinvsq * $sat->sgps->xnodp;
144
-            $temp2 = $temp1 * Predict::ck2 * $pinvsq;
145
-            $temp3 = 1.25 * Predict::ck4 * $pinvsq * $pinvsq * $sat->sgps->xnodp;
146
-            $sat->sgps->xmdot = $sat->sgps->xnodp + 0.5 * $temp1 * $betao * $sat->sgps->x3thm1 +
147
-                0.0625 * $temp2 * $betao * (13.0 - 78.0 * $theta2 + 137.0 * $theta4);
148
-            $x1m5th = 1.0 - 5.0 * $theta2;
149
-            $sat->sgps->omgdot = -0.5 * $temp1 * $x1m5th +
150
-                0.0625 * $temp2 * (7.0 - 114.0 * $theta2 + 395.0 * $theta4) +
151
-                $temp3 * (3.0 - 36.0 * $theta2 + 49.0 * $theta4);
152
-            $xhdot1 = -$temp1 * $sat->sgps->cosio;
153
-            $sat->sgps->xnodot = $xhdot1 + (0.5 * $temp2 * (4.0 - 19.0 * $theta2) +
154
-                             2.0 * $temp3 * (3.0 - 7.0 * $theta2)) * $sat->sgps->cosio;
155
-            $sat->sgps->omgcof = $sat->tle->bstar * $c3 * cos($sat->tle->omegao);
156
-            $sat->sgps->xmcof = -Predict::tothrd * $coef * $sat->tle->bstar * Predict::ae / $eeta;
157
-            $sat->sgps->xnodcf = 3.5 * $betao2 * $xhdot1 * $sat->sgps->c1;
158
-            $sat->sgps->t2cof = 1.5 * $sat->sgps->c1;
159
-            $sat->sgps->xlcof = 0.125 * $a3ovk2 * $sat->sgps->sinio *
160
-                (3.0 + 5.0 * $sat->sgps->cosio) / (1.0 + $sat->sgps->cosio);
161
-            $sat->sgps->aycof = 0.25 * $a3ovk2 * $sat->sgps->sinio;
162
-            $sat->sgps->delmo = pow(1.0 + $sat->sgps->eta * cos($sat->tle->xmo), 3);
133
+            $sat->sgps->c4 = 2.0*$sat->sgps->xnodp*$coef1*$sat->sgps->aodp*$betao2*
134
+                ($sat->sgps->eta*(2.0 + 0.5*$etasq) +
135
+                 $sat->tle->eo*(0.5 + 2.0*$etasq) -
136
+                 2.0*Predict::ck2*$tsi/($sat->sgps->aodp*$psisq)*
137
+                 (-3.0*$sat->sgps->x3thm1*(1.0 - 2.0*$eeta + $etasq*(1.5 - 0.5*$eeta)) +
138
+                  0.75*$sat->sgps->x1mth2*(2.0*$etasq - $eeta*(1.0 + $etasq))*
139
+                  cos(2.0*$sat->tle->omegao)));
140
+            $sat->sgps->c5 = 2.0*$coef1*$sat->sgps->aodp*$betao2*
141
+                (1.0 + 2.75*($etasq + $eeta) + $eeta*$etasq);
142
+            $theta4 = $theta2*$theta2;
143
+            $temp1 = 3.0*Predict::ck2*$pinvsq*$sat->sgps->xnodp;
144
+            $temp2 = $temp1*Predict::ck2*$pinvsq;
145
+            $temp3 = 1.25*Predict::ck4*$pinvsq*$pinvsq*$sat->sgps->xnodp;
146
+            $sat->sgps->xmdot = $sat->sgps->xnodp + 0.5*$temp1*$betao*$sat->sgps->x3thm1 +
147
+                0.0625*$temp2*$betao*(13.0 - 78.0*$theta2 + 137.0*$theta4);
148
+            $x1m5th = 1.0 - 5.0*$theta2;
149
+            $sat->sgps->omgdot = -0.5*$temp1*$x1m5th +
150
+                0.0625*$temp2*(7.0 - 114.0*$theta2 + 395.0*$theta4) +
151
+                $temp3*(3.0 - 36.0*$theta2 + 49.0*$theta4);
152
+            $xhdot1 = -$temp1*$sat->sgps->cosio;
153
+            $sat->sgps->xnodot = $xhdot1 + (0.5*$temp2*(4.0 - 19.0*$theta2) +
154
+                             2.0*$temp3*(3.0 - 7.0*$theta2))*$sat->sgps->cosio;
155
+            $sat->sgps->omgcof = $sat->tle->bstar*$c3*cos($sat->tle->omegao);
156
+            $sat->sgps->xmcof = -Predict::tothrd*$coef*$sat->tle->bstar*Predict::ae/$eeta;
157
+            $sat->sgps->xnodcf = 3.5*$betao2*$xhdot1*$sat->sgps->c1;
158
+            $sat->sgps->t2cof = 1.5*$sat->sgps->c1;
159
+            $sat->sgps->xlcof = 0.125*$a3ovk2*$sat->sgps->sinio*
160
+                (3.0 + 5.0*$sat->sgps->cosio)/(1.0 + $sat->sgps->cosio);
161
+            $sat->sgps->aycof = 0.25*$a3ovk2*$sat->sgps->sinio;
162
+            $sat->sgps->delmo = pow(1.0 + $sat->sgps->eta*cos($sat->tle->xmo), 3);
163 163
             $sat->sgps->sinmo = sin($sat->tle->xmo);
164
-            $sat->sgps->x7thm1 = 7.0 * $theta2 - 1.0;
164
+            $sat->sgps->x7thm1 = 7.0*$theta2 - 1.0;
165 165
             if (~$sat->flags & self::SIMPLE_FLAG) {
166
-                $c1sq = $sat->sgps->c1 * $sat->sgps->c1;
167
-                $sat->sgps->d2 = 4.0 * $sat->sgps->aodp * $tsi * $c1sq;
168
-                $temp = $sat->sgps->d2 * $tsi * $sat->sgps->c1 / 3.0;
169
-                $sat->sgps->d3 = (17.0 * $sat->sgps->aodp + $s4) * $temp;
170
-                $sat->sgps->d4 = 0.5 * $temp * $sat->sgps->aodp * $tsi *
171
-                    (221.0 * $sat->sgps->aodp + 31.0 * $s4) * $sat->sgps->c1;
172
-                $sat->sgps->t3cof = $sat->sgps->d2 + 2.0 * $c1sq;
173
-                $sat->sgps->t4cof = 0.25 * (3.0 * $sat->sgps->d3 + $sat->sgps->c1 *
174
-                              (12.0 * $sat->sgps->d2 + 10.0 * $c1sq));
175
-                $sat->sgps->t5cof = 0.2 * (3.0 * $sat->sgps->d4 +
176
-                             12.0 * $sat->sgps->c1 * $sat->sgps->d3 +
177
-                             6.0 * $sat->sgps->d2 * $sat->sgps->d2 +
178
-                             15.0 * $c1sq * (2.0 * $sat->sgps->d2 + $c1sq));
166
+                $c1sq = $sat->sgps->c1*$sat->sgps->c1;
167
+                $sat->sgps->d2 = 4.0*$sat->sgps->aodp*$tsi*$c1sq;
168
+                $temp = $sat->sgps->d2*$tsi*$sat->sgps->c1/3.0;
169
+                $sat->sgps->d3 = (17.0*$sat->sgps->aodp + $s4)*$temp;
170
+                $sat->sgps->d4 = 0.5*$temp*$sat->sgps->aodp*$tsi*
171
+                    (221.0*$sat->sgps->aodp + 31.0*$s4)*$sat->sgps->c1;
172
+                $sat->sgps->t3cof = $sat->sgps->d2 + 2.0*$c1sq;
173
+                $sat->sgps->t4cof = 0.25*(3.0*$sat->sgps->d3 + $sat->sgps->c1*
174
+                              (12.0*$sat->sgps->d2 + 10.0*$c1sq));
175
+                $sat->sgps->t5cof = 0.2*(3.0*$sat->sgps->d4 +
176
+                             12.0*$sat->sgps->c1*$sat->sgps->d3 +
177
+                             6.0*$sat->sgps->d2*$sat->sgps->d2 +
178
+                             15.0*$c1sq*(2.0*$sat->sgps->d2 + $c1sq));
179 179
             }; /* End of if (isFlagClear(SIMPLE_FLAG)) */
180 180
         }; /* End of SGP4() initialization */
181 181
 
182 182
         /* Update for secular gravity and atmospheric drag. */
183
-        $xmdf = $sat->tle->xmo + $sat->sgps->xmdot * $tsince;
184
-        $omgadf = $sat->tle->omegao + $sat->sgps->omgdot * $tsince;
185
-        $xnoddf = $sat->tle->xnodeo + $sat->sgps->xnodot * $tsince;
183
+        $xmdf = $sat->tle->xmo + $sat->sgps->xmdot*$tsince;
184
+        $omgadf = $sat->tle->omegao + $sat->sgps->omgdot*$tsince;
185
+        $xnoddf = $sat->tle->xnodeo + $sat->sgps->xnodot*$tsince;
186 186
         $omega = $omgadf;
187 187
         $xmp = $xmdf;
188
-        $tsq = $tsince * $tsince;
189
-        $xnode = $xnoddf + $sat->sgps->xnodcf * $tsq;
190
-        $tempa = 1.0 - $sat->sgps->c1 * $tsince;
191
-        $tempe = $sat->tle->bstar * $sat->sgps->c4 * $tsince;
192
-        $templ = $sat->sgps->t2cof * $tsq;
188
+        $tsq = $tsince*$tsince;
189
+        $xnode = $xnoddf + $sat->sgps->xnodcf*$tsq;
190
+        $tempa = 1.0 - $sat->sgps->c1*$tsince;
191
+        $tempe = $sat->tle->bstar*$sat->sgps->c4*$tsince;
192
+        $templ = $sat->sgps->t2cof*$tsq;
193 193
         if (~$sat->flags & self::SIMPLE_FLAG) {
194
-            $delomg = $sat->sgps->omgcof * $tsince;
195
-            $delm = $sat->sgps->xmcof * (pow(1 + $sat->sgps->eta * cos($xmdf), 3) - $sat->sgps->delmo);
194
+            $delomg = $sat->sgps->omgcof*$tsince;
195
+            $delm = $sat->sgps->xmcof*(pow(1 + $sat->sgps->eta*cos($xmdf), 3) - $sat->sgps->delmo);
196 196
             $temp = $delomg + $delm;
197 197
             $xmp = $xmdf + $temp;
198 198
             $omega = $omgadf - $temp;
199
-            $tcube = $tsq * $tsince;
200
-            $tfour = $tsince * $tcube;
201
-            $tempa = $tempa - $sat->sgps->d2 * $tsq - $sat->sgps->d3 * $tcube - $sat->sgps->d4 * $tfour;
202
-            $tempe = $tempe + $sat->tle->bstar * $sat->sgps->c5 * (sin($xmp) - $sat->sgps->sinmo);
203
-            $templ = $templ + $sat->sgps->t3cof * $tcube + $tfour *
204
-                ($sat->sgps->t4cof + $tsince * $sat->sgps->t5cof);
199
+            $tcube = $tsq*$tsince;
200
+            $tfour = $tsince*$tcube;
201
+            $tempa = $tempa - $sat->sgps->d2*$tsq - $sat->sgps->d3*$tcube - $sat->sgps->d4*$tfour;
202
+            $tempe = $tempe + $sat->tle->bstar*$sat->sgps->c5*(sin($xmp) - $sat->sgps->sinmo);
203
+            $templ = $templ + $sat->sgps->t3cof*$tcube + $tfour*
204
+                ($sat->sgps->t4cof + $tsince*$sat->sgps->t5cof);
205 205
         }; /* End of if (isFlagClear(SIMPLE_FLAG)) */
206 206
 
207
-        $a = $sat->sgps->aodp * pow($tempa, 2);
207
+        $a = $sat->sgps->aodp*pow($tempa, 2);
208 208
         $e = $sat->tle->eo - $tempe;
209
-        $xl = $xmp + $omega + $xnode + $sat->sgps->xnodp * $templ;
210
-        $beta = sqrt(1.0 - ($e * $e));
211
-        $xn = Predict::xke / pow($a, 1.5);
209
+        $xl = $xmp + $omega + $xnode + $sat->sgps->xnodp*$templ;
210
+        $beta = sqrt(1.0 - ($e*$e));
211
+        $xn = Predict::xke/pow($a, 1.5);
212 212
 
213 213
         /* Long period periodics */
214
-        $axn = $e * cos($omega);
215
-        $temp = 1.0 / ($a * $beta * $beta);
216
-        $xll = $temp * $sat->sgps->xlcof * $axn;
217
-        $aynl = $temp * $sat->sgps->aycof;
214
+        $axn = $e*cos($omega);
215
+        $temp = 1.0/($a*$beta*$beta);
216
+        $xll = $temp*$sat->sgps->xlcof*$axn;
217
+        $aynl = $temp*$sat->sgps->aycof;
218 218
         $xlt = $xl + $xll;
219
-        $ayn = $e * sin($omega) + $aynl;
219
+        $ayn = $e*sin($omega) + $aynl;
220 220
 
221 221
         /* Solve Kepler's' Equation */
222 222
         $capu = Predict_Math::FMod2p($xlt - $xnode);
@@ -226,11 +226,11 @@  discard block
 block discarded – undo
226 226
         do {
227 227
             $sinepw = sin($temp2);
228 228
             $cosepw = cos($temp2);
229
-            $temp3 = $axn * $sinepw;
230
-            $temp4 = $ayn * $cosepw;
231
-            $temp5 = $axn * $cosepw;
232
-            $temp6 = $ayn * $sinepw;
233
-            $epw = ($capu - $temp4 + $temp3 - $temp2) / (1.0 - $temp5 - $temp6) + $temp2;
229
+            $temp3 = $axn*$sinepw;
230
+            $temp4 = $ayn*$cosepw;
231
+            $temp5 = $axn*$cosepw;
232
+            $temp6 = $ayn*$sinepw;
233
+            $epw = ($capu - $temp4 + $temp3 - $temp2)/(1.0 - $temp5 - $temp6) + $temp2;
234 234
             if (abs($epw - $temp2) <= Predict::e6a) {
235 235
                 break;
236 236
             }
@@ -240,33 +240,33 @@  discard block
 block discarded – undo
240 240
         /* Short period preliminary quantities */
241 241
         $ecose = $temp5 + $temp6;
242 242
         $esine = $temp3 - $temp4;
243
-        $elsq = $axn * $axn + $ayn * $ayn;
243
+        $elsq = $axn*$axn + $ayn*$ayn;
244 244
         $temp = 1.0 - $elsq;
245
-        $pl = $a * $temp;
246
-        $r = $a * (1.0 - $ecose);
247
-        $temp1 = 1.0 / $r;
248
-        $rdot = Predict::xke * sqrt($a) * $esine * $temp1;
249
-        $rfdot = Predict::xke * sqrt($pl) * $temp1;
250
-        $temp2 = $a * $temp1;
245
+        $pl = $a*$temp;
246
+        $r = $a*(1.0 - $ecose);
247
+        $temp1 = 1.0/$r;
248
+        $rdot = Predict::xke*sqrt($a)*$esine*$temp1;
249
+        $rfdot = Predict::xke*sqrt($pl)*$temp1;
250
+        $temp2 = $a*$temp1;
251 251
         $betal = sqrt($temp);
252
-        $temp3 = 1.0 / (1.0 + $betal);
253
-        $cosu = $temp2 * ($cosepw - $axn + $ayn * $esine * $temp3);
254
-        $sinu = $temp2 * ($sinepw - $ayn - $axn * $esine * $temp3);
252
+        $temp3 = 1.0/(1.0 + $betal);
253
+        $cosu = $temp2*($cosepw - $axn + $ayn*$esine*$temp3);
254
+        $sinu = $temp2*($sinepw - $ayn - $axn*$esine*$temp3);
255 255
         $u = Predict_Math::AcTan($sinu, $cosu);
256
-        $sin2u = 2.0 * $sinu * $cosu;
257
-        $cos2u = 2.0 * $cosu * $cosu - 1.0;
258
-        $temp = 1.0 / $pl;
259
-        $temp1 = Predict::ck2 * $temp;
260
-        $temp2 = $temp1 * $temp;
256
+        $sin2u = 2.0*$sinu*$cosu;
257
+        $cos2u = 2.0*$cosu*$cosu - 1.0;
258
+        $temp = 1.0/$pl;
259
+        $temp1 = Predict::ck2*$temp;
260
+        $temp2 = $temp1*$temp;
261 261
 
262 262
         /* Update for short periodics */
263
-        $rk = $r * (1.0 - 1.5 * $temp2 * $betal * $sat->sgps->x3thm1) +
264
-            0.5 * $temp1 * $sat->sgps->x1mth2 * $cos2u;
265
-        $uk = $u - 0.25 * $temp2 * $sat->sgps->x7thm1 * $sin2u;
266
-        $xnodek = $xnode + 1.5 * $temp2 * $sat->sgps->cosio * $sin2u;
267
-        $xinck = $sat->tle->xincl + 1.5 * $temp2 * $sat->sgps->cosio * $sat->sgps->sinio * $cos2u;
268
-        $rdotk = $rdot - $xn * $temp1 * $sat->sgps->x1mth2 * $sin2u;
269
-        $rfdotk = $rfdot + $xn * $temp1 * ($sat->sgps->x1mth2 * $cos2u + 1.5 * $sat->sgps->x3thm1);
263
+        $rk = $r*(1.0 - 1.5*$temp2*$betal*$sat->sgps->x3thm1) +
264
+            0.5*$temp1*$sat->sgps->x1mth2*$cos2u;
265
+        $uk = $u - 0.25*$temp2*$sat->sgps->x7thm1*$sin2u;
266
+        $xnodek = $xnode + 1.5*$temp2*$sat->sgps->cosio*$sin2u;
267
+        $xinck = $sat->tle->xincl + 1.5*$temp2*$sat->sgps->cosio*$sat->sgps->sinio*$cos2u;
268
+        $rdotk = $rdot - $xn*$temp1*$sat->sgps->x1mth2*$sin2u;
269
+        $rfdotk = $rfdot + $xn*$temp1*($sat->sgps->x1mth2*$cos2u + 1.5*$sat->sgps->x3thm1);
270 270
 
271 271
 
272 272
         /* Orientation vectors */
@@ -276,22 +276,22 @@  discard block
 block discarded – undo
276 276
         $cosik = cos($xinck);
277 277
         $sinnok = sin($xnodek);
278 278
         $cosnok = cos($xnodek);
279
-        $xmx = -$sinnok * $cosik;
280
-        $xmy = $cosnok * $cosik;
281
-        $ux = $xmx * $sinuk + $cosnok * $cosuk;
282
-        $uy = $xmy * $sinuk + $sinnok * $cosuk;
283
-        $uz = $sinik * $sinuk;
284
-        $vx = $xmx * $cosuk - $cosnok * $sinuk;
285
-        $vy = $xmy * $cosuk - $sinnok * $sinuk;
286
-        $vz = $sinik * $cosuk;
279
+        $xmx = -$sinnok*$cosik;
280
+        $xmy = $cosnok*$cosik;
281
+        $ux = $xmx*$sinuk + $cosnok*$cosuk;
282
+        $uy = $xmy*$sinuk + $sinnok*$cosuk;
283
+        $uz = $sinik*$sinuk;
284
+        $vx = $xmx*$cosuk - $cosnok*$sinuk;
285
+        $vy = $xmy*$cosuk - $sinnok*$sinuk;
286
+        $vz = $sinik*$cosuk;
287 287
 
288 288
         /* Position and velocity */
289
-        $sat->pos->x = $rk * $ux;
290
-        $sat->pos->y = $rk * $uy;
291
-        $sat->pos->z = $rk * $uz;
292
-        $sat->vel->x = $rdotk * $ux + $rfdotk * $vx;
293
-        $sat->vel->y = $rdotk * $uy + $rfdotk * $vy;
294
-        $sat->vel->z = $rdotk * $uz + $rfdotk * $vz;
289
+        $sat->pos->x = $rk*$ux;
290
+        $sat->pos->y = $rk*$uy;
291
+        $sat->pos->z = $rk*$uz;
292
+        $sat->vel->x = $rdotk*$ux + $rfdotk*$vx;
293
+        $sat->vel->y = $rdotk*$uy + $rfdotk*$vy;
294
+        $sat->vel->z = $rdotk*$uz + $rfdotk*$vz;
295 295
 
296 296
         $sat->phase = $xlt - $xnode - $omgadf + Predict::twopi;
297 297
         if ($sat->phase < 0) {
@@ -321,100 +321,100 @@  discard block
 block discarded – undo
321 321
 
322 322
             /* Recover original mean motion (xnodp) and   */
323 323
             /* semimajor axis (aodp) from input elements. */
324
-            $a1 = pow(Predict::xke / $sat->tle->xno, Predict::tothrd);
324
+            $a1 = pow(Predict::xke/$sat->tle->xno, Predict::tothrd);
325 325
             $sat->deep_arg->cosio = cos($sat->tle->xincl);
326
-            $sat->deep_arg->theta2 = $sat->deep_arg->cosio * $sat->deep_arg->cosio;
327
-            $sat->sgps->x3thm1 = 3.0 * $sat->deep_arg->theta2 - 1.0;
328
-            $sat->deep_arg->eosq = $sat->tle->eo * $sat->tle->eo;
326
+            $sat->deep_arg->theta2 = $sat->deep_arg->cosio*$sat->deep_arg->cosio;
327
+            $sat->sgps->x3thm1 = 3.0*$sat->deep_arg->theta2 - 1.0;
328
+            $sat->deep_arg->eosq = $sat->tle->eo*$sat->tle->eo;
329 329
             $sat->deep_arg->betao2 = 1.0 - $sat->deep_arg->eosq;
330 330
             $sat->deep_arg->betao = sqrt($sat->deep_arg->betao2);
331
-            $del1 = 1.5 * Predict::ck2 * $sat->sgps->x3thm1 /
332
-                ($a1 * $a1 * $sat->deep_arg->betao * $sat->deep_arg->betao2);
333
-            $ao = $a1 * (1.0 - $del1 * (0.5 * Predict::tothrd + $del1 * (1.0 + 134.0 / 81.0 * $del1)));
334
-            $delo = 1.5 * Predict::ck2 * $sat->sgps->x3thm1 /
335
-                ($ao * $ao * $sat->deep_arg->betao * $sat->deep_arg->betao2);
336
-            $sat->deep_arg->xnodp = $sat->tle->xno / (1.0 + $delo);
337
-            $sat->deep_arg->aodp = $ao / (1.0 - $delo);
331
+            $del1 = 1.5*Predict::ck2*$sat->sgps->x3thm1/
332
+                ($a1*$a1*$sat->deep_arg->betao*$sat->deep_arg->betao2);
333
+            $ao = $a1*(1.0 - $del1*(0.5*Predict::tothrd + $del1*(1.0 + 134.0/81.0*$del1)));
334
+            $delo = 1.5*Predict::ck2*$sat->sgps->x3thm1/
335
+                ($ao*$ao*$sat->deep_arg->betao*$sat->deep_arg->betao2);
336
+            $sat->deep_arg->xnodp = $sat->tle->xno/(1.0 + $delo);
337
+            $sat->deep_arg->aodp = $ao/(1.0 - $delo);
338 338
 
339 339
             /* For perigee below 156 km, the values */
340 340
             /* of s and qoms2t are altered.         */
341 341
             $s4 = Predict::__s__;
342 342
             $qoms24 = Predict::qoms2t;
343
-            $perige = ($sat->deep_arg->aodp * (1.0 - $sat->tle->eo) - Predict::ae) * Predict::xkmper;
343
+            $perige = ($sat->deep_arg->aodp*(1.0 - $sat->tle->eo) - Predict::ae)*Predict::xkmper;
344 344
             if ($perige < 156.0) {
345 345
                 if ($perige <= 98.0) {
346 346
                     $s4 = 20.0;
347 347
                 } else {
348 348
                     $s4 = $perige - 78.0;
349 349
                 }
350
-                $qoms24 = pow((120.0 - $s4) * Predict::ae / Predict::xkmper, 4);
351
-                $s4 = $s4 / Predict::xkmper + Predict::ae;
350
+                $qoms24 = pow((120.0 - $s4)*Predict::ae/Predict::xkmper, 4);
351
+                $s4 = $s4/Predict::xkmper + Predict::ae;
352 352
             }
353
-            $pinvsq = 1.0 / ($sat->deep_arg->aodp * $sat->deep_arg->aodp *
354
-                    $sat->deep_arg->betao2 * $sat->deep_arg->betao2);
353
+            $pinvsq = 1.0/($sat->deep_arg->aodp*$sat->deep_arg->aodp*
354
+                    $sat->deep_arg->betao2*$sat->deep_arg->betao2);
355 355
             $sat->deep_arg->sing = sin($sat->tle->omegao);
356 356
             $sat->deep_arg->cosg = cos($sat->tle->omegao);
357
-            $tsi = 1.0 / ($sat->deep_arg->aodp - $s4);
358
-            $eta = $sat->deep_arg->aodp * $sat->tle->eo * $tsi;
359
-            $etasq = $eta * $eta;
360
-            $eeta = $sat->tle->eo * $eta;
357
+            $tsi = 1.0/($sat->deep_arg->aodp - $s4);
358
+            $eta = $sat->deep_arg->aodp*$sat->tle->eo*$tsi;
359
+            $etasq = $eta*$eta;
360
+            $eeta = $sat->tle->eo*$eta;
361 361
             $psisq = abs(1.0 - $etasq);
362
-            $coef = $qoms24 * pow($tsi, 4);
363
-            $coef1 = $coef / pow($psisq, 3.5);
364
-            $c2 = $coef1 * $sat->deep_arg->xnodp * ($sat->deep_arg->aodp *
365
-                                (1.0 + 1.5 * $etasq + $eeta *
366
-                                 (4.0 + $etasq)) + 0.75 * Predict::ck2 * $tsi / $psisq *
367
-                                $sat->sgps->x3thm1 * (8.0 + 3.0 * $etasq *
362
+            $coef = $qoms24*pow($tsi, 4);
363
+            $coef1 = $coef/pow($psisq, 3.5);
364
+            $c2 = $coef1*$sat->deep_arg->xnodp*($sat->deep_arg->aodp*
365
+                                (1.0 + 1.5*$etasq + $eeta*
366
+                                 (4.0 + $etasq)) + 0.75*Predict::ck2*$tsi/$psisq*
367
+                                $sat->sgps->x3thm1*(8.0 + 3.0*$etasq*
368 368
                                         (8.0 + $etasq)));
369
-            $sat->sgps->c1 = $sat->tle->bstar * $c2;
369
+            $sat->sgps->c1 = $sat->tle->bstar*$c2;
370 370
             $sat->deep_arg->sinio = sin($sat->tle->xincl);
371
-            $a3ovk2 = -Predict::xj3 / Predict::ck2 * pow(Predict::ae, 3);
371
+            $a3ovk2 = -Predict::xj3/Predict::ck2*pow(Predict::ae, 3);
372 372
             $sat->sgps->x1mth2 = 1.0 - $sat->deep_arg->theta2;
373
-            $sat->sgps->c4 = 2.0 * $sat->deep_arg->xnodp * $coef1 *
374
-                $sat->deep_arg->aodp * $sat->deep_arg->betao2 *
375
-                ($eta * (2.0 + 0.5 * $etasq) + $sat->tle->eo *
376
-                 (0.5 + 2.0 * $etasq) - 2.0 * Predict::ck2 * $tsi /
377
-                 ($sat->deep_arg->aodp * $psisq) * (-3.0 * $sat->sgps->x3thm1 *
378
-                                 (1.0 - 2.0 * $eeta + $etasq *
379
-                                  (1.5 - 0.5 * $eeta)) +
380
-                                 0.75 * $sat->sgps->x1mth2 *
381
-                                 (2.0 * $etasq - $eeta * (1.0 + $etasq)) *
382
-                                 cos(2.0 * $sat->tle->omegao)));
383
-            $theta4 = $sat->deep_arg->theta2 * $sat->deep_arg->theta2;
384
-            $temp1 = 3.0 * Predict::ck2 * $pinvsq * $sat->deep_arg->xnodp;
385
-            $temp2 = $temp1 * Predict::ck2 * $pinvsq;
386
-            $temp3 = 1.25 * Predict::ck4 * $pinvsq * $pinvsq * $sat->deep_arg->xnodp;
387
-            $sat->deep_arg->xmdot = $sat->deep_arg->xnodp + 0.5 * $temp1 * $sat->deep_arg->betao *
388
-                $sat->sgps->x3thm1 + 0.0625 * $temp2 * $sat->deep_arg->betao *
389
-                (13.0 - 78.0 * $sat->deep_arg->theta2 + 137.0 * $theta4);
390
-            $x1m5th = 1.0 - 5.0 * $sat->deep_arg->theta2;
391
-            $sat->deep_arg->omgdot = -0.5 * $temp1 * $x1m5th + 0.0625 * $temp2 *
392
-                            (7.0 - 114.0 * $sat->deep_arg->theta2 + 395.0 * $theta4) +
393
-                        $temp3 * (3.0 - 36.0 * $sat->deep_arg->theta2 + 49.0 * $theta4);
394
-            $xhdot1 = -$temp1 * $sat->deep_arg->cosio;
395
-            $sat->deep_arg->xnodot = $xhdot1 + (0.5 * $temp2 * (4.0 - 19.0 * $sat->deep_arg->theta2) +
396
-                             2.0 * $temp3 * (3.0 - 7.0 * $sat->deep_arg->theta2)) *
373
+            $sat->sgps->c4 = 2.0*$sat->deep_arg->xnodp*$coef1*
374
+                $sat->deep_arg->aodp*$sat->deep_arg->betao2*
375
+                ($eta*(2.0 + 0.5*$etasq) + $sat->tle->eo*
376
+                 (0.5 + 2.0*$etasq) - 2.0*Predict::ck2*$tsi/
377
+                 ($sat->deep_arg->aodp*$psisq)*(-3.0*$sat->sgps->x3thm1*
378
+                                 (1.0 - 2.0*$eeta + $etasq*
379
+                                  (1.5 - 0.5*$eeta)) +
380
+                                 0.75*$sat->sgps->x1mth2*
381
+                                 (2.0*$etasq - $eeta*(1.0 + $etasq))*
382
+                                 cos(2.0*$sat->tle->omegao)));
383
+            $theta4 = $sat->deep_arg->theta2*$sat->deep_arg->theta2;
384
+            $temp1 = 3.0*Predict::ck2*$pinvsq*$sat->deep_arg->xnodp;
385
+            $temp2 = $temp1*Predict::ck2*$pinvsq;
386
+            $temp3 = 1.25*Predict::ck4*$pinvsq*$pinvsq*$sat->deep_arg->xnodp;
387
+            $sat->deep_arg->xmdot = $sat->deep_arg->xnodp + 0.5*$temp1*$sat->deep_arg->betao*
388
+                $sat->sgps->x3thm1 + 0.0625*$temp2*$sat->deep_arg->betao*
389
+                (13.0 - 78.0*$sat->deep_arg->theta2 + 137.0*$theta4);
390
+            $x1m5th = 1.0 - 5.0*$sat->deep_arg->theta2;
391
+            $sat->deep_arg->omgdot = -0.5*$temp1*$x1m5th + 0.0625*$temp2*
392
+                            (7.0 - 114.0*$sat->deep_arg->theta2 + 395.0*$theta4) +
393
+                        $temp3*(3.0 - 36.0*$sat->deep_arg->theta2 + 49.0*$theta4);
394
+            $xhdot1 = -$temp1*$sat->deep_arg->cosio;
395
+            $sat->deep_arg->xnodot = $xhdot1 + (0.5*$temp2*(4.0 - 19.0*$sat->deep_arg->theta2) +
396
+                             2.0*$temp3*(3.0 - 7.0*$sat->deep_arg->theta2))*
397 397
                 $sat->deep_arg->cosio;
398
-            $sat->sgps->xnodcf = 3.5 * $sat->deep_arg->betao2 * $xhdot1 * $sat->sgps->c1;
399
-            $sat->sgps->t2cof = 1.5 * $sat->sgps->c1;
400
-            $sat->sgps->xlcof = 0.125 * $a3ovk2 * $sat->deep_arg->sinio *
401
-                (3.0 + 5.0 * $sat->deep_arg->cosio) / (1.0 + $sat->deep_arg->cosio);
402
-            $sat->sgps->aycof = 0.25 * $a3ovk2 * $sat->deep_arg->sinio;
403
-            $sat->sgps->x7thm1 = 7.0 * $sat->deep_arg->theta2 - 1.0;
398
+            $sat->sgps->xnodcf = 3.5*$sat->deep_arg->betao2*$xhdot1*$sat->sgps->c1;
399
+            $sat->sgps->t2cof = 1.5*$sat->sgps->c1;
400
+            $sat->sgps->xlcof = 0.125*$a3ovk2*$sat->deep_arg->sinio*
401
+                (3.0 + 5.0*$sat->deep_arg->cosio)/(1.0 + $sat->deep_arg->cosio);
402
+            $sat->sgps->aycof = 0.25*$a3ovk2*$sat->deep_arg->sinio;
403
+            $sat->sgps->x7thm1 = 7.0*$sat->deep_arg->theta2 - 1.0;
404 404
 
405 405
             /* initialize Deep() */
406 406
             $this->Deep(self::dpinit, $sat);
407 407
         }; /*End of SDP4() initialization */
408 408
 
409 409
         /* Update for secular gravity and atmospheric drag */
410
-        $xmdf = $sat->tle->xmo + $sat->deep_arg->xmdot * $tsince;
411
-        $sat->deep_arg->omgadf = $sat->tle->omegao + $sat->deep_arg->omgdot * $tsince;
412
-        $xnoddf = $sat->tle->xnodeo + $sat->deep_arg->xnodot * $tsince;
413
-        $tsq = $tsince * $tsince;
414
-        $sat->deep_arg->xnode = $xnoddf + $sat->sgps->xnodcf * $tsq;
415
-        $tempa = 1.0 - $sat->sgps->c1 * $tsince;
416
-        $tempe = $sat->tle->bstar * $sat->sgps->c4 * $tsince;
417
-        $templ = $sat->sgps->t2cof * $tsq;
410
+        $xmdf = $sat->tle->xmo + $sat->deep_arg->xmdot*$tsince;
411
+        $sat->deep_arg->omgadf = $sat->tle->omegao + $sat->deep_arg->omgdot*$tsince;
412
+        $xnoddf = $sat->tle->xnodeo + $sat->deep_arg->xnodot*$tsince;
413
+        $tsq = $tsince*$tsince;
414
+        $sat->deep_arg->xnode = $xnoddf + $sat->sgps->xnodcf*$tsq;
415
+        $tempa = 1.0 - $sat->sgps->c1*$tsince;
416
+        $tempe = $sat->tle->bstar*$sat->sgps->c4*$tsince;
417
+        $templ = $sat->sgps->t2cof*$tsq;
418 418
         $sat->deep_arg->xn = $sat->deep_arg->xnodp;
419 419
 
420 420
         /* Update for deep-space secular effects */
@@ -424,9 +424,9 @@  discard block
 block discarded – undo
424 424
         $this->Deep(self::dpsec, $sat);
425 425
 
426 426
         $xmdf = $sat->deep_arg->xll;
427
-        $a = pow(Predict::xke / $sat->deep_arg->xn, Predict::tothrd) * $tempa * $tempa;
427
+        $a = pow(Predict::xke/$sat->deep_arg->xn, Predict::tothrd)*$tempa*$tempa;
428 428
         $sat->deep_arg->em = $sat->deep_arg->em - $tempe;
429
-        $xmam = $xmdf + $sat->deep_arg->xnodp * $templ;
429
+        $xmam = $xmdf + $sat->deep_arg->xnodp*$templ;
430 430
 
431 431
         /* Update for deep-space periodic effects */
432 432
         $sat->deep_arg->xll = $xmam;
@@ -435,30 +435,30 @@  discard block
 block discarded – undo
435 435
 
436 436
         $xmam = $sat->deep_arg->xll;
437 437
         $xl = $xmam + $sat->deep_arg->omgadf + $sat->deep_arg->xnode;
438
-        $beta = sqrt(1.0 - $sat->deep_arg->em * $sat->deep_arg->em);
439
-        $sat->deep_arg->xn = Predict::xke / pow($a, 1.5);
438
+        $beta = sqrt(1.0 - $sat->deep_arg->em*$sat->deep_arg->em);
439
+        $sat->deep_arg->xn = Predict::xke/pow($a, 1.5);
440 440
 
441 441
         /* Long period periodics */
442
-        $axn = $sat->deep_arg->em * cos($sat->deep_arg->omgadf);
443
-        $temp = 1.0 / ($a * $beta * $beta);
444
-        $xll = $temp * $sat->sgps->xlcof * $axn;
445
-        $aynl = $temp * $sat->sgps->aycof;
442
+        $axn = $sat->deep_arg->em*cos($sat->deep_arg->omgadf);
443
+        $temp = 1.0/($a*$beta*$beta);
444
+        $xll = $temp*$sat->sgps->xlcof*$axn;
445
+        $aynl = $temp*$sat->sgps->aycof;
446 446
         $xlt = $xl + $xll;
447
-        $ayn = $sat->deep_arg->em * sin($sat->deep_arg->omgadf) + $aynl;
447
+        $ayn = $sat->deep_arg->em*sin($sat->deep_arg->omgadf) + $aynl;
448 448
 
449 449
         /* Solve Kepler's Equation */
450
-        $capu = Predict_Math::FMod2p ($xlt - $sat->deep_arg->xnode);
450
+        $capu = Predict_Math::FMod2p($xlt - $sat->deep_arg->xnode);
451 451
         $temp2 = $capu;
452 452
 
453 453
         $i = 0;
454 454
         do {
455 455
             $sinepw = sin($temp2);
456 456
             $cosepw = cos($temp2);
457
-            $temp3 = $axn * $sinepw;
458
-            $temp4 = $ayn * $cosepw;
459
-            $temp5 = $axn * $cosepw;
460
-            $temp6 = $ayn * $sinepw;
461
-            $epw = ($capu - $temp4 + $temp3 - $temp2) / (1.0 - $temp5 - $temp6) + $temp2;
457
+            $temp3 = $axn*$sinepw;
458
+            $temp4 = $ayn*$cosepw;
459
+            $temp5 = $axn*$cosepw;
460
+            $temp6 = $ayn*$sinepw;
461
+            $epw = ($capu - $temp4 + $temp3 - $temp2)/(1.0 - $temp5 - $temp6) + $temp2;
462 462
             if (abs($epw - $temp2) <= Predict::e6a) {
463 463
                 break;
464 464
             }
@@ -468,35 +468,35 @@  discard block
 block discarded – undo
468 468
         /* Short period preliminary quantities */
469 469
         $ecose = $temp5 + $temp6;
470 470
         $esine = $temp3 - $temp4;
471
-        $elsq = $axn * $axn + $ayn * $ayn;
471
+        $elsq = $axn*$axn + $ayn*$ayn;
472 472
         $temp = 1.0 - $elsq;
473
-        $pl = $a * $temp;
474
-        $r = $a * (1.0 - $ecose);
475
-        $temp1 = 1.0 / $r;
476
-        $rdot = Predict::xke * sqrt($a) * $esine * $temp1;
477
-        $rfdot = Predict::xke * sqrt($pl) * $temp1;
478
-        $temp2 = $a * $temp1;
473
+        $pl = $a*$temp;
474
+        $r = $a*(1.0 - $ecose);
475
+        $temp1 = 1.0/$r;
476
+        $rdot = Predict::xke*sqrt($a)*$esine*$temp1;
477
+        $rfdot = Predict::xke*sqrt($pl)*$temp1;
478
+        $temp2 = $a*$temp1;
479 479
         $betal = sqrt($temp);
480
-        $temp3 = 1.0 / (1.0 + $betal);
481
-        $cosu = $temp2 * ($cosepw - $axn + $ayn * $esine * $temp3);
482
-        $sinu = $temp2 * ($sinepw - $ayn - $axn * $esine * $temp3);
480
+        $temp3 = 1.0/(1.0 + $betal);
481
+        $cosu = $temp2*($cosepw - $axn + $ayn*$esine*$temp3);
482
+        $sinu = $temp2*($sinepw - $ayn - $axn*$esine*$temp3);
483 483
         $u = Predict_Math::AcTan($sinu, $cosu);
484
-        $sin2u = 2.0 * $sinu * $cosu;
485
-        $cos2u = 2.0 * $cosu * $cosu - 1.0;
486
-        $temp = 1.0 / $pl;
487
-        $temp1 = Predict::ck2 * $temp;
488
-        $temp2 = $temp1 * $temp;
484
+        $sin2u = 2.0*$sinu*$cosu;
485
+        $cos2u = 2.0*$cosu*$cosu - 1.0;
486
+        $temp = 1.0/$pl;
487
+        $temp1 = Predict::ck2*$temp;
488
+        $temp2 = $temp1*$temp;
489 489
 
490 490
         /* Update for short periodics */
491
-        $rk = $r * (1.0 - 1.5 * $temp2 * $betal * $sat->sgps->x3thm1) +
492
-             0.5 * $temp1 * $sat->sgps->x1mth2 * $cos2u;
493
-        $uk = $u - 0.25 * $temp2 * $sat->sgps->x7thm1 * $sin2u;
494
-        $xnodek = $sat->deep_arg->xnode + 1.5 * $temp2 * $sat->deep_arg->cosio * $sin2u;
495
-        $xinck = $sat->deep_arg->xinc + 1.5 * $temp2 *
496
-             $sat->deep_arg->cosio * $sat->deep_arg->sinio * $cos2u;
497
-        $rdotk = $rdot - $sat->deep_arg->xn * $temp1 * $sat->sgps->x1mth2 * $sin2u;
498
-        $rfdotk = $rfdot + $sat->deep_arg->xn * $temp1 *
499
-             ($sat->sgps->x1mth2 * $cos2u + 1.5 * $sat->sgps->x3thm1);
491
+        $rk = $r*(1.0 - 1.5*$temp2*$betal*$sat->sgps->x3thm1) +
492
+             0.5*$temp1*$sat->sgps->x1mth2*$cos2u;
493
+        $uk = $u - 0.25*$temp2*$sat->sgps->x7thm1*$sin2u;
494
+        $xnodek = $sat->deep_arg->xnode + 1.5*$temp2*$sat->deep_arg->cosio*$sin2u;
495
+        $xinck = $sat->deep_arg->xinc + 1.5*$temp2*
496
+             $sat->deep_arg->cosio*$sat->deep_arg->sinio*$cos2u;
497
+        $rdotk = $rdot - $sat->deep_arg->xn*$temp1*$sat->sgps->x1mth2*$sin2u;
498
+        $rfdotk = $rfdot + $sat->deep_arg->xn*$temp1*
499
+             ($sat->sgps->x1mth2*$cos2u + 1.5*$sat->sgps->x3thm1);
500 500
 
501 501
         /* Orientation vectors */
502 502
         $sinuk = sin($uk);
@@ -505,29 +505,29 @@  discard block
 block discarded – undo
505 505
         $cosik = cos($xinck);
506 506
         $sinnok = sin($xnodek);
507 507
         $cosnok = cos($xnodek);
508
-        $xmx = -$sinnok * $cosik;
509
-        $xmy = $cosnok * $cosik;
510
-        $ux = $xmx * $sinuk + $cosnok * $cosuk;
511
-        $uy = $xmy * $sinuk + $sinnok * $cosuk;
512
-        $uz = $sinik * $sinuk;
513
-        $vx = $xmx * $cosuk - $cosnok * $sinuk;
514
-        $vy = $xmy * $cosuk - $sinnok * $sinuk;
515
-        $vz = $sinik * $cosuk;
508
+        $xmx = -$sinnok*$cosik;
509
+        $xmy = $cosnok*$cosik;
510
+        $ux = $xmx*$sinuk + $cosnok*$cosuk;
511
+        $uy = $xmy*$sinuk + $sinnok*$cosuk;
512
+        $uz = $sinik*$sinuk;
513
+        $vx = $xmx*$cosuk - $cosnok*$sinuk;
514
+        $vy = $xmy*$cosuk - $sinnok*$sinuk;
515
+        $vz = $sinik*$cosuk;
516 516
 
517 517
         /* Position and velocity */
518
-        $sat->pos->x = $rk * $ux;
519
-        $sat->pos->y = $rk * $uy;
520
-        $sat->pos->z = $rk * $uz;
521
-        $sat->vel->x = $rdotk * $ux + $rfdotk * $vx;
522
-        $sat->vel->y = $rdotk * $uy + $rfdotk * $vy;
523
-        $sat->vel->z = $rdotk * $uz + $rfdotk * $vz;
518
+        $sat->pos->x = $rk*$ux;
519
+        $sat->pos->y = $rk*$uy;
520
+        $sat->pos->z = $rk*$uz;
521
+        $sat->vel->x = $rdotk*$ux + $rfdotk*$vx;
522
+        $sat->vel->y = $rdotk*$uy + $rfdotk*$vy;
523
+        $sat->vel->z = $rdotk*$uz + $rfdotk*$vz;
524 524
 
525 525
         /* Phase in rads */
526 526
         $sat->phase = $xlt - $sat->deep_arg->xnode - $sat->deep_arg->omgadf + Predict::twopi;
527 527
         if ($sat->phase < 0.0) {
528 528
             $sat->phase += Predict::twopi;
529 529
         }
530
-        $sat->phase = Predict_Math::FMod2p ($sat->phase);
530
+        $sat->phase = Predict_Math::FMod2p($sat->phase);
531 531
 
532 532
         $sat->tle->omegao1 = $sat->deep_arg->omgadf;
533 533
         $sat->tle->xincl1  = $sat->deep_arg->xinc;
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
             $sat->dps->thgr = Predict_Time::ThetaG($sat->tle->epoch, $sat->deep_arg);
546 546
             $eq = $sat->tle->eo;
547 547
             $sat->dps->xnq = $sat->deep_arg->xnodp;
548
-            $aqnv = 1.0 / $sat->deep_arg->aodp;
548
+            $aqnv = 1.0/$sat->deep_arg->aodp;
549 549
             $sat->dps->xqncl = $sat->tle->xincl;
550 550
             $xmao = $sat->tle->xmo;
551 551
             $xpidot = $sat->deep_arg->omgdot + $sat->deep_arg->xnodot;
@@ -555,26 +555,26 @@  discard block
 block discarded – undo
555 555
             $sat->dps->preep = 0;
556 556
 
557 557
             /* Initialize lunar solar terms */
558
-            $day = $sat->deep_arg->ds50 + 18261.5;  /* Days since 1900 Jan 0.5 */
558
+            $day = $sat->deep_arg->ds50 + 18261.5; /* Days since 1900 Jan 0.5 */
559 559
             if ($day != $sat->dps->preep) {
560 560
                 $sat->dps->preep = $day;
561
-                $xnodce = 4.5236020 - 9.2422029E-4 * $day;
561
+                $xnodce = 4.5236020 - 9.2422029E-4*$day;
562 562
                 $stem = sin($xnodce);
563 563
                 $ctem = cos($xnodce);
564
-                $sat->dps->zcosil = 0.91375164 - 0.03568096 * $ctem;
565
-                $sat->dps->zsinil = sqrt(1.0 - $sat->dps->zcosil * $sat->dps->zcosil);
566
-                $sat->dps->zsinhl = 0.089683511 * $stem / $sat->dps->zsinil;
567
-                $sat->dps->zcoshl = sqrt(1.0 - $sat->dps->zsinhl * $sat->dps->zsinhl);
568
-                $c = 4.7199672 + 0.22997150 * $day;
569
-                $gam = 5.8351514 + 0.0019443680 * $day;
564
+                $sat->dps->zcosil = 0.91375164 - 0.03568096*$ctem;
565
+                $sat->dps->zsinil = sqrt(1.0 - $sat->dps->zcosil*$sat->dps->zcosil);
566
+                $sat->dps->zsinhl = 0.089683511*$stem/$sat->dps->zsinil;
567
+                $sat->dps->zcoshl = sqrt(1.0 - $sat->dps->zsinhl*$sat->dps->zsinhl);
568
+                $c = 4.7199672 + 0.22997150*$day;
569
+                $gam = 5.8351514 + 0.0019443680*$day;
570 570
                 $sat->dps->zmol = Predict_Math::FMod2p($c - $gam);
571
-                $zx = 0.39785416 * $stem / $sat->dps->zsinil;
572
-                $zy = $sat->dps->zcoshl * $ctem + 0.91744867 * $sat->dps->zsinhl * $stem;
571
+                $zx = 0.39785416*$stem/$sat->dps->zsinil;
572
+                $zy = $sat->dps->zcoshl*$ctem + 0.91744867*$sat->dps->zsinhl*$stem;
573 573
                 $zx = Predict_Math::AcTan($zx, $zy);
574 574
                 $zx = $gam + $zx - $xnodce;
575 575
                 $sat->dps->zcosgl = cos($zx);
576 576
                 $sat->dps->zsingl = sin($zx);
577
-                $sat->dps->zmos = 6.2565837 + 0.017201977 * $day;
577
+                $sat->dps->zmos = 6.2565837 + 0.017201977*$day;
578 578
                 $sat->dps->zmos = Predict_Math::FMod2p($sat->dps->zmos);
579 579
             } /* End if(day != preep) */
580 580
 
@@ -590,74 +590,74 @@  discard block
 block discarded – undo
590 590
             $zn = Predict::zns;
591 591
             $ze = Predict::zes;
592 592
             $zmo = $sat->dps->zmos;
593
-            $xnoi = 1.0 / $sat->dps->xnq;
593
+            $xnoi = 1.0/$sat->dps->xnq;
594 594
 
595 595
             /* Loop breaks when Solar terms are done a second */
596 596
             /* time, after Lunar terms are initialized        */
597
-            for(;;) {
597
+            for (;;) {
598 598
                 /* Solar terms done again after Lunar terms are done */
599
-                $a1 = $zcosg * $zcosh + $zsing * $zcosi * $zsinh;
600
-                $a3 = -$zsing * $zcosh + $zcosg * $zcosi * $zsinh;
601
-                $a7 = -$zcosg * $zsinh + $zsing * $zcosi * $zcosh;
602
-                $a8 = $zsing * $zsini;
603
-                $a9 = $zsing * $zsinh + $zcosg * $zcosi * $zcosh;
604
-                $a10 = $zcosg * $zsini;
605
-                $a2 = $sat->deep_arg->cosio * $a7 + $sat->deep_arg->sinio * $a8;
606
-                $a4 = $sat->deep_arg->cosio * $a9 + $sat->deep_arg->sinio * $a10;
607
-                $a5 = -$sat->deep_arg->sinio * $a7 + $sat->deep_arg->cosio * $a8;
608
-                $a6 = -$sat->deep_arg->sinio * $a9 + $sat->deep_arg->cosio * $a10;
609
-                $x1 = $a1 * $sat->deep_arg->cosg + $a2 * $sat->deep_arg->sing;
610
-                $x2 = $a3 * $sat->deep_arg->cosg + $a4 * $sat->deep_arg->sing;
611
-                $x3 = -$a1 * $sat->deep_arg->sing + $a2 * $sat->deep_arg->cosg;
612
-                $x4 = -$a3 * $sat->deep_arg->sing + $a4 * $sat->deep_arg->cosg;
613
-                $x5 = $a5 * $sat->deep_arg->sing;
614
-                $x6 = $a6 * $sat->deep_arg->sing;
615
-                $x7 = $a5 * $sat->deep_arg->cosg;
616
-                $x8 = $a6 * $sat->deep_arg->cosg;
617
-                $z31 = 12 * $x1 * $x1 - 3 * $x3 * $x3;
618
-                $z32 = 24 * $x1 * $x2 - 6 * $x3 * $x4;
619
-                $z33 = 12 * $x2 * $x2 - 3 * $x4 * $x4;
620
-                $z1 = 3 * ($a1 * $a1 + $a2 * $a2) + $z31 * $sat->deep_arg->eosq;
621
-                $z2 = 6 * ($a1 * $a3 + $a2 * $a4) + $z32 * $sat->deep_arg->eosq;
622
-                $z3 = 3 * ($a3 * $a3 + $a4 * $a4) + $z33 * $sat->deep_arg->eosq;
623
-                $z11 = -6 * $a1 * $a5 + $sat->deep_arg->eosq * (-24 * $x1 * $x7 - 6 * $x3 * $x5);
624
-                $z12 = -6 * ($a1 * $a6 + $a3 * $a5) + $sat->deep_arg->eosq *
625
-                    (-24 * ($x2 * $x7 + $x1 * $x8) - 6 * ($x3 * $x6 + $x4 * $x5));
626
-                $z13 = -6 * $a3 * $a6 + $sat->deep_arg->eosq * (-24 * $x2 * $x8 - 6 * $x4 * $x6);
627
-                $z21 = 6 * $a2 * $a5 + $sat->deep_arg->eosq * (24 * $x1 * $x5 - 6 * $x3 * $x7);
628
-                $z22 = 6 * ($a4 * $a5 + $a2 * $a6) + $sat->deep_arg->eosq *
629
-                    (24 * ($x2 * $x5 + $x1 * $x6) - 6 * ($x4 * $x7 + $x3 * $x8));
630
-                $z23 = 6 * $a4 * $a6 + $sat->deep_arg->eosq * (24 * $x2 * $x6 - 6 * $x4 * $x8);
631
-                $z1 = $z1 + $z1 + $sat->deep_arg->betao2 * $z31;
632
-                $z2 = $z2 + $z2 + $sat->deep_arg->betao2 * $z32;
633
-                $z3 = $z3 + $z3 + $sat->deep_arg->betao2 * $z33;
634
-                $s3 = $cc * $xnoi;
635
-                $s2 = -0.5 * $s3 / $sat->deep_arg->betao;
636
-                $s4 = $s3 * $sat->deep_arg->betao;
637
-                $s1 = -15 * $eq * $s4;
638
-                $s5 = $x1 * $x3 + $x2 * $x4;
639
-                $s6 = $x2 * $x3 + $x1 * $x4;
640
-                $s7 = $x2 * $x4 - $x1 * $x3;
641
-                $se = $s1 * $zn * $s5;
642
-                $si = $s2 * $zn * ($z11 + $z13);
643
-                $sl = -$zn * $s3 * ($z1 + $z3 - 14 - 6 * $sat->deep_arg->eosq);
644
-                $sgh = $s4 * $zn * ($z31 + $z33 - 6);
645
-                $sh = -$zn * $s2 * ($z21 + $z23);
599
+                $a1 = $zcosg*$zcosh + $zsing*$zcosi*$zsinh;
600
+                $a3 = -$zsing*$zcosh + $zcosg*$zcosi*$zsinh;
601
+                $a7 = -$zcosg*$zsinh + $zsing*$zcosi*$zcosh;
602
+                $a8 = $zsing*$zsini;
603
+                $a9 = $zsing*$zsinh + $zcosg*$zcosi*$zcosh;
604
+                $a10 = $zcosg*$zsini;
605
+                $a2 = $sat->deep_arg->cosio*$a7 + $sat->deep_arg->sinio*$a8;
606
+                $a4 = $sat->deep_arg->cosio*$a9 + $sat->deep_arg->sinio*$a10;
607
+                $a5 = -$sat->deep_arg->sinio*$a7 + $sat->deep_arg->cosio*$a8;
608
+                $a6 = -$sat->deep_arg->sinio*$a9 + $sat->deep_arg->cosio*$a10;
609
+                $x1 = $a1*$sat->deep_arg->cosg + $a2*$sat->deep_arg->sing;
610
+                $x2 = $a3*$sat->deep_arg->cosg + $a4*$sat->deep_arg->sing;
611
+                $x3 = -$a1*$sat->deep_arg->sing + $a2*$sat->deep_arg->cosg;
612
+                $x4 = -$a3*$sat->deep_arg->sing + $a4*$sat->deep_arg->cosg;
613
+                $x5 = $a5*$sat->deep_arg->sing;
614
+                $x6 = $a6*$sat->deep_arg->sing;
615
+                $x7 = $a5*$sat->deep_arg->cosg;
616
+                $x8 = $a6*$sat->deep_arg->cosg;
617
+                $z31 = 12*$x1*$x1 - 3*$x3*$x3;
618
+                $z32 = 24*$x1*$x2 - 6*$x3*$x4;
619
+                $z33 = 12*$x2*$x2 - 3*$x4*$x4;
620
+                $z1 = 3*($a1*$a1 + $a2*$a2) + $z31*$sat->deep_arg->eosq;
621
+                $z2 = 6*($a1*$a3 + $a2*$a4) + $z32*$sat->deep_arg->eosq;
622
+                $z3 = 3*($a3*$a3 + $a4*$a4) + $z33*$sat->deep_arg->eosq;
623
+                $z11 = -6*$a1*$a5 + $sat->deep_arg->eosq*(-24*$x1*$x7 - 6*$x3*$x5);
624
+                $z12 = -6*($a1*$a6 + $a3*$a5) + $sat->deep_arg->eosq*
625
+                    (-24*($x2*$x7 + $x1*$x8) - 6*($x3*$x6 + $x4*$x5));
626
+                $z13 = -6*$a3*$a6 + $sat->deep_arg->eosq*(-24*$x2*$x8 - 6*$x4*$x6);
627
+                $z21 = 6*$a2*$a5 + $sat->deep_arg->eosq*(24*$x1*$x5 - 6*$x3*$x7);
628
+                $z22 = 6*($a4*$a5 + $a2*$a6) + $sat->deep_arg->eosq*
629
+                    (24*($x2*$x5 + $x1*$x6) - 6*($x4*$x7 + $x3*$x8));
630
+                $z23 = 6*$a4*$a6 + $sat->deep_arg->eosq*(24*$x2*$x6 - 6*$x4*$x8);
631
+                $z1 = $z1 + $z1 + $sat->deep_arg->betao2*$z31;
632
+                $z2 = $z2 + $z2 + $sat->deep_arg->betao2*$z32;
633
+                $z3 = $z3 + $z3 + $sat->deep_arg->betao2*$z33;
634
+                $s3 = $cc*$xnoi;
635
+                $s2 = -0.5*$s3/$sat->deep_arg->betao;
636
+                $s4 = $s3*$sat->deep_arg->betao;
637
+                $s1 = -15*$eq*$s4;
638
+                $s5 = $x1*$x3 + $x2*$x4;
639
+                $s6 = $x2*$x3 + $x1*$x4;
640
+                $s7 = $x2*$x4 - $x1*$x3;
641
+                $se = $s1*$zn*$s5;
642
+                $si = $s2*$zn*($z11 + $z13);
643
+                $sl = -$zn*$s3*($z1 + $z3 - 14 - 6*$sat->deep_arg->eosq);
644
+                $sgh = $s4*$zn*($z31 + $z33 - 6);
645
+                $sh = -$zn*$s2*($z21 + $z23);
646 646
                 if ($sat->dps->xqncl < 5.2359877E-2) {
647 647
                     $sh = 0;
648 648
                 }
649
-                $sat->dps->ee2 = 2 * $s1 * $s6;
650
-                $sat->dps->e3 = 2 * $s1 * $s7;
651
-                $sat->dps->xi2 = 2 * $s2 * $z12;
652
-                $sat->dps->xi3 = 2 * $s2 * ($z13 - $z11);
653
-                $sat->dps->xl2 = -2 * $s3 * $z2;
654
-                $sat->dps->xl3 = -2 * $s3 * ($z3 - $z1);
655
-                $sat->dps->xl4 = -2 * $s3 * (-21 - 9 * $sat->deep_arg->eosq) * $ze;
656
-                $sat->dps->xgh2 = 2 * $s4 * $z32;
657
-                $sat->dps->xgh3 = 2 * $s4 * ($z33 - $z31);
658
-                $sat->dps->xgh4 = -18 * $s4 * $ze;
659
-                $sat->dps->xh2 = -2 * $s2 * $z22;
660
-                $sat->dps->xh3 = -2 * $s2 * ($z23 - $z21);
649
+                $sat->dps->ee2 = 2*$s1*$s6;
650
+                $sat->dps->e3 = 2*$s1*$s7;
651
+                $sat->dps->xi2 = 2*$s2*$z12;
652
+                $sat->dps->xi3 = 2*$s2*($z13 - $z11);
653
+                $sat->dps->xl2 = -2*$s3*$z2;
654
+                $sat->dps->xl3 = -2*$s3*($z3 - $z1);
655
+                $sat->dps->xl4 = -2*$s3*(-21 - 9*$sat->deep_arg->eosq)*$ze;
656
+                $sat->dps->xgh2 = 2*$s4*$z32;
657
+                $sat->dps->xgh3 = 2*$s4*($z33 - $z31);
658
+                $sat->dps->xgh4 = -18*$s4*$ze;
659
+                $sat->dps->xh2 = -2*$s2*$z22;
660
+                $sat->dps->xh3 = -2*$s2*($z23 - $z21);
661 661
 
662 662
                 if ($sat->flags & self::LUNAR_TERMS_DONE_FLAG) {
663 663
                     break;
@@ -667,8 +667,8 @@  discard block
 block discarded – undo
667 667
                 $sat->dps->sse = $se;
668 668
                 $sat->dps->ssi = $si;
669 669
                 $sat->dps->ssl = $sl;
670
-                $sat->dps->ssh = $sh / $sat->deep_arg->sinio;
671
-                $sat->dps->ssg = $sgh - $sat->deep_arg->cosio * $sat->dps->ssh;
670
+                $sat->dps->ssh = $sh/$sat->deep_arg->sinio;
671
+                $sat->dps->ssg = $sgh - $sat->deep_arg->cosio*$sat->dps->ssh;
672 672
                 $sat->dps->se2 = $sat->dps->ee2;
673 673
                 $sat->dps->si2 = $sat->dps->xi2;
674 674
                 $sat->dps->sl2 = $sat->dps->xl2;
@@ -685,8 +685,8 @@  discard block
 block discarded – undo
685 685
                 $zsing = $sat->dps->zsingl;
686 686
                 $zcosi = $sat->dps->zcosil;
687 687
                 $zsini = $sat->dps->zsinil;
688
-                $zcosh = $sat->dps->zcoshl * $cosq + $sat->dps->zsinhl * $sinq;
689
-                $zsinh = $sinq * $sat->dps->zcoshl - $cosq * $sat->dps->zsinhl;
688
+                $zcosh = $sat->dps->zcoshl*$cosq + $sat->dps->zsinhl*$sinq;
689
+                $zsinh = $sinq*$sat->dps->zcoshl - $cosq*$sat->dps->zsinhl;
690 690
                 $zn = Predict::znl;
691 691
                 $cc = Predict::c1l;
692 692
                 $ze = Predict::zel;
@@ -697,113 +697,113 @@  discard block
 block discarded – undo
697 697
             $sat->dps->sse = $sat->dps->sse + $se;
698 698
             $sat->dps->ssi = $sat->dps->ssi + $si;
699 699
             $sat->dps->ssl = $sat->dps->ssl + $sl;
700
-            $sat->dps->ssg = $sat->dps->ssg + $sgh - $sat->deep_arg->cosio / $sat->deep_arg->sinio * $sh;
701
-            $sat->dps->ssh = $sat->dps->ssh + $sh / $sat->deep_arg->sinio;
700
+            $sat->dps->ssg = $sat->dps->ssg + $sgh - $sat->deep_arg->cosio/$sat->deep_arg->sinio*$sh;
701
+            $sat->dps->ssh = $sat->dps->ssh + $sh/$sat->deep_arg->sinio;
702 702
 
703 703
             /* Geopotential resonance initialization for 12 hour orbits */
704 704
             $sat->flags &= ~self::RESONANCE_FLAG;
705 705
             $sat->flags &= ~self::SYNCHRONOUS_FLAG;
706 706
 
707 707
             if (!(($sat->dps->xnq < 0.0052359877) && ($sat->dps->xnq > 0.0034906585))) {
708
-                if( ($sat->dps->xnq < 0.00826) || ($sat->dps->xnq > 0.00924) ) {
708
+                if (($sat->dps->xnq < 0.00826) || ($sat->dps->xnq > 0.00924)) {
709 709
                     return;
710 710
                 }
711 711
                 if ($eq < 0.5) {
712 712
                     return;
713 713
                 }
714 714
                 $sat->flags |= self::RESONANCE_FLAG;
715
-                $eoc = $eq * $sat->deep_arg->eosq;
716
-                $g201 = -0.306 - ($eq - 0.64) * 0.440;
715
+                $eoc = $eq*$sat->deep_arg->eosq;
716
+                $g201 = -0.306 - ($eq - 0.64)*0.440;
717 717
                 if ($eq <= 0.65) {
718
-                    $g211 = 3.616 - 13.247 * $eq + 16.290 * $sat->deep_arg->eosq;
719
-                    $g310 = -19.302 + 117.390 * $eq - 228.419 *
720
-                        $sat->deep_arg->eosq + 156.591 * $eoc;
721
-                    $g322 = -18.9068 + 109.7927 * $eq - 214.6334 *
722
-                        $sat->deep_arg->eosq + 146.5816 * $eoc;
723
-                    $g410 = -41.122 + 242.694 * $eq - 471.094 *
724
-                        $sat->deep_arg->eosq + 313.953 * $eoc;
725
-                    $g422 = -146.407 + 841.880 * $eq - 1629.014 *
726
-                        $sat->deep_arg->eosq + 1083.435 * $eoc;
727
-                    $g520 = -532.114 + 3017.977 * $eq - 5740 *
728
-                        $sat->deep_arg->eosq + 3708.276 * $eoc;
718
+                    $g211 = 3.616 - 13.247*$eq + 16.290*$sat->deep_arg->eosq;
719
+                    $g310 = -19.302 + 117.390*$eq - 228.419*
720
+                        $sat->deep_arg->eosq + 156.591*$eoc;
721
+                    $g322 = -18.9068 + 109.7927*$eq - 214.6334*
722
+                        $sat->deep_arg->eosq + 146.5816*$eoc;
723
+                    $g410 = -41.122 + 242.694*$eq - 471.094*
724
+                        $sat->deep_arg->eosq + 313.953*$eoc;
725
+                    $g422 = -146.407 + 841.880*$eq - 1629.014*
726
+                        $sat->deep_arg->eosq + 1083.435*$eoc;
727
+                    $g520 = -532.114 + 3017.977*$eq - 5740*
728
+                        $sat->deep_arg->eosq + 3708.276*$eoc;
729 729
                 } else {
730
-                    $g211 = -72.099 + 331.819 * $eq - 508.738 *
731
-                        $sat->deep_arg->eosq + 266.724 * $eoc;
732
-                    $g310 = -346.844 + 1582.851 * $eq - 2415.925 *
733
-                        $sat->deep_arg->eosq + 1246.113 * $eoc;
734
-                    $g322 = -342.585 + 1554.908 * $eq - 2366.899 *
735
-                        $sat->deep_arg->eosq + 1215.972 * $eoc;
736
-                    $g410 = -1052.797 + 4758.686 * $eq - 7193.992 *
737
-                        $sat->deep_arg->eosq + 3651.957 * $eoc;
738
-                    $g422 = -3581.69 + 16178.11 * $eq - 24462.77 *
739
-                        $sat->deep_arg->eosq+ 12422.52 * $eoc;
730
+                    $g211 = -72.099 + 331.819*$eq - 508.738*
731
+                        $sat->deep_arg->eosq + 266.724*$eoc;
732
+                    $g310 = -346.844 + 1582.851*$eq - 2415.925*
733
+                        $sat->deep_arg->eosq + 1246.113*$eoc;
734
+                    $g322 = -342.585 + 1554.908*$eq - 2366.899*
735
+                        $sat->deep_arg->eosq + 1215.972*$eoc;
736
+                    $g410 = -1052.797 + 4758.686*$eq - 7193.992*
737
+                        $sat->deep_arg->eosq + 3651.957*$eoc;
738
+                    $g422 = -3581.69 + 16178.11*$eq - 24462.77*
739
+                        $sat->deep_arg->eosq + 12422.52*$eoc;
740 740
                     if ($eq <= 0.715) {
741
-                        $g520 = 1464.74 - 4664.75 * $eq + 3763.64 * $sat->deep_arg->eosq;
741
+                        $g520 = 1464.74 - 4664.75*$eq + 3763.64*$sat->deep_arg->eosq;
742 742
                     } else {
743
-                        $g520 = -5149.66 + 29936.92 * $eq - 54087.36 *
744
-                            $sat->deep_arg->eosq + 31324.56 * $eoc;
743
+                        $g520 = -5149.66 + 29936.92*$eq - 54087.36*
744
+                            $sat->deep_arg->eosq + 31324.56*$eoc;
745 745
                     }
746 746
                 } /* End if (eq <= 0.65) */
747 747
 
748 748
                 if ($eq < 0.7) {
749
-                    $g533 = -919.2277 + 4988.61 * $eq - 9064.77 *
750
-                        $sat->deep_arg->eosq + 5542.21 * $eoc;
751
-                    $g521 = -822.71072 + 4568.6173 * $eq - 8491.4146 *
752
-                        $sat->deep_arg->eosq + 5337.524 * $eoc;
753
-                    $g532 = -853.666 + 4690.25 * $eq - 8624.77 *
754
-                        $sat->deep_arg->eosq + 5341.4 * $eoc;
749
+                    $g533 = -919.2277 + 4988.61*$eq - 9064.77*
750
+                        $sat->deep_arg->eosq + 5542.21*$eoc;
751
+                    $g521 = -822.71072 + 4568.6173*$eq - 8491.4146*
752
+                        $sat->deep_arg->eosq + 5337.524*$eoc;
753
+                    $g532 = -853.666 + 4690.25*$eq - 8624.77*
754
+                        $sat->deep_arg->eosq + 5341.4*$eoc;
755 755
                 }
756 756
                 else {
757
-                    $g533 = -37995.78 + 161616.52 * $eq - 229838.2*
758
-                        $sat->deep_arg->eosq + 109377.94 * $eoc;
759
-                    $g521 = -51752.104 + 218913.95 * $eq - 309468.16*
760
-                        $sat->deep_arg->eosq + 146349.42 * $eoc;
761
-                    $g532 = -40023.88 + 170470.89 * $eq - 242699.48*
762
-                        $sat->deep_arg->eosq + 115605.82 * $eoc;
757
+                    $g533 = -37995.78 + 161616.52*$eq - 229838.2*
758
+                        $sat->deep_arg->eosq + 109377.94*$eoc;
759
+                    $g521 = -51752.104 + 218913.95*$eq - 309468.16*
760
+                        $sat->deep_arg->eosq + 146349.42*$eoc;
761
+                    $g532 = -40023.88 + 170470.89*$eq - 242699.48*
762
+                        $sat->deep_arg->eosq + 115605.82*$eoc;
763 763
                 } /* End if (eq <= 0.7) */
764 764
 
765
-                $sini2 = $sat->deep_arg->sinio * $sat->deep_arg->sinio;
766
-                $f220 = 0.75 * (1 + 2 * $sat->deep_arg->cosio + $sat->deep_arg->theta2);
767
-                $f221 = 1.5 * $sini2;
768
-                $f321 = 1.875 * $sat->deep_arg->sinio * (1 - 2 *
769
-                                  $sat->deep_arg->cosio - 3 * $sat->deep_arg->theta2);
770
-                $f322 = -1.875 * $sat->deep_arg->sinio * (1 + 2*
771
-                                   $sat->deep_arg->cosio - 3 * $sat->deep_arg->theta2);
772
-                $f441 = 35 * $sini2 * $f220;
773
-                $f442 = 39.3750 * $sini2 * $sini2;
774
-                $f522 = 9.84375 * $sat->deep_arg->sinio * ($sini2 * (1 - 2 * $sat->deep_arg->cosio - 5 *
775
-                                       $sat->deep_arg->theta2) + 0.33333333 * (-2 + 4 * $sat->deep_arg->cosio +
776
-                                                     6 * $sat->deep_arg->theta2));
777
-                $f523 = $sat->deep_arg->sinio * (4.92187512 * $sini2 * (-2 - 4 *
778
-                                      $sat->deep_arg->cosio + 10 * $sat->deep_arg->theta2) + 6.56250012
779
-                            * (1 + 2 * $sat->deep_arg->cosio - 3 * $sat->deep_arg->theta2));
780
-                $f542 = 29.53125 * $sat->deep_arg->sinio * (2 - 8 *
781
-                                 $sat->deep_arg->cosio + $sat->deep_arg->theta2 *
782
-                                 (-12 + 8 * $sat->deep_arg->cosio + 10 * $sat->deep_arg->theta2));
783
-                $f543 = 29.53125 * $sat->deep_arg->sinio * (-2 - 8 * $sat->deep_arg->cosio +
784
-                                 $sat->deep_arg->theta2 * (12 + 8 * $sat->deep_arg->cosio - 10 *
765
+                $sini2 = $sat->deep_arg->sinio*$sat->deep_arg->sinio;
766
+                $f220 = 0.75*(1 + 2*$sat->deep_arg->cosio + $sat->deep_arg->theta2);
767
+                $f221 = 1.5*$sini2;
768
+                $f321 = 1.875*$sat->deep_arg->sinio*(1 - 2*
769
+                                  $sat->deep_arg->cosio - 3*$sat->deep_arg->theta2);
770
+                $f322 = -1.875*$sat->deep_arg->sinio*(1 + 2*
771
+                                   $sat->deep_arg->cosio - 3*$sat->deep_arg->theta2);
772
+                $f441 = 35*$sini2*$f220;
773
+                $f442 = 39.3750*$sini2*$sini2;
774
+                $f522 = 9.84375*$sat->deep_arg->sinio*($sini2*(1 - 2*$sat->deep_arg->cosio - 5*
775
+                                       $sat->deep_arg->theta2) + 0.33333333*(-2 + 4*$sat->deep_arg->cosio +
776
+                                                     6*$sat->deep_arg->theta2));
777
+                $f523 = $sat->deep_arg->sinio*(4.92187512*$sini2*(-2 - 4*
778
+                                      $sat->deep_arg->cosio + 10*$sat->deep_arg->theta2) + 6.56250012
779
+                            * (1 + 2*$sat->deep_arg->cosio - 3*$sat->deep_arg->theta2));
780
+                $f542 = 29.53125*$sat->deep_arg->sinio*(2 - 8*
781
+                                 $sat->deep_arg->cosio + $sat->deep_arg->theta2*
782
+                                 (-12 + 8*$sat->deep_arg->cosio + 10*$sat->deep_arg->theta2));
783
+                $f543 = 29.53125*$sat->deep_arg->sinio*(-2 - 8*$sat->deep_arg->cosio +
784
+                                 $sat->deep_arg->theta2*(12 + 8*$sat->deep_arg->cosio - 10*
785 785
                                            $sat->deep_arg->theta2));
786
-                $xno2 = $sat->dps->xnq * $sat->dps->xnq;
787
-                $ainv2 = $aqnv * $aqnv;
788
-                $temp1 = 3 * $xno2 * $ainv2;
789
-                $temp = $temp1 * Predict::root22;
790
-                $sat->dps->d2201 = $temp * $f220 * $g201;
791
-                $sat->dps->d2211 = $temp * $f221 * $g211;
792
-                $temp1 = $temp1 * $aqnv;
793
-                $temp = $temp1 * Predict::root32;
794
-                $sat->dps->d3210 = $temp * $f321 * $g310;
795
-                $sat->dps->d3222 = $temp * $f322 * $g322;
796
-                $temp1 = $temp1 * $aqnv;
797
-                $temp = 2 * $temp1 * Predict::root44;
798
-                $sat->dps->d4410 = $temp * $f441 * $g410;
799
-                $sat->dps->d4422 = $temp * $f442 * $g422;
800
-                $temp1 = $temp1 * $aqnv;
801
-                $temp = $temp1 * Predict::root52;
802
-                $sat->dps->d5220 = $temp * $f522 * $g520;
803
-                $sat->dps->d5232 = $temp * $f523 * $g532;
804
-                $temp = 2 * $temp1 * Predict::root54;
805
-                $sat->dps->d5421 = $temp * $f542 * $g521;
806
-                $sat->dps->d5433 = $temp * $f543 * $g533;
786
+                $xno2 = $sat->dps->xnq*$sat->dps->xnq;
787
+                $ainv2 = $aqnv*$aqnv;
788
+                $temp1 = 3*$xno2*$ainv2;
789
+                $temp = $temp1*Predict::root22;
790
+                $sat->dps->d2201 = $temp*$f220*$g201;
791
+                $sat->dps->d2211 = $temp*$f221*$g211;
792
+                $temp1 = $temp1*$aqnv;
793
+                $temp = $temp1*Predict::root32;
794
+                $sat->dps->d3210 = $temp*$f321*$g310;
795
+                $sat->dps->d3222 = $temp*$f322*$g322;
796
+                $temp1 = $temp1*$aqnv;
797
+                $temp = 2*$temp1*Predict::root44;
798
+                $sat->dps->d4410 = $temp*$f441*$g410;
799
+                $sat->dps->d4422 = $temp*$f442*$g422;
800
+                $temp1 = $temp1*$aqnv;
801
+                $temp = $temp1*Predict::root52;
802
+                $sat->dps->d5220 = $temp*$f522*$g520;
803
+                $sat->dps->d5232 = $temp*$f523*$g532;
804
+                $temp = 2*$temp1*Predict::root54;
805
+                $sat->dps->d5421 = $temp*$f542*$g521;
806
+                $sat->dps->d5433 = $temp*$f543*$g533;
807 807
                 $sat->dps->xlamo = $xmao + $sat->tle->xnodeo + $sat->tle->xnodeo - $sat->dps->thgr - $sat->dps->thgr;
808 808
                 $bfact = $sat->deep_arg->xmdot + $sat->deep_arg->xnodot +
809 809
                     $sat->deep_arg->xnodot - Predict::thdt - Predict::thdt;
@@ -812,18 +812,18 @@  discard block
 block discarded – undo
812 812
                 $sat->flags |= self::RESONANCE_FLAG;
813 813
                 $sat->flags |= self::SYNCHRONOUS_FLAG;
814 814
                 /* Synchronous resonance terms initialization */
815
-                $g200 = 1 + $sat->deep_arg->eosq * (-2.5 + 0.8125 * $sat->deep_arg->eosq);
816
-                $g310 = 1 + 2 * $sat->deep_arg->eosq;
817
-                $g300 = 1 + $sat->deep_arg->eosq * (-6 + 6.60937 * $sat->deep_arg->eosq);
818
-                $f220 = 0.75 * (1 + $sat->deep_arg->cosio) * (1 + $sat->deep_arg->cosio);
819
-                $f311 = 0.9375 * $sat->deep_arg->sinio * $sat->deep_arg->sinio *
820
-                    (1 + 3 * $sat->deep_arg->cosio) - 0.75 * (1 + $sat->deep_arg->cosio);
815
+                $g200 = 1 + $sat->deep_arg->eosq*(-2.5 + 0.8125*$sat->deep_arg->eosq);
816
+                $g310 = 1 + 2*$sat->deep_arg->eosq;
817
+                $g300 = 1 + $sat->deep_arg->eosq*(-6 + 6.60937*$sat->deep_arg->eosq);
818
+                $f220 = 0.75*(1 + $sat->deep_arg->cosio)*(1 + $sat->deep_arg->cosio);
819
+                $f311 = 0.9375*$sat->deep_arg->sinio*$sat->deep_arg->sinio*
820
+                    (1 + 3*$sat->deep_arg->cosio) - 0.75*(1 + $sat->deep_arg->cosio);
821 821
                 $f330 = 1 + $sat->deep_arg->cosio;
822
-                $f330 = 1.875 * $f330 * $f330 * $f330;
823
-                $sat->dps->del1 = 3 * $sat->dps->xnq * $sat->dps->xnq * $aqnv * $aqnv;
824
-                $sat->dps->del2 = 2 * $sat->dps->del1 * $f220 * $g200 * Predict::q22;
825
-                $sat->dps->del3 = 3 * $sat->dps->del1 * $f330 * $g300 * Predict::q33 * $aqnv;
826
-                $sat->dps->del1 = $sat->dps->del1 * $f311 * $g310 * Predict::q31 * $aqnv;
822
+                $f330 = 1.875*$f330*$f330*$f330;
823
+                $sat->dps->del1 = 3*$sat->dps->xnq*$sat->dps->xnq*$aqnv*$aqnv;
824
+                $sat->dps->del2 = 2*$sat->dps->del1*$f220*$g200*Predict::q22;
825
+                $sat->dps->del3 = 3*$sat->dps->del1*$f330*$g300*Predict::q33*$aqnv;
826
+                $sat->dps->del1 = $sat->dps->del1*$f311*$g310*Predict::q31*$aqnv;
827 827
                 $sat->dps->fasx2 = 0.13130908;
828 828
                 $sat->dps->fasx4 = 2.8843198;
829 829
                 $sat->dps->fasx6 = 0.37448087;
@@ -845,24 +845,24 @@  discard block
 block discarded – undo
845 845
             return;
846 846
 
847 847
         case self::dpsec: /* Entrance for deep space secular effects */
848
-            $sat->deep_arg->xll = $sat->deep_arg->xll + $sat->dps->ssl * $sat->deep_arg->t;
849
-            $sat->deep_arg->omgadf = $sat->deep_arg->omgadf + $sat->dps->ssg * $sat->deep_arg->t;
850
-            $sat->deep_arg->xnode = $sat->deep_arg->xnode + $sat->dps->ssh * $sat->deep_arg->t;
851
-            $sat->deep_arg->em = $sat->tle->eo + $sat->dps->sse * $sat->deep_arg->t;
852
-            $sat->deep_arg->xinc = $sat->tle->xincl + $sat->dps->ssi * $sat->deep_arg->t;
848
+            $sat->deep_arg->xll = $sat->deep_arg->xll + $sat->dps->ssl*$sat->deep_arg->t;
849
+            $sat->deep_arg->omgadf = $sat->deep_arg->omgadf + $sat->dps->ssg*$sat->deep_arg->t;
850
+            $sat->deep_arg->xnode = $sat->deep_arg->xnode + $sat->dps->ssh*$sat->deep_arg->t;
851
+            $sat->deep_arg->em = $sat->tle->eo + $sat->dps->sse*$sat->deep_arg->t;
852
+            $sat->deep_arg->xinc = $sat->tle->xincl + $sat->dps->ssi*$sat->deep_arg->t;
853 853
             if ($sat->deep_arg->xinc < 0) {
854 854
                 $sat->deep_arg->xinc = -$sat->deep_arg->xinc;
855 855
                 $sat->deep_arg->xnode = $sat->deep_arg->xnode + Predict::pi;
856 856
                 $sat->deep_arg->omgadf = $sat->deep_arg->omgadf - Predict::pi;
857 857
             }
858
-            if(~$sat->flags & self::RESONANCE_FLAG ) {
858
+            if (~$sat->flags & self::RESONANCE_FLAG) {
859 859
                 return;
860 860
             }
861 861
 
862 862
             do {
863
-                if ( ($sat->dps->atime == 0) ||
863
+                if (($sat->dps->atime == 0) ||
864 864
                     (($sat->deep_arg->t >= 0) && ($sat->dps->atime < 0)) ||
865
-                    (($sat->deep_arg->t < 0) && ($sat->dps->atime >= 0)) ) {
865
+                    (($sat->deep_arg->t < 0) && ($sat->dps->atime >= 0))) {
866 866
                     /* Epoch restart */
867 867
                     if ($sat->deep_arg->t >= 0) {
868 868
                         $delt = $sat->dps->stepp;
@@ -899,47 +899,47 @@  discard block
 block discarded – undo
899 899
                         } else {
900 900
                             $delt = $sat->dps->stepp;
901 901
                         }
902
-                        $sat->flags |= (self::DO_LOOP_FLAG | self::EPOCH_RESTART_FLAG);
902
+                        $sat->flags |= (self::DO_LOOP_FLAG|self::EPOCH_RESTART_FLAG);
903 903
                     }
904 904
 
905 905
                     /* Dot terms calculated */
906 906
                     if ($sat->flags & self::SYNCHRONOUS_FLAG) {
907
-                        $xndot = $sat->dps->del1 * sin($sat->dps->xli - $sat->dps->fasx2) + $sat->dps->del2 * sin(2 * ($sat->dps->xli - $sat->dps->fasx4))
908
-                            + $sat->dps->del3 * sin(3 * ($sat->dps->xli - $sat->dps->fasx6));
909
-                        $xnddt = $sat->dps->del1 * cos($sat->dps->xli - $sat->dps->fasx2) + 2 * $sat->dps->del2 * cos(2 * ($sat->dps->xli - $sat->dps->fasx4))
910
-                            + 3 * $sat->dps->del3 * cos(3 * ($sat->dps->xli - $sat->dps->fasx6));
907
+                        $xndot = $sat->dps->del1*sin($sat->dps->xli - $sat->dps->fasx2) + $sat->dps->del2*sin(2*($sat->dps->xli - $sat->dps->fasx4))
908
+                            + $sat->dps->del3*sin(3*($sat->dps->xli - $sat->dps->fasx6));
909
+                        $xnddt = $sat->dps->del1*cos($sat->dps->xli - $sat->dps->fasx2) + 2*$sat->dps->del2*cos(2*($sat->dps->xli - $sat->dps->fasx4))
910
+                            + 3*$sat->dps->del3*cos(3*($sat->dps->xli - $sat->dps->fasx6));
911 911
                     } else {
912
-                        $xomi = $sat->dps->omegaq + $sat->deep_arg->omgdot * $sat->dps->atime;
912
+                        $xomi = $sat->dps->omegaq + $sat->deep_arg->omgdot*$sat->dps->atime;
913 913
                         $x2omi = $xomi + $xomi;
914 914
                         $x2li = $sat->dps->xli + $sat->dps->xli;
915
-                        $xndot = $sat->dps->d2201 * sin($x2omi + $sat->dps->xli - Predict::g22)
916
-                            + $sat->dps->d2211 * sin($sat->dps->xli - Predict::g22)
917
-                            + $sat->dps->d3210 * sin($xomi + $sat->dps->xli - Predict::g32)
918
-                            + $sat->dps->d3222 * sin(-$xomi + $sat->dps->xli - Predict::g32)
919
-                            + $sat->dps->d4410 * sin($x2omi + $x2li- Predict::g44)
920
-                            + $sat->dps->d4422 * sin($x2li- Predict::g44)
921
-                            + $sat->dps->d5220 * sin($xomi + $sat->dps->xli- Predict::g52)
922
-                            + $sat->dps->d5232 * sin(-$xomi + $sat->dps->xli- Predict::g52)
923
-                            + $sat->dps->d5421 * sin($xomi + $x2li - Predict::g54)
924
-                            + $sat->dps->d5433 * sin(-$xomi + $x2li - Predict::g54);
925
-                        $xnddt = $sat->dps->d2201 * cos($x2omi + $sat->dps->xli- Predict::g22)
926
-                            + $sat->dps->d2211 * cos($sat->dps->xli - Predict::g22)
927
-                            + $sat->dps->d3210 * cos($xomi + $sat->dps->xli - Predict::g32)
928
-                            + $sat->dps->d3222 * cos(-$xomi + $sat->dps->xli - Predict::g32)
929
-                            + $sat->dps->d5220 * cos($xomi + $sat->dps->xli - Predict::g52)
930
-                            + $sat->dps->d5232 * cos(-$xomi + $sat->dps->xli - Predict::g52)
931
-                            + 2 * ($sat->dps->d4410 * cos($x2omi + $x2li - Predict::g44)
932
-                                + $sat->dps->d4422 * cos($x2li - Predict::g44)
933
-                                + $sat->dps->d5421 * cos($xomi + $x2li - Predict::g54)
934
-                                + $sat->dps->d5433 * cos(-$xomi + $x2li - Predict::g54));
915
+                        $xndot = $sat->dps->d2201*sin($x2omi + $sat->dps->xli - Predict::g22)
916
+                            + $sat->dps->d2211*sin($sat->dps->xli - Predict::g22)
917
+                            + $sat->dps->d3210*sin($xomi + $sat->dps->xli - Predict::g32)
918
+                            + $sat->dps->d3222*sin(-$xomi + $sat->dps->xli - Predict::g32)
919
+                            + $sat->dps->d4410*sin($x2omi + $x2li - Predict::g44)
920
+                            + $sat->dps->d4422*sin($x2li - Predict::g44)
921
+                            + $sat->dps->d5220*sin($xomi + $sat->dps->xli - Predict::g52)
922
+                            + $sat->dps->d5232*sin(-$xomi + $sat->dps->xli - Predict::g52)
923
+                            + $sat->dps->d5421*sin($xomi + $x2li - Predict::g54)
924
+                            + $sat->dps->d5433*sin(-$xomi + $x2li - Predict::g54);
925
+                        $xnddt = $sat->dps->d2201*cos($x2omi + $sat->dps->xli - Predict::g22)
926
+                            + $sat->dps->d2211*cos($sat->dps->xli - Predict::g22)
927
+                            + $sat->dps->d3210*cos($xomi + $sat->dps->xli - Predict::g32)
928
+                            + $sat->dps->d3222*cos(-$xomi + $sat->dps->xli - Predict::g32)
929
+                            + $sat->dps->d5220*cos($xomi + $sat->dps->xli - Predict::g52)
930
+                            + $sat->dps->d5232*cos(-$xomi + $sat->dps->xli - Predict::g52)
931
+                            + 2*($sat->dps->d4410*cos($x2omi + $x2li - Predict::g44)
932
+                                + $sat->dps->d4422*cos($x2li - Predict::g44)
933
+                                + $sat->dps->d5421*cos($xomi + $x2li - Predict::g54)
934
+                                + $sat->dps->d5433*cos(-$xomi + $x2li - Predict::g54));
935 935
                     } /* End of if (isFlagSet(SYNCHRONOUS_FLAG)) */
936 936
 
937 937
                     $xldot = $sat->dps->xni + $sat->dps->xfact;
938
-                    $xnddt = $xnddt * $xldot;
938
+                    $xnddt = $xnddt*$xldot;
939 939
 
940 940
                     if ($sat->flags & self::DO_LOOP_FLAG) {
941
-                        $sat->dps->xli = $sat->dps->xli + $xldot * $delt + $xndot * $sat->dps->step2;
942
-                        $sat->dps->xni = $sat->dps->xni + $xndot * $delt + $xnddt * $sat->dps->step2;
941
+                        $sat->dps->xli = $sat->dps->xli + $xldot*$delt + $xndot*$sat->dps->step2;
942
+                        $sat->dps->xni = $sat->dps->xni + $xndot*$delt + $xnddt*$sat->dps->step2;
943 943
                         $sat->dps->atime = $sat->dps->atime + $delt;
944 944
                     }
945 945
                 } while (($sat->flags & self::DO_LOOP_FLAG) &&
@@ -947,9 +947,9 @@  discard block
 block discarded – undo
947 947
             }
948 948
             while (($sat->flags & self::DO_LOOP_FLAG) && ($sat->flags & self::EPOCH_RESTART_FLAG));
949 949
 
950
-            $sat->deep_arg->xn = $sat->dps->xni + $xndot * $ft + $xnddt * $ft * $ft * 0.5;
951
-            $xl = $sat->dps->xli + $xldot * $ft + $xndot * $ft * $ft * 0.5;
952
-            $temp = -$sat->deep_arg->xnode + $sat->dps->thgr + $sat->deep_arg->t * Predict::thdt;
950
+            $sat->deep_arg->xn = $sat->dps->xni + $xndot*$ft + $xnddt*$ft*$ft*0.5;
951
+            $xl = $sat->dps->xli + $xldot*$ft + $xndot*$ft*$ft*0.5;
952
+            $temp = -$sat->deep_arg->xnode + $sat->dps->thgr + $sat->deep_arg->t*Predict::thdt;
953 953
 
954 954
             if (~$sat->flags & self::SYNCHRONOUS_FLAG) {
955 955
                 $sat->deep_arg->xll = $xl + $temp + $temp;
@@ -965,26 +965,26 @@  discard block
 block discarded – undo
965 965
             $cosis = cos($sat->deep_arg->xinc);
966 966
             if (abs($sat->dps->savtsn - $sat->deep_arg->t) >= 30) {
967 967
                 $sat->dps->savtsn = $sat->deep_arg->t;
968
-                $zm = $sat->dps->zmos + Predict::zns * $sat->deep_arg->t;
969
-                $zf = $zm + 2 * Predict::zes * sin($zm);
968
+                $zm = $sat->dps->zmos + Predict::zns*$sat->deep_arg->t;
969
+                $zf = $zm + 2*Predict::zes*sin($zm);
970 970
                 $sinzf = sin($zf);
971
-                $f2 = 0.5 * $sinzf * $sinzf - 0.25;
972
-                $f3 = -0.5 * $sinzf * cos($zf);
973
-                $ses = $sat->dps->se2 * $f2 + $sat->dps->se3 * $f3;
974
-                $sis = $sat->dps->si2 * $f2 + $sat->dps->si3 * $f3;
975
-                $sls = $sat->dps->sl2 * $f2 + $sat->dps->sl3 * $f3 + $sat->dps->sl4 * $sinzf;
976
-                $sat->dps->sghs = $sat->dps->sgh2 * $f2 + $sat->dps->sgh3 * $f3 + $sat->dps->sgh4 * $sinzf;
977
-                $sat->dps->shs = $sat->dps->sh2 * $f2 + $sat->dps->sh3 * $f3;
978
-                $zm = $sat->dps->zmol + Predict::znl * $sat->deep_arg->t;
979
-                $zf = $zm + 2 * Predict::zel * sin($zm);
971
+                $f2 = 0.5*$sinzf*$sinzf - 0.25;
972
+                $f3 = -0.5*$sinzf*cos($zf);
973
+                $ses = $sat->dps->se2*$f2 + $sat->dps->se3*$f3;
974
+                $sis = $sat->dps->si2*$f2 + $sat->dps->si3*$f3;
975
+                $sls = $sat->dps->sl2*$f2 + $sat->dps->sl3*$f3 + $sat->dps->sl4*$sinzf;
976
+                $sat->dps->sghs = $sat->dps->sgh2*$f2 + $sat->dps->sgh3*$f3 + $sat->dps->sgh4*$sinzf;
977
+                $sat->dps->shs = $sat->dps->sh2*$f2 + $sat->dps->sh3*$f3;
978
+                $zm = $sat->dps->zmol + Predict::znl*$sat->deep_arg->t;
979
+                $zf = $zm + 2*Predict::zel*sin($zm);
980 980
                 $sinzf = sin($zf);
981
-                $f2 = 0.5 * $sinzf * $sinzf - 0.25;
982
-                $f3 = -0.5 * $sinzf * cos($zf);
983
-                $sel = $sat->dps->ee2 * $f2 + $sat->dps->e3 * $f3;
984
-                $sil = $sat->dps->xi2 * $f2 + $sat->dps->xi3 * $f3;
985
-                $sll = $sat->dps->xl2 * $f2 + $sat->dps->xl3 * $f3 + $sat->dps->xl4 * $sinzf;
986
-                $sat->dps->sghl = $sat->dps->xgh2 * $f2 + $sat->dps->xgh3 * $f3 + $sat->dps->xgh4 * $sinzf;
987
-                $sat->dps->sh1 = $sat->dps->xh2 * $f2 + $sat->dps->xh3 * $f3;
981
+                $f2 = 0.5*$sinzf*$sinzf - 0.25;
982
+                $f3 = -0.5*$sinzf*cos($zf);
983
+                $sel = $sat->dps->ee2*$f2 + $sat->dps->e3*$f3;
984
+                $sil = $sat->dps->xi2*$f2 + $sat->dps->xi3*$f3;
985
+                $sll = $sat->dps->xl2*$f2 + $sat->dps->xl3*$f3 + $sat->dps->xl4*$sinzf;
986
+                $sat->dps->sghl = $sat->dps->xgh2*$f2 + $sat->dps->xgh3*$f3 + $sat->dps->xgh4*$sinzf;
987
+                $sat->dps->sh1 = $sat->dps->xh2*$f2 + $sat->dps->xh3*$f3;
988 988
                 $sat->dps->pe = $ses + $sel;
989 989
                 $sat->dps->pinc = $sis + $sil;
990 990
                 $sat->dps->pl = $sls + $sll;
@@ -997,8 +997,8 @@  discard block
 block discarded – undo
997 997
 
998 998
             if ($sat->dps->xqncl >= 0.2) {
999 999
                 /* Apply periodics directly */
1000
-                $ph = $ph / $sat->deep_arg->sinio;
1001
-                $pgh = $pgh - $sat->deep_arg->cosio * $ph;
1000
+                $ph = $ph/$sat->deep_arg->sinio;
1001
+                $pgh = $pgh - $sat->deep_arg->cosio*$ph;
1002 1002
                 $sat->deep_arg->omgadf = $sat->deep_arg->omgadf + $pgh;
1003 1003
                 $sat->deep_arg->xnode = $sat->deep_arg->xnode + $ph;
1004 1004
                 $sat->deep_arg->xll = $sat->deep_arg->xll + $sat->dps->pl;
@@ -1006,22 +1006,22 @@  discard block
 block discarded – undo
1006 1006
                 /* Apply periodics with Lyddane modification */
1007 1007
                 $sinok = sin($sat->deep_arg->xnode);
1008 1008
                 $cosok = cos($sat->deep_arg->xnode);
1009
-                $alfdp = $sinis * $sinok;
1010
-                $betdp = $sinis * $cosok;
1011
-                $dalf = $ph * $cosok + $sat->dps->pinc * $cosis * $sinok;
1012
-                $dbet = -$ph * $sinok + $sat->dps->pinc * $cosis * $cosok;
1009
+                $alfdp = $sinis*$sinok;
1010
+                $betdp = $sinis*$cosok;
1011
+                $dalf = $ph*$cosok + $sat->dps->pinc*$cosis*$sinok;
1012
+                $dbet = -$ph*$sinok + $sat->dps->pinc*$cosis*$cosok;
1013 1013
                 $alfdp = $alfdp + $dalf;
1014 1014
                 $betdp = $betdp + $dbet;
1015 1015
                 $sat->deep_arg->xnode = Predict_Math::FMod2p($sat->deep_arg->xnode);
1016
-                $xls = $sat->deep_arg->xll + $sat->deep_arg->omgadf + $cosis * $sat->deep_arg->xnode;
1017
-                $dls = $sat->dps->pl + $pgh - $sat->dps->pinc * $sat->deep_arg->xnode * $sinis;
1016
+                $xls = $sat->deep_arg->xll + $sat->deep_arg->omgadf + $cosis*$sat->deep_arg->xnode;
1017
+                $dls = $sat->dps->pl + $pgh - $sat->dps->pinc*$sat->deep_arg->xnode*$sinis;
1018 1018
                 $xls = $xls + $dls;
1019 1019
                 $xnoh = $sat->deep_arg->xnode;
1020 1020
                 $sat->deep_arg->xnode = Predict_Math::AcTan($alfdp, $betdp);
1021 1021
 
1022 1022
                 /* This is a patch to Lyddane modification */
1023 1023
                 /* suggested by Rob Matson. */
1024
-                if(abs($xnoh - $sat->deep_arg->xnode) > Predict::pi) {
1024
+                if (abs($xnoh - $sat->deep_arg->xnode) > Predict::pi) {
1025 1025
                     if ($sat->deep_arg->xnode < $xnoh) {
1026 1026
                         $sat->deep_arg->xnode += Predict::twopi;
1027 1027
                     } else {
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
                 }
1031 1031
 
1032 1032
                 $sat->deep_arg->xll = $sat->deep_arg->xll + $sat->dps->pl;
1033
-                $sat->deep_arg->omgadf = $xls - $sat->deep_arg->xll - cos($sat->deep_arg->xinc) *
1033
+                $sat->deep_arg->omgadf = $xls - $sat->deep_arg->xll - cos($sat->deep_arg->xinc)*
1034 1034
                     $sat->deep_arg->xnode;
1035 1035
             } /* End case dpper: */
1036 1036
             return;
Please login to merge, or discard this patch.
require/libs/Predict/Predict/Sat.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -29,42 +29,42 @@  discard block
 block discarded – undo
29 29
     public $nickname = null;
30 30
     public $website  = null;
31 31
 
32
-    public $tle      = null;   /*!< Keplerian elements */
33
-    public $flags    = 0;      /*!< Flags for algo ctrl */
32
+    public $tle      = null; /*!< Keplerian elements */
33
+    public $flags    = 0; /*!< Flags for algo ctrl */
34 34
     public $sgps     = null;
35 35
     public $dps      = null;
36 36
     public $deep_arg = null;
37
-    public $pos      = null;   /*!< Raw position and range */
38
-    public $vel      = null;   /*!< Raw velocity */
37
+    public $pos      = null; /*!< Raw position and range */
38
+    public $vel      = null; /*!< Raw velocity */
39 39
 
40 40
     /*** FIXME: REMOVE */
41
-    public $bearing = null;   /*!< Az, El, range and vel */
42
-    public $astro   = null;   /*!< Ra and Decl */
41
+    public $bearing = null; /*!< Az, El, range and vel */
42
+    public $astro   = null; /*!< Ra and Decl */
43 43
     /*** END */
44 44
 
45 45
     /* time keeping fields */
46 46
     public $jul_epoch = null;
47 47
     public $jul_utc   = null;
48 48
     public $tsince    = null;
49
-    public $aos       = null;    /*!< Next AOS. */
50
-    public $los       = null;    /*!< Next LOS */
51
-
52
-    public $az         = null;   /*!< Azimuth [deg] */
53
-    public $el         = null;   /*!< Elevation [deg] */
54
-    public $range      = null;   /*!< Range [km] */
55
-    public $range_rate = null;   /*!< Range Rate [km/sec] */
56
-    public $ra         = null;   /*!< Right Ascension [deg] */
57
-    public $dec        = null;   /*!< Declination [deg] */
58
-    public $ssplat     = null;   /*!< SSP latitude [deg] */
59
-    public $ssplon     = null;   /*!< SSP longitude [deg] */
60
-    public $alt        = null;   /*!< altitude [km] */
61
-    public $velo       = null;   /*!< velocity [km/s] */
62
-    public $ma         = null;   /*!< mean anomaly */
63
-    public $footprint  = null;   /*!< footprint */
64
-    public $phase      = null;   /*!< orbit phase */
65
-    public $meanmo     = null;   /*!< mean motion kept in rev/day */
66
-    public $orbit      = null;   /*!< orbit number */
67
-    public $otype      = null;   /*!< orbit type. */
49
+    public $aos       = null; /*!< Next AOS. */
50
+    public $los       = null; /*!< Next LOS */
51
+
52
+    public $az         = null; /*!< Azimuth [deg] */
53
+    public $el         = null; /*!< Elevation [deg] */
54
+    public $range      = null; /*!< Range [km] */
55
+    public $range_rate = null; /*!< Range Rate [km/sec] */
56
+    public $ra         = null; /*!< Right Ascension [deg] */
57
+    public $dec        = null; /*!< Declination [deg] */
58
+    public $ssplat     = null; /*!< SSP latitude [deg] */
59
+    public $ssplon     = null; /*!< SSP longitude [deg] */
60
+    public $alt        = null; /*!< altitude [km] */
61
+    public $velo       = null; /*!< velocity [km/s] */
62
+    public $ma         = null; /*!< mean anomaly */
63
+    public $footprint  = null; /*!< footprint */
64
+    public $phase      = null; /*!< orbit phase */
65
+    public $meanmo     = null; /*!< mean motion kept in rev/day */
66
+    public $orbit      = null; /*!< orbit number */
67
+    public $otype      = null; /*!< orbit type. */
68 68
 
69 69
     public function __construct(Predict_TLE $tle)
70 70
     {
@@ -93,30 +93,30 @@  discard block
 block discarded – undo
93 93
         $this->tle->omegao *= Predict::de2ra;
94 94
         $this->tle->xmo    *= Predict::de2ra;
95 95
         $this->tle->xincl  *= Predict::de2ra;
96
-        $temp = Predict::twopi / Predict::xmnpda / Predict::xmnpda;
96
+        $temp = Predict::twopi/Predict::xmnpda/Predict::xmnpda;
97 97
 
98 98
         /* store mean motion before conversion */
99 99
         $this->meanmo       = $this->tle->xno;
100
-        $this->tle->xno     = $this->tle->xno * $temp * Predict::xmnpda;
100
+        $this->tle->xno     = $this->tle->xno*$temp*Predict::xmnpda;
101 101
         $this->tle->xndt2o *= $temp;
102
-        $this->tle->xndd6o  = $this->tle->xndd6o * $temp / Predict::xmnpda;
102
+        $this->tle->xndd6o  = $this->tle->xndd6o*$temp/Predict::xmnpda;
103 103
         $this->tle->bstar  /= Predict::ae;
104 104
 
105 105
         /* Period > 225 minutes is deep space */
106
-        $dd1 = Predict::xke / $this->tle->xno;
106
+        $dd1 = Predict::xke/$this->tle->xno;
107 107
         $dd2 = Predict::tothrd;
108 108
         $a1 = pow($dd1, $dd2);
109 109
         $r1 = cos($this->tle->xincl);
110
-        $dd1 = 1.0 - $this->tle->eo * $this->tle->eo;
111
-        $temp = Predict::ck2 * 1.5 * ($r1 * $r1 * 3.0 - 1.0) / pow($dd1, 1.5);
112
-        $del1 = $temp / ($a1 * $a1);
113
-        $ao = $a1 * (1.0 - $del1 * (Predict::tothrd * 0.5 + $del1 *
114
-                                 ($del1 * 1.654320987654321 + 1.0)));
115
-        $delo = $temp / ($ao * $ao);
116
-        $xnodp = $this->tle->xno / ($delo + 1.0);
110
+        $dd1 = 1.0 - $this->tle->eo*$this->tle->eo;
111
+        $temp = Predict::ck2*1.5*($r1*$r1*3.0 - 1.0)/pow($dd1, 1.5);
112
+        $del1 = $temp/($a1*$a1);
113
+        $ao = $a1*(1.0 - $del1*(Predict::tothrd*0.5 + $del1*
114
+                                 ($del1*1.654320987654321 + 1.0)));
115
+        $delo = $temp/($ao*$ao);
116
+        $xnodp = $this->tle->xno/($delo + 1.0);
117 117
 
118 118
         /* Select a deep-space/near-earth ephemeris */
119
-        if (Predict::twopi / $xnodp / Predict::xmnpda >= .15625) {
119
+        if (Predict::twopi/$xnodp/Predict::xmnpda >= .15625) {
120 120
             $this->flags |= Predict_SGPSDP::DEEP_SPACE_EPHEM_FLAG;
121 121
         } else {
122 122
             $this->flags &= ~Predict_SGPSDP::DEEP_SPACE_EPHEM_FLAG;
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
 
143 143
         /* initialise observer location */
144 144
         if ($qth != null) {
145
-            $obs_geodetic->lon = $qth->lon * Predict::de2ra;
146
-            $obs_geodetic->lat = $qth->lat * Predict::de2ra;
147
-            $obs_geodetic->alt = $qth->alt / 1000.0;
145
+            $obs_geodetic->lon = $qth->lon*Predict::de2ra;
146
+            $obs_geodetic->lat = $qth->lat*Predict::de2ra;
147
+            $obs_geodetic->alt = $qth->alt/1000.0;
148 148
             $obs_geodetic->theta = 0;
149 149
         }
150 150
         else {
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         Predict_Math::Convert_Sat_State($sat->pos, $sat->vel);
167 167
 
168 168
         /* get the velocity of the satellite */
169
-        $sat->vel->w = sqrt($sat->vel->x * $sat->vel->x + $sat->vel->y * $sat->vel->y + $sat->vel->z * $sat->vel->z);
169
+        $sat->vel->w = sqrt($sat->vel->x*$sat->vel->x + $sat->vel->y*$sat->vel->y + $sat->vel->z*$sat->vel->z);
170 170
         $sat->velo = $sat->vel->w;
171 171
         Predict_SGPObs::Calculate_Obs($jul_utc, $sat->pos, $sat->vel, $obs_geodetic, $obs_set);
172 172
         Predict_SGPObs::Calculate_LatLonAlt($jul_utc, $sat->pos, $sat_geodetic);
@@ -187,12 +187,12 @@  discard block
 block discarded – undo
187 187
         $sat->ssplon = Predict_Math::Degrees($sat_geodetic->lon);
188 188
         $sat->alt = $sat_geodetic->alt;
189 189
         $sat->ma = Predict_Math::Degrees($sat->phase);
190
-        $sat->ma *= 256.0 / 360.0;
191
-        $sat->footprint = 2.0 * Predict::xkmper * acos (Predict::xkmper/$sat->pos->w);
190
+        $sat->ma *= 256.0/360.0;
191
+        $sat->footprint = 2.0*Predict::xkmper*acos(Predict::xkmper/$sat->pos->w);
192 192
         $age = 0.0;
193
-        $sat->orbit = floor(($sat->tle->xno * Predict::xmnpda / Predict::twopi +
194
-                                   $age * $sat->tle->bstar * Predict::ae) * $age +
195
-                                  $sat->tle->xmo / Predict::twopi) + $sat->tle->revnum - 1;
193
+        $sat->orbit = floor(($sat->tle->xno*Predict::xmnpda/Predict::twopi +
194
+                                   $age*$sat->tle->bstar*Predict::ae)*$age +
195
+                                  $sat->tle->xmo/Predict::twopi) + $sat->tle->revnum - 1;
196 196
 
197 197
         /* orbit type */
198 198
         $sat->otype = $sat->get_orbit_type($sat);
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
              It is time dependent. Also sat->jul_utc is often zero
257 257
              when this function is called
258 258
         ***/
259
-        if ((10.0 * abs($sat->tle->xndt2o / (Predict::twopi / Predict::xmnpda / Predict::xmnpda))) == 0) {
259
+        if ((10.0*abs($sat->tle->xndt2o/(Predict::twopi/Predict::xmnpda/Predict::xmnpda))) == 0) {
260 260
     		return true;
261
-    	} elseif ($sat->jul_epoch + ((16.666666 - $sat->meanmo) /
262
-                               (10.0 * abs($sat->tle->xndt2o / (Predict::twopi / Predict::xmnpda / Predict::xmnpda)))) < $sat->jul_utc) {
261
+    	} elseif ($sat->jul_epoch + ((16.666666 - $sat->meanmo)/
262
+                               (10.0*abs($sat->tle->xndt2o/(Predict::twopi/Predict::xmnpda/Predict::xmnpda)))) < $sat->jul_utc) {
263 263
               return true;
264 264
         } else {
265 265
               return false;
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
         $observerGeo      = new Predict_Geodetic();
299 299
         $observerGeo->lat = Predict_Math::Radians($qth->lat);
300 300
         $observerGeo->lon = Predict_Math::Radians($qth->lon);
301
-        $observerGeo->alt = $qth->alt * 1000;
301
+        $observerGeo->alt = $qth->alt*1000;
302 302
 
303 303
         // Now determine the sun and observer positions
304 304
         $observerPos      = new Predict_Vector();
@@ -311,12 +311,12 @@  discard block
 block discarded – undo
311 311
         $observerSatPos = new Predict_Vector();
312 312
         Predict_Math::Vec_Sub($this->pos, $observerPos, $observerSatPos);
313 313
         $phaseAngle = Predict_Math::Degrees(Predict_Math::Angle($solarVector, $observerSatPos));
314
-        $illum      = $phaseAngle / 180;
314
+        $illum      = $phaseAngle/180;
315 315
 
316
-        $illuminationChange            = $illum / $imag['illum'];
317
-        $inverseSquareOfDistanceChange = pow(($imag['distance'] / $this->range), 2);
316
+        $illuminationChange            = $illum/$imag['illum'];
317
+        $inverseSquareOfDistanceChange = pow(($imag['distance']/$this->range), 2);
318 318
         $changeInMagnitude             = log(
319
-            $illuminationChange * $inverseSquareOfDistanceChange,
319
+            $illuminationChange*$inverseSquareOfDistanceChange,
320 320
             self::POGSONS_RATIO
321 321
         );
322 322
 
Please login to merge, or discard this patch.
require/libs/Predict/Predict.php 1 patch
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -52,60 +52,60 @@  discard block
 block discarded – undo
52 52
  */
53 53
 class Predict
54 54
 {
55
-    const de2ra    =  1.74532925E-2;   /* Degrees to Radians */
56
-    const pi       =  3.1415926535898; /* Pi */
57
-    const pio2     =  1.5707963267949; /* Pi/2 */
58
-    const x3pio2   =  4.71238898;      /* 3*Pi/2 */
59
-    const twopi    =  6.2831853071796; /* 2*Pi  */
60
-    const e6a      =  1.0E-6;
61
-    const tothrd   =  6.6666667E-1;    /* 2/3 */
62
-    const xj2      =  1.0826158E-3;    /* J2 Harmonic */
63
-    const xj3      = -2.53881E-6;      /* J3 Harmonic */
64
-    const xj4      = -1.65597E-6;      /* J4 Harmonic */
65
-    const xke      =  7.43669161E-2;
66
-    const xkmper   =  6.378135E3;      /* Earth radius km */
67
-    const xmnpda   =  1.44E3;          /* Minutes per day */
68
-    const km2mi    =  0.621371;        /* Kilometers per Mile */
69
-    const ae       =  1.0;
70
-    const ck2      =  5.413079E-4;
71
-    const ck4      =  6.209887E-7;
72
-    const __f      =  3.352779E-3;
73
-    const ge       =  3.986008E5;
74
-    const __s__    =  1.012229;
75
-    const qoms2t   =  1.880279E-09;
76
-    const secday   =  8.6400E4;        /* Seconds per day */
77
-    const omega_E  =  1.0027379;
78
-    const omega_ER =  6.3003879;
79
-    const zns      =  1.19459E-5;
80
-    const c1ss     =  2.9864797E-6;
81
-    const zes      =  1.675E-2;
82
-    const znl      =  1.5835218E-4;
83
-    const c1l      =  4.7968065E-7;
84
-    const zel      =  5.490E-2;
85
-    const zcosis   =  9.1744867E-1;
86
-    const zsinis   =  3.9785416E-1;
55
+    const de2ra    = 1.74532925E-2; /* Degrees to Radians */
56
+    const pi       = 3.1415926535898; /* Pi */
57
+    const pio2     = 1.5707963267949; /* Pi/2 */
58
+    const x3pio2   = 4.71238898; /* 3*Pi/2 */
59
+    const twopi    = 6.2831853071796; /* 2*Pi  */
60
+    const e6a      = 1.0E-6;
61
+    const tothrd   = 6.6666667E-1; /* 2/3 */
62
+    const xj2      = 1.0826158E-3; /* J2 Harmonic */
63
+    const xj3      = -2.53881E-6; /* J3 Harmonic */
64
+    const xj4      = -1.65597E-6; /* J4 Harmonic */
65
+    const xke      = 7.43669161E-2;
66
+    const xkmper   = 6.378135E3; /* Earth radius km */
67
+    const xmnpda   = 1.44E3; /* Minutes per day */
68
+    const km2mi    = 0.621371; /* Kilometers per Mile */
69
+    const ae       = 1.0;
70
+    const ck2      = 5.413079E-4;
71
+    const ck4      = 6.209887E-7;
72
+    const __f      = 3.352779E-3;
73
+    const ge       = 3.986008E5;
74
+    const __s__    = 1.012229;
75
+    const qoms2t   = 1.880279E-09;
76
+    const secday   = 8.6400E4; /* Seconds per day */
77
+    const omega_E  = 1.0027379;
78
+    const omega_ER = 6.3003879;
79
+    const zns      = 1.19459E-5;
80
+    const c1ss     = 2.9864797E-6;
81
+    const zes      = 1.675E-2;
82
+    const znl      = 1.5835218E-4;
83
+    const c1l      = 4.7968065E-7;
84
+    const zel      = 5.490E-2;
85
+    const zcosis   = 9.1744867E-1;
86
+    const zsinis   = 3.9785416E-1;
87 87
     const zsings   = -9.8088458E-1;
88
-    const zcosgs   =  1.945905E-1;
89
-    const zcoshs   =  1;
90
-    const zsinhs   =  0;
91
-    const q22      =  1.7891679E-6;
92
-    const q31      =  2.1460748E-6;
93
-    const q33      =  2.2123015E-7;
94
-    const g22      =  5.7686396;
95
-    const g32      =  9.5240898E-1;
96
-    const g44      =  1.8014998;
97
-    const g52      =  1.0508330;
98
-    const g54      =  4.4108898;
99
-    const root22   =  1.7891679E-6;
100
-    const root32   =  3.7393792E-7;
101
-    const root44   =  7.3636953E-9;
102
-    const root52   =  1.1428639E-7;
103
-    const root54   =  2.1765803E-9;
104
-    const thdt     =  4.3752691E-3;
105
-    const rho      =  1.5696615E-1;
106
-    const mfactor  =  7.292115E-5;
107
-    const __sr__   =  6.96000E5;      /*Solar radius - kilometers (IAU 76)*/
108
-    const AU       =  1.49597870E8;   /*Astronomical unit - kilometers (IAU 76)*/
88
+    const zcosgs   = 1.945905E-1;
89
+    const zcoshs   = 1;
90
+    const zsinhs   = 0;
91
+    const q22      = 1.7891679E-6;
92
+    const q31      = 2.1460748E-6;
93
+    const q33      = 2.2123015E-7;
94
+    const g22      = 5.7686396;
95
+    const g32      = 9.5240898E-1;
96
+    const g44      = 1.8014998;
97
+    const g52      = 1.0508330;
98
+    const g54      = 4.4108898;
99
+    const root22   = 1.7891679E-6;
100
+    const root32   = 3.7393792E-7;
101
+    const root44   = 7.3636953E-9;
102
+    const root52   = 1.1428639E-7;
103
+    const root54   = 2.1765803E-9;
104
+    const thdt     = 4.3752691E-3;
105
+    const rho      = 1.5696615E-1;
106
+    const mfactor  = 7.292115E-5;
107
+    const __sr__   = 6.96000E5; /*Solar radius - kilometers (IAU 76)*/
108
+    const AU       = 1.49597870E8; /*Astronomical unit - kilometers (IAU 76)*/
109 109
 
110 110
     /* visibility constants */
111 111
     const SAT_VIS_NONE     = 0;
@@ -163,18 +163,18 @@  discard block
 block discarded – undo
163 163
      */
164 164
     public function get_pass(Predict_Sat $sat_in, Predict_QTH $qth, $start, $maxdt)
165 165
     {
166
-        $aos = 0.0;    /* time of AOS */
167
-        $tca = 0.0;    /* time of TCA */
168
-        $los = 0.0;    /* time of LOS */
169
-        $dt = 0.0;     /* time diff */
170
-        $step = 0.0;   /* time step */
166
+        $aos = 0.0; /* time of AOS */
167
+        $tca = 0.0; /* time of TCA */
168
+        $los = 0.0; /* time of LOS */
169
+        $dt = 0.0; /* time diff */
170
+        $step = 0.0; /* time step */
171 171
         $t0 = $start;
172
-        $tres = 0.0;   /* required time resolution */
172
+        $tres = 0.0; /* required time resolution */
173 173
         $max_el = 0.0; /* maximum elevation */
174 174
         $pass = null;
175 175
         $detail = null;
176 176
         $done = false;
177
-        $iter = 0;      /* number of iterations */
177
+        $iter = 0; /* number of iterations */
178 178
         /* FIXME: watchdog */
179 179
 
180 180
         /*copy sat_in to a working structure*/
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         $sat_working = clone $sat_in;
183 183
 
184 184
         /* get time resolution; sat-cfg stores it in seconds */
185
-        $tres = $this->timeRes / 86400.0;
185
+        $tres = $this->timeRes/86400.0;
186 186
 
187 187
         /* loop until we find a pass with elevation > SAT_CFG_INT_PRED_MIN_EL
188 188
             or we run out of time
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             /* aos = 0.0 means no aos */
208 208
             if ($aos == 0.0) {
209 209
                 $done = true;
210
-            } else if (($maxdt > 0.0) && ($aos > ($start + $maxdt)) ) {
210
+            } else if (($maxdt > 0.0) && ($aos > ($start + $maxdt))) {
211 211
                 /* check whether we are within time limits;
212 212
                     maxdt = 0 mean no time limit.
213 213
                 */
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
                 $dt = $los - $aos;
218 218
 
219 219
                 /* get time step, which will give us the max number of entries */
220
-                $step = $dt / $this->numEntries;
220
+                $step = $dt/$this->numEntries;
221 221
 
222 222
                 /* but if this is smaller than the required resolution
223 223
                     we go with the resolution
@@ -369,9 +369,9 @@  discard block
 block discarded – undo
369 369
         $solar_set = new Predict_ObsSet();
370 370
 
371 371
         /* FIXME: could be passed as parameter */
372
-        $obs_geodetic->lon   = $qth->lon * self::de2ra;
373
-        $obs_geodetic->lat   = $qth->lat * self::de2ra;
374
-        $obs_geodetic->alt   = $qth->alt / 1000.0;
372
+        $obs_geodetic->lon   = $qth->lon*self::de2ra;
373
+        $obs_geodetic->lat   = $qth->lat*self::de2ra;
374
+        $obs_geodetic->alt   = $qth->alt/1000.0;
375 375
         $obs_geodetic->theta = 0;
376 376
 
377 377
         Predict_Solar::Calculate_Solar_Position($jul_utc, $solar_vector);
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 
453 453
             /* coarse time steps */
454 454
             while (($sat->el < -1.0) && ($t <= ($start + $maxdt))) {
455
-                $t -= 0.00035 * ($sat->el * (($sat->alt / 8400.0) + 0.46) - 2.0);
455
+                $t -= 0.00035*($sat->el*(($sat->alt/8400.0) + 0.46) - 2.0);
456 456
                 $this->predict_calc($sat, $qth, $t);
457 457
             }
458 458
 
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
                 if (abs($sat->el) < 0.005) {
463 463
                     $aostime = $t;
464 464
                 } else {
465
-                    $t -= $sat->el * sqrt($sat->alt) / 530000.0;
465
+                    $t -= $sat->el*sqrt($sat->alt)/530000.0;
466 466
                     $this->predict_calc($sat, $qth, $t);
467 467
                 }
468 468
             }
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
             /* coarse time steps */
473 473
             while ($sat->el < -1.0) {
474 474
 
475
-                $t -= 0.00035 * ($sat->el * (($sat->alt / 8400.0) + 0.46) - 2.0);
475
+                $t -= 0.00035*($sat->el*(($sat->alt/8400.0) + 0.46) - 2.0);
476 476
                 $this->predict_calc($sat, $qth, $t);
477 477
             }
478 478
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
                 if (abs($sat->el) < 0.005) {
483 483
                     $aostime = $t;
484 484
                 } else {
485
-                    $t -= $sat->el * sqrt($sat->alt) / 530000.0;
485
+                    $t -= $sat->el*sqrt($sat->alt)/530000.0;
486 486
                     $this->predict_calc($sat, $qth, $t);
487 487
                 }
488 488
 
@@ -504,13 +504,13 @@  discard block
 block discarded – undo
504 504
         $sat_geodetic = new Predict_Geodetic();
505 505
         $obs_geodetic = new Predict_Geodetic();
506 506
 
507
-        $obs_geodetic->lon   = $qth->lon * self::de2ra;
508
-        $obs_geodetic->lat   = $qth->lat * self::de2ra;
509
-        $obs_geodetic->alt   = $qth->alt / 1000.0;
507
+        $obs_geodetic->lon   = $qth->lon*self::de2ra;
508
+        $obs_geodetic->lat   = $qth->lat*self::de2ra;
509
+        $obs_geodetic->alt   = $qth->alt/1000.0;
510 510
         $obs_geodetic->theta = 0;
511 511
 
512 512
         $sat->jul_utc = $t;
513
-        $sat->tsince = ($sat->jul_utc - $sat->jul_epoch) * self::xmnpda;
513
+        $sat->tsince = ($sat->jul_utc - $sat->jul_epoch)*self::xmnpda;
514 514
 
515 515
         /* call the norad routines according to the deep-space flag */
516 516
         $sgpsdp = Predict_SGPSDP::getInstance($sat);
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
         Predict_Math::Convert_Sat_State($sat->pos, $sat->vel);
524 524
 
525 525
         /* get the velocity of the satellite */
526
-        $sat->vel->w = sqrt($sat->vel->x * $sat->vel->x + $sat->vel->y * $sat->vel->y + $sat->vel->z * $sat->vel->z);
526
+        $sat->vel->w = sqrt($sat->vel->x*$sat->vel->x + $sat->vel->y*$sat->vel->y + $sat->vel->z*$sat->vel->z);
527 527
         $sat->velo = $sat->vel->w;
528 528
         Predict_SGPObs::Calculate_Obs($sat->jul_utc, $sat->pos, $sat->vel, $obs_geodetic, $obs_set);
529 529
         Predict_SGPObs::Calculate_LatLonAlt($sat->jul_utc, $sat->pos, $sat_geodetic);
@@ -544,16 +544,16 @@  discard block
 block discarded – undo
544 544
         $sat->ssplon = Predict_Math::Degrees($sat_geodetic->lon);
545 545
         $sat->alt = $sat_geodetic->alt;
546 546
         $sat->ma = Predict_Math::Degrees($sat->phase);
547
-        $sat->ma *= 256.0 / 360.0;
547
+        $sat->ma *= 256.0/360.0;
548 548
         $sat->phase = Predict_Math::Degrees($sat->phase);
549 549
 
550 550
         /* same formulas, but the one from predict is nicer */
551 551
         //sat->footprint = 2.0 * xkmper * acos (xkmper/sat->pos.w);
552
-        $sat->footprint = 12756.33 * acos(self::xkmper / (self::xkmper + $sat->alt));
552
+        $sat->footprint = 12756.33*acos(self::xkmper/(self::xkmper + $sat->alt));
553 553
         $age = $sat->jul_utc - $sat->jul_epoch;
554
-        $sat->orbit = floor(($sat->tle->xno * self::xmnpda / self::twopi +
555
-                        $age * $sat->tle->bstar * self::ae) * $age +
556
-                        $sat->tle->xmo / self::twopi) + $sat->tle->revnum - 1;
554
+        $sat->orbit = floor(($sat->tle->xno*self::xmnpda/self::twopi +
555
+                        $age*$sat->tle->bstar*self::ae)*$age +
556
+                        $sat->tle->xmo/self::twopi) + $sat->tle->revnum - 1;
557 557
     }
558 558
 
559 559
     /** Find the LOS time of the next pass.
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
         /* check whether satellite has aos */
586 586
         if (($sat->otype == Predict_SGPSDP::ORBIT_TYPE_GEO) ||
587 587
             ($sat->otype == Predict_SGPSDP::ORBIT_TYPE_DECAYED) ||
588
-            !$this->has_aos ($sat, $qth)) {
588
+            !$this->has_aos($sat, $qth)) {
589 589
 
590 590
             return 0.0;
591 591
         }
@@ -607,14 +607,14 @@  discard block
 block discarded – undo
607 607
 
608 608
             /* coarse steps */
609 609
             while (($sat->el >= 1.0) && ($t <= ($start + $maxdt))) {
610
-                $t += cos(($sat->el - 1.0) * self::de2ra) * sqrt($sat->alt) / 25000.0;
610
+                $t += cos(($sat->el - 1.0)*self::de2ra)*sqrt($sat->alt)/25000.0;
611 611
                 $this->predict_calc($sat, $qth, $t);
612 612
             }
613 613
 
614 614
             /* fine steps */
615
-            while (($lostime == 0.0) && ($t <= ($start + $maxdt)))  {
615
+            while (($lostime == 0.0) && ($t <= ($start + $maxdt))) {
616 616
 
617
-                $t += $sat->el * sqrt($sat->alt) / 502500.0;
617
+                $t += $sat->el*sqrt($sat->alt)/502500.0;
618 618
                 $this->predict_calc($sat, $qth, $t);
619 619
 
620 620
                 if (abs($sat->el) < 0.005) {
@@ -626,14 +626,14 @@  discard block
 block discarded – undo
626 626
 
627 627
             /* coarse steps */
628 628
             while ($sat->el >= 1.0) {
629
-                $t += cos(($sat->el - 1.0) * self::de2ra) * sqrt($sat->alt) / 25000.0;
629
+                $t += cos(($sat->el - 1.0)*self::de2ra)*sqrt($sat->alt)/25000.0;
630 630
                 $this->predict_calc($sat, $qth, $t);
631 631
             }
632 632
 
633 633
             /* fine steps */
634 634
             while ($lostime == 0.0) {
635 635
 
636
-                $t += $sat->el * sqrt($sat->alt) / 502500.0;
636
+                $t += $sat->el*sqrt($sat->alt)/502500.0;
637 637
                 $this->predict_calc($sat, $qth, $t);
638 638
 
639 639
                 if (abs($sat->el) < 0.005)
@@ -701,10 +701,10 @@  discard block
 block discarded – undo
701 701
                 $lin = self::pi - $lin;
702 702
             }
703 703
 
704
-            $sma = 331.25 * exp(log(1440.0 / $sat->meanmo) * (2.0 / 3.0));
705
-            $apogee = $sma * (1.0 + $sat->tle->eo) - self::xkmper;
704
+            $sma = 331.25*exp(log(1440.0/$sat->meanmo)*(2.0/3.0));
705
+            $apogee = $sma*(1.0 + $sat->tle->eo) - self::xkmper;
706 706
 
707
-            if ((acos(self::xkmper / ($apogee + self::xkmper)) + ($lin)) > abs($qth->lat * self::de2ra)) {
707
+            if ((acos(self::xkmper/($apogee + self::xkmper)) + ($lin)) > abs($qth->lat*self::de2ra)) {
708 708
                 $retcode = true;
709 709
             } else {
710 710
                 $retcode = false;
@@ -866,10 +866,10 @@  discard block
 block discarded – undo
866 866
      */
867 867
     public function azDegreesToDirection($az = 0)
868 868
     {
869
-        $i = floor($az / 22.5);
870
-        $m = (22.5 * (2 * $i + 1)) / 2;
869
+        $i = floor($az/22.5);
870
+        $m = (22.5*(2*$i + 1))/2;
871 871
         $i = ($az >= $m) ? $i + 1 : $i;
872 872
 
873
-        return trim(substr('N  NNENE ENEE  ESESE SSES  SSWSW WSWW  WNWNW NNWN  ', $i * 3, 3));
873
+        return trim(substr('N  NNENE ENEE  ESESE SSES  SSWSW WSWW  WNWNW NNWN  ', $i*3, 3));
874 874
     }
875 875
 }
Please login to merge, or discard this patch.
require/libs/SimplePie.compiled.php 1 patch
Spacing   +238 added lines, -238 removed lines patch added patch discarded remove patch
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
  * SimplePie Useragent
70 70
  * @see SimplePie::set_useragent()
71 71
  */
72
-define('SIMPLEPIE_USERAGENT', SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION . ' (Feed Parser; ' . SIMPLEPIE_URL . '; Allow like Gecko) Build/' . SIMPLEPIE_BUILD);
72
+define('SIMPLEPIE_USERAGENT', SIMPLEPIE_NAME.'/'.SIMPLEPIE_VERSION.' (Feed Parser; '.SIMPLEPIE_URL.'; Allow like Gecko) Build/'.SIMPLEPIE_BUILD);
73 73
 
74 74
 /**
75 75
  * SimplePie Linkback
76 76
  */
77
-define('SIMPLEPIE_LINKBACK', '<a href="' . SIMPLEPIE_URL . '" title="' . SIMPLEPIE_NAME . ' ' . SIMPLEPIE_VERSION . '">' . SIMPLEPIE_NAME . '</a>');
77
+define('SIMPLEPIE_LINKBACK', '<a href="'.SIMPLEPIE_URL.'" title="'.SIMPLEPIE_NAME.' '.SIMPLEPIE_VERSION.'">'.SIMPLEPIE_NAME.'</a>');
78 78
 
79 79
 /**
80 80
  * No Autodiscovery
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 		{
786 786
 			$this->feed_url = $file->url;
787 787
 			$this->permanent_url = $this->feed_url;
788
-			$this->file =& $file;
788
+			$this->file = & $file;
789 789
 			return true;
790 790
 		}
791 791
 		return false;
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
 	 */
874 874
 	public function force_cache_fallback($enable = false)
875 875
 	{
876
-		$this->force_cache_fallback= (bool) $enable;
876
+		$this->force_cache_fallback = (bool) $enable;
877 877
 	}
878 878
 
879 879
 	/**
@@ -1258,7 +1258,7 @@  discard block
 block discarded – undo
1258 1258
 	{
1259 1259
 		if ($page !== false)
1260 1260
 		{
1261
-			$this->sanitize->set_image_handler($page . '?' . $qs . '=');
1261
+			$this->sanitize->set_image_handler($page.'?'.$qs.'=');
1262 1262
 		}
1263 1263
 		else
1264 1264
 		{
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
 		}
1390 1390
 		
1391 1391
 		// Empty response check
1392
-		if(empty($this->raw_data)){
1392
+		if (empty($this->raw_data)) {
1393 1393
 			$this->error = "A feed could not be found at `$this->feed_url`. Empty body.";
1394 1394
 			$this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__));
1395 1395
 			return false;
@@ -1455,7 +1455,7 @@  discard block
 block discarded – undo
1455 1455
 				if ($parser->parse($utf8_data, 'UTF-8', $this->permanent_url))
1456 1456
 				{
1457 1457
 					$this->data = $parser->get_data();
1458
-					if (!($this->get_type() & ~SIMPLEPIE_TYPE_NONE))
1458
+					if (!($this->get_type()&~SIMPLEPIE_TYPE_NONE))
1459 1459
 					{
1460 1460
 						$this->error = "A feed could not be found at `$this->feed_url`. This does not appear to be a valid RSS or Atom feed.";
1461 1461
 						$this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__));
@@ -1500,7 +1500,7 @@  discard block
 block discarded – undo
1500 1500
 				if (!class_exists('\UConverter')) {
1501 1501
 					$missingExtensions[] = 'intl (PHP 5.5+)';
1502 1502
 				}
1503
-				$this->error .= ' Try installing/enabling the ' . implode(' or ', $missingExtensions) . ' extension.';
1503
+				$this->error .= ' Try installing/enabling the '.implode(' or ', $missingExtensions).' extension.';
1504 1504
 			}
1505 1505
 		}
1506 1506
 
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
 						else
1592 1592
 						{
1593 1593
 							$this->check_modified = false;
1594
-							if($this->force_cache_fallback)
1594
+							if ($this->force_cache_fallback)
1595 1595
 							{
1596 1596
 								$cache->touch();
1597 1597
 								return true;
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
 		{
1621 1621
 			if ($this->file instanceof SimplePie_File && $this->file->url === $this->feed_url)
1622 1622
 			{
1623
-				$file =& $this->file;
1623
+				$file = & $this->file;
1624 1624
 			}
1625 1625
 			else
1626 1626
 			{
@@ -1786,7 +1786,7 @@  discard block
 block discarded – undo
1786 1786
 			$header = "Content-type: $mime;";
1787 1787
 			if ($this->get_encoding())
1788 1788
 			{
1789
-				$header .= ' charset=' . $this->get_encoding();
1789
+				$header .= ' charset='.$this->get_encoding();
1790 1790
 			}
1791 1791
 			else
1792 1792
 			{
@@ -1978,28 +1978,28 @@  discard block
 block discarded – undo
1978 1978
 	public function get_feed_tags($namespace, $tag)
1979 1979
 	{
1980 1980
 		$type = $this->get_type();
1981
-		if ($type & SIMPLEPIE_TYPE_ATOM_10)
1981
+		if ($type&SIMPLEPIE_TYPE_ATOM_10)
1982 1982
 		{
1983 1983
 			if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag]))
1984 1984
 			{
1985 1985
 				return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]['child'][$namespace][$tag];
1986 1986
 			}
1987 1987
 		}
1988
-		if ($type & SIMPLEPIE_TYPE_ATOM_03)
1988
+		if ($type&SIMPLEPIE_TYPE_ATOM_03)
1989 1989
 		{
1990 1990
 			if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag]))
1991 1991
 			{
1992 1992
 				return $this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]['child'][$namespace][$tag];
1993 1993
 			}
1994 1994
 		}
1995
-		if ($type & SIMPLEPIE_TYPE_RSS_RDF)
1995
+		if ($type&SIMPLEPIE_TYPE_RSS_RDF)
1996 1996
 		{
1997 1997
 			if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag]))
1998 1998
 			{
1999 1999
 				return $this->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]['child'][$namespace][$tag];
2000 2000
 			}
2001 2001
 		}
2002
-		if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
2002
+		if ($type&SIMPLEPIE_TYPE_RSS_SYNDICATION)
2003 2003
 		{
2004 2004
 			if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][$namespace][$tag]))
2005 2005
 			{
@@ -2026,14 +2026,14 @@  discard block
 block discarded – undo
2026 2026
 	public function get_channel_tags($namespace, $tag)
2027 2027
 	{
2028 2028
 		$type = $this->get_type();
2029
-		if ($type & SIMPLEPIE_TYPE_ATOM_ALL)
2029
+		if ($type&SIMPLEPIE_TYPE_ATOM_ALL)
2030 2030
 		{
2031 2031
 			if ($return = $this->get_feed_tags($namespace, $tag))
2032 2032
 			{
2033 2033
 				return $return;
2034 2034
 			}
2035 2035
 		}
2036
-		if ($type & SIMPLEPIE_TYPE_RSS_10)
2036
+		if ($type&SIMPLEPIE_TYPE_RSS_10)
2037 2037
 		{
2038 2038
 			if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'channel'))
2039 2039
 			{
@@ -2043,7 +2043,7 @@  discard block
 block discarded – undo
2043 2043
 				}
2044 2044
 			}
2045 2045
 		}
2046
-		if ($type & SIMPLEPIE_TYPE_RSS_090)
2046
+		if ($type&SIMPLEPIE_TYPE_RSS_090)
2047 2047
 		{
2048 2048
 			if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'channel'))
2049 2049
 			{
@@ -2053,7 +2053,7 @@  discard block
 block discarded – undo
2053 2053
 				}
2054 2054
 			}
2055 2055
 		}
2056
-		if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
2056
+		if ($type&SIMPLEPIE_TYPE_RSS_SYNDICATION)
2057 2057
 		{
2058 2058
 			if ($channel = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'channel'))
2059 2059
 			{
@@ -2083,7 +2083,7 @@  discard block
 block discarded – undo
2083 2083
 	public function get_image_tags($namespace, $tag)
2084 2084
 	{
2085 2085
 		$type = $this->get_type();
2086
-		if ($type & SIMPLEPIE_TYPE_RSS_10)
2086
+		if ($type&SIMPLEPIE_TYPE_RSS_10)
2087 2087
 		{
2088 2088
 			if ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'image'))
2089 2089
 			{
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
 				}
2094 2094
 			}
2095 2095
 		}
2096
-		if ($type & SIMPLEPIE_TYPE_RSS_090)
2096
+		if ($type&SIMPLEPIE_TYPE_RSS_090)
2097 2097
 		{
2098 2098
 			if ($image = $this->get_feed_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'image'))
2099 2099
 			{
@@ -2103,7 +2103,7 @@  discard block
 block discarded – undo
2103 2103
 				}
2104 2104
 			}
2105 2105
 		}
2106
-		if ($type & SIMPLEPIE_TYPE_RSS_SYNDICATION)
2106
+		if ($type&SIMPLEPIE_TYPE_RSS_SYNDICATION)
2107 2107
 		{
2108 2108
 			if ($image = $this->get_channel_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'image'))
2109 2109
 			{
@@ -2130,7 +2130,7 @@  discard block
 block discarded – undo
2130 2130
 	 */
2131 2131
 	public function get_base($element = array())
2132 2132
 	{
2133
-		if (!($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION) && !empty($element['xml_base_explicit']) && isset($element['xml_base']))
2133
+		if (!($this->get_type()&SIMPLEPIE_TYPE_RSS_SYNDICATION) && !empty($element['xml_base_explicit']) && isset($element['xml_base']))
2134 2134
 		{
2135 2135
 			return $element['xml_base'];
2136 2136
 		}
@@ -2578,19 +2578,19 @@  discard block
 block discarded – undo
2578 2578
 			{
2579 2579
 				if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
2580 2580
 				{
2581
-					if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
2581
+					if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]))
2582 2582
 					{
2583
-						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
2584
-						$this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
2583
+						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]);
2584
+						$this->data['links'][$key] = & $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key];
2585 2585
 					}
2586 2586
 					else
2587 2587
 					{
2588
-						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
2588
+						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = & $this->data['links'][$key];
2589 2589
 					}
2590 2590
 				}
2591 2591
 				elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
2592 2592
 				{
2593
-					$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
2593
+					$this->data['links'][substr($key, 41)] = & $this->data['links'][$key];
2594 2594
 				}
2595 2595
 				$this->data['links'][$key] = array_unique($this->data['links'][$key]);
2596 2596
 			}
@@ -2938,7 +2938,7 @@  discard block
 block discarded – undo
2938 2938
 		{
2939 2939
 			return round($return[0]['data']);
2940 2940
 		}
2941
-		elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
2941
+		elseif ($this->get_type()&SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
2942 2942
 		{
2943 2943
 			return 88.0;
2944 2944
 		}
@@ -2964,7 +2964,7 @@  discard block
 block discarded – undo
2964 2964
 		{
2965 2965
 			return round($return[0]['data']);
2966 2966
 		}
2967
-		elseif ($this->get_type() & SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
2967
+		elseif ($this->get_type()&SIMPLEPIE_TYPE_RSS_SYNDICATION && $this->get_image_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'url'))
2968 2968
 		{
2969 2969
 			return 31.0;
2970 2970
 		}
@@ -3144,7 +3144,7 @@  discard block
 block discarded – undo
3144 3144
 
3145 3145
 		if (($url = $this->get_link()) !== null)
3146 3146
 		{
3147
-			return 'https://www.google.com/s2/favicons?domain=' . urlencode($url);
3147
+			return 'https://www.google.com/s2/favicons?domain='.urlencode($url);
3148 3148
 		}
3149 3149
 
3150 3150
 		return false;
@@ -3606,19 +3606,19 @@  discard block
 block discarded – undo
3606 3606
 
3607 3607
 			if (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))
3608 3608
 			{
3609
-				$channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
3609
+				$channel = & $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
3610 3610
 			}
3611 3611
 			elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))
3612 3612
 			{
3613
-				$channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
3613
+				$channel = & $data->data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
3614 3614
 			}
3615 3615
 			elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))
3616 3616
 			{
3617
-				$channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
3617
+				$channel = & $data->data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
3618 3618
 			}
3619 3619
 			elseif (isset($data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0]))
3620 3620
 			{
3621
-				$channel =& $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0];
3621
+				$channel = & $data->data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]['child'][SIMPLEPIE_NAMESPACE_RSS_20]['channel'][0];
3622 3622
 			}
3623 3623
 			else
3624 3624
 			{
@@ -3838,7 +3838,7 @@  discard block
 block discarded – undo
3838 3838
 		);
3839 3839
 		$this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));
3840 3840
 
3841
-		$this->name = $this->options['extras']['prefix'] . md5("$name:$type");
3841
+		$this->name = $this->options['extras']['prefix'].md5("$name:$type");
3842 3842
 
3843 3843
 		$this->cache = new Memcache();
3844 3844
 		$this->cache->addServer($this->options['host'], (int) $this->options['port']);
@@ -3972,10 +3972,10 @@  discard block
 block discarded – undo
3972 3972
         );
3973 3973
         $this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));
3974 3974
 
3975
-        $this->name = $this->options['extras']['prefix'] . md5("$name:$type");
3975
+        $this->name = $this->options['extras']['prefix'].md5("$name:$type");
3976 3976
 
3977 3977
         $this->cache = new Memcached();
3978
-        $this->cache->addServer($this->options['host'], (int)$this->options['port']);
3978
+        $this->cache->addServer($this->options['host'], (int) $this->options['port']);
3979 3979
     }
3980 3980
 
3981 3981
     /**
@@ -4009,7 +4009,7 @@  discard block
 block discarded – undo
4009 4009
      * @return int Timestamp
4010 4010
      */
4011 4011
     public function mtime() {
4012
-        $data = $this->cache->get($this->name . '_mtime');
4012
+        $data = $this->cache->get($this->name.'_mtime');
4013 4013
         return (int) $data;
4014 4014
     }
4015 4015
 
@@ -4037,8 +4037,8 @@  discard block
 block discarded – undo
4037 4037
     private function setData($data) {
4038 4038
 
4039 4039
         if ($data !== false) {
4040
-            $this->cache->set($this->name . '_mtime', time(), (int)$this->options['extras']['timeout']);
4041
-            return $this->cache->set($this->name, $data, (int)$this->options['extras']['timeout']);
4040
+            $this->cache->set($this->name.'_mtime', time(), (int) $this->options['extras']['timeout']);
4041
+            return $this->cache->set($this->name, $data, (int) $this->options['extras']['timeout']);
4042 4042
         }
4043 4043
 
4044 4044
         return false;
@@ -4116,7 +4116,7 @@  discard block
 block discarded – undo
4116 4116
 			return;
4117 4117
 		}
4118 4118
 
4119
-		$this->id = $name . $type;
4119
+		$this->id = $name.$type;
4120 4120
 
4121 4121
 		if (!$query = $this->mysql->query('SHOW TABLES'))
4122 4122
 		{
@@ -4130,23 +4130,23 @@  discard block
 block discarded – undo
4130 4130
 			$db[] = $row;
4131 4131
 		}
4132 4132
 
4133
-		if (!in_array($this->options['extras']['prefix'] . 'cache_data', $db))
4133
+		if (!in_array($this->options['extras']['prefix'].'cache_data', $db))
4134 4134
 		{
4135
-			$query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))');
4135
+			$query = $this->mysql->exec('CREATE TABLE `'.$this->options['extras']['prefix'].'cache_data` (`id` TEXT CHARACTER SET utf8 NOT NULL, `items` SMALLINT NOT NULL DEFAULT 0, `data` BLOB NOT NULL, `mtime` INT UNSIGNED NOT NULL, UNIQUE (`id`(125)))');
4136 4136
 			if ($query === false)
4137 4137
 			{
4138
-				trigger_error("Can't create " . $this->options['extras']['prefix'] . "cache_data table, check permissions", E_USER_WARNING);
4138
+				trigger_error("Can't create ".$this->options['extras']['prefix']."cache_data table, check permissions", E_USER_WARNING);
4139 4139
 				$this->mysql = null;
4140 4140
 				return;
4141 4141
 			}
4142 4142
 		}
4143 4143
 
4144
-		if (!in_array($this->options['extras']['prefix'] . 'items', $db))
4144
+		if (!in_array($this->options['extras']['prefix'].'items', $db))
4145 4145
 		{
4146
-			$query = $this->mysql->exec('CREATE TABLE `' . $this->options['extras']['prefix'] . 'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` MEDIUMBLOB NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))');
4146
+			$query = $this->mysql->exec('CREATE TABLE `'.$this->options['extras']['prefix'].'items` (`feed_id` TEXT CHARACTER SET utf8 NOT NULL, `id` TEXT CHARACTER SET utf8 NOT NULL, `data` MEDIUMBLOB NOT NULL, `posted` INT UNSIGNED NOT NULL, INDEX `feed_id` (`feed_id`(125)))');
4147 4147
 			if ($query === false)
4148 4148
 			{
4149
-				trigger_error("Can't create " . $this->options['extras']['prefix'] . "items table, check permissions", E_USER_WARNING);
4149
+				trigger_error("Can't create ".$this->options['extras']['prefix']."items table, check permissions", E_USER_WARNING);
4150 4150
 				$this->mysql = null;
4151 4151
 				return;
4152 4152
 			}
@@ -4166,9 +4166,9 @@  discard block
 block discarded – undo
4166 4166
 			return false;
4167 4167
 		}
4168 4168
 
4169
-		$query = $this->mysql->prepare('DELETE i, cd FROM `' . $this->options['extras']['prefix'] . 'cache_data` cd, ' .
4170
-			'`' . $this->options['extras']['prefix'] . 'items` i ' .
4171
-			'WHERE cd.id = i.feed_id ' .
4169
+		$query = $this->mysql->prepare('DELETE i, cd FROM `'.$this->options['extras']['prefix'].'cache_data` cd, '.
4170
+			'`'.$this->options['extras']['prefix'].'items` i '.
4171
+			'WHERE cd.id = i.feed_id '.
4172 4172
 			'AND cd.mtime < (unix_timestamp() - :purge_time)');
4173 4173
 		$query->bindValue(':purge_time', $this->options['extras']['cache_purge_time']);
4174 4174
 
@@ -4183,7 +4183,7 @@  discard block
 block discarded – undo
4183 4183
 
4184 4184
 			$prepared = self::prepare_simplepie_object_for_cache($data);
4185 4185
 
4186
-			$query = $this->mysql->prepare('SELECT COUNT(*) FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed');
4186
+			$query = $this->mysql->prepare('SELECT COUNT(*) FROM `'.$this->options['extras']['prefix'].'cache_data` WHERE `id` = :feed');
4187 4187
 			$query->bindValue(':feed', $this->id);
4188 4188
 			if ($query->execute())
4189 4189
 			{
@@ -4192,13 +4192,13 @@  discard block
 block discarded – undo
4192 4192
 					$items = count($prepared[1]);
4193 4193
 					if ($items)
4194 4194
 					{
4195
-						$sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = :items, `data` = :data, `mtime` = :time WHERE `id` = :feed';
4195
+						$sql = 'UPDATE `'.$this->options['extras']['prefix'].'cache_data` SET `items` = :items, `data` = :data, `mtime` = :time WHERE `id` = :feed';
4196 4196
 						$query = $this->mysql->prepare($sql);
4197 4197
 						$query->bindValue(':items', $items);
4198 4198
 					}
4199 4199
 					else
4200 4200
 					{
4201
-						$sql = 'UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `data` = :data, `mtime` = :time WHERE `id` = :feed';
4201
+						$sql = 'UPDATE `'.$this->options['extras']['prefix'].'cache_data` SET `data` = :data, `mtime` = :time WHERE `id` = :feed';
4202 4202
 						$query = $this->mysql->prepare($sql);
4203 4203
 					}
4204 4204
 
@@ -4212,7 +4212,7 @@  discard block
 block discarded – undo
4212 4212
 				}
4213 4213
 				else
4214 4214
 				{
4215
-					$query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:feed, :count, :data, :time)');
4215
+					$query = $this->mysql->prepare('INSERT INTO `'.$this->options['extras']['prefix'].'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:feed, :count, :data, :time)');
4216 4216
 					$query->bindValue(':feed', $this->id);
4217 4217
 					$query->bindValue(':count', count($prepared[1]));
4218 4218
 					$query->bindValue(':data', $prepared[0]);
@@ -4231,7 +4231,7 @@  discard block
 block discarded – undo
4231 4231
 						$database_ids[] = $this->mysql->quote($id);
4232 4232
 					}
4233 4233
 
4234
-					$query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `id` = ' . implode(' OR `id` = ', $database_ids) . ' AND `feed_id` = :feed');
4234
+					$query = $this->mysql->prepare('SELECT `id` FROM `'.$this->options['extras']['prefix'].'items` WHERE `id` = '.implode(' OR `id` = ', $database_ids).' AND `feed_id` = :feed');
4235 4235
 					$query->bindValue(':feed', $this->id);
4236 4236
 
4237 4237
 					if ($query->execute())
@@ -4251,7 +4251,7 @@  discard block
 block discarded – undo
4251 4251
 								$date = time();
4252 4252
 							}
4253 4253
 
4254
-							$query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'items` (`feed_id`, `id`, `data`, `posted`) VALUES(:feed, :id, :data, :date)');
4254
+							$query = $this->mysql->prepare('INSERT INTO `'.$this->options['extras']['prefix'].'items` (`feed_id`, `id`, `data`, `posted`) VALUES(:feed, :id, :data, :date)');
4255 4255
 							$query->bindValue(':feed', $this->id);
4256 4256
 							$query->bindValue(':id', $new_id);
4257 4257
 							$query->bindValue(':data', serialize($prepared[1][$new_id]->data));
@@ -4272,13 +4272,13 @@  discard block
 block discarded – undo
4272 4272
 		}
4273 4273
 		else
4274 4274
 		{
4275
-			$query = $this->mysql->prepare('SELECT `id` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :feed');
4275
+			$query = $this->mysql->prepare('SELECT `id` FROM `'.$this->options['extras']['prefix'].'cache_data` WHERE `id` = :feed');
4276 4276
 			$query->bindValue(':feed', $this->id);
4277 4277
 			if ($query->execute())
4278 4278
 			{
4279 4279
 				if ($query->rowCount() > 0)
4280 4280
 				{
4281
-					$query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `items` = 0, `data` = :data, `mtime` = :time WHERE `id` = :feed');
4281
+					$query = $this->mysql->prepare('UPDATE `'.$this->options['extras']['prefix'].'cache_data` SET `items` = 0, `data` = :data, `mtime` = :time WHERE `id` = :feed');
4282 4282
 					$query->bindValue(':data', serialize($data));
4283 4283
 					$query->bindValue(':time', time());
4284 4284
 					$query->bindValue(':feed', $this->id);
@@ -4289,7 +4289,7 @@  discard block
 block discarded – undo
4289 4289
 				}
4290 4290
 				else
4291 4291
 				{
4292
-					$query = $this->mysql->prepare('INSERT INTO `' . $this->options['extras']['prefix'] . 'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:id, 0, :data, :time)');
4292
+					$query = $this->mysql->prepare('INSERT INTO `'.$this->options['extras']['prefix'].'cache_data` (`id`, `items`, `data`, `mtime`) VALUES(:id, 0, :data, :time)');
4293 4293
 					$query->bindValue(':id', $this->id);
4294 4294
 					$query->bindValue(':data', serialize($data));
4295 4295
 					$query->bindValue(':time', time());
@@ -4315,7 +4315,7 @@  discard block
 block discarded – undo
4315 4315
 			return false;
4316 4316
 		}
4317 4317
 
4318
-		$query = $this->mysql->prepare('SELECT `items`, `data` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');
4318
+		$query = $this->mysql->prepare('SELECT `items`, `data` FROM `'.$this->options['extras']['prefix'].'cache_data` WHERE `id` = :id');
4319 4319
 		$query->bindValue(':id', $this->id);
4320 4320
 		if ($query->execute() && ($row = $query->fetch()))
4321 4321
 		{
@@ -4334,19 +4334,19 @@  discard block
 block discarded – undo
4334 4334
 			{
4335 4335
 				if (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))
4336 4336
 				{
4337
-					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
4337
+					$feed = & $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
4338 4338
 				}
4339 4339
 				elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))
4340 4340
 				{
4341
-					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
4341
+					$feed = & $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
4342 4342
 				}
4343 4343
 				elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))
4344 4344
 				{
4345
-					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
4345
+					$feed = & $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
4346 4346
 				}
4347 4347
 				elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]))
4348 4348
 				{
4349
-					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0];
4349
+					$feed = & $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0];
4350 4350
 				}
4351 4351
 				else
4352 4352
 				{
@@ -4355,10 +4355,10 @@  discard block
 block discarded – undo
4355 4355
 
4356 4356
 				if ($feed !== null)
4357 4357
 				{
4358
-					$sql = 'SELECT `data` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :feed ORDER BY `posted` DESC';
4358
+					$sql = 'SELECT `data` FROM `'.$this->options['extras']['prefix'].'items` WHERE `feed_id` = :feed ORDER BY `posted` DESC';
4359 4359
 					if ($items > 0)
4360 4360
 					{
4361
-						$sql .= ' LIMIT ' . $items;
4361
+						$sql .= ' LIMIT '.$items;
4362 4362
 					}
4363 4363
 
4364 4364
 					$query = $this->mysql->prepare($sql);
@@ -4393,7 +4393,7 @@  discard block
 block discarded – undo
4393 4393
 			return false;
4394 4394
 		}
4395 4395
 
4396
-		$query = $this->mysql->prepare('SELECT `mtime` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');
4396
+		$query = $this->mysql->prepare('SELECT `mtime` FROM `'.$this->options['extras']['prefix'].'cache_data` WHERE `id` = :id');
4397 4397
 		$query->bindValue(':id', $this->id);
4398 4398
 		if ($query->execute() && ($time = $query->fetchColumn()))
4399 4399
 		{
@@ -4417,7 +4417,7 @@  discard block
 block discarded – undo
4417 4417
 			return false;
4418 4418
 		}
4419 4419
 
4420
-		$query = $this->mysql->prepare('UPDATE `' . $this->options['extras']['prefix'] . 'cache_data` SET `mtime` = :time WHERE `id` = :id');
4420
+		$query = $this->mysql->prepare('UPDATE `'.$this->options['extras']['prefix'].'cache_data` SET `mtime` = :time WHERE `id` = :id');
4421 4421
 		$query->bindValue(':time', time());
4422 4422
 		$query->bindValue(':id', $this->id);
4423 4423
 		if ($query->execute() && $query->rowCount() > 0)
@@ -4442,9 +4442,9 @@  discard block
 block discarded – undo
4442 4442
 			return false;
4443 4443
 		}
4444 4444
 
4445
-		$query = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');
4445
+		$query = $this->mysql->prepare('DELETE FROM `'.$this->options['extras']['prefix'].'cache_data` WHERE `id` = :id');
4446 4446
 		$query->bindValue(':id', $this->id);
4447
-		$query2 = $this->mysql->prepare('DELETE FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :id');
4447
+		$query2 = $this->mysql->prepare('DELETE FROM `'.$this->options['extras']['prefix'].'items` WHERE `feed_id` = :id');
4448 4448
 		$query2->bindValue(':id', $this->id);
4449 4449
 		if ($query->execute() && $query2->execute())
4450 4450
 		{
@@ -4516,13 +4516,13 @@  discard block
 block discarded – undo
4516 4516
         if (!is_null($options) && is_array($options)) {
4517 4517
             $this->options = $options;
4518 4518
         } else {
4519
-            $this->options = array (
4519
+            $this->options = array(
4520 4520
                 'prefix' => 'rss:simple_primary:',
4521 4521
                 'expire' => 0,
4522 4522
             );
4523 4523
         }
4524 4524
 
4525
-        $this->name = $this->options['prefix'] . $name;
4525
+        $this->name = $this->options['prefix'].$name;
4526 4526
     }
4527 4527
 
4528 4528
     /**
@@ -6841,7 +6841,7 @@  discard block
 block discarded – undo
6841 6841
 	 * @param array|string $options See first paramter to {@see embed}
6842 6842
 	 * @return string HTML string to output
6843 6843
 	 */
6844
-	public function native_embed($options='')
6844
+	public function native_embed($options = '')
6845 6845
 	{
6846 6846
 		return $this->embed($options, true);
6847 6847
 	}
@@ -6915,7 +6915,7 @@  discard block
 block discarded – undo
6915 6915
 		else
6916 6916
 		{
6917 6917
 			$options = explode(',', $options);
6918
-			foreach($options as $option)
6918
+			foreach ($options as $option)
6919 6919
 			{
6920 6920
 				$opt = explode(':', $option, 2);
6921 6921
 				if (isset($opt[0], $opt[1]))
@@ -7050,11 +7050,11 @@  discard block
 block discarded – undo
7050 7050
 		{
7051 7051
 			if ($native)
7052 7052
 			{
7053
-				$embed .= "<embed src=\"" . $this->get_link() . "\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>";
7053
+				$embed .= "<embed src=\"".$this->get_link()."\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"$type\" quality=\"high\" width=\"$width\" height=\"$height\" bgcolor=\"$bgcolor\" loop=\"$loop\"></embed>";
7054 7054
 			}
7055 7055
 			else
7056 7056
 			{
7057
-				$embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$loop', '$type');</script>";
7057
+				$embed .= "<script type='text/javascript'>embed_flash('$bgcolor', '$width', '$height', '".$this->get_link()."', '$loop', '$type');</script>";
7058 7058
 			}
7059 7059
 		}
7060 7060
 
@@ -7065,11 +7065,11 @@  discard block
 block discarded – undo
7065 7065
 			$height += 20;
7066 7066
 			if ($native)
7067 7067
 			{
7068
-				$embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>";
7068
+				$embed .= "<embed src=\"$mediaplayer\" pluginspage=\"http://adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"$width\" height=\"$height\" wmode=\"transparent\" flashvars=\"file=".rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension())."&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\"></embed>";
7069 7069
 			}
7070 7070
 			else
7071 7071
 			{
7072
-				$embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '" . rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension()) . "', '$placeholder', '$loop', '$mediaplayer');</script>";
7072
+				$embed .= "<script type='text/javascript'>embed_flv('$width', '$height', '".rawurlencode($this->get_link().'?file_extension=.'.$this->get_extension())."', '$placeholder', '$loop', '$mediaplayer');</script>";
7073 7073
 			}
7074 7074
 		}
7075 7075
 
@@ -7082,16 +7082,16 @@  discard block
 block discarded – undo
7082 7082
 			{
7083 7083
 				if ($placeholder !== '')
7084 7084
 				{
7085
-					$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"" . $this->get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
7085
+					$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" href=\"".$this->get_link()."\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
7086 7086
 				}
7087 7087
 				else
7088 7088
 				{
7089
-					$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"" . $this->get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
7089
+					$embed .= "<embed type=\"$type\" style=\"cursor:hand; cursor:pointer;\" src=\"".$this->get_link()."\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\"></embed>";
7090 7090
 				}
7091 7091
 			}
7092 7092
 			else
7093 7093
 			{
7094
-				$embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '" . $this->get_link() . "', '$placeholder', '$loop');</script>";
7094
+				$embed .= "<script type='text/javascript'>embed_quicktime('$type', '$bgcolor', '$width', '$height', '".$this->get_link()."', '$placeholder', '$loop');</script>";
7095 7095
 			}
7096 7096
 		}
7097 7097
 
@@ -7101,16 +7101,16 @@  discard block
 block discarded – undo
7101 7101
 			$height += 45;
7102 7102
 			if ($native)
7103 7103
 			{
7104
-				$embed .= "<embed type=\"application/x-mplayer2\" src=\"" . $this->get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>";
7104
+				$embed .= "<embed type=\"application/x-mplayer2\" src=\"".$this->get_link()."\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\"></embed>";
7105 7105
 			}
7106 7106
 			else
7107 7107
 			{
7108
-				$embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '" . $this->get_link() . "');</script>";
7108
+				$embed .= "<script type='text/javascript'>embed_wmedia('$width', '$height', '".$this->get_link()."');</script>";
7109 7109
 			}
7110 7110
 		}
7111 7111
 
7112 7112
 		// Everything else
7113
-		else $embed .= '<a href="' . $this->get_link() . '" class="' . $altclass . '">' . $alt . '</a>';
7113
+		else $embed .= '<a href="'.$this->get_link().'" class="'.$altclass.'">'.$alt.'</a>';
7114 7114
 
7115 7115
 		return $embed;
7116 7116
 	}
@@ -7130,7 +7130,7 @@  discard block
 block discarded – undo
7130 7130
 	{
7131 7131
 		// Mime-types by handler.
7132 7132
 		$types_flash = array('application/x-shockwave-flash', 'application/futuresplash'); // Flash
7133
-		$types_fmedia = array('video/flv', 'video/x-flv','flv-application/octet-stream'); // Flash Media Player
7133
+		$types_fmedia = array('video/flv', 'video/x-flv', 'flv-application/octet-stream'); // Flash Media Player
7134 7134
 		$types_quicktime = array('audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video'); // QuickTime
7135 7135
 		$types_wmedia = array('application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx'); // Windows Media
7136 7136
 		$types_mp3 = array('audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg'); // MP3
@@ -7359,7 +7359,7 @@  discard block
 block discarded – undo
7359 7359
 			}
7360 7360
 			if (!$force_fsockopen && function_exists('curl_exec'))
7361 7361
 			{
7362
-				$this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_CURL;
7362
+				$this->method = SIMPLEPIE_FILE_SOURCE_REMOTE|SIMPLEPIE_FILE_SOURCE_CURL;
7363 7363
 				$fp = curl_init();
7364 7364
 				$headers2 = array();
7365 7365
 				foreach ($headers as $key => $value)
@@ -7396,7 +7396,7 @@  discard block
 block discarded – undo
7396 7396
 				}
7397 7397
 				if (curl_errno($fp))
7398 7398
 				{
7399
-					$this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp);
7399
+					$this->error = 'cURL error '.curl_errno($fp).': '.curl_error($fp);
7400 7400
 					$this->success = false;
7401 7401
 				}
7402 7402
 				else
@@ -7427,7 +7427,7 @@  discard block
 block discarded – undo
7427 7427
 			}
7428 7428
 			else
7429 7429
 			{
7430
-				$this->method = SIMPLEPIE_FILE_SOURCE_REMOTE | SIMPLEPIE_FILE_SOURCE_FSOCKOPEN;
7430
+				$this->method = SIMPLEPIE_FILE_SOURCE_REMOTE|SIMPLEPIE_FILE_SOURCE_FSOCKOPEN;
7431 7431
 				$url_parts = parse_url($url);
7432 7432
 				$socket_host = $url_parts['host'];
7433 7433
 				if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https')
@@ -7442,7 +7442,7 @@  discard block
 block discarded – undo
7442 7442
 				$fp = @fsockopen($socket_host, $url_parts['port'], $errno, $errstr, $timeout);
7443 7443
 				if (!$fp)
7444 7444
 				{
7445
-					$this->error = 'fsockopen error: ' . $errstr;
7445
+					$this->error = 'fsockopen error: '.$errstr;
7446 7446
 					$this->success = false;
7447 7447
 				}
7448 7448
 				else
@@ -7473,7 +7473,7 @@  discard block
 block discarded – undo
7473 7473
 
7474 7474
 					if (isset($url_parts['user']) && isset($url_parts['pass']))
7475 7475
 					{
7476
-						$out .= "Authorization: Basic " . base64_encode("$url_parts[user]:$url_parts[pass]") . "\r\n";
7476
+						$out .= "Authorization: Basic ".base64_encode("$url_parts[user]:$url_parts[pass]")."\r\n";
7477 7477
 					}
7478 7478
 					foreach ($headers as $key => $value)
7479 7479
 					{
@@ -7564,7 +7564,7 @@  discard block
 block discarded – undo
7564 7564
 		}
7565 7565
 		else
7566 7566
 		{
7567
-			$this->method = SIMPLEPIE_FILE_SOURCE_LOCAL | SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS;
7567
+			$this->method = SIMPLEPIE_FILE_SOURCE_LOCAL|SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS;
7568 7568
 			if (empty($url) || !($this->body = trim(file_get_contents($url))))
7569 7569
 			{
7570 7570
 				$this->error = 'file_get_contents could not read the file';
@@ -7789,7 +7789,7 @@  discard block
 block discarded – undo
7789 7789
 			// We should only use the last Content-Type header. c.f. issue #1
7790 7790
 			if (isset($this->headers[$this->name]) && $this->name !== 'content-type')
7791 7791
 			{
7792
-				$this->headers[$this->name] .= ', ' . $this->value;
7792
+				$this->headers[$this->name] .= ', '.$this->value;
7793 7793
 			}
7794 7794
 			else
7795 7795
 			{
@@ -7999,7 +7999,7 @@  discard block
 block discarded – undo
7999 7999
 
8000 8000
 		while (true)
8001 8001
 		{
8002
-			$is_chunked = (bool) preg_match( '/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches );
8002
+			$is_chunked = (bool) preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches);
8003 8003
 			if (!$is_chunked)
8004 8004
 			{
8005 8005
 				// Looks like it's not chunked after all
@@ -8154,9 +8154,9 @@  discard block
 block discarded – undo
8154 8154
 	 */
8155 8155
 	public function __set($name, $value)
8156 8156
 	{
8157
-		if (method_exists($this, 'set_' . $name))
8157
+		if (method_exists($this, 'set_'.$name))
8158 8158
 		{
8159
-			call_user_func(array($this, 'set_' . $name), $value);
8159
+			call_user_func(array($this, 'set_'.$name), $value);
8160 8160
 		}
8161 8161
 		elseif (
8162 8162
 			   $name === 'iauthority'
@@ -8167,7 +8167,7 @@  discard block
 block discarded – undo
8167 8167
 			|| $name === 'ifragment'
8168 8168
 		)
8169 8169
 		{
8170
-			call_user_func(array($this, 'set_' . substr($name, 1)), $value);
8170
+			call_user_func(array($this, 'set_'.substr($name, 1)), $value);
8171 8171
 		}
8172 8172
 	}
8173 8173
 
@@ -8197,7 +8197,7 @@  discard block
 block discarded – undo
8197 8197
 			$return = $this->$name;
8198 8198
 		}
8199 8199
 		// host -> ihost
8200
-		elseif (($prop = 'i' . $name) && array_key_exists($prop, $props))
8200
+		elseif (($prop = 'i'.$name) && array_key_exists($prop, $props))
8201 8201
 		{
8202 8202
 			$name = $prop;
8203 8203
 			$return = $this->$prop;
@@ -8210,7 +8210,7 @@  discard block
 block discarded – undo
8210 8210
 		}
8211 8211
 		else
8212 8212
 		{
8213
-			trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE);
8213
+			trigger_error('Undefined property: '.get_class($this).'::'.$name, E_USER_NOTICE);
8214 8214
 			$return = null;
8215 8215
 		}
8216 8216
 
@@ -8232,7 +8232,7 @@  discard block
 block discarded – undo
8232 8232
 	 */
8233 8233
 	public function __isset($name)
8234 8234
 	{
8235
-		if (method_exists($this, 'get_' . $name) || isset($this->$name))
8235
+		if (method_exists($this, 'get_'.$name) || isset($this->$name))
8236 8236
 		{
8237 8237
 			return true;
8238 8238
 		}
@@ -8249,9 +8249,9 @@  discard block
 block discarded – undo
8249 8249
 	 */
8250 8250
 	public function __unset($name)
8251 8251
 	{
8252
-		if (method_exists($this, 'set_' . $name))
8252
+		if (method_exists($this, 'set_'.$name))
8253 8253
 		{
8254
-			call_user_func(array($this, 'set_' . $name), '');
8254
+			call_user_func(array($this, 'set_'.$name), '');
8255 8255
 		}
8256 8256
 	}
8257 8257
 
@@ -8327,11 +8327,11 @@  discard block
 block discarded – undo
8327 8327
 							}
8328 8328
 							elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '')
8329 8329
 							{
8330
-								$target->ipath = '/' . $relative->ipath;
8330
+								$target->ipath = '/'.$relative->ipath;
8331 8331
 							}
8332 8332
 							elseif (($last_segment = strrpos($base->ipath, '/')) !== false)
8333 8333
 							{
8334
-								$target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath;
8334
+								$target->ipath = substr($base->ipath, 0, $last_segment + 1).$relative->ipath;
8335 8335
 							}
8336 8336
 							else
8337 8337
 							{
@@ -8467,7 +8467,7 @@  discard block
 block discarded – undo
8467 8467
 				$input = '';
8468 8468
 			}
8469 8469
 		}
8470
-		return $output . $input;
8470
+		return $output.$input;
8471 8471
 	}
8472 8472
 
8473 8473
 	/**
@@ -8506,23 +8506,23 @@  discard block
 block discarded – undo
8506 8506
 
8507 8507
 			// No one byte sequences are valid due to the while.
8508 8508
 			// Two byte sequence:
8509
-			if (($value & 0xE0) === 0xC0)
8509
+			if (($value&0xE0) === 0xC0)
8510 8510
 			{
8511
-				$character = ($value & 0x1F) << 6;
8511
+				$character = ($value&0x1F) << 6;
8512 8512
 				$length = 2;
8513 8513
 				$remaining = 1;
8514 8514
 			}
8515 8515
 			// Three byte sequence:
8516
-			elseif (($value & 0xF0) === 0xE0)
8516
+			elseif (($value&0xF0) === 0xE0)
8517 8517
 			{
8518
-				$character = ($value & 0x0F) << 12;
8518
+				$character = ($value&0x0F) << 12;
8519 8519
 				$length = 3;
8520 8520
 				$remaining = 2;
8521 8521
 			}
8522 8522
 			// Four byte sequence:
8523
-			elseif (($value & 0xF8) === 0xF0)
8523
+			elseif (($value&0xF8) === 0xF0)
8524 8524
 			{
8525
-				$character = ($value & 0x07) << 18;
8525
+				$character = ($value&0x07) << 18;
8526 8526
 				$length = 4;
8527 8527
 				$remaining = 3;
8528 8528
 			}
@@ -8543,9 +8543,9 @@  discard block
 block discarded – undo
8543 8543
 						$value = ord($string[$position]);
8544 8544
 
8545 8545
 						// Check that the byte is valid, then add it to the character:
8546
-						if (($value & 0xC0) === 0x80)
8546
+						if (($value&0xC0) === 0x80)
8547 8547
 						{
8548
-							$character |= ($value & 0x3F) << (--$remaining * 6);
8548
+							$character |= ($value&0x3F) << (--$remaining*6);
8549 8549
 						}
8550 8550
 						// If it is invalid, count the sequence as invalid and reprocess the current byte:
8551 8551
 						else
@@ -8573,7 +8573,7 @@  discard block
 block discarded – undo
8573 8573
 				|| $length > 3 && $character <= 0xFFFF
8574 8574
 				// Outside of range of ucschar codepoints
8575 8575
 				// Noncharacters
8576
-				|| ($character & 0xFFFE) === 0xFFFE
8576
+				|| ($character&0xFFFE) === 0xFFFE
8577 8577
 				|| $character >= 0xFDD0 && $character <= 0xFDEF
8578 8578
 				|| (
8579 8579
 					// Everything else not in ucschar
@@ -8648,23 +8648,23 @@  discard block
 block discarded – undo
8648 8648
 					$length = 1;
8649 8649
 				}
8650 8650
 				// Two byte sequence:
8651
-				elseif (($value & 0xE0) === 0xC0)
8651
+				elseif (($value&0xE0) === 0xC0)
8652 8652
 				{
8653
-					$character = ($value & 0x1F) << 6;
8653
+					$character = ($value&0x1F) << 6;
8654 8654
 					$length = 2;
8655 8655
 					$remaining = 1;
8656 8656
 				}
8657 8657
 				// Three byte sequence:
8658
-				elseif (($value & 0xF0) === 0xE0)
8658
+				elseif (($value&0xF0) === 0xE0)
8659 8659
 				{
8660
-					$character = ($value & 0x0F) << 12;
8660
+					$character = ($value&0x0F) << 12;
8661 8661
 					$length = 3;
8662 8662
 					$remaining = 2;
8663 8663
 				}
8664 8664
 				// Four byte sequence:
8665
-				elseif (($value & 0xF8) === 0xF0)
8665
+				elseif (($value&0xF8) === 0xF0)
8666 8666
 				{
8667
-					$character = ($value & 0x07) << 18;
8667
+					$character = ($value&0x07) << 18;
8668 8668
 					$length = 4;
8669 8669
 					$remaining = 3;
8670 8670
 				}
@@ -8679,10 +8679,10 @@  discard block
 block discarded – undo
8679 8679
 			else
8680 8680
 			{
8681 8681
 				// Check that the byte is valid, then add it to the character:
8682
-				if (($value & 0xC0) === 0x80)
8682
+				if (($value&0xC0) === 0x80)
8683 8683
 				{
8684 8684
 					$remaining--;
8685
-					$character |= ($value & 0x3F) << ($remaining * 6);
8685
+					$character |= ($value&0x3F) << ($remaining*6);
8686 8686
 				}
8687 8687
 				// If it is invalid, count the sequence as invalid and reprocess the current byte as the start of a sequence:
8688 8688
 				else
@@ -8708,7 +8708,7 @@  discard block
 block discarded – undo
8708 8708
 					|| $character < 0x2D
8709 8709
 					|| $character > 0xEFFFD
8710 8710
 					// Noncharacters
8711
-					|| ($character & 0xFFFE) === 0xFFFE
8711
+					|| ($character&0xFFFE) === 0xFFFE
8712 8712
 					|| $character >= 0xFDD0 && $character <= 0xFDEF
8713 8713
 					// Everything else not in iunreserved (this is all BMP)
8714 8714
 					|| $character === 0x2F
@@ -8721,7 +8721,7 @@  discard block
 block discarded – undo
8721 8721
 				{
8722 8722
 					for ($j = $start; $j <= $i; $j++)
8723 8723
 					{
8724
-						$string .= '%' . strtoupper($bytes[$j]);
8724
+						$string .= '%'.strtoupper($bytes[$j]);
8725 8725
 					}
8726 8726
 				}
8727 8727
 				else
@@ -8740,7 +8740,7 @@  discard block
 block discarded – undo
8740 8740
 		{
8741 8741
 			for ($j = $start; $j < $len; $j++)
8742 8742
 			{
8743
-				$string .= '%' . strtoupper($bytes[$j]);
8743
+				$string .= '%'.strtoupper($bytes[$j]);
8744 8744
 			}
8745 8745
 		}
8746 8746
 
@@ -8999,7 +8999,7 @@  discard block
 block discarded – undo
8999 8999
 		{
9000 9000
 			if (SimplePie_Net_IPv6::check_ipv6(substr($ihost, 1, -1)))
9001 9001
 			{
9002
-				$this->ihost = '[' . SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)) . ']';
9002
+				$this->ihost = '['.SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)).']';
9003 9003
 			}
9004 9004
 			else
9005 9005
 			{
@@ -9095,7 +9095,7 @@  discard block
 block discarded – undo
9095 9095
 			$removed = $this->remove_dot_segments($valid);
9096 9096
 
9097 9097
 			$cache[$ipath] = array($valid, $removed);
9098
-			$this->ipath =  ($this->scheme !== null) ? $removed : $valid;
9098
+			$this->ipath = ($this->scheme !== null) ? $removed : $valid;
9099 9099
 		}
9100 9100
 
9101 9101
 		$this->scheme_normalization();
@@ -9182,11 +9182,11 @@  discard block
 block discarded – undo
9182 9182
 		$iri = '';
9183 9183
 		if ($this->scheme !== null)
9184 9184
 		{
9185
-			$iri .= $this->scheme . ':';
9185
+			$iri .= $this->scheme.':';
9186 9186
 		}
9187 9187
 		if (($iauthority = $this->get_iauthority()) !== null)
9188 9188
 		{
9189
-			$iri .= '//' . $iauthority;
9189
+			$iri .= '//'.$iauthority;
9190 9190
 		}
9191 9191
 		if ($this->ipath !== '')
9192 9192
 		{
@@ -9198,11 +9198,11 @@  discard block
 block discarded – undo
9198 9198
 		}
9199 9199
 		if ($this->iquery !== null)
9200 9200
 		{
9201
-			$iri .= '?' . $this->iquery;
9201
+			$iri .= '?'.$this->iquery;
9202 9202
 		}
9203 9203
 		if ($this->ifragment !== null)
9204 9204
 		{
9205
-			$iri .= '#' . $this->ifragment;
9205
+			$iri .= '#'.$this->ifragment;
9206 9206
 		}
9207 9207
 
9208 9208
 		return $iri;
@@ -9230,7 +9230,7 @@  discard block
 block discarded – undo
9230 9230
 			$iauthority = '';
9231 9231
 			if ($this->iuserinfo !== null)
9232 9232
 			{
9233
-				$iauthority .= $this->iuserinfo . '@';
9233
+				$iauthority .= $this->iuserinfo.'@';
9234 9234
 			}
9235 9235
 			if ($this->ihost !== null)
9236 9236
 			{
@@ -9238,7 +9238,7 @@  discard block
 block discarded – undo
9238 9238
 			}
9239 9239
 			if ($this->port !== null)
9240 9240
 			{
9241
-				$iauthority .= ':' . $this->port;
9241
+				$iauthority .= ':'.$this->port;
9242 9242
 			}
9243 9243
 			return $iauthority;
9244 9244
 		}
@@ -10273,19 +10273,19 @@  discard block
 block discarded – undo
10273 10273
 			{
10274 10274
 				if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
10275 10275
 				{
10276
-					if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
10276
+					if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]))
10277 10277
 					{
10278
-						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
10279
-						$this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
10278
+						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]);
10279
+						$this->data['links'][$key] = & $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key];
10280 10280
 					}
10281 10281
 					else
10282 10282
 					{
10283
-						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
10283
+						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = & $this->data['links'][$key];
10284 10284
 					}
10285 10285
 				}
10286 10286
 				elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
10287 10287
 				{
10288
-					$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
10288
+					$this->data['links'][substr($key, 41)] = & $this->data['links'][$key];
10289 10289
 				}
10290 10290
 				$this->data['links'][$key] = array_unique($this->data['links'][$key]);
10291 10291
 			}
@@ -10626,12 +10626,12 @@  discard block
 block discarded – undo
10626 10626
 					if (sizeof($temp) > 0)
10627 10627
 					{
10628 10628
 						$minutes = (int) array_pop($temp);
10629
-						$seconds += $minutes * 60;
10629
+						$seconds += $minutes*60;
10630 10630
 					}
10631 10631
 					if (sizeof($temp) > 0)
10632 10632
 					{
10633 10633
 						$hours = (int) array_pop($temp);
10634
-						$seconds += $hours * 3600;
10634
+						$seconds += $hours*3600;
10635 10635
 					}
10636 10636
 					unset($temp);
10637 10637
 					$duration_parent = $seconds;
@@ -10986,7 +10986,7 @@  discard block
 block discarded – undo
10986 10986
 			// If we have media:group tags, loop through them.
10987 10987
 			foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_MEDIARSS, 'group') as $group)
10988 10988
 			{
10989
-				if(isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']))
10989
+				if (isset($group['child']) && isset($group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content']))
10990 10990
 				{
10991 10991
 					// If we have media:content tags, loop through them.
10992 10992
 					foreach ((array) $group['child'][SIMPLEPIE_NAMESPACE_MEDIARSS]['content'] as $content)
@@ -12293,34 +12293,34 @@  discard block
 block discarded – undo
12293 12293
 			}
12294 12294
 		}
12295 12295
 
12296
-		if ($type & ~SIMPLEPIE_LOCATOR_NONE)
12296
+		if ($type&~SIMPLEPIE_LOCATOR_NONE)
12297 12297
 		{
12298 12298
 			$this->get_base();
12299 12299
 		}
12300 12300
 
12301
-		if ($type & SIMPLEPIE_LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery())
12301
+		if ($type&SIMPLEPIE_LOCATOR_AUTODISCOVERY && $working = $this->autodiscovery())
12302 12302
 		{
12303 12303
 			return $working[0];
12304 12304
 		}
12305 12305
 
12306
-		if ($type & (SIMPLEPIE_LOCATOR_LOCAL_EXTENSION | SIMPLEPIE_LOCATOR_LOCAL_BODY | SIMPLEPIE_LOCATOR_REMOTE_EXTENSION | SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links())
12306
+		if ($type&(SIMPLEPIE_LOCATOR_LOCAL_EXTENSION|SIMPLEPIE_LOCATOR_LOCAL_BODY|SIMPLEPIE_LOCATOR_REMOTE_EXTENSION|SIMPLEPIE_LOCATOR_REMOTE_BODY) && $this->get_links())
12307 12307
 		{
12308
-			if ($type & SIMPLEPIE_LOCATOR_LOCAL_EXTENSION && $working = $this->extension($this->local))
12308
+			if ($type&SIMPLEPIE_LOCATOR_LOCAL_EXTENSION && $working = $this->extension($this->local))
12309 12309
 			{
12310 12310
 				return $working[0];
12311 12311
 			}
12312 12312
 
12313
-			if ($type & SIMPLEPIE_LOCATOR_LOCAL_BODY && $working = $this->body($this->local))
12313
+			if ($type&SIMPLEPIE_LOCATOR_LOCAL_BODY && $working = $this->body($this->local))
12314 12314
 			{
12315 12315
 				return $working[0];
12316 12316
 			}
12317 12317
 
12318
-			if ($type & SIMPLEPIE_LOCATOR_REMOTE_EXTENSION && $working = $this->extension($this->elsewhere))
12318
+			if ($type&SIMPLEPIE_LOCATOR_REMOTE_EXTENSION && $working = $this->extension($this->elsewhere))
12319 12319
 			{
12320 12320
 				return $working[0];
12321 12321
 			}
12322 12322
 
12323
-			if ($type & SIMPLEPIE_LOCATOR_REMOTE_BODY && $working = $this->body($this->elsewhere))
12323
+			if ($type&SIMPLEPIE_LOCATOR_REMOTE_BODY && $working = $this->body($this->elsewhere))
12324 12324
 			{
12325 12325
 				return $working[0];
12326 12326
 			}
@@ -12625,22 +12625,22 @@  discard block
 block discarded – undo
12625 12625
 	{
12626 12626
 		$time = '';
12627 12627
 
12628
-		$hours = floor($seconds / 3600);
12629
-		$remainder = $seconds % 3600;
12628
+		$hours = floor($seconds/3600);
12629
+		$remainder = $seconds%3600;
12630 12630
 		if ($hours > 0)
12631 12631
 		{
12632 12632
 			$time .= $hours.':';
12633 12633
 		}
12634 12634
 
12635
-		$minutes = floor($remainder / 60);
12636
-		$seconds = $remainder % 60;
12635
+		$minutes = floor($remainder/60);
12636
+		$seconds = $remainder%60;
12637 12637
 		if ($minutes < 10 && $hours > 0)
12638 12638
 		{
12639
-			$minutes = '0' . $minutes;
12639
+			$minutes = '0'.$minutes;
12640 12640
 		}
12641 12641
 		if ($seconds < 10)
12642 12642
 		{
12643
-			$seconds = '0' . $seconds;
12643
+			$seconds = '0'.$seconds;
12644 12644
 		}
12645 12645
 
12646 12646
 		$time .= $minutes.':';
@@ -12671,7 +12671,7 @@  discard block
 block discarded – undo
12671 12671
 	{
12672 12672
 		$return = array();
12673 12673
 		$name = preg_quote($realname, '/');
12674
-		if (preg_match_all("/<($name)" . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . "(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE))
12674
+		if (preg_match_all("/<($name)".SIMPLEPIE_PCRE_HTML_ATTRIBUTE."(>(.*)<\/$name>|(\/)?>)/siU", $string, $matches, PREG_SET_ORDER|PREG_OFFSET_CAPTURE))
12675 12675
 		{
12676 12676
 			for ($i = 0, $total_matches = count($matches); $i < $total_matches; $i++)
12677 12677
 			{
@@ -12688,7 +12688,7 @@  discard block
 block discarded – undo
12688 12688
 					$return[$i]['content'] = $matches[$i][4][0];
12689 12689
 				}
12690 12690
 				$return[$i]['attribs'] = array();
12691
-				if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' ' . $matches[$i][2][0] . ' ', $attribs, PREG_SET_ORDER))
12691
+				if (isset($matches[$i][2][0]) && preg_match_all('/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*)(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"([^"]*)"|\'([^\']*)\'|([^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?/', ' '.$matches[$i][2][0].' ', $attribs, PREG_SET_ORDER))
12692 12692
 				{
12693 12693
 					for ($j = 0, $total_attribs = count($attribs); $j < $total_attribs; $j++)
12694 12694
 					{
@@ -12710,7 +12710,7 @@  discard block
 block discarded – undo
12710 12710
 		foreach ($element['attribs'] as $key => $value)
12711 12711
 		{
12712 12712
 			$key = strtolower($key);
12713
-			$full .= " $key=\"" . htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8') . '"';
12713
+			$full .= " $key=\"".htmlspecialchars($value['data'], ENT_COMPAT, 'UTF-8').'"';
12714 12714
 		}
12715 12715
 		if ($element['self_closing'])
12716 12716
 		{
@@ -12725,7 +12725,7 @@  discard block
 block discarded – undo
12725 12725
 
12726 12726
 	public static function error($message, $level, $file, $line)
12727 12727
 	{
12728
-		if ((ini_get('error_reporting') & $level) > 0)
12728
+		if ((ini_get('error_reporting')&$level) > 0)
12729 12729
 		{
12730 12730
 			switch ($level)
12731 12731
 			{
@@ -14343,7 +14343,7 @@  discard block
 block discarded – undo
14343 14343
 				$data = '';
14344 14344
 			}
14345 14345
 		}
14346
-		return $output . $data;
14346
+		return $output.$data;
14347 14347
 	}
14348 14348
 
14349 14349
 	public static function parse_date($dt)
@@ -14453,23 +14453,23 @@  discard block
 block discarded – undo
14453 14453
 			{
14454 14454
 				case 'text':
14455 14455
 				case 'text/plain':
14456
-					return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
14456
+					return SIMPLEPIE_CONSTRUCT_TEXT|$mode;
14457 14457
 
14458 14458
 				case 'html':
14459 14459
 				case 'text/html':
14460
-					return SIMPLEPIE_CONSTRUCT_HTML | $mode;
14460
+					return SIMPLEPIE_CONSTRUCT_HTML|$mode;
14461 14461
 
14462 14462
 				case 'xhtml':
14463 14463
 				case 'application/xhtml+xml':
14464
-					return SIMPLEPIE_CONSTRUCT_XHTML | $mode;
14464
+					return SIMPLEPIE_CONSTRUCT_XHTML|$mode;
14465 14465
 
14466 14466
 				default:
14467
-					return SIMPLEPIE_CONSTRUCT_NONE | $mode;
14467
+					return SIMPLEPIE_CONSTRUCT_NONE|$mode;
14468 14468
 			}
14469 14469
 		}
14470 14470
 		else
14471 14471
 		{
14472
-			return SIMPLEPIE_CONSTRUCT_TEXT | $mode;
14472
+			return SIMPLEPIE_CONSTRUCT_TEXT|$mode;
14473 14473
 		}
14474 14474
 	}
14475 14475
 
@@ -14570,15 +14570,15 @@  discard block
 block discarded – undo
14570 14570
 		}
14571 14571
 		else if ($codepoint <= 0x7ff)
14572 14572
 		{
14573
-			return chr(0xc0 | ($codepoint >> 6)) . chr(0x80 | ($codepoint & 0x3f));
14573
+			return chr(0xc0|($codepoint >> 6)).chr(0x80|($codepoint&0x3f));
14574 14574
 		}
14575 14575
 		else if ($codepoint <= 0xffff)
14576 14576
 		{
14577
-			return chr(0xe0 | ($codepoint >> 12)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
14577
+			return chr(0xe0|($codepoint >> 12)).chr(0x80|(($codepoint >> 6)&0x3f)).chr(0x80|($codepoint&0x3f));
14578 14578
 		}
14579 14579
 		else if ($codepoint <= 0x10ffff)
14580 14580
 		{
14581
-			return chr(0xf0 | ($codepoint >> 18)) . chr(0x80 | (($codepoint >> 12) & 0x3f)) . chr(0x80 | (($codepoint >> 6) & 0x3f)) . chr(0x80 | ($codepoint & 0x3f));
14581
+			return chr(0xf0|($codepoint >> 18)).chr(0x80|(($codepoint >> 12)&0x3f)).chr(0x80|(($codepoint >> 6)&0x3f)).chr(0x80|($codepoint&0x3f));
14582 14582
 		}
14583 14583
 		else
14584 14584
 		{
@@ -14734,7 +14734,7 @@  discard block
 block discarded – undo
14734 14734
 		}
14735 14735
 		header('Content-type: text/javascript; charset: UTF-8');
14736 14736
 		header('Cache-Control: must-revalidate');
14737
-		header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days
14737
+		header('Expires: '.gmdate('D, d M Y H:i:s', time() + 604800).' GMT'); // 7 days
14738 14738
 		?>
14739 14739
 function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {
14740 14740
 	if (placeholder != '') {
@@ -14768,14 +14768,14 @@  discard block
 block discarded – undo
14768 14768
 	public static function get_build()
14769 14769
 	{
14770 14770
 		$root = dirname(dirname(__FILE__));
14771
-		if (file_exists($root . '/.git/index'))
14771
+		if (file_exists($root.'/.git/index'))
14772 14772
 		{
14773
-			return filemtime($root . '/.git/index');
14773
+			return filemtime($root.'/.git/index');
14774 14774
 		}
14775
-		elseif (file_exists($root . '/SimplePie'))
14775
+		elseif (file_exists($root.'/SimplePie'))
14776 14776
 		{
14777 14777
 			$time = 0;
14778
-			foreach (glob($root . '/SimplePie/*.php') as $file)
14778
+			foreach (glob($root.'/SimplePie/*.php') as $file)
14779 14779
 			{
14780 14780
 				if (($mtime = filemtime($file)) > $time)
14781 14781
 				{
@@ -14784,9 +14784,9 @@  discard block
 block discarded – undo
14784 14784
 			}
14785 14785
 			return $time;
14786 14786
 		}
14787
-		elseif (file_exists(dirname(__FILE__) . '/Core.php'))
14787
+		elseif (file_exists(dirname(__FILE__).'/Core.php'))
14788 14788
 		{
14789
-			return filemtime(dirname(__FILE__) . '/Core.php');
14789
+			return filemtime(dirname(__FILE__).'/Core.php');
14790 14790
 		}
14791 14791
 		else
14792 14792
 		{
@@ -14799,11 +14799,11 @@  discard block
 block discarded – undo
14799 14799
 	 */
14800 14800
 	public static function debug(&$sp)
14801 14801
 	{
14802
-		$info = 'SimplePie ' . SIMPLEPIE_VERSION . ' Build ' . SIMPLEPIE_BUILD . "\n";
14803
-		$info .= 'PHP ' . PHP_VERSION . "\n";
14802
+		$info = 'SimplePie '.SIMPLEPIE_VERSION.' Build '.SIMPLEPIE_BUILD."\n";
14803
+		$info .= 'PHP '.PHP_VERSION."\n";
14804 14804
 		if ($sp->error() !== null)
14805 14805
 		{
14806
-			$info .= 'Error occurred: ' . $sp->error() . "\n";
14806
+			$info .= 'Error occurred: '.$sp->error()."\n";
14807 14807
 		}
14808 14808
 		else
14809 14809
 		{
@@ -14819,20 +14819,20 @@  discard block
 block discarded – undo
14819 14819
 				switch ($ext)
14820 14820
 				{
14821 14821
 					case 'pcre':
14822
-						$info .= '      Version ' . PCRE_VERSION . "\n";
14822
+						$info .= '      Version '.PCRE_VERSION."\n";
14823 14823
 						break;
14824 14824
 					case 'curl':
14825 14825
 						$version = curl_version();
14826
-						$info .= '      Version ' . $version['version'] . "\n";
14826
+						$info .= '      Version '.$version['version']."\n";
14827 14827
 						break;
14828 14828
 					case 'mbstring':
14829
-						$info .= '      Overloading: ' . mb_get_info('func_overload') . "\n";
14829
+						$info .= '      Overloading: '.mb_get_info('func_overload')."\n";
14830 14830
 						break;
14831 14831
 					case 'iconv':
14832
-						$info .= '      Version ' . ICONV_VERSION . "\n";
14832
+						$info .= '      Version '.ICONV_VERSION."\n";
14833 14833
 						break;
14834 14834
 					case 'xml':
14835
-						$info .= '      Version ' . LIBXML_DOTTED_VERSION . "\n";
14835
+						$info .= '      Version '.LIBXML_DOTTED_VERSION."\n";
14836 14836
 						break;
14837 14837
 				}
14838 14838
 			}
@@ -14930,7 +14930,7 @@  discard block
 block discarded – undo
14930 14930
 			// xxx::xxx
14931 14931
 			else
14932 14932
 			{
14933
-				$fill = ':' . str_repeat('0:', 6 - $c2 - $c1);
14933
+				$fill = ':'.str_repeat('0:', 6 - $c2 - $c1);
14934 14934
 				$ip = str_replace('::', $fill, $ip);
14935 14935
 			}
14936 14936
 		}
@@ -15581,8 +15581,8 @@  discard block
 block discarded – undo
15581 15581
 	 */
15582 15582
 	public function __construct()
15583 15583
 	{
15584
-		$this->day_pcre = '(' . implode(array_keys($this->day), '|') . ')';
15585
-		$this->month_pcre = '(' . implode(array_keys($this->month), '|') . ')';
15584
+		$this->day_pcre = '('.implode(array_keys($this->day), '|').')';
15585
+		$this->month_pcre = '('.implode(array_keys($this->month), '|').')';
15586 15586
 
15587 15587
 		static $cache;
15588 15588
 		if (!isset($cache[get_class($this)]))
@@ -15684,7 +15684,7 @@  discard block
 block discarded – undo
15684 15684
 			$month = $day = $hour = $minute = $second = '([0-9]{2})';
15685 15685
 			$decimal = '([0-9]*)';
15686 15686
 			$zone = '(?:(Z)|([+\-])([0-9]{1,2}):?([0-9]{1,2}))';
15687
-			$pcre = '/^' . $year . '(?:-?' . $month . '(?:-?' . $day . '(?:[Tt\x09\x20]+' . $hour . '(?::?' . $minute . '(?::?' . $second . '(?:.' . $decimal . ')?)?)?' . $zone . ')?)?)?$/';
15687
+			$pcre = '/^'.$year.'(?:-?'.$month.'(?:-?'.$day.'(?:[Tt\x09\x20]+'.$hour.'(?::?'.$minute.'(?::?'.$second.'(?:.'.$decimal.')?)?)?'.$zone.')?)?)?$/';
15688 15688
 		}
15689 15689
 		if (preg_match($pcre, $date, $match))
15690 15690
 		{
@@ -15717,8 +15717,8 @@  discard block
 block discarded – undo
15717 15717
 			// Numeric timezone
15718 15718
 			if (isset($match[9]) && $match[9] !== '')
15719 15719
 			{
15720
-				$timezone = $match[10] * 3600;
15721
-				$timezone += $match[11] * 60;
15720
+				$timezone = $match[10]*3600;
15721
+				$timezone += $match[11]*60;
15722 15722
 				if ($match[9] === '-')
15723 15723
 				{
15724 15724
 					$timezone = 0 - $timezone;
@@ -15730,7 +15730,7 @@  discard block
 block discarded – undo
15730 15730
 			}
15731 15731
 
15732 15732
 			// Convert the number of seconds to an integer, taking decimals into account
15733
-			$second = round((int)$match[6] + (int)$match[7] / pow(10, strlen($match[7])));
15733
+			$second = round((int) $match[6] + (int) $match[7]/pow(10, strlen($match[7])));
15734 15734
 
15735 15735
 			return gmmktime($match[4], $match[5], $second, $match[2], $match[3], $match[1]) - $timezone;
15736 15736
 		}
@@ -15813,8 +15813,8 @@  discard block
 block discarded – undo
15813 15813
 		if (!$pcre)
15814 15814
 		{
15815 15815
 			$wsp = '[\x09\x20]';
15816
-			$fws = '(?:' . $wsp . '+|' . $wsp . '*(?:\x0D\x0A' . $wsp . '+)+)';
15817
-			$optional_fws = $fws . '?';
15816
+			$fws = '(?:'.$wsp.'+|'.$wsp.'*(?:\x0D\x0A'.$wsp.'+)+)';
15817
+			$optional_fws = $fws.'?';
15818 15818
 			$day_name = $this->day_pcre;
15819 15819
 			$month = $this->month_pcre;
15820 15820
 			$day = '([0-9]{1,2})';
@@ -15822,8 +15822,8 @@  discard block
 block discarded – undo
15822 15822
 			$year = '([0-9]{2,4})';
15823 15823
 			$num_zone = '([+\-])([0-9]{2})([0-9]{2})';
15824 15824
 			$character_zone = '([A-Z]{1,5})';
15825
-			$zone = '(?:' . $num_zone . '|' . $character_zone . ')';
15826
-			$pcre = '/(?:' . $optional_fws . $day_name . $optional_fws . ',)?' . $optional_fws . $day . $fws . $month . $fws . $year . $fws . $hour . $optional_fws . ':' . $optional_fws . $minute . '(?:' . $optional_fws . ':' . $optional_fws . $second . ')?' . $fws . $zone . '/i';
15825
+			$zone = '(?:'.$num_zone.'|'.$character_zone.')';
15826
+			$pcre = '/(?:'.$optional_fws.$day_name.$optional_fws.',)?'.$optional_fws.$day.$fws.$month.$fws.$year.$fws.$hour.$optional_fws.':'.$optional_fws.$minute.'(?:'.$optional_fws.':'.$optional_fws.$second.')?'.$fws.$zone.'/i';
15827 15827
 		}
15828 15828
 		if (preg_match($pcre, $this->remove_rfc2822_comments($date), $match))
15829 15829
 		{
@@ -15848,8 +15848,8 @@  discard block
 block discarded – undo
15848 15848
 			// Numeric timezone
15849 15849
 			if ($match[8] !== '')
15850 15850
 			{
15851
-				$timezone = $match[9] * 3600;
15852
-				$timezone += $match[10] * 60;
15851
+				$timezone = $match[9]*3600;
15852
+				$timezone += $match[10]*60;
15853 15853
 				if ($match[8] === '-')
15854 15854
 				{
15855 15855
 					$timezone = 0 - $timezone;
@@ -15911,7 +15911,7 @@  discard block
 block discarded – undo
15911 15911
 			$day = '([0-9]{1,2})';
15912 15912
 			$year = $hour = $minute = $second = '([0-9]{2})';
15913 15913
 			$zone = '([A-Z]{1,5})';
15914
-			$pcre = '/^' . $day_name . ',' . $space . $day . '-' . $month . '-' . $year . $space . $hour . ':' . $minute . ':' . $second . $space . $zone . '$/i';
15914
+			$pcre = '/^'.$day_name.','.$space.$day.'-'.$month.'-'.$year.$space.$hour.':'.$minute.':'.$second.$space.$zone.'$/i';
15915 15915
 		}
15916 15916
 		if (preg_match($pcre, $date, $match))
15917 15917
 		{
@@ -15977,7 +15977,7 @@  discard block
 block discarded – undo
15977 15977
 			$hour = $sec = $min = '([0-9]{2})';
15978 15978
 			$year = '([0-9]{4})';
15979 15979
 			$terminator = '\x0A?\x00?';
15980
-			$pcre = '/^' . $wday_name . $space . $mon_name . $space . $day . $space . $hour . ':' . $min . ':' . $sec . $space . $year . $terminator . '$/i';
15980
+			$pcre = '/^'.$wday_name.$space.$mon_name.$space.$day.$space.$hour.':'.$min.':'.$sec.$space.$year.$terminator.'$/i';
15981 15981
 		}
15982 15982
 		if (preg_match($pcre, $date, $match))
15983 15983
 		{
@@ -16113,7 +16113,7 @@  discard block
 block discarded – undo
16113 16113
 			if ($declaration->parse())
16114 16114
 			{
16115 16115
 				$data = substr($data, $pos + 2);
16116
-				$data = '<?xml version="' . $declaration->version . '" encoding="' . $encoding . '" standalone="' . (($declaration->standalone) ? 'yes' : 'no') . '"?>' ."\n". $this->declare_html_entities() . $data;
16116
+				$data = '<?xml version="'.$declaration->version.'" encoding="'.$encoding.'" standalone="'.(($declaration->standalone) ? 'yes' : 'no').'"?>'."\n".$this->declare_html_entities().$data;
16117 16117
 			}
16118 16118
 			else
16119 16119
 			{
@@ -16169,7 +16169,7 @@  discard block
 block discarded – undo
16169 16169
 					case constant('XMLReader::END_ELEMENT'):
16170 16170
 						if ($xml->namespaceURI !== '')
16171 16171
 						{
16172
-							$tagName = $xml->namespaceURI . $this->separator . $xml->localName;
16172
+							$tagName = $xml->namespaceURI.$this->separator.$xml->localName;
16173 16173
 						}
16174 16174
 						else
16175 16175
 						{
@@ -16181,7 +16181,7 @@  discard block
 block discarded – undo
16181 16181
 						$empty = $xml->isEmptyElement;
16182 16182
 						if ($xml->namespaceURI !== '')
16183 16183
 						{
16184
-							$tagName = $xml->namespaceURI . $this->separator . $xml->localName;
16184
+							$tagName = $xml->namespaceURI.$this->separator.$xml->localName;
16185 16185
 						}
16186 16186
 						else
16187 16187
 						{
@@ -16192,7 +16192,7 @@  discard block
 block discarded – undo
16192 16192
 						{
16193 16193
 							if ($xml->namespaceURI !== '')
16194 16194
 							{
16195
-								$attrName = $xml->namespaceURI . $this->separator . $xml->localName;
16195
+								$attrName = $xml->namespaceURI.$this->separator.$xml->localName;
16196 16196
 							}
16197 16197
 							else
16198 16198
 							{
@@ -16298,12 +16298,12 @@  discard block
 block discarded – undo
16298 16298
 			$this->current_xhtml_construct++;
16299 16299
 			if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML)
16300 16300
 			{
16301
-				$this->data['data'] .= '<' . end($this->element);
16301
+				$this->data['data'] .= '<'.end($this->element);
16302 16302
 				if (isset($attribs['']))
16303 16303
 				{
16304 16304
 					foreach ($attribs[''] as $name => $value)
16305 16305
 					{
16306
-						$this->data['data'] .= ' ' . $name . '="' . htmlspecialchars($value, ENT_COMPAT, $this->encoding) . '"';
16306
+						$this->data['data'] .= ' '.$name.'="'.htmlspecialchars($value, ENT_COMPAT, $this->encoding).'"';
16307 16307
 					}
16308 16308
 				}
16309 16309
 				$this->data['data'] .= '>';
@@ -16311,8 +16311,8 @@  discard block
 block discarded – undo
16311 16311
 		}
16312 16312
 		else
16313 16313
 		{
16314
-			$this->datas[] =& $this->data;
16315
-			$this->data =& $this->data['child'][end($this->namespace)][end($this->element)][];
16314
+			$this->datas[] = & $this->data;
16315
+			$this->data = & $this->data['child'][end($this->namespace)][end($this->element)][];
16316 16316
 			$this->data = array('data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang));
16317 16317
 			if ((end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_03 && in_array(end($this->element), array('title', 'tagline', 'copyright', 'info', 'summary', 'content')) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')
16318 16318
 			|| (end($this->namespace) === SIMPLEPIE_NAMESPACE_ATOM_10 && in_array(end($this->element), array('rights', 'subtitle', 'summary', 'info', 'title', 'content')) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml')
@@ -16344,12 +16344,12 @@  discard block
 block discarded – undo
16344 16344
 			$this->current_xhtml_construct--;
16345 16345
 			if (end($this->namespace) === SIMPLEPIE_NAMESPACE_XHTML && !in_array(end($this->element), array('area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param')))
16346 16346
 			{
16347
-				$this->data['data'] .= '</' . end($this->element) . '>';
16347
+				$this->data['data'] .= '</'.end($this->element).'>';
16348 16348
 			}
16349 16349
 		}
16350 16350
 		if ($this->current_xhtml_construct === -1)
16351 16351
 		{
16352
-			$this->data =& $this->datas[count($this->datas) - 1];
16352
+			$this->data = & $this->datas[count($this->datas) - 1];
16353 16353
 			array_pop($this->datas);
16354 16354
 		}
16355 16355
 
@@ -16384,7 +16384,7 @@  discard block
 block discarded – undo
16384 16384
 					$namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG2 ||
16385 16385
 					$namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG3 ||
16386 16386
 					$namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG4 ||
16387
-					$namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5 )
16387
+					$namespace === SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG5)
16388 16388
 				{
16389 16389
 					$namespace = SIMPLEPIE_NAMESPACE_MEDIARSS;
16390 16390
 				}
@@ -17227,11 +17227,11 @@  discard block
 block discarded – undo
17227 17227
 	public function sanitize($data, $type, $base = '')
17228 17228
 	{
17229 17229
 		$data = trim($data);
17230
-		if ($data !== '' || $type & SIMPLEPIE_CONSTRUCT_IRI)
17230
+		if ($data !== '' || $type&SIMPLEPIE_CONSTRUCT_IRI)
17231 17231
 		{
17232
-			if ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML)
17232
+			if ($type&SIMPLEPIE_CONSTRUCT_MAYBE_HTML)
17233 17233
 			{
17234
-				if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data))
17234
+				if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*'.SIMPLEPIE_PCRE_HTML_ATTRIBUTE.'>)/', $data))
17235 17235
 				{
17236 17236
 					$type |= SIMPLEPIE_CONSTRUCT_HTML;
17237 17237
 				}
@@ -17241,12 +17241,12 @@  discard block
 block discarded – undo
17241 17241
 				}
17242 17242
 			}
17243 17243
 
17244
-			if ($type & SIMPLEPIE_CONSTRUCT_BASE64)
17244
+			if ($type&SIMPLEPIE_CONSTRUCT_BASE64)
17245 17245
 			{
17246 17246
 				$data = base64_decode($data);
17247 17247
 			}
17248 17248
 
17249
-			if ($type & (SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML))
17249
+			if ($type&(SIMPLEPIE_CONSTRUCT_HTML|SIMPLEPIE_CONSTRUCT_XHTML))
17250 17250
 			{
17251 17251
 
17252 17252
 				if (!class_exists('DOMDocument'))
@@ -17322,7 +17322,7 @@  discard block
 block discarded – undo
17322 17322
 
17323 17323
 							if ($cache->load())
17324 17324
 							{
17325
-								$img->setAttribute('src', $this->image_handler . $image_url);
17325
+								$img->setAttribute('src', $this->image_handler.$image_url);
17326 17326
 							}
17327 17327
 							else
17328 17328
 							{
@@ -17333,7 +17333,7 @@  discard block
 block discarded – undo
17333 17333
 								{
17334 17334
 									if ($cache->save(array('headers' => $file->headers, 'body' => $file->body)))
17335 17335
 									{
17336
-										$img->setAttribute('src', $this->image_handler . $image_url);
17336
+										$img->setAttribute('src', $this->image_handler.$image_url);
17337 17337
 									}
17338 17338
 									else
17339 17339
 									{
@@ -17359,16 +17359,16 @@  discard block
 block discarded – undo
17359 17359
 
17360 17360
 				if ($this->remove_div)
17361 17361
 				{
17362
-					$data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '', $data);
17362
+					$data = preg_replace('/^<div'.SIMPLEPIE_PCRE_XML_ATTRIBUTE.'>/', '', $data);
17363 17363
 					$data = preg_replace('/<\/div>$/', '', $data);
17364 17364
 				}
17365 17365
 				else
17366 17366
 				{
17367
-					$data = preg_replace('/^<div' . SIMPLEPIE_PCRE_XML_ATTRIBUTE . '>/', '<div>', $data);
17367
+					$data = preg_replace('/^<div'.SIMPLEPIE_PCRE_XML_ATTRIBUTE.'>/', '<div>', $data);
17368 17368
 				}
17369 17369
 			}
17370 17370
 
17371
-			if ($type & SIMPLEPIE_CONSTRUCT_IRI)
17371
+			if ($type&SIMPLEPIE_CONSTRUCT_IRI)
17372 17372
 			{
17373 17373
 				$absolute = $this->registry->call('Misc', 'absolutize_url', array($data, $base));
17374 17374
 				if ($absolute !== false)
@@ -17377,7 +17377,7 @@  discard block
 block discarded – undo
17377 17377
 				}
17378 17378
 			}
17379 17379
 
17380
-			if ($type & (SIMPLEPIE_CONSTRUCT_TEXT | SIMPLEPIE_CONSTRUCT_IRI))
17380
+			if ($type&(SIMPLEPIE_CONSTRUCT_TEXT|SIMPLEPIE_CONSTRUCT_IRI))
17381 17381
 			{
17382 17382
 				$data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8');
17383 17383
 			}
@@ -17394,11 +17394,11 @@  discard block
 block discarded – undo
17394 17394
 	{
17395 17395
 		$ret = '';
17396 17396
 		$html = preg_replace('%</?(?:html|body)[^>]*?'.'>%is', '', $html);
17397
-		if ($type & ~SIMPLEPIE_CONSTRUCT_XHTML)
17397
+		if ($type&~SIMPLEPIE_CONSTRUCT_XHTML)
17398 17398
 		{
17399 17399
 			// Atom XHTML constructs are wrapped with a div by default
17400 17400
 			// Note: No protection if $html contains a stray </div>!
17401
-			$html = '<div>' . $html . '</div>';
17401
+			$html = '<div>'.$html.'</div>';
17402 17402
 			$ret .= '<!DOCTYPE html>';
17403 17403
 			$content_type = 'text/html';
17404 17404
 		}
@@ -17409,8 +17409,8 @@  discard block
 block discarded – undo
17409 17409
 		}
17410 17410
 
17411 17411
 		$ret .= '<html><head>';
17412
-		$ret .= '<meta http-equiv="Content-Type" content="' . $content_type . '; charset=utf-8" />';
17413
-		$ret .= '</head><body>' . $html . '</body></html>';
17412
+		$ret .= '<meta http-equiv="Content-Type" content="'.$content_type.'; charset=utf-8" />';
17413
+		$ret .= '</head><body>'.$html.'</body></html>';
17414 17414
 		return $ret;
17415 17415
 	}
17416 17416
 
@@ -17468,7 +17468,7 @@  discard block
 block discarded – undo
17468 17468
 
17469 17469
 	protected function strip_tag($tag, $document, $xpath, $type)
17470 17470
 	{
17471
-		$elements = $xpath->query('body//' . $tag);
17471
+		$elements = $xpath->query('body//'.$tag);
17472 17472
 		if ($this->encode_instead_of_strip)
17473 17473
 		{
17474 17474
 			foreach ($elements as $element)
@@ -17478,7 +17478,7 @@  discard block
 block discarded – undo
17478 17478
 				// For elements which aren't script or style, include the tag itself
17479 17479
 				if (!in_array($tag, array('script', 'style')))
17480 17480
 				{
17481
-					$text = '<' . $tag;
17481
+					$text = '<'.$tag;
17482 17482
 					if ($element->hasAttributes())
17483 17483
 					{
17484 17484
 						$attrs = array();
@@ -17487,21 +17487,21 @@  discard block
 block discarded – undo
17487 17487
 							$value = $attr->value;
17488 17488
 
17489 17489
 							// In XHTML, empty values should never exist, so we repeat the value
17490
-							if (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_XHTML))
17490
+							if (empty($value) && ($type&SIMPLEPIE_CONSTRUCT_XHTML))
17491 17491
 							{
17492 17492
 								$value = $name;
17493 17493
 							}
17494 17494
 							// For HTML, empty is fine
17495
-							elseif (empty($value) && ($type & SIMPLEPIE_CONSTRUCT_HTML))
17495
+							elseif (empty($value) && ($type&SIMPLEPIE_CONSTRUCT_HTML))
17496 17496
 							{
17497 17497
 								$attrs[] = $name;
17498 17498
 								continue;
17499 17499
 							}
17500 17500
 
17501 17501
 							// Standard attribute text
17502
-							$attrs[] = $name . '="' . $attr->value . '"';
17502
+							$attrs[] = $name.'="'.$attr->value.'"';
17503 17503
 						}
17504
-						$text .= ' ' . implode(' ', $attrs);
17504
+						$text .= ' '.implode(' ', $attrs);
17505 17505
 					}
17506 17506
 					$text .= '>';
17507 17507
 					$fragment->appendChild(new DOMText($text));
@@ -17516,7 +17516,7 @@  discard block
 block discarded – undo
17516 17516
 
17517 17517
 				if (!in_array($tag, array('script', 'style')))
17518 17518
 				{
17519
-					$fragment->appendChild(new DOMText('</' . $tag . '>'));
17519
+					$fragment->appendChild(new DOMText('</'.$tag.'>'));
17520 17520
 				}
17521 17521
 
17522 17522
 				$element->parentNode->replaceChild($fragment, $element);
@@ -17552,7 +17552,7 @@  discard block
 block discarded – undo
17552 17552
 
17553 17553
 	protected function strip_attr($attrib, $xpath)
17554 17554
 	{
17555
-		$elements = $xpath->query('//*[@' . $attrib . ']');
17555
+		$elements = $xpath->query('//*[@'.$attrib.']');
17556 17556
 
17557 17557
 		foreach ($elements as $element)
17558 17558
 		{
@@ -17959,19 +17959,19 @@  discard block
 block discarded – undo
17959 17959
 			{
17960 17960
 				if ($this->registry->call('Misc', 'is_isegment_nz_nc', array($key)))
17961 17961
 				{
17962
-					if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]))
17962
+					if (isset($this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]))
17963 17963
 					{
17964
-						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key]);
17965
-						$this->data['links'][$key] =& $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key];
17964
+						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = array_merge($this->data['links'][$key], $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key]);
17965
+						$this->data['links'][$key] = & $this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key];
17966 17966
 					}
17967 17967
 					else
17968 17968
 					{
17969
-						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY . $key] =& $this->data['links'][$key];
17969
+						$this->data['links'][SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY.$key] = & $this->data['links'][$key];
17970 17970
 					}
17971 17971
 				}
17972 17972
 				elseif (substr($key, 0, 41) === SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY)
17973 17973
 				{
17974
-					$this->data['links'][substr($key, 41)] =& $this->data['links'][$key];
17974
+					$this->data['links'][substr($key, 41)] = & $this->data['links'][$key];
17975 17975
 				}
17976 17976
 				$this->data['links'][$key] = array_unique($this->data['links'][$key]);
17977 17977
 			}
@@ -18734,7 +18734,7 @@  discard block
 block discarded – undo
18734 18734
 					$crc = current(unpack('v', substr($this->compressed_data, $this->position, 2)));
18735 18735
 
18736 18736
 					// Check the CRC matches
18737
-					if ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc)
18737
+					if ((crc32(substr($this->compressed_data, 0, $this->position))&0xFFFF) === $crc)
18738 18738
 					{
18739 18739
 						$this->position += 2;
18740 18740
 					}
@@ -18770,7 +18770,7 @@  discard block
 block discarded – undo
18770 18770
 			// Check ISIZE of data
18771 18771
 			$isize = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
18772 18772
 			$this->position += 4;
18773
-			if (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize))
18773
+			if (sprintf('%u', strlen($this->data)&0xFFFFFFFF) !== sprintf('%u', $isize))
18774 18774
 			{
18775 18775
 				return false;
18776 18776
 			}
Please login to merge, or discard this patch.
owner-statistics-time.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -9,22 +9,22 @@  discard block
 block discarded – undo
9 9
 }
10 10
 $Spotter = new Spotter();
11 11
 $SpotterArchive = new SpotterArchive();
12
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
13
-$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING));
14
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
15
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
12
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
13
+$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING));
14
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
15
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
16 16
 $filter = array();
17
-if ($year != '') $filter = array_merge($filter,array('year' => $year));
18
-if ($month != '') $filter = array_merge($filter,array('month' => $month));
17
+if ($year != '') $filter = array_merge($filter, array('year' => $year));
18
+if ($month != '') $filter = array_merge($filter, array('month' => $month));
19 19
 $archive = false;
20
-$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter);
20
+$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter);
21 21
 if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
22 22
 	$archive = true;
23
-	$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,"0,1", $sort,$filter);
23
+	$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, "0,1", $sort, $filter);
24 24
 }
25 25
 if (!empty($spotter_array))
26 26
 {
27
-	$title = sprintf(_("Most Common Time of Day of %s"),$spotter_array[0]['aircraft_owner']);
27
+	$title = sprintf(_("Most Common Time of Day of %s"), $spotter_array[0]['aircraft_owner']);
28 28
 	require_once('header.php');
29 29
 	print '<div class="info column">';
30 30
 	print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>';
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
 	include('owner-sub-menu.php');
36 36
 	print '<div class="column">';
37 37
 	print '<h2>'._("Most Common Time of Day").'</h2>';
38
-	print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>';
38
+	print '<p>'.sprintf(_("The statistic below shows the most common time of day of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>';
39 39
 
40 40
 	if ($archive === false) {
41
-		$hour_array = $Spotter->countAllHoursByOwner($owner,$filter);
41
+		$hour_array = $Spotter->countAllHoursByOwner($owner, $filter);
42 42
 	} else {
43
-		$hour_array = $SpotterArchive->countAllHoursByOwner($owner,$filter);
43
+		$hour_array = $SpotterArchive->countAllHoursByOwner($owner, $filter);
44 44
 	}
45 45
 	print '<link href="'.$globalURL.'/css/c3.min.css" rel="stylesheet" type="text/css">';
46 46
 	print '<script type="text/javascript" src="'.$globalURL.'/js/d3.min.js"></script>';
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 	$hour_data = '';
50 50
 	$hour_cnt = '';
51 51
 	$last = 0;
52
-	foreach($hour_array as $hour_item)
52
+	foreach ($hour_array as $hour_item)
53 53
 	{
54
-		while($last != $hour_item['hour_name']) {
54
+		while ($last != $hour_item['hour_name']) {
55 55
 			$hour_data .= '"'.$last.':00",';
56 56
 			$hour_cnt .= '0,';
57 57
 			$last++;
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		$hour_cnt .= $hour_item['hour_count'].',';
62 62
 	}
63 63
 	$hour_data = "['x',".substr($hour_data, 0, -1)."]";
64
-	$hour_cnt = "['flights',".substr($hour_cnt,0,-1)."]";
64
+	$hour_cnt = "['flights',".substr($hour_cnt, 0, -1)."]";
65 65
 	print 'c3.generate({
66 66
 	    bindto: "#chartHour",
67 67
 	    data: {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 		print '</thead>';
87 87
 		print '<tbody>';
88 88
 		$i = 1;
89
-		foreach($hour_array as $hour_item)
89
+		foreach ($hour_array as $hour_item)
90 90
 		{
91 91
 			print '<tr>';
92 92
 			print '<td>'.$hour_item['hour_name'].':00</td>';
Please login to merge, or discard this patch.
owner-statistics-registration.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -9,21 +9,21 @@  discard block
 block discarded – undo
9 9
 }
10 10
 $Spotter = new Spotter();
11 11
 $SpotterArchive = new SpotterArchive();
12
-$owner = urldecode(filter_input(INPUT_GET,'owner',FILTER_SANITIZE_STRING));
13
-$sort = filter_input(INPUT_GET,'sort',FILTER_SANITIZE_STRING);
14
-$year = filter_input(INPUT_GET,'year',FILTER_SANITIZE_NUMBER_INT);
15
-$month = filter_input(INPUT_GET,'month',FILTER_SANITIZE_NUMBER_INT);
12
+$owner = urldecode(filter_input(INPUT_GET, 'owner', FILTER_SANITIZE_STRING));
13
+$sort = filter_input(INPUT_GET, 'sort', FILTER_SANITIZE_STRING);
14
+$year = filter_input(INPUT_GET, 'year', FILTER_SANITIZE_NUMBER_INT);
15
+$month = filter_input(INPUT_GET, 'month', FILTER_SANITIZE_NUMBER_INT);
16 16
 $filter = array();
17
-if ($year != '') $filter = array_merge($filter,array('year' => $year));
18
-if ($month != '') $filter = array_merge($filter,array('month' => $month));
17
+if ($year != '') $filter = array_merge($filter, array('year' => $year));
18
+if ($month != '') $filter = array_merge($filter, array('month' => $month));
19 19
 $archive = false;
20
-$spotter_array = $Spotter->getSpotterDataByOwner($owner,"0,1", $sort,$filter);
20
+$spotter_array = $Spotter->getSpotterDataByOwner($owner, "0,1", $sort, $filter);
21 21
 if (empty($spotter_array) && isset($globalArchiveResults) && $globalArchiveResults) {
22
-	$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner,"0,1", $sort,$filter);
22
+	$spotter_array = $SpotterArchive->getSpotterDataByOwner($owner, "0,1", $sort, $filter);
23 23
 }
24 24
 if (!empty($spotter_array))
25 25
 {
26
-	$title = sprintf(_("Most Common Aircraft by Registration of %s"),$spotter_array[0]['aircraft_owner']);
26
+	$title = sprintf(_("Most Common Aircraft by Registration of %s"), $spotter_array[0]['aircraft_owner']);
27 27
 	require_once('header.php');
28 28
 	print '<div class="info column">';
29 29
 	print '<h1>'.$spotter_array[0]['aircraft_owner'].'</h1>';
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
 	include('owner-sub-menu.php');
35 35
 	print '<div class="column">';
36 36
 	print '<h2>'._("Most Common Aircraft by Registration").'</h2>';
37
-	print '<p>'.sprintf(_("The statistic below shows the most common aircraft by Registration of flights owned by <strong>%s</strong>."),$spotter_array[0]['aircraft_owner']).'</p>';
37
+	print '<p>'.sprintf(_("The statistic below shows the most common aircraft by Registration of flights owned by <strong>%s</strong>."), $spotter_array[0]['aircraft_owner']).'</p>';
38 38
 	if ($archive === false) {
39
-		$aircraft_array = $Spotter->countAllAircraftRegistrationByOwner($owner,$filter);
39
+		$aircraft_array = $Spotter->countAllAircraftRegistrationByOwner($owner, $filter);
40 40
 	} else {
41
-		$aircraft_array = $SpotterArchive->countAllAircraftRegistrationByOwner($owner,$filter);
41
+		$aircraft_array = $SpotterArchive->countAllAircraftRegistrationByOwner($owner, $filter);
42 42
 	}
43 43
 	
44 44
 	if (!empty($aircraft_array))
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 		print '</thead>';
56 56
 		print '<tbody>';
57 57
 		$i = 1;
58
-		foreach($aircraft_array as $aircraft_item)
58
+		foreach ($aircraft_array as $aircraft_item)
59 59
 		{
60 60
 			print '<tr>';
61 61
 			print '<td><strong>'.$i.'</strong></td>';
Please login to merge, or discard this patch.