summaryrefslogtreecommitdiff
path: root/frontend/conf.php
blob: dea8c25c1d14e72b0a53d2fc8534488aa030eaea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
define('DB_HOST', 'db');
define('DB_NAME', 'clpmdb');
define('DB_USER', 'clpm');
define('DB_PASS', 'clpm');
define('DB_PORT', 3306);

session_start();

try {
	$_pdo = new PDO("mysql:host=".DB_HOST.";port=".DB_PORT.";dbname=".DB_NAME.";charset=utf8", DB_USER, DB_PASS);
	$_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	$_pdo->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_NATURAL);
	$_pdo->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
} catch (PDOException $e) {
	die("Down until PDO error fixed.");
}

spl_autoload_register(function ($pClass) {
	$path = __DIR__ . "/$pClass.php";
	if (file_exists($path))
		require_once($path);
});