示例#1
0
require_once dirname(__FILE__) . '/../require/settings.php';
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";
示例#2
0
#!/usr/bin/php
<?php 
/**
* This script is used to update databases with external data.
* Should be run as cronjob no more than every 2 weeks if NOTAM is not activated, else once a day.
*/
require_once dirname(__FILE__) . '/../require/settings.php';
require dirname(__FILE__) . '/../install/class.update_db.php';
if (isset($globalNOTAM) && $globalNOTAM && update_db::check_last_notam_update()) {
    echo "update 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)) {
    update_db::update_all();
    #    require_once('../require/class.Spotter.php');
    #    Spotter::updateFieldsFromOtherTables();
    update_db::insert_last_update();
} elseif (isset($globalDebug) && $globalDebug && (!isset($globalIVAO) || !$globalIVAO)) {
    echo "DB are populated with external data only every 15 days ! Files are not updated more often.\n";
}