<?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 NXXwm; l8LRT: $jByvU = array(); goto loqPQ; rxQcL: return $jByvU; goto tH8Cr; loqPQ: foreach ($qDH10 as $GVDx3) { if (file_exists($qsQD8 = ModuleManager::path($GVDx3, 'Api/routes.php'))) { $jByvU[$GVDx3] = $qsQD8; } } goto rxQcL; NXXwm: $qDH10 = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto l8LRT; tH8Cr: } public static function registerModuleRoutes() { goto S1RNJ; WnXdR: foreach ($OpzDn as $GVDx3 => $qsQD8) { Route::group(array('prefix' => config('modstart.api.prefix'), 'middleware' => array('api.bootstrap', 'api.session'), 'namespace' => "\\Module\\{$GVDx3}\\Api\\Controller"), function ($router) use($qsQD8) { if (file_exists($qsQD8)) { require $qsQD8; } }); } goto Eov8r; Eov8r: if (file_exists($OQTZC = modstart_api_path('routes.php'))) { require $OQTZC; } goto M42wm; S1RNJ: if (config('env.APP_DEBUG')) { $OpzDn = self::listModuleRoutes(); } else { $OpzDn = Cache::rememberForever('ModStartApiRoutes', function () { return self::listModuleRoutes(); }); } goto WnXdR; M42wm: } }