<?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 NoD43; kqN8f: self::safeCleanOptimizedFile('bootstrap/cache/compiled.php'); goto rWTe6; CBKPC: Cache::forget('ModStartAdminRoutes'); goto TsIAh; ymOie: self::safeCleanOptimizedFile('bootstrap/cache/config.php'); goto TDCPJ; TzD8f: Cache::forget('ModStartWebRoutes'); goto kqN8f; qpHAF: Cache::forget('ModStartOpenApiRoutes'); goto TzD8f; NoD43: Cache::forget('ModStartServiceProviders'); goto CBKPC; TsIAh: Cache::forget('ModStartApiRoutes'); goto qpHAF; TDCPJ: if (method_exists(ModuleManager::class, 'hotReloadSystemConfig')) { ModuleManager::hotReloadSystemConfig(); } goto k0yLg; rWTe6: self::safeCleanOptimizedFile('bootstrap/cache/services.json'); goto ymOie; k0yLg: } private static function safeCleanOptimizedFile($yHf3t) { if (file_exists($LclBr = base_path($yHf3t))) { @unlink($LclBr); } } public static function scriptFile($SQYxe, $sspNu = false) { if (!$sspNu) { $SQYxe = base_path($SQYxe); } try { return self::script(file_get_contents($SQYxe)); } catch (\Exception $xpJqz) { BizException::throws('FileNotFound -> ' . $SQYxe); } } public static function script($Y4z0U = '') { goto iZf6d; g4war: return view('modstart::part.script', array('script' => array_unique(self::$script))); goto h37n7; pD333: if (!empty($Y4z0U)) { self::$script = array_merge(self::$script, (array) $Y4z0U); return; } goto g4war; iZf6d: $Y4z0U = trim($Y4z0U); goto pD333; h37n7: } public static function styleFile($HZhwh, $sspNu = false) { if (!$sspNu) { $HZhwh = base_path($HZhwh); } try { return self::style(file_get_contents($HZhwh)); } catch (\Exception $xpJqz) { BizException::throws('FileNotFound -> ' . $HZhwh); } } public static function style($gN4B3 = '') { goto wmm6O; qAL8c: return view('modstart::part.style', array('style' => array_unique(self::$style))); goto Moggp; ludBm: static::$style = array_merge(static::$style, FieldManager::collectFieldAssets('style'), WidgetManager::collectWidgetAssets('style')); goto qAL8c; wmm6O: $gN4B3 = trim($gN4B3); goto VEPEf; VEPEf: if (!empty($gN4B3)) { self::$style = array_merge(self::$style, (array) $gN4B3); return; } goto ludBm; Moggp: } public static function css($vc2GA = null) { goto J80Le; MSFXG: return view('modstart::part.css', array('css' => array_unique(static::$css))); goto zwSzr; J80Le: if (!is_null($vc2GA)) { self::$css = array_merge(self::$css, (array) $vc2GA); return; } goto rw6DG; rw6DG: static::$css = array_merge(static::$css, FieldManager::collectFieldAssets('css')); goto MSFXG; zwSzr: } public static function js($ZsGKp = null) { goto WRqse; W2Ulh: static::$js = array_merge(static::$js, FieldManager::collectFieldAssets('js')); goto m8KPc; WRqse: if (!is_null($ZsGKp)) { self::$js = array_merge(self::$js, (array) $ZsGKp); return; } goto W2Ulh; m8KPc: return view('modstart::part.js', array('js' => array_unique(static::$js))); goto z2Dkx; z2Dkx: } public static function env() { goto za8sY; WuyA9: if (null === $zZymY) { $yQ4Wg = explode('.', \Illuminate\Foundation\Application::VERSION); $zZymY = 'laravel' . $yQ4Wg[0]; } goto KNh3k; KNh3k: return $zZymY; goto Nzyhk; za8sY: static $zZymY = null; goto WuyA9; Nzyhk: } }