<?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 Mds33; Mds33: $qDH10 = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto cBeYT; cBeYT: $jByvU = array(); goto tk5lb; tk5lb: foreach ($qDH10 as $GVDx3) { if (file_exists($qsQD8 = ModuleManager::path($GVDx3, 'Web/routes.php'))) { $jByvU[$GVDx3] = $qsQD8; } } goto TnH8p; TnH8p: return $jByvU; goto blHyB; blHyB: } public static function registerModuleRoutes() { goto B7xPr; B7xPr: if (config('env.APP_DEBUG')) { $OpzDn = self::listModuleRoutes(); } else { $OpzDn = Cache::rememberForever('ModStartWebRoutes', function () { return self::listModuleRoutes(); }); } goto Co7gK; Co7gK: foreach ($OpzDn as $GVDx3 => $qsQD8) { Route::group(array('prefix' => config('modstart.web.prefix'), 'middleware' => array('web.bootstrap'), 'namespace' => "\\Module\\{$GVDx3}\\Web\\Controller"), function ($router) use($qsQD8) { if (file_exists($qsQD8)) { require $qsQD8; } }); } goto CZngh; CZngh: if (file_exists($OQTZC = modstart_web_path('routes.php'))) { require $OQTZC; } goto o6nuI; o6nuI: } }