aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework/phpbb_database_connection_odbc_pdo_wrapper.php
blob: db31edc984461febaab92e24f5dd29dffd900e95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/

if (!class_exists('PDO'))
{
	return;
}

/**
* Used for passing in information about the PDO driver
* since the PDO class reveals nothing about the DSN that
* the user provided.
*
* This is used in the custom PHPUnit ODBC driver
*/
class phpbb_database_connection_odbc_pdo_wrapper extends PDO
{
	// Name of the driver being used (i.e. mssql)
	public $driver = '';

	// Version number of driver since PDO::getAttribute(PDO::ATTR_CLIENT_VERSION) is pretty useless for this
	public $version = 0;

	function __construct($dbms, $version, $dsn, $user, $pass)
	{
		$this->driver = $dbms;
		$this->version = (double) $version;

		parent::__construct($dsn, $user, $pass);
	}
}