aboutsummaryrefslogtreecommitdiff
path: root/conf.php
blob: e8ed00098cf40f992a924b9e41f015938d0bb471 (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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
 * conf.php
 *
 * @author Camil Staps
 *
 * Configuration file for the control panel
 *
 * You can edit some configuration properties, in the area marked for that.
 * The file also provides the basics that should be run on every page (session, database connection, etc.)
 *
 * BusinessAdmin: administrative software for small companies
 * Copyright (C) 2015 Camil Staps (ViviSoft)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

session_start();

error_reporting(0);
ini_set('display_errors', 0);

/**
 * Autoload a class if it isn't loaded yet
 *
 * This function is automatically called by PHP if a class isn't loaded yet. It shouldn't be used manually.
 *
 * @param string $pClass The name of the class to load
 */
function __autoload($pClass) {
	require_once("classes/$pClass.php");
}

set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__));

require_once('./conf.private.php');

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);
} catch (PDOException $e) {
	die("Down until PDO error fixed.");
}