Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PdoSessionHandler.php

function PdoSessionHandler::connect

Lazy-connects to the database.

2 calls to PdoSessionHandler::connect()
PdoSessionHandler::getConnection in vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
Return a PDO instance.
PdoSessionHandler::open in vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php

File

vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php, line 422

Class

PdoSessionHandler
Session handler using a PDO connection to read and write data.

Namespace

Symfony\Component\HttpFoundation\Session\Storage\Handler

Code

private function connect(string $dsn) : void {
    $this->pdo = new \PDO($dsn, $this->username, $this->password, $this->connectionOptions);
    $this->pdo
        ->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
    $this->driver = $this->pdo
        ->getAttribute(\PDO::ATTR_DRIVER_NAME);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal