<?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 XUDQe; XUDQe: Cache::forget('ModStartServiceProviders'); goto NeFWz; NeFWz: Cache::forget('ModStartAdminRoutes'); goto AXHhd; AXHhd: Cache::forget('ModStartApiRoutes'); goto zwf7t; vjsUa: self::safeCleanOptimizedFile('bootstrap/cache/services.json'); goto ofLFK; D6LZI: self::safeCleanOptimizedFile('bootstrap/cache/compiled.php'); goto vjsUa; kedfk: Cache::forget('ModStartWebRoutes'); goto D6LZI; zwf7t: Cache::forget('ModStartOpenApiRoutes'); goto kedfk; pYyg5: if (method_exists(ModuleManager::class, 'hotReloadSystemConfig')) { ModuleManager::hotReloadSystemConfig(); } goto JGu0L; ofLFK: self::safeCleanOptimizedFile('bootstrap/cache/config.php'); goto pYyg5; JGu0L: } private static function safeCleanOptimizedFile($ypGny) { if (file_exists($YhsOb = base_path($ypGny))) { @unlink($YhsOb); } } public static function scriptFile($xQAPj, $rPn9H = false) { if (!$rPn9H) { $xQAPj = base_path($xQAPj); } try { return self::script(file_get_contents($xQAPj)); } catch (\Exception $Xlb8r) { BizException::throws('FileNotFound -> ' . $xQAPj); } } public static function script($p9E4n = '') { goto LZv9d; wvQy0: if (!empty($p9E4n)) { self::$script = array_merge(self::$script, (array) $p9E4n); return; } goto kB3js; kB3js: return view('modstart::part.script', array('script' => array_unique(self::$script))); goto HW_Sl; LZv9d: $p9E4n = trim($p9E4n); goto wvQy0; HW_Sl: } public static function styleFile($lLTfW, $rPn9H = false) { if (!$rPn9H) { $lLTfW = base_path($lLTfW); } try { return self::style(file_get_contents($lLTfW)); } catch (\Exception $Xlb8r) { BizException::throws('FileNotFound -> ' . $lLTfW); } } public static function style($emJJZ = '') { goto UB71y; ej98W: if (!empty($emJJZ)) { self::$style = array_merge(self::$style, (array) $emJJZ); return; } goto rnOzK; lGLTO: return view('modstart::part.style', array('style' => array_unique(self::$style))); goto tsgTP; UB71y: $emJJZ = trim($emJJZ); goto ej98W; rnOzK: static::$style = array_merge(static::$style, FieldManager::collectFieldAssets('style'), WidgetManager::collectWidgetAssets('style')); goto lGLTO; tsgTP: } public static function css($mSMT0 = null) { goto U5Ko1; ce6cE: static::$css = array_merge(static::$css, FieldManager::collectFieldAssets('css')); goto j1BpV; j1BpV: return view('modstart::part.css', array('css' => array_unique(static::$css))); goto WY_70; U5Ko1: if (!is_null($mSMT0)) { self::$css = array_merge(self::$css, (array) $mSMT0); return; } goto ce6cE; WY_70: } public static function js($pt6eZ = null) { goto dLs5l; rg4eX: return view('modstart::part.js', array('js' => array_unique(static::$js))); goto eh1M1; dLs5l: if (!is_null($pt6eZ)) { self::$js = array_merge(self::$js, (array) $pt6eZ); return; } goto S00_1; S00_1: static::$js = array_merge(static::$js, FieldManager::collectFieldAssets('js')); goto rg4eX; eh1M1: } public static function env() { goto bQrfP; bQrfP: static $XoENN = null; goto b3XCM; b3XCM: if (null === $XoENN) { $q26cr = explode('.', \Illuminate\Foundation\Application::VERSION); $XoENN = 'laravel' . $q26cr[0]; } goto jFm3y; jFm3y: return $XoENN; goto RBs6X; RBs6X: } }