<?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 z2xQQ; BH0ye: $Nia5n = array(); goto GYhil; z2xQQ: $iIBnu = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto BH0ye; A2OuI: return $Nia5n; goto I1CU_; GYhil: foreach ($iIBnu as $uacrl) { if (file_exists($fWBvH = ModuleManager::path($uacrl, 'Web/routes.php'))) { $Nia5n[$uacrl] = $fWBvH; } } goto A2OuI; I1CU_: } public static function registerModuleRoutes() { goto LnY5P; odijj: foreach ($Z8Sit as $uacrl => $fWBvH) { Route::group(array('prefix' => config('modstart.web.prefix'), 'middleware' => array('web.bootstrap'), 'namespace' => "\\Module\\{$uacrl}\\Web\\Controller"), function ($router) use($fWBvH) { if (file_exists($fWBvH)) { require $fWBvH; } }); } goto QVegy; LnY5P: if (config('env.APP_DEBUG')) { $Z8Sit = self::listModuleRoutes(); } else { $Z8Sit = Cache::rememberForever('ModStartWebRoutes', function () { return self::listModuleRoutes(); }); } goto odijj; QVegy: if (file_exists($xP96R = modstart_web_path('routes.php'))) { require $xP96R; } goto BZtUa; BZtUa: } }