Update config.php

This commit is contained in:
ArkQuark 2022-03-07 16:19:49 +03:00
parent 28fef6cd36
commit 2f44e5e76d

18
src/config.php Executable file → Normal file
View file

@ -21,10 +21,13 @@
set_time_limit(0); set_time_limit(0);
if(ini_get("date.timezone") == ""){ //No Timezone set
date_default_timezone_set("GMT"); date_default_timezone_set("GMT");
if(strpos(" ".strtoupper(php_uname("s")), " WIN") !== false){ if(strpos(" ".strtoupper(php_uname("s")), " WIN") !== false){
$time = time(); $time = time();
$time -= $time % 60; $time -= $time % 60;
//TODO: Parse different time & date formats by region. ¬¬ world
//Example: USA
exec("time.exe /T", $hour); exec("time.exe /T", $hour);
$i = array_map("intval", explode(":", trim($hour[0]))); $i = array_map("intval", explode(":", trim($hour[0])));
exec("date.exe /T", $date); exec("date.exe /T", $date);
@ -36,8 +39,17 @@ if(strpos(" ".strtoupper(php_uname("s")), " WIN") !== false){
} }
$daylight = (int) date("I"); $daylight = (int) date("I");
$d = timezone_name_from_abbr("", $offset, $daylight);
date_default_timezone_set(timezone_name_from_abbr("", $offset, $daylight)); @ini_set("date.timezone", $d);
date_default_timezone_set($d);
}else{
$d = @date_default_timezone_get();
if(strpos($d, "/") === false){
$d = timezone_name_from_abbr($d);
@ini_set("date.timezone", $d);
date_default_timezone_set($d);
}
}
gc_enable(); gc_enable();
error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
@ -56,7 +68,7 @@ ini_set("memory_limit", "128M"); //Default
define("LOG", true); define("LOG", true);
define("START_TIME", microtime(true)); define("START_TIME", microtime(true));
define("MAJOR_VERSION", "1.0 (Alpha_1.3.12)"); define("MAJOR_VERSION", "1.0 (Alpha_1.3.12)");
define("CODENAME", "懐かしさ (Nostalgia)"); define("CODENAME", "懐かしさ (Nostalgia)"); //i'm not very creative - kotyaralih
define("CURRENT_MINECRAFT_VERSION", "v0.8.1 alpha"); define("CURRENT_MINECRAFT_VERSION", "v0.8.1 alpha");
define("CURRENT_API_VERSION", 12); define("CURRENT_API_VERSION", 12);
define("CURRENT_PHP_VERSION", "5.5"); define("CURRENT_PHP_VERSION", "5.5");