<?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($PbprP) { self::$gates[] = $PbprP; } public function handle(Request $Mjv3h, \Closure $WExJt) { goto nri8G; WeKQu: foreach (self::$gates as $Xvngd) { goto bW5FC; U5Nzz: $f3Nqc = $URw5T->check($Mjv3h); goto RtpXL; RtpXL: if (Response::isError($f3Nqc)) { return $f3Nqc; } goto jKcOM; bW5FC: $URw5T = app($Xvngd); goto U5Nzz; jKcOM: } goto fDAIN; nri8G: if (method_exists(CurrentApp::class, 'set')) { CurrentApp::set(CurrentApp::API); } goto WeKQu; fDAIN: FieldManager::registerBuiltinFields(); goto pIzr2; x_PKJ: return $WExJt($Mjv3h); goto OT8HL; pIzr2: WidgetManager::registerBuiltinWidgets(); goto mvqyH; mvqyH: if (file_exists($RgmUO = modstart_admin_path('bootstrap.php'))) { require $RgmUO; } goto x_PKJ; OT8HL: } }