本文整理汇总了PHP中DataAccess::GetSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP DataAccess::GetSetting方法的具体用法?PHP DataAccess::GetSetting怎么用?PHP DataAccess::GetSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccess
的用法示例。
在下文中一共展示了DataAccess::GetSetting方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filter
function filter($value)
{
static $dbVersion;
if (!isset($dbVersion)) {
$dbVersion = DataAccess::GetSetting("DATABASE_VERSION", "0.0");
}
return version_compare($value["version"], $dbVersion) > 0;
}
示例2: Execute
public function Execute()
{
$viewData = array();
// no user specified - redirect to user list page
if (!getCurrentUser()) {
Helper::Redirect("users.php");
}
// user is hidden - redirect to user list page
if (!getCurrentUser()->Visible) {
Helper::Redirect("users.php");
}
// the requested map
$map = new Map();
$map->Load($_GET["map"]);
if (!$map->ID) {
die("The map has been removed.");
}
DataAccess::UnprotectMapIfNeeded($map);
if (Helper::MapIsProtected($map)) {
die("The map is protected until " . date("Y-m-d H:i:s", Helper::StringToTime($map->ProtectedUntil, true)) . ".");
}
if ($map->UserID != getCurrentUser()->ID) {
die;
}
$viewData["Comments"] = DataAccess::GetCommentsByMapId($map->ID);
$viewData["Name"] = $map->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($map->Date, true)) . ')';
// previous map in archive
$previous = DataAccess::GetPreviousMap(getCurrentUser()->ID, $map->ID, Helper::GetLoggedInUserID());
$viewData["PreviousName"] = $previous == null ? null : $previous->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($previous->Date, true)) . ')';
// next map in archive
$next = DataAccess::GetNextMap(getCurrentUser()->ID, $map->ID, Helper::GetLoggedInUserID());
$viewData["NextName"] = $next == null ? null : $next->Name . ' (' . date(__("DATE_FORMAT"), Helper::StringToTime($next->Date, true)) . ')';
$size = $map->GetMapImageSize();
$viewData["ImageWidth"] = $size["Width"];
$viewData["ImageHeight"] = $size["Height"];
DataAccess::IncreaseMapViews($map);
$viewData["Map"] = $map;
$viewData["BackUrl"] = isset($_SERVER["HTTP_REFERER"]) && basename($_SERVER["HTTP_REFERER"]) == "users.php" ? "users.php" : "index.php?" . Helper::CreateQuerystring(getCurrentUser());
$viewData["Previous"] = $previous;
$viewData["Next"] = $next;
$viewData["ShowComments"] = isset($_GET["showComments"]) && ($_GET["showComments"] = true) || !__("COLLAPSE_VISITOR_COMMENTS");
$viewData["FirstMapImageName"] = Helper::GetMapImage($map);
if ($map->BlankMapImage) {
$viewData["SecondMapImageName"] = Helper::GetBlankMapImage($map);
}
$viewData["QuickRouteJpegExtensionData"] = $map->GetQuickRouteJpegExtensionData();
if (isset($viewData["QuickRouteJpegExtensionData"]) && $viewData["QuickRouteJpegExtensionData"]->IsValid) {
$categories = DataAccess::GetCategoriesByUserID(getCurrentUser()->ID);
$viewData["OverviewMapData"][] = Helper::GetOverviewMapData($map, true, false, false, $categories);
$viewData["GoogleMapsUrl"] = "http://maps.google.com/maps" . "?q=" . urlencode(Helper::GlobalPath("export_kml.php?id=" . $map->ID . "&format=kml")) . "&language=" . Session::GetLanguageCode();
}
if (USE_3DRERUN == '1' && DataAccess::GetSetting("LAST_WORLDOFO_CHECK_DOMA_TIME", "0") + RERUN_FREQUENCY * 3600 < time()) {
$viewData["RerunMaps"] = Helper::GetMapsForRerunRequest();
$viewData["TotalRerunMaps"] = count(explode(",", $viewData["RerunMaps"]));
$viewData["ProcessRerun"] = true;
}
return $viewData;
}
示例3: Execute
public function Execute()
{
$viewData = array();
// load session
session_start();
Helper::SetUser(null);
$errors = array();
// load strings
Session::SetLanguageStrings(Helper::GetLanguageStrings());
// check php version
if (version_compare(phpversion(), "5.0.0") < 0) {
$errors[] = sprintf(__("TOO_OLD_PHP_VERSION"), phpversion());
}
if (count($errors) == 0) {
if (Helper::DatabaseVersionIsValid()) {
$errors[] = __("SITE_ALREADY_CREATED");
}
if (count($errors) == 0) {
$previousDatabaseVersion = DataAccess::GetSetting("DATABASE_VERSION", "0.0");
// create or update database
$result = executeDatabaseScripts();
$errors = $result["errors"];
// chmod only has effect on linux/unix systems
@mkdir(Helper::LocalPath(MAP_IMAGE_PATH));
@chmod(Helper::LocalPath(MAP_IMAGE_PATH), 0777);
@mkdir(Helper::LocalPath(TEMP_FILE_PATH));
@chmod(Helper::LocalPath(TEMP_FILE_PATH), 0777);
if (count($errors) == 0) {
if ($previousDatabaseVersion == "0.0") {
// created databse
Helper::LogUsage("createSite", "version=" . DOMA_VERSION);
Helper::LoginAdmin(ADMIN_USERNAME, ADMIN_PASSWORD);
} else {
// updated database
Helper::LogUsage("updateSite", "oldVersion={$previousDatabaseVersion}&newVersion=" . DOMA_VERSION);
// redirect to originally requested page
$redirectUrl = $_GET["redirectUrl"];
if (!isset($redirectUrl)) {
$redirectUrl = "users.php";
}
Helper::Redirect($redirectUrl);
}
}
}
}
$viewData["Errors"] = $errors;
return $viewData;
}
示例4: getMapCornerPositionsAndRouteCoordinates
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);
}
示例5: DatabaseVersionIsValid
public static function DatabaseVersionIsValid()
{
$databaseVersion = Session::GetDatabaseVersion();
if ($databaseVersion == null || version_compare($databaseVersion, DOMA_VERSION) < 0) {
$databaseVersion = DataAccess::GetSetting("DATABASE_VERSION", "0.0");
Session::SetDatabaseVersion($databaseVersion);
}
return version_compare($databaseVersion, DOMA_VERSION) >= 0;
}