/** * @param \yii\web\Request $request * @return array|bool|void */ public function parseRequest($request) { $route = parent::parseRequest($request); $action = explode('/', $route[0]); $actionCount = count($action); if ($actionCount == 2) { $action = $action[1]; } elseif ($actionCount == 3) { $action = $action[2]; } if ($actionCount > 1) { if (preg_match('/\.([a-zA-Z]+)$/', $action, $matches)) { $type = strtolower($matches[1]);
* @return array|bool|void */ public function parseRequest($request) { $route = parent::parseRequest($request); $action = explode('/', $route[0]); $actionCount = count($action); if ($actionCount == 2) { $action = $action[1]; } elseif ($actionCount == 3) { $action = $action[2]; }
* Resolves the current request into a route and the associated parameters. * @return array the first element is the route, and the second is the associated parameters. * @throws NotFoundHttpException if the request cannot be resolved. */ public function resolve() { $result = Yii::$app->getUrlManager()->parseRequest($this); if ($result !== false) { list($route, $params) = $result; if ($this->_queryParams === null) { $_GET = $params + $_GET; // preserve numeric keys } else { $this->_queryParams = $params + $this->_queryParams;
* @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], '/');
{ 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();
require __DIR__ . '/../index.next/config/_bootstrap.php'; require(__DIR__ . '/../index.next/vendor/yiisoft/yii2/Yii.php'); require(__DIR__ . '/../index.next/base/web/Application.php'); $config = require(__DIR__ . '/../index.next/config/web.php'); (new \app\base\web\Application($config))->run(); if(isset($_SERVER['REQUEST_URI']) && substr($_SERVER['REQUEST_URI'], 0, 8) == '/graphql') { $logGqlDir = __DIR__.'/../index.next/runtime/gql'; if(!is_dir($logGqlDir)) { @mkdir($logGqlDir); }