<?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 bSzu6; bSzu6: Cache::forget('ModStartServiceProviders'); goto vk0gn; vk0gn: Cache::forget('ModStartAdminRoutes'); goto weGq_; weGq_: Cache::forget('ModStartApiRoutes'); goto VMowi; VMowi: Cache::forget('ModStartOpenApiRoutes'); goto AMZEc; FBCJp: self::safeCleanOptimizedFile('bootstrap/cache/config.php'); goto twoWy; twoWy: if (method_exists(ModuleManager::class, 'hotReloadSystemConfig')) { ModuleManager::hotReloadSystemConfig(); } goto Y7wtO; gkBcr: self::safeCleanOptimizedFile('bootstrap/cache/compiled.php'); goto jhAxZ; jhAxZ: self::safeCleanOptimizedFile('bootstrap/cache/services.json'); goto FBCJp; AMZEc: Cache::forget('ModStartWebRoutes'); goto gkBcr; Y7wtO: } private static function safeCleanOptimizedFile($sCmIC) { if (file_exists($adFNb = base_path($sCmIC))) { @unlink($adFNb); } } public static function scriptFile($w0Ima, $M2omJ = false) { if (!$M2omJ) { $w0Ima = base_path($w0Ima); } try { return self::script(file_get_contents($w0Ima)); } catch (\Exception $tZVhb) { BizException::throws('FileNotFound -> ' . $w0Ima); } } public static function script($rVDER = '') { goto miSYb; FbSx4: return view('modstart::part.script', array('script' => array_unique(self::$script))); goto P0g11; Lh5EJ: if (!empty($rVDER)) { self::$script = array_merge(self::$script, (array) $rVDER); return; } goto FbSx4; miSYb: $rVDER = trim($rVDER); goto Lh5EJ; P0g11: } public static function styleFile($CsNEA, $M2omJ = false) { if (!$M2omJ) { $CsNEA = base_path($CsNEA); } try { return self::style(file_get_contents($CsNEA)); } catch (\Exception $tZVhb) { BizException::throws('FileNotFound -> ' . $CsNEA); } } public static function style($iCtji = '') { goto PvcMo; ui1Gr: return view('modstart::part.style', array('style' => array_unique(self::$style))); goto tUfnh; m_TUD: if (!empty($iCtji)) { self::$style = array_merge(self::$style, (array) $iCtji); return; } goto j5kPn; PvcMo: $iCtji = trim($iCtji); goto m_TUD; j5kPn: static::$style = array_merge(static::$style, FieldManager::collectFieldAssets('style'), WidgetManager::collectWidgetAssets('style')); goto ui1Gr; tUfnh: } public static function css($gX8_3 = null) { goto dOXKG; dOXKG: if (!is_null($gX8_3)) { self::$css = array_merge(self::$css, (array) $gX8_3); return; } goto ZCTtp; TlwjL: return view('modstart::part.css', array('css' => array_unique(static::$css))); goto wqWc1; ZCTtp: static::$css = array_merge(static::$css, FieldManager::collectFieldAssets('css')); goto TlwjL; wqWc1: } public static function js($k4QhH = null) { goto iEzfO; iEzfO: if (!is_null($k4QhH)) { self::$js = array_merge(self::$js, (array) $k4QhH); return; } goto vDDck; bcXz4: return view('modstart::part.js', array('js' => array_unique(static::$js))); goto lIZAv; vDDck: static::$js = array_merge(static::$js, FieldManager::collectFieldAssets('js')); goto bcXz4; lIZAv: } public static function env() { goto WH3l8; rv20T: if (null === $V3q1i) { $KHn4u = explode('.', \Illuminate\Foundation\Application::VERSION); $V3q1i = 'laravel' . $KHn4u[0]; } goto ND68f; WH3l8: static $V3q1i = null; goto rv20T; ND68f: return $V3q1i; goto wGg8J; wGg8J: } }