<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use ModStart\Core\Exception\BizException; class MetaUtil { private static $supportKeys = array('APP_NAME'); public static function get($VFU9l) { goto GQarS; xcU_3: if (isset($DI9nj[$VFU9l])) { return $DI9nj[$VFU9l]; } goto gz051; X0kXr: BizException::throwsIf('Meta信息不包含' . $VFU9l, !in_array($VFU9l, self::$supportKeys)); goto UgV4z; gz051: switch ($VFU9l) { case 'APP_NAME': if (defined('\\App\\Constant\\AppConstant::APP_NAME')) { return \App\Constant\AppConstant::APP_NAME; } else { if (defined('\\App\\Constant\\AppConstant::APP')) { return \App\Constant\AppConstant::APP; } } return 'UnknownAppName'; } goto G4SDq; UgV4z: if (null === $DI9nj) { goto oFuMz; oFuMz: $Jtt5u = base_path('meta.json'); goto F0j1Z; l6kHW: if (empty($DI9nj)) { $DI9nj = array(); } goto srLRj; F0j1Z: if (file_exists($Jtt5u)) { $DI9nj = @json_decode(file_get_contents($Jtt5u), true); } goto l6kHW; srLRj: } goto xcU_3; G4SDq: return '-'; goto xfOfo; GQarS: static $DI9nj = null; goto X0kXr; xfOfo: } }