8 private static $dbh = null;
11 * Return an already existing database object or newly instantiated object
13 * @return \PDO A database connection using PDO
15 public static function connect() {
16 if (self
::$dbh === null) {
18 self
::$dbh = new PDO(AUR_db_DSN_prefix
. ":" . AUR_db_host
19 . ";dbname=" . AUR_db_name
, AUR_db_user
, AUR_db_pass
);
20 self
::$dbh->exec("SET NAMES 'utf8' COLLATE 'utf8_general_ci';");
21 } catch (PDOException
$e) {
22 die('Error - Could not connect to AUR database');