<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\App\OpenApi; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Route; use ModStart\ModStart; use ModStart\Module\ModuleManager; class ModStartOpenApi { private static function listModuleRoutes() { goto sxekH; Uxp0x: foreach ($XgbS2 as $JHuzz) { if (file_exists($WF06r = ModuleManager::path($JHuzz, 'OpenApi/routes.php'))) { $Kxp3W[$JHuzz] = $WF06r; } } goto hhX7N; hhX7N: return $Kxp3W; goto pFgKg; VYJMI: $Kxp3W = array(); goto Uxp0x; sxekH: $XgbS2 = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto VYJMI; pFgKg: } public static function registerModuleRoutes() { goto TKjpl; oeJTC: if (file_exists($LxgGc = modstart_open_api_path('routes.php'))) { require $LxgGc; } goto GS9S8; TKjpl: if (config('env.APP_DEBUG')) { $VBeCb = self::listModuleRoutes(); } else { if (method_exists(ModStart::class, 'cacheKey')) { $VBeCb = Cache::rememberForever(ModStart::cacheKey('ModStartOpenApiRoutes'), function () { return self::listModuleRoutes(); }); } else { $VBeCb = self::listModuleRoutes(); } } goto s5RMQ; s5RMQ: foreach ($VBeCb as $JHuzz => $WF06r) { Route::group(array('prefix' => config('modstart.openApi.prefix'), 'middleware' => array('openApi.bootstrap'), 'namespace' => "\\Module\\{$JHuzz}\\OpenApi\\Controller"), function ($router) use($WF06r) { if (file_exists($WF06r)) { require $WF06r; } }); } goto oeJTC; GS9S8: } }