<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\App\Api; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Route; use ModStart\ModStart; use ModStart\Module\ModuleManager; class ModStartApi { private static function listModuleRoutes() { goto tu3Nj; VwYRn: foreach ($XgbS2 as $JHuzz) { if (file_exists($WF06r = ModuleManager::path($JHuzz, 'Api/routes.php'))) { $Kxp3W[$JHuzz] = $WF06r; } } goto yATmR; KhBac: $Kxp3W = array(); goto VwYRn; yATmR: return $Kxp3W; goto QoCl6; tu3Nj: $XgbS2 = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto KhBac; QoCl6: } public static function registerModuleRoutes() { goto hOdJc; hOdJc: if (config('env.APP_DEBUG')) { $VBeCb = self::listModuleRoutes(); } else { if (method_exists(ModStart::class, 'cacheKey')) { $VBeCb = Cache::rememberForever(ModStart::cacheKey('ModStartApiRoutes'), function () { return self::listModuleRoutes(); }); } else { $VBeCb = self::listModuleRoutes(); } } goto tUi0M; TC_10: if (file_exists($LxgGc = modstart_api_path('routes.php'))) { require $LxgGc; } goto DGKcu; tUi0M: foreach ($VBeCb as $JHuzz => $WF06r) { Route::group(array('prefix' => config('modstart.api.prefix'), 'middleware' => array('api.bootstrap', 'api.session'), 'namespace' => "\\Module\\{$JHuzz}\\Api\\Controller"), function ($router) use($WF06r) { if (file_exists($WF06r)) { require $WF06r; } }); } goto TC_10; DGKcu: } }