<?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 t860G; NU2la: $qwIog = array(); goto x4TYQ; nwHG0: return $qwIog; goto hfLvC; t860G: $sywti = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto NU2la; x4TYQ: foreach ($sywti as $CiBrR) { if (file_exists($yHf3t = ModuleManager::path($CiBrR, 'Api/routes.php'))) { $qwIog[$CiBrR] = $yHf3t; } } goto nwHG0; hfLvC: } public static function registerModuleRoutes() { goto HBS4E; fDsxh: foreach ($a8f31 as $CiBrR => $yHf3t) { Route::group(array('prefix' => config('modstart.api.prefix'), 'middleware' => array('api.bootstrap', 'api.session'), 'namespace' => "\\Module\\{$CiBrR}\\Api\\Controller"), function ($router) use($yHf3t) { if (file_exists($yHf3t)) { require $yHf3t; } }); } goto wSwCP; wSwCP: if (file_exists($Qkds9 = modstart_api_path('routes.php'))) { require $Qkds9; } goto i61h2; HBS4E: if (config('env.APP_DEBUG')) { $a8f31 = self::listModuleRoutes(); } else { $a8f31 = Cache::rememberForever('ModStartApiRoutes', function () { return self::listModuleRoutes(); }); } goto fDsxh; i61h2: } }