<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart; use Illuminate\Contracts\View\Factory; use Illuminate\Foundation\Application; use Illuminate\Support\Facades\Cache; use Illuminate\View\View; use ModStart\Core\Exception\BizException; use ModStart\Module\ModuleManager; use ModStart\Support\Manager\FieldManager; use ModStart\Support\Manager\WidgetManager; class ModStart { public static $version = '3.8.0'; public static $script = array(); public static $style = array(); public static $css = array(); public static $js = array(); public static function cacheKey($oMJcb) { goto IB2NI; Kd1MW: if (null === $n0mgm) { $n0mgm = md5(__DIR__); } goto zp__W; IB2NI: static $n0mgm = null; goto Kd1MW; zp__W: return join(':', array($oMJcb, $n0mgm)); goto hMdDl; hMdDl: } public static function clearCache() { goto JSWsT; JSWsT: Cache::forget(self::cacheKey('ModStartServiceProviders')); goto cyC6r; HJYTb: self::safeCleanOptimizedFile('bootstrap/cache/compiled.php'); goto y8Jcc; wc8oF: Cache::forget(self::cacheKey('ModStartOpenApiRoutes')); goto qejUq; qejUq: Cache::forget(self::cacheKey('ModStartWebRoutes')); goto HJYTb; NjO6D: Cache::forget(self::cacheKey('ModStartApiRoutes')); goto wc8oF; GIzp0: self::safeCleanOptimizedFile('bootstrap/cache/config.php'); goto Hi3bh; cyC6r: Cache::forget(self::cacheKey('ModStartAdminRoutes')); goto NjO6D; y8Jcc: self::safeCleanOptimizedFile('bootstrap/cache/services.json'); goto GIzp0; Hi3bh: if (method_exists(ModuleManager::class, 'hotReloadSystemConfig')) { ModuleManager::hotReloadSystemConfig(); } goto pTIAZ; pTIAZ: } private static function safeCleanOptimizedFile($WF06r) { if (file_exists($QTKvb = base_path($WF06r))) { @unlink($QTKvb); } } public static function scriptFile($w2_6J, $I9bqE = false) { if (!$I9bqE) { $w2_6J = base_path($w2_6J); } try { return self::script(file_get_contents($w2_6J)); } catch (\Exception $Sgh1N) { BizException::throws('FileNotFound -> ' . $w2_6J); } } public static function script($oL7Ir = '') { goto S4Qiv; S4Qiv: $oL7Ir = trim($oL7Ir); goto Jot2E; Jot2E: if (!empty($oL7Ir)) { self::$script = array_merge(self::$script, (array) $oL7Ir); return; } goto xUPx3; xUPx3: return view('modstart::part.script', array('script' => array_unique(self::$script))); goto FjusE; FjusE: } public static function styleFile($hvaHB, $I9bqE = false) { if (!$I9bqE) { $hvaHB = base_path($hvaHB); } try { return self::style(file_get_contents($hvaHB)); } catch (\Exception $Sgh1N) { BizException::throws('FileNotFound -> ' . $hvaHB); } } public static function style($LJOUJ = '') { goto POny0; cmapn: return view('modstart::part.style', array('style' => array_unique(self::$style))); goto FCe8n; iNsml: if (!empty($LJOUJ)) { self::$style = array_merge(self::$style, (array) $LJOUJ); return; } goto SRfv_; SRfv_: static::$style = array_merge(static::$style, FieldManager::collectFieldAssets('style'), WidgetManager::collectWidgetAssets('style')); goto cmapn; POny0: $LJOUJ = trim($LJOUJ); goto iNsml; FCe8n: } public static function css($rGAr3 = null) { goto Khb29; Khb29: if (!is_null($rGAr3)) { self::$css = array_merge(self::$css, (array) $rGAr3); return; } goto HTym7; EAxV3: return view('modstart::part.css', array('css' => array_unique(static::$css))); goto XnFhM; HTym7: static::$css = array_merge(static::$css, FieldManager::collectFieldAssets('css')); goto EAxV3; XnFhM: } public static function js($RdR3t = null) { goto hv3YE; eZau8: static::$js = array_merge(static::$js, FieldManager::collectFieldAssets('js')); goto ntYeo; ntYeo: return view('modstart::part.js', array('js' => array_unique(static::$js))); goto bs1xd; hv3YE: if (!is_null($RdR3t)) { self::$js = array_merge(self::$js, (array) $RdR3t); return; } goto eZau8; bs1xd: } public static function env() { goto g7q_H; CblIW: if (null === $NUVIZ) { $TsqdX = explode('.', \Illuminate\Foundation\Application::VERSION); $NUVIZ = 'laravel' . $TsqdX[0]; } goto hWPP7; g7q_H: static $NUVIZ = null; goto CblIW; hWPP7: return $NUVIZ; goto tme21; tme21: } }