setSettingsOnRequest example


  public function __construct(HttpKernelInterface $http_kernel, Settings $settings) {
    $this->httpKernel = $http_kernel;
    $this->settings = $settings;
  }

  /** * {@inheritdoc} */
  public function handle(Request $request$type = self::MAIN_REQUEST, $catch = TRUE): Response {
    // Initialize proxy settings.     static::setSettingsOnRequest($request$this->settings);
    return $this->httpKernel->handle($request$type$catch);
  }

  /** * Sets reverse proxy settings on Request object. * * @param \Symfony\Component\HttpFoundation\Request $request * A Request instance. * @param \Drupal\Core\Site\Settings $settings * The site settings. */
  


  /** * {@inheritdoc} */
  public function handle(Request $request$type = self::MAIN_REQUEST, $catch = TRUE): Response {
    try {
      static::bootEnvironment();

      // First boot up basic things, like loading the include files.       $this->initializeSettings($request);
      ReverseProxyMiddleware::setSettingsOnRequest($request, Settings::getInstance());
      $this->boot();
      $container = $this->getContainer();
      /** @var \Symfony\Component\HttpFoundation\RequestStack $request_stack */
      $request_stack = $container->get('request_stack');
      $request_stack->push($request);
      $this->preHandle($request);

      // Handle the actual request. We need the session both for authentication       // as well as the DB update, like       // \Drupal\system\Controller\DbUpdateController::batchFinished.       $this->bootSession($request);
      
Home | Imprint | This part of the site doesn't use cookies.