<?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 PRiwk; J07pW: if (method_exists(ModuleManager::class, 'hotReloadSystemConfig')) { ModuleManager::hotReloadSystemConfig(); } goto WPM_X; PRiwk: Cache::forget('ModStartServiceProviders'); goto okb3w; ZkeO5: Cache::forget('ModStartWebRoutes'); goto fIGuA; oNyKe: self::safeCleanOptimizedFile('bootstrap/cache/services.json'); goto G_LFc; okb3w: Cache::forget('ModStartAdminRoutes'); goto hEiwx; hEiwx: Cache::forget('ModStartApiRoutes'); goto xqvyd; fIGuA: self::safeCleanOptimizedFile('bootstrap/cache/compiled.php'); goto oNyKe; G_LFc: self::safeCleanOptimizedFile('bootstrap/cache/config.php'); goto J07pW; xqvyd: Cache::forget('ModStartOpenApiRoutes'); goto ZkeO5; WPM_X: } private static function safeCleanOptimizedFile($qsQD8) { if (file_exists($tGXA6 = base_path($qsQD8))) { @unlink($tGXA6); } } public static function scriptFile($rJIwr, $PfdcD = false) { if (!$PfdcD) { $rJIwr = base_path($rJIwr); } try { return self::script(file_get_contents($rJIwr)); } catch (\Exception $SXS9c) { BizException::throws('FileNotFound -> ' . $rJIwr); } } public static function script($GNrb6 = '') { goto zLYqS; CkmpG: return view('modstart::part.script', array('script' => array_unique(self::$script))); goto CTDaV; zLYqS: $GNrb6 = trim($GNrb6); goto uJhhR; uJhhR: if (!empty($GNrb6)) { self::$script = array_merge(self::$script, (array) $GNrb6); return; } goto CkmpG; CTDaV: } public static function styleFile($FrHW5, $PfdcD = false) { if (!$PfdcD) { $FrHW5 = base_path($FrHW5); } try { return self::style(file_get_contents($FrHW5)); } catch (\Exception $SXS9c) { BizException::throws('FileNotFound -> ' . $FrHW5); } } public static function style($fvRyM = '') { goto jlNQ8; jlNQ8: $fvRyM = trim($fvRyM); goto ohl2h; I_uMp: static::$style = array_merge(static::$style, FieldManager::collectFieldAssets('style'), WidgetManager::collectWidgetAssets('style')); goto GBPJ2; GBPJ2: return view('modstart::part.style', array('style' => array_unique(self::$style))); goto ki_Hc; ohl2h: if (!empty($fvRyM)) { self::$style = array_merge(self::$style, (array) $fvRyM); return; } goto I_uMp; ki_Hc: } public static function css($hiMKE = null) { goto yv_w7; tBOfh: return view('modstart::part.css', array('css' => array_unique(static::$css))); goto I03Bj; yv_w7: if (!is_null($hiMKE)) { self::$css = array_merge(self::$css, (array) $hiMKE); return; } goto RU7Vu; RU7Vu: static::$css = array_merge(static::$css, FieldManager::collectFieldAssets('css')); goto tBOfh; I03Bj: } public static function js($IsPeU = null) { goto XHZ8z; LM_3W: return view('modstart::part.js', array('js' => array_unique(static::$js))); goto hT7Lr; NsBIU: static::$js = array_merge(static::$js, FieldManager::collectFieldAssets('js')); goto LM_3W; XHZ8z: if (!is_null($IsPeU)) { self::$js = array_merge(self::$js, (array) $IsPeU); return; } goto NsBIU; hT7Lr: } public static function env() { goto TOKKT; HiNdX: return $rMRoE; goto X_P0w; TOKKT: static $rMRoE = null; goto tfm_8; tfm_8: if (null === $rMRoE) { $jT5GX = explode('.', \Illuminate\Foundation\Application::VERSION); $rMRoE = 'laravel' . $jT5GX[0]; } goto HiNdX; X_P0w: } }