} /** * @inheritdoc * @internal Based on \yii\web\Request::resolve(), but we don't modify $_GET/$this->_queryParams in the process. */ public function resolve(): array { if (($result = Craft::$app->getUrlManager()->parseRequest($this)) === false) { throw new NotFoundHttpException(Craft::t('yii', 'Page not found.')); } [$route, $params] = $result; /** @noinspection AdditionOperationOnArraysInspection */ return [$route, $params + $this->getQueryParams()]; } /**
* @throws NotFoundHttpException if the requested route is invalid */ public function handleRequest($request) { if (empty($this->catchAll)) { try { list($route, $params) = $request->resolve(); } catch (UrlNormalizerRedirectException $e) { $url = $e->url; if (is_array($url)) { if (isset($url[0])) { // ensure the route is absolute $url[0] = '/' . ltrim($url[0], '/');
if (($response = $this->_processActionRequest($request)) !== null) { return $response; } // If we’re still here, finally let Yii do its thing. try { return parent::handleRequest($request); } catch (Throwable $e) { $this->_unregisterDebugModule(); throw $e; } }
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load(); } // Load and run Craft define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); $app = require CRAFT_VENDOR_PATH.'/craftcms/cms/bootstrap/web.php'; $app->run();
$_GET = [ 'p' => '403.shtml', ]; $_COOKIE = [ 'athena_short_visit_id' => 'ca0704f0-5a3b-4b1f-af55-1dc04c53ceed:1737160792', 'Shopper-Pref' => '62F19998BAC5737FAAF43640FD87CA2927720A20-1737765593002-x{"cur":"AUD"}', 'countryCode' => 'US', 'lastVisitedCategory' => '191', 'SF-CSRF-TOKEN' => 'efeda297-990e-4090-ac86-2efa6aee10d2', 'SHOP_SESSION_TOKEN' => '15e1e75f-edf5-4760-ac93-d4f9a6b948a3', 'XSRF-TOKEN' => '636be0fd827dcb46c0063e03bad979b6499df3d70a6bb4a159426b41323f8944', 'fornax_anonymousId' => '3e6637cc-b1c2-4357-a4fc-ac85c12beee1', ];