<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use ModStart\Data\FileManager; class EnvUtil { public static function parse($Jtt5u) { goto u2YCw; v1Jhe: if (file_exists($Jtt5u)) { foreach (explode('
', file_get_contents($Jtt5u)) as $Qm87n) { if ($Qm87n = trim($Qm87n)) { goto XlLD0; Me0ES: array_shift($QhMxe); goto pW4lv; wJzt7: $QhMxe = explode('=', $Qm87n); goto pvjD0; gjWRE: $gkAzG[$pztz4] = $Q0rz2; goto FKUfv; Uz1dh: switch (strtolower($Q0rz2)) { case 'true': case '(true)': $Q0rz2 = true; break; case 'false': case '(false)': $Q0rz2 = false; break; case 'empty': case '(empty)': $Q0rz2 = ''; break; case 'null': case '(null)': $Q0rz2 = null; break; } goto gjWRE; XlLD0: if (substr($Qm87n, 0, 1) === '#') { continue; } goto wJzt7; pvjD0: $pztz4 = trim($QhMxe[0]); goto Me0ES; pW4lv: $Q0rz2 = trim(join('=', $QhMxe)); goto Uz1dh; FKUfv: } } } goto iGLzb; u2YCw: $gkAzG = array(); goto v1Jhe; iGLzb: return $gkAzG; goto qr6bT; qr6bT: } public static function all($Jtt5u = null) { goto DzQ9E; PznPN: return self::parse($Jtt5u); goto bAfef; QEn8_: if (!empty($rn24R)) { return $rn24R; } goto Fwi9I; DzQ9E: global $rn24R; goto QEn8_; Fwi9I: if (null === $Jtt5u) { $Jtt5u = base_path('.env'); } goto PznPN; bAfef: } public static function env($VFU9l) { switch ($VFU9l) { case 'uploadMaxSize': goto TCGQE; YaX_t: if (empty($YXIem)) { return 0; } goto Xiv7m; INWkd: return min(max($IiMdC, 100 * 1024), 2 * 1024 * 1024); goto OxdSQ; k9Ykb: $YXIem = @ini_get('upload_max_filesize'); goto YaX_t; Que3e: if (empty($CwbXI)) { return 0; } goto K0nSO; KSNhy: $CwbXI = FileUtil::formattedSizeToBytes($CwbXI); goto Pz2bg; TCGQE: if (FileManager::$slowDebug) { return 100; } goto k9Ykb; zEZ4m: $IiMdC -= 10 * 1024; goto INWkd; K0nSO: $YXIem = FileUtil::formattedSizeToBytes($YXIem); goto KSNhy; Xiv7m: $CwbXI = @ini_get('post_max_size'); goto Que3e; Pz2bg: $IiMdC = min($YXIem, $CwbXI); goto zEZ4m; OxdSQ: } return null; } public static function iniFileConfig($VFU9l) { return @ini_get($VFU9l); } public static function securityKey() { goto JiOoW; G7XUk: if (null === $VFU9l) { $VFU9l = md5(SerializeUtil::jsonEncode(config('env'))); } goto H42HT; JiOoW: static $VFU9l = null; goto G7XUk; H42HT: return $VFU9l; goto Na_58; Na_58: } }