From 18698df8e6772a85d104c839ea7a85b92aeb4877 Mon Sep 17 00:00:00 2001 From: Tema1d <84407490+Tema1d@users.noreply.github.com> Date: Tue, 10 Jun 2025 12:29:40 +0300 Subject: [PATCH] Add files via upload --- src/config.php | 116 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 src/config.php diff --git a/src/config.php b/src/config.php new file mode 100644 index 00000000..afc3247b --- /dev/null +++ b/src/config.php @@ -0,0 +1,116 @@ + + * string(7) "Caption" + * [1] => + * string(20) "(UTC+09:30) Adelaide" + * [2] => + * string(0) "" + * } + */ + exec("wmic timezone get Caption", $output); + + $string = trim(implode("\n", $output)); + + //Detect the Time Zone string + preg_match($regex, $string, $matches); + + if(!isset($matches[2]) or ($timezone = parseOffset($matches[2])) === false){ + $timezone = 'UTC'; + } + if(date_default_timezone_set($timezone)){ + ini_set("date.timezone", $timezone); + } + }else{ + exec("date +%s", $t); + $offset = round((intval(trim($t[0])) - time()) / 60) * 60; + $daylight = (int) date("I"); + $d = timezone_name_from_abbr("", $offset, $daylight); + @ini_set("date.timezone", $d); + date_default_timezone_set($d); + } +}else{ + $d = @date_default_timezone_get(); + if(!str_contains($d, "/")){ + $d = timezone_name_from_abbr($d); + @ini_set("date.timezone", $d); + date_default_timezone_set($d); + } +} + +gc_enable(); +error_reporting(E_ALL | E_STRICT); +ini_set("allow_url_fopen", 1); +ini_set("display_errors", 1); +ini_set("display_startup_errors", 1); +ini_set("default_charset", "utf-8"); +if(defined("POCKETMINE_COMPILE") and POCKETMINE_COMPILE === true){ + define("FILE_PATH", realpath(dirname(__FILE__)) . "/"); +}else{ + define("FILE_PATH", realpath(dirname(__FILE__) . "/../") . "/"); +} +set_include_path(get_include_path() . PATH_SEPARATOR . FILE_PATH); + +ini_set("memory_limit", "256M"); //Default +define("LOG", true); +define("START_TIME", microtime(true)); +define("MAJOR_VERSION", "1.1.1dev"); +define("CODENAME", "Nostalgia"); //i'm not very creative - kotyaralih, yeah - tema1d. +define("CURRENT_MINECRAFT_VERSION", "v0.8.1 alpha"); +define("CURRENT_API_VERSION", "12.2"); +define("CURRENT_PHP_VERSION", "8.0"); +$gitsha1 = false; +if(file_exists(FILE_PATH . ".git/refs/heads/master")){ //Found Git information! + define("GIT_COMMIT", strtolower(trim(file_get_contents(FILE_PATH . ".git/refs/heads/master")))); +}else{ //Unknown :( + define("GIT_COMMIT", str_repeat("00", 20)); +}