<?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 Mfkzd; Mfkzd: $CveEo = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto ORKe0; STr8u: return $GsFul; goto yTf4u; zar4U: foreach ($CveEo as $vbusR) { if (file_exists($RLMU5 = ModuleManager::path($vbusR, 'Api/routes.php'))) { $GsFul[$vbusR] = $RLMU5; } } goto STr8u; ORKe0: $GsFul = array(); goto zar4U; yTf4u: } public static function registerModuleRoutes() { goto iQXKd; JvRlT: if (file_exists($Yf5XN = modstart_api_path('routes.php'))) { require $Yf5XN; } goto IoFzm; iQXKd: if (config('env.APP_DEBUG')) { $oVpdn = self::listModuleRoutes(); } else { $oVpdn = Cache::rememberForever('ModStartApiRoutes', function () { return self::listModuleRoutes(); }); } goto lQpxb; lQpxb: foreach ($oVpdn as $vbusR => $RLMU5) { Route::group(array('prefix' => config('modstart.api.prefix'), 'middleware' => array('api.bootstrap', 'api.session'), 'namespace' => "\\Module\\{$vbusR}\\Api\\Controller"), function ($router) use($RLMU5) { if (file_exists($RLMU5)) { require $RLMU5; } }); } goto JvRlT; IoFzm: } }