‪TYPO3CMS  9.5
Driver.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
19 use Doctrine\DBAL\DBALException;
20 use Doctrine\DBAL\Driver\PDOMySql\Driver as DoctrinePDOMySqlDriver;
21 use PDOException;
23 
28 class ‪Driver extends DoctrinePDOMySqlDriver
29 {
33  public function ‪connect(array $params, $username = null, $password = null, array $driverOptions = [])
34  {
35  try {
36  $conn = new ‪PDOConnection(
37  $this->constructPdoDsn($params),
38  $username,
39  $password,
40  $driverOptions
41  );
42 
43  // use prepared statements for pdo_mysql per default to retrieve native data types
44  if (!isset($driverOptions[\PDO::ATTR_EMULATE_PREPARES])) {
45  $conn->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false);
46  }
47  } catch (PDOException $e) {
48  throw DBALException::driverException($this, $e);
49  }
50 
51  return $conn;
52  }
53 }
‪TYPO3\CMS\Core\Database\Driver\PDOMySql\Driver
Definition: Driver.php:29
‪TYPO3\CMS\Core\Database\Driver\PDOMySql\Driver\connect
‪connect(array $params, $username=null, $password=null, array $driverOptions=[])
Definition: Driver.php:33
‪TYPO3\CMS\Core\Database\Driver\PDOConnection
Definition: PDOConnection.php:28
‪TYPO3\CMS\Core\Database\Driver\PDOMySql
Definition: Driver.php:4