@@ -9,7 +9,9 @@ discard block |
||
9 | 9 | if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { |
10 | 10 | exec("ps ux", $output, $result); |
11 | 11 | $j = 0; |
12 | - foreach ($output as $line) if(strpos($line, dirname(__FILE__)."/update_db.php") && !strpos($line, "sh ") && !strpos($line, "sudo ")) $j++; |
|
12 | + foreach ($output as $line) { |
|
13 | + if(strpos($line, dirname(__FILE__)."/update_db.php") && !strpos($line, "sh ") && !strpos($line, "sudo ")) $j++; |
|
14 | + } |
|
13 | 15 | if ($j > 1) { |
14 | 16 | echo "Script is already runnning..."; |
15 | 17 | die(); |
@@ -29,14 +31,18 @@ discard block |
||
29 | 31 | $update_db->update_notam(); |
30 | 32 | } |
31 | 33 | $update_db->insert_last_notam_update(); |
32 | - } elseif (isset($globalDebug) && $globalDebug && isset($globalNOTAM) && $globalNOTAM) echo "NOTAM are only updated once a day.\n"; |
|
34 | + } elseif (isset($globalDebug) && $globalDebug && isset($globalNOTAM) && $globalNOTAM) { |
|
35 | + echo "NOTAM are only updated once a day.\n"; |
|
36 | + } |
|
33 | 37 | if ($update_db->check_last_update() && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
34 | 38 | $update_db->update_all(); |
35 | 39 | // require_once(dirname(__FILE__).'/../require/class.Spotter.php'); |
36 | 40 | // $Spotter = new Spotter(); |
37 | 41 | // $Spotter->updateFieldsFromOtherTables(); |
38 | 42 | $update_db->insert_last_update(); |
39 | - } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) echo "DB are populated with external data only every 15 days ! Files are not updated more often.\n"; |
|
43 | + } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalphpVMS) || !$globalphpVMS) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) { |
|
44 | + echo "DB are populated with external data only every 15 days ! Files are not updated more often.\n"; |
|
45 | + } |
|
40 | 46 | if (isset($globalWaypoints) && $globalWaypoints && $update_db->check_last_airspace_update()) { |
41 | 47 | echo "Check if new airspace version exist..."; |
42 | 48 | echo $update_db->update_airspace_fam(); |
@@ -45,8 +51,11 @@ discard block |
||
45 | 51 | if (isset($globalGeoid) && $globalGeoid && $update_db->check_last_geoid_update()) { |
46 | 52 | echo "Check if new geoid version exist..."; |
47 | 53 | $error = $update_db->update_geoid_fam(); |
48 | - if ($error == '') $update_db->insert_last_geoid_update(); |
|
49 | - else echo $error; |
|
54 | + if ($error == '') { |
|
55 | + $update_db->insert_last_geoid_update(); |
|
56 | + } else { |
|
57 | + echo $error; |
|
58 | + } |
|
50 | 59 | } |
51 | 60 | if (isset($globalMarine) && $globalMarine && $update_db->check_last_marine_identity_update()) { |
52 | 61 | echo "Check if new marine identity version exist..."; |
@@ -64,13 +73,17 @@ discard block |
||
64 | 73 | //echo "Done"; |
65 | 74 | } |
66 | 75 | $update_db->insert_last_owner_update(); |
67 | - } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) echo "Owner are only updated every 15 days.\n"; |
|
76 | + } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
|
77 | + echo "Owner are only updated every 15 days.\n"; |
|
78 | + } |
|
68 | 79 | |
69 | 80 | if ($update_db->check_last_airlines_update() && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
70 | 81 | echo "Updating airlines...\n"; |
71 | 82 | echo $update_db->update_airlines_fam(); |
72 | 83 | $update_db->insert_last_airlines_update(); |
73 | - } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) echo "Airlines are only updated every 15 days.\n"; |
|
84 | + } elseif (isset($globalDebug) && $globalDebug && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
|
85 | + echo "Airlines are only updated every 15 days.\n"; |
|
86 | + } |
|
74 | 87 | |
75 | 88 | if (isset($globalAccidents) && $globalAccidents && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
76 | 89 | require_once(dirname(__FILE__).'/../require/class.Accident.php'); |
@@ -79,7 +92,9 @@ discard block |
||
79 | 92 | if ($Accident->check_last_accidents_update()) { |
80 | 93 | $Accident->download_update(); |
81 | 94 | $Accident->insert_last_accidents_update(); |
82 | - } else echo "Accidents are updated once a day.\n"; |
|
95 | + } else { |
|
96 | + echo "Accidents are updated once a day.\n"; |
|
97 | + } |
|
83 | 98 | } |
84 | 99 | |
85 | 100 | } |
@@ -92,7 +107,9 @@ discard block |
||
92 | 107 | if ($METAR->check_last_update()) { |
93 | 108 | $METAR->addMETARCycle(); |
94 | 109 | $METAR->insert_last_update(); |
95 | - } else echo "METAR are only updated every 30 minutes.\n"; |
|
110 | + } else { |
|
111 | + echo "METAR are only updated every 30 minutes.\n"; |
|
112 | + } |
|
96 | 113 | } |
97 | 114 | |
98 | 115 | if (isset($globalSchedules) && $globalSchedules && $update_db->check_last_schedules_update() && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
@@ -100,8 +117,10 @@ discard block |
||
100 | 117 | //$update_db->update_oneworld(); |
101 | 118 | $update_db->update_skyteam(); |
102 | 119 | $update_db->insert_last_schedules_update(); |
103 | - } elseif (isset($globalDebug) && $globalDebug && isset($globalOwner) && $globalOwner && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) echo "Schedules are only updated every 15 days.\n"; |
|
104 | -} |
|
120 | + } elseif (isset($globalDebug) && $globalDebug && isset($globalOwner) && $globalOwner && (!isset($globalVA) || !$globalVA) && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM) && (!isset($globalphpVMS) || !$globalphpVMS)) { |
|
121 | + echo "Schedules are only updated every 15 days.\n"; |
|
122 | + } |
|
123 | + } |
|
105 | 124 | |
106 | 125 | if (isset($globalArchiveMonths) && $globalArchiveMonths > 0) { |
107 | 126 | echo "Updating statistics and archive old data...\n"; |