<?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.7.0'; public static $script = array(); public static $style = array(); public static $css = array(); public static $js = array(); public static function clearCache() { goto Lp99E; uQhWP: Cache::forget('ModStartAdminRoutes'); goto xUB9n; MwXI2: Cache::forget('ModStartWebRoutes'); goto qi8Lp; Lp99E: Cache::forget('ModStartServiceProviders'); goto uQhWP; W4957: self::safeCleanOptimizedFile('bootstrap/cache/services.json'); goto V7iuQ; xUB9n: Cache::forget('ModStartApiRoutes'); goto Ga6JD; Nel8X: if (method_exists(ModuleManager::class, 'hotReloadSystemConfig')) { ModuleManager::hotReloadSystemConfig(); } goto RXauq; qi8Lp: self::safeCleanOptimizedFile('bootstrap/cache/compiled.php'); goto W4957; Ga6JD: Cache::forget('ModStartOpenApiRoutes'); goto MwXI2; V7iuQ: self::safeCleanOptimizedFile('bootstrap/cache/config.php'); goto Nel8X; RXauq: } private static function safeCleanOptimizedFile($aYJAK) { if (file_exists($VF_G6 = base_path($aYJAK))) { @unlink($VF_G6); } } public static function scriptFile($D6g6H, $JXMPg = false) { if (!$JXMPg) { $D6g6H = base_path($D6g6H); } try { return self::script(file_get_contents($D6g6H)); } catch (\Exception $WVwSN) { BizException::throws('FileNotFound -> ' . $D6g6H); } } public static function script($PZ208 = '') { goto p1EFR; p1EFR: $PZ208 = trim($PZ208); goto G5UrP; G5UrP: if (!empty($PZ208)) { self::$script = array_merge(self::$script, (array) $PZ208); return; } goto CHFCG; CHFCG: return view('modstart::part.script', array('script' => array_unique(self::$script))); goto ohxML; ohxML: } public static function styleFile($s9xYB, $JXMPg = false) { if (!$JXMPg) { $s9xYB = base_path($s9xYB); } try { return self::style(file_get_contents($s9xYB)); } catch (\Exception $WVwSN) { BizException::throws('FileNotFound -> ' . $s9xYB); } } public static function style($glv7e = '') { goto rTN1q; lVoaa: if (!empty($glv7e)) { self::$style = array_merge(self::$style, (array) $glv7e); return; } goto DXkqV; rTN1q: $glv7e = trim($glv7e); goto lVoaa; GBZ5W: return view('modstart::part.style', array('style' => array_unique(self::$style))); goto uGEYL; DXkqV: static::$style = array_merge(static::$style, FieldManager::collectFieldAssets('style'), WidgetManager::collectWidgetAssets('style')); goto GBZ5W; uGEYL: } public static function css($O1p9S = null) { goto LHfQI; Ij1KE: static::$css = array_merge(static::$css, FieldManager::collectFieldAssets('css')); goto ji8jI; LHfQI: if (!is_null($O1p9S)) { self::$css = array_merge(self::$css, (array) $O1p9S); return; } goto Ij1KE; ji8jI: return view('modstart::part.css', array('css' => array_unique(static::$css))); goto X9Dr5; X9Dr5: } public static function js($wnLYl = null) { goto euPvI; CJvu8: return view('modstart::part.js', array('js' => array_unique(static::$js))); goto pady3; HmJIW: static::$js = array_merge(static::$js, FieldManager::collectFieldAssets('js')); goto CJvu8; euPvI: if (!is_null($wnLYl)) { self::$js = array_merge(self::$js, (array) $wnLYl); return; } goto HmJIW; pady3: } public static function env() { goto mFFjF; mFFjF: static $fFKJA = null; goto h4Vnb; dN2d6: return $fFKJA; goto ZP9bd; h4Vnb: if (null === $fFKJA) { $TDAzu = explode('.', \Illuminate\Foundation\Application::VERSION); $fFKJA = 'laravel' . $TDAzu[0]; } goto dN2d6; ZP9bd: } }