<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\App\OpenApi; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Route; use ModStart\Module\ModuleManager; class ModStartOpenApi { private static function listModuleRoutes() { goto VSeiY; GBNY0: foreach ($o6GFl as $h8H9D) { if (file_exists($aYJAK = ModuleManager::path($h8H9D, 'OpenApi/routes.php'))) { $vQMyn[$h8H9D] = $aYJAK; } } goto J2vkI; NykXL: $vQMyn = array(); goto GBNY0; VSeiY: $o6GFl = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto NykXL; J2vkI: return $vQMyn; goto RXH0j; RXH0j: } public static function registerModuleRoutes() { goto X39uM; unCqQ: foreach ($YGKPa as $h8H9D => $aYJAK) { Route::group(array('prefix' => config('modstart.openApi.prefix'), 'middleware' => array('openApi.bootstrap'), 'namespace' => "\\Module\\{$h8H9D}\\OpenApi\\Controller"), function ($router) use($aYJAK) { if (file_exists($aYJAK)) { require $aYJAK; } }); } goto vQkx0; X39uM: if (config('env.APP_DEBUG')) { $YGKPa = self::listModuleRoutes(); } else { $YGKPa = Cache::rememberForever('ModStartOpenApiRoutes', function () { return self::listModuleRoutes(); }); } goto unCqQ; vQkx0: if (file_exists($urkV4 = modstart_open_api_path('routes.php'))) { require $urkV4; } goto yWfFj; yWfFj: } }