<?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 sColF; KJsrH: foreach ($YdlEo as $satFX) { if (file_exists($sCmIC = ModuleManager::path($satFX, 'Api/routes.php'))) { $moNxb[$satFX] = $sCmIC; } } goto BqYNU; BqYNU: return $moNxb; goto aQrrM; HY1hg: $moNxb = array(); goto KJsrH; sColF: $YdlEo = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto HY1hg; aQrrM: } public static function registerModuleRoutes() { goto k0VcF; bY5So: foreach ($z7thA as $satFX => $sCmIC) { Route::group(array('prefix' => config('modstart.api.prefix'), 'middleware' => array('api.bootstrap', 'api.session'), 'namespace' => "\\Module\\{$satFX}\\Api\\Controller"), function ($router) use($sCmIC) { if (file_exists($sCmIC)) { require $sCmIC; } }); } goto TNHSN; TNHSN: if (file_exists($hHJCV = modstart_api_path('routes.php'))) { require $hHJCV; } goto RrWkI; k0VcF: if (config('env.APP_DEBUG')) { $z7thA = self::listModuleRoutes(); } else { $z7thA = Cache::rememberForever('ModStartApiRoutes', function () { return self::listModuleRoutes(); }); } goto bY5So; RrWkI: } }