-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.php.in
28 lines (24 loc) · 927 Bytes
/
database.php.in
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
<?php
/**
* Database connection parameters and function for VCard testing.
* @author Eric Vought [email protected] 2014-11-14
* @license MIT http://opensource.org/licenses/MIT
* NOTE: database.php is generated by "phing dbconfig" from database.php.in
* with db.properties. Edit the values in db.properties.
*/
const VCARD_DSN = "@vcardtools.db.unittest.dsn@";
const VCARD_USERNAME = "@vcardtools.db.unittest.user@";
const VCARD_PASSWORD = "@vcardtools.db.unittest.passwd@";
const VCARD_DBNAME = "@vcardtools.db.unittest.dbname@";
/**
* Connect to database and return a PDO connection
*/
function vcard_db_connect()
{
$connection = new PDO( VCARD_DSN . ';dbname=' . VCARD_DBNAME,
VCARD_USERNAME, VCARD_PASSWORD );
// set the PDO error mode to exception
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $connection;
}
?>