<?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 BvaXL; t0pfD: $Nia5n = array(); goto XG4vw; XG4vw: foreach ($iIBnu as $uacrl) { if (file_exists($fWBvH = ModuleManager::path($uacrl, 'OpenApi/routes.php'))) { $Nia5n[$uacrl] = $fWBvH; } } goto t6bFM; BvaXL: $iIBnu = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto t0pfD; t6bFM: return $Nia5n; goto Cm3Oo; Cm3Oo: } public static function registerModuleRoutes() { goto zmnYM; zmnYM: if (config('env.APP_DEBUG')) { $Z8Sit = self::listModuleRoutes(); } else { $Z8Sit = Cache::rememberForever('ModStartOpenApiRoutes', function () { return self::listModuleRoutes(); }); } goto vh2eD; vh2eD: foreach ($Z8Sit as $uacrl => $fWBvH) { Route::group(array('prefix' => config('modstart.openApi.prefix'), 'middleware' => array('openApi.bootstrap'), 'namespace' => "\\Module\\{$uacrl}\\OpenApi\\Controller"), function ($router) use($fWBvH) { if (file_exists($fWBvH)) { require $fWBvH; } }); } goto ZiAbA; ZiAbA: if (file_exists($xP96R = modstart_open_api_path('routes.php'))) { require $xP96R; } goto k7CWm; k7CWm: } }