<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use ModStart\Data\FileManager; class EnvUtil { public static function parse($WF06r) { goto Oh7Oo; Oh7Oo: $wdPwZ = array(); goto b3peN; Sb7A1: return $wdPwZ; goto zV5Du; b3peN: if (file_exists($WF06r)) { foreach (explode('
', file_get_contents($WF06r)) as $BGbF6) { if ($BGbF6 = trim($BGbF6)) { goto y7I0J; yAj0M: $knQyJ = trim(join('=', $TsqdX)); goto eTy78; et_Kj: $lxIPA = trim($TsqdX[0]); goto S8hhq; y7I0J: if (substr($BGbF6, 0, 1) === '#') { continue; } goto ZUhV_; S8hhq: array_shift($TsqdX); goto yAj0M; ZUhV_: $TsqdX = explode('=', $BGbF6); goto et_Kj; eTy78: switch (strtolower($knQyJ)) { case 'true': case '(true)': $knQyJ = true; break; case 'false': case '(false)': $knQyJ = false; break; case 'empty': case '(empty)': $knQyJ = ''; break; case 'null': case '(null)': $knQyJ = null; break; } goto jjZT5; jjZT5: $wdPwZ[$lxIPA] = $knQyJ; goto KXOHH; KXOHH: } } } goto Sb7A1; zV5Du: } public static function all($WF06r = null) { goto jJiHu; H_7BL: return self::parse($WF06r); goto giWW0; jJiHu: global $ZPjLh; goto OOkML; p24D9: if (null === $WF06r) { $WF06r = base_path('.env'); } goto H_7BL; OOkML: if (!empty($ZPjLh)) { return $ZPjLh; } goto p24D9; giWW0: } public static function env($oMJcb) { switch ($oMJcb) { case 'uploadMaxSize': goto sauKR; sauKR: if (FileManager::$slowDebug) { return 100; } goto vk4mf; IeLR_: return min(max($Klf84, 100 * 1024), 2 * 1024 * 1024); goto DwHGd; WikDv: $Klf84 = min($ZCUtZ, $sHFE_); goto tguNL; ARqxn: $sHFE_ = @ini_get('post_max_size'); goto y6XIm; y6XIm: if (empty($sHFE_)) { return 0; } goto HVsWw; HVsWw: $ZCUtZ = FileUtil::formattedSizeToBytes($ZCUtZ); goto C25Pp; tguNL: $Klf84 -= 10 * 1024; goto IeLR_; pG4UL: if (empty($ZCUtZ)) { return 0; } goto ARqxn; C25Pp: $sHFE_ = FileUtil::formattedSizeToBytes($sHFE_); goto WikDv; vk4mf: $ZCUtZ = @ini_get('upload_max_filesize'); goto pG4UL; DwHGd: } return null; } public static function iniFileConfig($oMJcb) { return @ini_get($oMJcb); } public static function securityKey() { goto NkcQt; NcEJ8: return $oMJcb; goto ZREjv; n30OX: if (null === $oMJcb) { $oMJcb = md5(SerializeUtil::jsonEncode(config('env'))); } goto NcEJ8; NkcQt: static $oMJcb = null; goto n30OX; ZREjv: } }