<?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 aVKl_; xqNeu: foreach ($iIBnu as $uacrl) { if (file_exists($fWBvH = ModuleManager::path($uacrl, 'Api/routes.php'))) { $Nia5n[$uacrl] = $fWBvH; } } goto OQqtI; aVKl_: $iIBnu = ModuleManager::listAllInstalledModulesInRequiredOrder(true); goto qCAQm; OQqtI: return $Nia5n; goto SUEZF; qCAQm: $Nia5n = array(); goto xqNeu; SUEZF: } public static function registerModuleRoutes() { goto o5MOJ; KSWWC: foreach ($Z8Sit as $uacrl => $fWBvH) { Route::group(array('prefix' => config('modstart.api.prefix'), 'middleware' => array('api.bootstrap', 'api.session'), 'namespace' => "\\Module\\{$uacrl}\\Api\\Controller"), function ($router) use($fWBvH) { if (file_exists($fWBvH)) { require $fWBvH; } }); } goto nRxsn; o5MOJ: if (config('env.APP_DEBUG')) { $Z8Sit = self::listModuleRoutes(); } else { $Z8Sit = Cache::rememberForever('ModStartApiRoutes', function () { return self::listModuleRoutes(); }); } goto KSWWC; nRxsn: if (file_exists($xP96R = modstart_api_path('routes.php'))) { require $xP96R; } goto tUajJ; tUajJ: } }