<?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 eVIeO; DiOBw: Cache::forget('ModStartApiRoutes'); goto L2HQB; S4V_n: if (method_exists(ModuleManager::class, 'hotReloadSystemConfig')) { ModuleManager::hotReloadSystemConfig(); } goto d1Fak; vKaou: self::safeCleanOptimizedFile('bootstrap/cache/compiled.php'); goto i0GER; L2HQB: Cache::forget('ModStartOpenApiRoutes'); goto KF2EW; Uh4S8: Cache::forget('ModStartAdminRoutes'); goto DiOBw; eVIeO: Cache::forget('ModStartServiceProviders'); goto Uh4S8; KF2EW: Cache::forget('ModStartWebRoutes'); goto vKaou; AX0HU: self::safeCleanOptimizedFile('bootstrap/cache/config.php'); goto S4V_n; i0GER: self::safeCleanOptimizedFile('bootstrap/cache/services.json'); goto AX0HU; d1Fak: } private static function safeCleanOptimizedFile($RLMU5) { if (file_exists($S3tfG = base_path($RLMU5))) { @unlink($S3tfG); } } public static function scriptFile($nDfYh, $tFAJY = false) { if (!$tFAJY) { $nDfYh = base_path($nDfYh); } try { return self::script(file_get_contents($nDfYh)); } catch (\Exception $Y5fnH) { BizException::throws('FileNotFound -> ' . $nDfYh); } } public static function script($BcREp = '') { goto GDKny; c97rp: if (!empty($BcREp)) { self::$script = array_merge(self::$script, (array) $BcREp); return; } goto UOZvp; UOZvp: return view('modstart::part.script', array('script' => array_unique(self::$script))); goto aT3GN; GDKny: $BcREp = trim($BcREp); goto c97rp; aT3GN: } public static function styleFile($bXl6t, $tFAJY = false) { if (!$tFAJY) { $bXl6t = base_path($bXl6t); } try { return self::style(file_get_contents($bXl6t)); } catch (\Exception $Y5fnH) { BizException::throws('FileNotFound -> ' . $bXl6t); } } public static function style($rCqHt = '') { goto iG1jr; x9_sl: static::$style = array_merge(static::$style, FieldManager::collectFieldAssets('style'), WidgetManager::collectWidgetAssets('style')); goto Of9Id; Of9Id: return view('modstart::part.style', array('style' => array_unique(self::$style))); goto RuZ1S; v4VHZ: if (!empty($rCqHt)) { self::$style = array_merge(self::$style, (array) $rCqHt); return; } goto x9_sl; iG1jr: $rCqHt = trim($rCqHt); goto v4VHZ; RuZ1S: } public static function css($fdyNP = null) { goto vKg4b; GcJJk: static::$css = array_merge(static::$css, FieldManager::collectFieldAssets('css')); goto TlUXH; TlUXH: return view('modstart::part.css', array('css' => array_unique(static::$css))); goto SJn03; vKg4b: if (!is_null($fdyNP)) { self::$css = array_merge(self::$css, (array) $fdyNP); return; } goto GcJJk; SJn03: } public static function js($dTK60 = null) { goto Qs0nr; MM1ZC: static::$js = array_merge(static::$js, FieldManager::collectFieldAssets('js')); goto Qb0ZZ; Qb0ZZ: return view('modstart::part.js', array('js' => array_unique(static::$js))); goto VM8h6; Qs0nr: if (!is_null($dTK60)) { self::$js = array_merge(self::$js, (array) $dTK60); return; } goto MM1ZC; VM8h6: } public static function env() { goto hd9_h; hd9_h: static $QZmRA = null; goto JN2KU; JN2KU: if (null === $QZmRA) { $kaMU7 = explode('.', \Illuminate\Foundation\Application::VERSION); $QZmRA = 'laravel' . $kaMU7[0]; } goto JXvU8; JXvU8: return $QZmRA; goto BVMfH; BVMfH: } }