<?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 U0anq; jaGU6: foreach ($fdcN9 as $oXHYw) { if (file_exists($Jtt5u = ModuleManager::path($oXHYw, 'OpenApi/routes.php'))) { $tBbJh[$oXHYw] = $Jtt5u; } } goto n3yKv; U0anq: $fdcN9 = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto WjQsw; n3yKv: return $tBbJh; goto H1wsz; WjQsw: $tBbJh = array(); goto jaGU6; H1wsz: } public static function registerModuleRoutes() { goto WXYKz; WXYKz: if (config('env.APP_DEBUG')) { $gn8Xw = self::listModuleRoutes(); } else { $gn8Xw = Cache::rememberForever('ModStartOpenApiRoutes', function () { return self::listModuleRoutes(); }); } goto jM2mh; Bo5BX: if (file_exists($f5foR = modstart_open_api_path('routes.php'))) { require $f5foR; } goto irvIx; jM2mh: foreach ($gn8Xw as $oXHYw => $Jtt5u) { Route::group(array('prefix' => config('modstart.openApi.prefix'), 'middleware' => array('openApi.bootstrap'), 'namespace' => "\\Module\\{$oXHYw}\\OpenApi\\Controller"), function ($router) use($Jtt5u) { if (file_exists($Jtt5u)) { require $Jtt5u; } }); } goto Bo5BX; irvIx: } }