$_SESSION['install'] = 'sources';
             $_SESSION['next'] = 'Insert data in source table';
         }
         $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
         print json_encode($result);
     }
 } else {
     if (isset($_SESSION['install']) && $_SESSION['install'] == 'owner') {
         if (!is_writable('tmp')) {
             $error = 'The directory <i>install/tmp</i> must be writable.';
             $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
             print json_encode($result);
         } else {
             include_once 'class.update_db.php';
             $globalDebug = FALSE;
             $error = update_db::update_owner();
             $_SESSION['done'] = array_merge($_SESSION['done'], array('Populate owner table with externals data'));
             $_SESSION['install'] = 'sources';
             $_SESSION['next'] = 'Insert data in source table';
             $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
             print json_encode($result);
         }
     } else {
         if (isset($_SESSION['install']) && $_SESSION['install'] == 'notam') {
             if (!is_writable('tmp')) {
                 $error = 'The directory <i>install/tmp</i> must be writable.';
                 $result = array('error' => $error, 'done' => $_SESSION['done'], 'next' => $_SESSION['next'], 'install' => $_SESSION['install']);
                 print json_encode($result);
             } else {
                 include_once 'class.update_db.php';
                 $globalDebug = FALSE;
Example #2
0
require dirname(__FILE__) . '/../install/class.update_db.php';
$update_db = new update_db();
if (isset($globalNOTAM) && $globalNOTAM && $update_db->check_last_notam_update()) {
    echo "updating NOTAM...";
    $update_db->update_notam();
    $update_db->insert_last_notam_update();
} elseif (isset($globalDebug) && $globalDebug && isset($globalNOTAM) && $globalNOTAM) {
    echo "NOTAM are only updated once a day.\n";
}
if ($update_db->check_last_update() && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) {
    $update_db->update_all();
    require_once '../require/class.Spotter.php';
    $Spotter = new Spotter();
    $Spotter->updateFieldsFromOtherTables();
    $update_db->insert_last_update();
} elseif (isset($globalDebug) && $globalDebug && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) {
    echo "DB are populated with external data only every 15 days ! Files are not updated more often.\n";
}
if (isset($globalMETAR) && isset($globalMETARcycle) && $globalMETAR && $globalMETARcycle) {
    echo "updating METAR...";
    require_once '../require/class.METAR.php';
    $METAR = new METAR();
    $METAR->addMETARCycle();
}
if (isset($globalOwner) && $globalOwner && $update_db->check_last_owner_update() && (!isset($globalIVAO) || !$globalIVAO) && (!isset($globalVATSIM) || !$globalVATSIM)) {
    echo "Updating private aircraft's owners...";
    $update_db->update_owner();
    $update_db->insert_last_owner_update();
} elseif (isset($globalDebug) && $globalDebug && isset($globalOwner) && $globalOwner && (!isset($globalIVAO) || !$globalIVAO)) {
    echo "Owner are only updated every 15 days.\n";
}
Example #3
0
}
require 'class.update_db.php';
echo "Populate all tables...\n";
update_db::update_all();
echo "\nInstall waypoints...(VERY slow!)";
update_db::update_waypoints();
echo "Done !\n";
echo "Install airspace...";
update_db::update_airspace();
echo "Done !\n";
echo "Install countries...";
update_db::update_countries();
echo "Done !\n";
if (isset($globalOwner) && $globalOwner) {
    echo "Install private owners...";
    update_db::update_owner();
    echo "Done !\n";
}
/*
if (isset($globalIVAO) && $globalIVAO) {
    echo "Install IVAO airlines and logos...";
    update_db::update_IVAO();
	echo "Done !\n";
}
*/
if (isset($globalNOTAM) && $globalNOTAM && isset($globalNOTAMSource) && $globalNOTAMSource != '') {
    echo "Install NOTAM from notaminfo.com...";
    update_db:
    update_notam();
    echo "Done !\n";
}