<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\App\Web; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Route; use ModStart\Module\ModuleManager; class ModStartWeb { private static function listModuleRoutes() { goto CGWsP; uP_0X: foreach ($fdcN9 as $oXHYw) { if (file_exists($Jtt5u = ModuleManager::path($oXHYw, 'Web/routes.php'))) { $tBbJh[$oXHYw] = $Jtt5u; } } goto RvgCS; ZA35S: $tBbJh = array(); goto uP_0X; RvgCS: return $tBbJh; goto vo4cM; CGWsP: $fdcN9 = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto ZA35S; vo4cM: } public static function registerModuleRoutes() { goto aJmg0; eCs_U: if (file_exists($f5foR = modstart_web_path('routes.php'))) { require $f5foR; } goto RoD6X; aJmg0: if (config('env.APP_DEBUG')) { $gn8Xw = self::listModuleRoutes(); } else { $gn8Xw = Cache::rememberForever('ModStartWebRoutes', function () { return self::listModuleRoutes(); }); } goto x_sjT; x_sjT: foreach ($gn8Xw as $oXHYw => $Jtt5u) { Route::group(array('prefix' => config('modstart.web.prefix'), 'middleware' => array('web.bootstrap'), 'namespace' => "\\Module\\{$oXHYw}\\Web\\Controller"), function ($router) use($Jtt5u) { if (file_exists($Jtt5u)) { require $Jtt5u; } }); } goto eCs_U; RoD6X: } }