fromRequest($request_stack->getCurrentRequest()); } /** * {@inheritdoc} */ public function fromRequest(Request $request) { parent::fromRequest($request); // @todo Extract the code in DrupalKernel::initializeRequestGlobals. // See https://www.drupal.org/node/2404601 if (isset($GLOBALS['base_url'])) { $this->setCompleteBaseUrl($GLOBALS['base_url']); } } /** * Gets the scheme, host and base path. * * For example, in an installation in a subdirectory "d8", it should be * "https://example.com/d8". */ public function getCompleteBaseUrl() { return $this->completeBaseUrl; } /** * Sets the complete base URL for the Request context. * * @param string $complete_base_url * The complete base URL. */ public function setCompleteBaseUrl($complete_base_url) { $this->completeBaseUrl = $complete_base_url; } }