<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\App\Api; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Route; use ModStart\Module\ModuleManager; class ModStartApi { private static function listModuleRoutes() { goto Hu04C; Hu04C: $fdcN9 = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto Vj5NC; NXATb: return $tBbJh; goto CacIy; pVc_I: foreach ($fdcN9 as $oXHYw) { if (file_exists($Jtt5u = ModuleManager::path($oXHYw, 'Api/routes.php'))) { $tBbJh[$oXHYw] = $Jtt5u; } } goto NXATb; Vj5NC: $tBbJh = array(); goto pVc_I; CacIy: } public static function registerModuleRoutes() { goto L3Xyi; L3Xyi: if (config('env.APP_DEBUG')) { $gn8Xw = self::listModuleRoutes(); } else { $gn8Xw = Cache::rememberForever('ModStartApiRoutes', function () { return self::listModuleRoutes(); }); } goto Gb_Pp; Gb_Pp: foreach ($gn8Xw as $oXHYw => $Jtt5u) { Route::group(array('prefix' => config('modstart.api.prefix'), 'middleware' => array('api.bootstrap', 'api.session'), 'namespace' => "\\Module\\{$oXHYw}\\Api\\Controller"), function ($router) use($Jtt5u) { if (file_exists($Jtt5u)) { require $Jtt5u; } }); } goto idQWU; idQWU: if (file_exists($f5foR = modstart_api_path('routes.php'))) { require $f5foR; } goto IzDYl; IzDYl: } }