You are here

private function PdoSessionHandler::connect in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php \Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::connect()

Lazy-connects to the database.

Parameters

string $dsn DSN string:

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 417

Class

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

Namespace

Symfony\Component\HttpFoundation\Session\Storage\Handler

Code

private function connect($dsn) {
  $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);
}