<?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 clearCache() { goto VC7zK; hoaz3: self::safeCleanOptimizedFile('bootstrap/cache/services.json'); goto pImg9; jvpwV: Cache::forget('ModStartWebRoutes'); goto qyfV3; qyfV3: self::safeCleanOptimizedFile('bootstrap/cache/compiled.php'); goto hoaz3; VC7zK: Cache::forget('ModStartServiceProviders'); goto ciNoO; ciNoO: Cache::forget('ModStartAdminRoutes'); goto H69H8; pImg9: self::safeCleanOptimizedFile('bootstrap/cache/config.php'); goto SCu3u; H69H8: Cache::forget('ModStartApiRoutes'); goto LKouc; SCu3u: if (method_exists(ModuleManager::class, 'hotReloadSystemConfig')) { ModuleManager::hotReloadSystemConfig(); } goto qPeYH; LKouc: Cache::forget('ModStartOpenApiRoutes'); goto jvpwV; qPeYH: } private static function safeCleanOptimizedFile($Jtt5u) { if (file_exists($nAf_0 = base_path($Jtt5u))) { @unlink($nAf_0); } } public static function scriptFile($oGPhX, $TI_ew = false) { if (!$TI_ew) { $oGPhX = base_path($oGPhX); } try { return self::script(file_get_contents($oGPhX)); } catch (\Exception $SwVsw) { BizException::throws('FileNotFound -> ' . $oGPhX); } } public static function script($klg2b = '') { goto cgOMi; cgOMi: $klg2b = trim($klg2b); goto Tyr__; zPSGI: return view('modstart::part.script', array('script' => array_unique(self::$script))); goto v06VA; Tyr__: if (!empty($klg2b)) { self::$script = array_merge(self::$script, (array) $klg2b); return; } goto zPSGI; v06VA: } public static function styleFile($hqiQI, $TI_ew = false) { if (!$TI_ew) { $hqiQI = base_path($hqiQI); } try { return self::style(file_get_contents($hqiQI)); } catch (\Exception $SwVsw) { BizException::throws('FileNotFound -> ' . $hqiQI); } } public static function style($N9uBF = '') { goto CX5a3; u1m73: return view('modstart::part.style', array('style' => array_unique(self::$style))); goto BsVSu; CX5a3: $N9uBF = trim($N9uBF); goto Ys65j; LPYgi: static::$style = array_merge(static::$style, FieldManager::collectFieldAssets('style'), WidgetManager::collectWidgetAssets('style')); goto u1m73; Ys65j: if (!empty($N9uBF)) { self::$style = array_merge(self::$style, (array) $N9uBF); return; } goto LPYgi; BsVSu: } public static function css($lx7Jl = null) { goto pMfTL; ZuOTE: return view('modstart::part.css', array('css' => array_unique(static::$css))); goto dHoRc; pMfTL: if (!is_null($lx7Jl)) { self::$css = array_merge(self::$css, (array) $lx7Jl); return; } goto pBhgR; pBhgR: static::$css = array_merge(static::$css, FieldManager::collectFieldAssets('css')); goto ZuOTE; dHoRc: } public static function js($ji32v = null) { goto CJJ7O; CJJ7O: if (!is_null($ji32v)) { self::$js = array_merge(self::$js, (array) $ji32v); return; } goto WZnc3; EDe0d: return view('modstart::part.js', array('js' => array_unique(static::$js))); goto G2wZj; WZnc3: static::$js = array_merge(static::$js, FieldManager::collectFieldAssets('js')); goto EDe0d; G2wZj: } public static function env() { goto FS0QU; qYo20: return $x3_wu; goto d_M_P; FS0QU: static $x3_wu = null; goto d2NOB; d2NOB: if (null === $x3_wu) { $QhMxe = explode('.', \Illuminate\Foundation\Application::VERSION); $x3_wu = 'laravel' . $QhMxe[0]; } goto qYo20; d_M_P: } }