<?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 ul2zg; gbIj3: Cache::forget('ModStartApiRoutes'); goto hPAtj; lQb8X: Cache::forget('ModStartAdminRoutes'); goto gbIj3; jT6sA: self::safeCleanOptimizedFile('bootstrap/cache/services.json'); goto Pd9WE; Qz3Ut: Cache::forget('ModStartWebRoutes'); goto XUnYQ; hPAtj: Cache::forget('ModStartOpenApiRoutes'); goto Qz3Ut; G0mwq: if (method_exists(ModuleManager::class, 'hotReloadSystemConfig')) { ModuleManager::hotReloadSystemConfig(); } goto V8xIF; ul2zg: Cache::forget('ModStartServiceProviders'); goto lQb8X; XUnYQ: self::safeCleanOptimizedFile('bootstrap/cache/compiled.php'); goto jT6sA; Pd9WE: self::safeCleanOptimizedFile('bootstrap/cache/config.php'); goto G0mwq; V8xIF: } private static function safeCleanOptimizedFile($fWBvH) { if (file_exists($aurrr = base_path($fWBvH))) { @unlink($aurrr); } } public static function scriptFile($rUaKG, $YT6jL = false) { if (!$YT6jL) { $rUaKG = base_path($rUaKG); } try { return self::script(file_get_contents($rUaKG)); } catch (\Exception $GrUf4) { BizException::throws('FileNotFound -> ' . $rUaKG); } } public static function script($ggdDa = '') { goto yjxT_; yjxT_: $ggdDa = trim($ggdDa); goto kDoZ1; kDoZ1: if (!empty($ggdDa)) { self::$script = array_merge(self::$script, (array) $ggdDa); return; } goto dEANy; dEANy: return view('modstart::part.script', array('script' => array_unique(self::$script))); goto Gint3; Gint3: } public static function styleFile($lgx3e, $YT6jL = false) { if (!$YT6jL) { $lgx3e = base_path($lgx3e); } try { return self::style(file_get_contents($lgx3e)); } catch (\Exception $GrUf4) { BizException::throws('FileNotFound -> ' . $lgx3e); } } public static function style($hEplZ = '') { goto EqUOG; QthMl: return view('modstart::part.style', array('style' => array_unique(self::$style))); goto vsWFj; EqUOG: $hEplZ = trim($hEplZ); goto JdXy4; JdXy4: if (!empty($hEplZ)) { self::$style = array_merge(self::$style, (array) $hEplZ); return; } goto g_y3O; g_y3O: static::$style = array_merge(static::$style, FieldManager::collectFieldAssets('style'), WidgetManager::collectWidgetAssets('style')); goto QthMl; vsWFj: } public static function css($bPmME = null) { goto W6yQe; Vn4KM: return view('modstart::part.css', array('css' => array_unique(static::$css))); goto d5CT4; W6yQe: if (!is_null($bPmME)) { self::$css = array_merge(self::$css, (array) $bPmME); return; } goto VXbLl; VXbLl: static::$css = array_merge(static::$css, FieldManager::collectFieldAssets('css')); goto Vn4KM; d5CT4: } public static function js($KtRTh = null) { goto L5oo0; L5oo0: if (!is_null($KtRTh)) { self::$js = array_merge(self::$js, (array) $KtRTh); return; } goto oJmXO; oJmXO: static::$js = array_merge(static::$js, FieldManager::collectFieldAssets('js')); goto frCg7; frCg7: return view('modstart::part.js', array('js' => array_unique(static::$js))); goto Wbxo7; Wbxo7: } public static function env() { goto TNZIP; TNZIP: static $JKwNL = null; goto OUW7Q; S6dI4: return $JKwNL; goto SMeJr; OUW7Q: if (null === $JKwNL) { $FSrde = explode('.', \Illuminate\Foundation\Application::VERSION); $JKwNL = 'laravel' . $FSrde[0]; } goto S6dI4; SMeJr: } }