<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use ModStart\Data\FileManager; class EnvUtil { public static function parse($ypGny) { goto wm3Ss; wm3Ss: $u_vzo = array(); goto YLgz0; Qz24H: return $u_vzo; goto nJvfk; YLgz0: if (file_exists($ypGny)) { foreach (explode('
', file_get_contents($ypGny)) as $PWzv9) { if ($PWzv9 = trim($PWzv9)) { goto w8V55; l7g7I: $Xz28r = trim(join('=', $q26cr)); goto JlXfO; cJt7l: array_shift($q26cr); goto l7g7I; Dt0wX: $q26cr = explode('=', $PWzv9); goto QrcLU; dWOpA: $u_vzo[$B34tD] = $Xz28r; goto H8re7; w8V55: if (substr($PWzv9, 0, 1) === '#') { continue; } goto Dt0wX; JlXfO: switch (strtolower($Xz28r)) { case 'true': case '(true)': $Xz28r = true; break; case 'false': case '(false)': $Xz28r = false; break; case 'empty': case '(empty)': $Xz28r = ''; break; case 'null': case '(null)': $Xz28r = null; break; } goto dWOpA; QrcLU: $B34tD = trim($q26cr[0]); goto cJt7l; H8re7: } } } goto Qz24H; nJvfk: } public static function all($ypGny = null) { goto JeDdb; JeDdb: global $aXjEi; goto cWutW; cWutW: if (!empty($aXjEi)) { return $aXjEi; } goto B4qTc; hJDB5: return self::parse($ypGny); goto vkTOJ; B4qTc: if (null === $ypGny) { $ypGny = base_path('.env'); } goto hJDB5; vkTOJ: } public static function env($l6tBV) { switch ($l6tBV) { case 'uploadMaxSize': goto cRnqO; sRpP7: $lXu5I = @ini_get('upload_max_filesize'); goto jDPh3; q8wL9: if (empty($pPUQN)) { return 0; } goto dSa9o; jDPh3: if (empty($lXu5I)) { return 0; } goto pIvzC; AZCX9: $DlhlZ -= 10 * 1024; goto zxW1N; cRnqO: if (FileManager::$slowDebug) { return 100; } goto sRpP7; S4iWY: $DlhlZ = min($lXu5I, $pPUQN); goto AZCX9; zxW1N: return min(max($DlhlZ, 100 * 1024), 2 * 1024 * 1024); goto QQRkf; YZmT1: $pPUQN = FileUtil::formattedSizeToBytes($pPUQN); goto S4iWY; pIvzC: $pPUQN = @ini_get('post_max_size'); goto q8wL9; dSa9o: $lXu5I = FileUtil::formattedSizeToBytes($lXu5I); goto YZmT1; QQRkf: } return null; } public static function iniFileConfig($l6tBV) { return @ini_get($l6tBV); } public static function securityKey() { goto Ys2L3; NqUyS: if (null === $l6tBV) { $l6tBV = md5(SerializeUtil::jsonEncode(config('env'))); } goto bLfRh; Ys2L3: static $l6tBV = null; goto NqUyS; bLfRh: return $l6tBV; goto qhbuf; qhbuf: } }