<?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 KBU5u; N0mQI: $zdxah = array(); goto KMhC4; KBU5u: $Zf0sy = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto N0mQI; KMhC4: foreach ($Zf0sy as $tUxPr) { if (file_exists($ypGny = ModuleManager::path($tUxPr, 'Api/routes.php'))) { $zdxah[$tUxPr] = $ypGny; } } goto CGgiP; CGgiP: return $zdxah; goto K6V1s; K6V1s: } public static function registerModuleRoutes() { goto E2m2H; XVE4k: foreach ($on4ze as $tUxPr => $ypGny) { Route::group(array('prefix' => config('modstart.api.prefix'), 'middleware' => array('api.bootstrap', 'api.session'), 'namespace' => "\\Module\\{$tUxPr}\\Api\\Controller"), function ($router) use($ypGny) { if (file_exists($ypGny)) { require $ypGny; } }); } goto dv72E; E2m2H: if (config('env.APP_DEBUG')) { $on4ze = self::listModuleRoutes(); } else { $on4ze = Cache::rememberForever('ModStartApiRoutes', function () { return self::listModuleRoutes(); }); } goto XVE4k; dv72E: if (file_exists($nbD48 = modstart_api_path('routes.php'))) { require $nbD48; } goto FDRTk; FDRTk: } }