Example #1
0
function executeDatabaseScripts()
{
    $allScripts = getScripts();
    $errors = array();
    foreach ($allScripts as $s) {
        // check whether scripts should be run
        if (isset($s["conditionFunction"])) {
            $f = $s["conditionFunction"];
            $runScripts = $f($s["conditionData"]);
        } else {
            $runScripts = true;
        }
        if ($runScripts) {
            foreach ($s["scripts"] as $script) {
                mysql_query($script);
                Helper::WriteToLog($script);
                $error = getMySQLErrorIfAny();
                if ($error) {
                    Helper::WriteToLog($error);
                    $errors[] = $error;
                }
            }
        }
    }
    if (count($errors) == 0) {
        DataAccess::SetSetting("DATABASE_VERSION", DOMA_VERSION);
    }
    return array("errors" => $errors);
}
Example #2
0
                            if (isset($_GET["rerunid"]) && is_numeric($_GET["rerunid"])) {
                                $rerunid = $_GET["rerunid"];
                                $map->RerunID = $rerunid;
                                if ($rerunid == 0) {
                                    $map->RerunTries = RERUN_MAX_TRIES;
                                    //map is not geocoded - avoid to send request again
                                } else {
                                    $map->RerunTries = 0;
                                }
                                $map->Save();
                            }
                        }
                    }
                }
            }
        }
        break;
    case "saveLastRerunCheck":
        if (USE_3DRERUN == "1" && DataAccess::GetSetting("LAST_WORLDOFO_CHECK_DOMA_TIME", "0") + RERUN_FREQUENCY * 3600 < time()) {
            DataAccess::SetSetting("LAST_WORLDOFO_CHECK_DOMA_TIME", time());
        }
        break;
}
function getMapCornerPositionsAndRouteCoordinates($id)
{
    $map = new Map();
    $map->Load($id);
    $user = DataAccess::GetUserByID($map->UserID);
    $categories = DataAccess::GetCategoriesByUserID($user->ID);
    return Helper::GetOverviewMapData($map, true, false, false, $categories);
}