<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\App\Api\Middleware; use Illuminate\Http\Request; use ModStart\App\Core\AccessGate; use ModStart\App\Core\CurrentApp; use ModStart\Core\Input\Response; use ModStart\Support\Manager\FieldManager; use ModStart\Support\Manager\WidgetManager; class BootstrapMiddleware { private static $gates = array(); public static function addGate($cxdWJ) { self::$gates[] = $cxdWJ; } public function handle(Request $Kv_Mp, \Closure $SuXEo) { goto UWxMS; UWxMS: if (method_exists(CurrentApp::class, 'set')) { CurrentApp::set(CurrentApp::API); } goto hxJ6p; x7opv: if (file_exists($CdZE0 = modstart_admin_path('bootstrap.php'))) { require $CdZE0; } goto Q7ZRe; Q7ZRe: return $SuXEo($Kv_Mp); goto uOc4M; NK2GO: FieldManager::registerBuiltinFields(); goto HL2V4; hxJ6p: foreach (self::$gates as $P1uVJ) { goto oyGFS; jYeuV: $bCCWW = $OX9qF->check($Kv_Mp); goto d_PvM; oyGFS: $OX9qF = app($P1uVJ); goto jYeuV; d_PvM: if (Response::isError($bCCWW)) { return $bCCWW; } goto yVc3G; yVc3G: } goto NK2GO; HL2V4: WidgetManager::registerBuiltinWidgets(); goto x7opv; uOc4M: } }