initializeSettings example


  public static function createFromRequest(Request $request$class_loader$environment$allow_dumping = TRUE, $app_root = NULL) {
    $kernel = new static($environment$class_loader$allow_dumping$app_root);
    static::bootEnvironment($app_root);
    $kernel->initializeSettings($request);
    return $kernel;
  }

  /** * Constructs a DrupalKernel object. * * @param string $environment * String indicating the environment, e.g. 'prod' or 'dev'. * @param $class_loader * The class loader. Normally \Composer\Autoload\ClassLoader, as included by * the front controller, but may also be decorated. * @param bool $allow_dumping * (optional) FALSE to stop the container from being written to or read * from disk. Defaults to TRUE. * @param string $app_root * (optional) The path to the application root as a string. If not supplied, * the application root will be computed. */
    return FALSE;
  }

  /** * {@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.
Home | Imprint | This part of the site doesn't use cookies.