diff options
author | Camil Staps | 2015-02-05 00:40:47 +0100 |
---|---|---|
committer | Camil Staps | 2015-02-05 00:40:47 +0100 |
commit | c50a323c25a0787ba2051b19721983776a229615 (patch) | |
tree | 87e13060ca6633bed3f5de2e25c5eedf866a0073 /conf.php | |
parent | Initial commit (diff) |
Initial commit
Diffstat (limited to 'conf.php')
-rw-r--r-- | conf.php | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/conf.php b/conf.php new file mode 100644 index 0000000..45a2571 --- /dev/null +++ b/conf.php @@ -0,0 +1,69 @@ +<?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(E_ALL); +ini_set('display_errors', 1); + +//------------------------------------------------------------------------------ +// Start editing below this line +//------------------------------------------------------------------------------ + +error_reporting(E_ALL); +ini_set('display_errors', 1); + +// Database settings (should be mysql) +$db_host = 'localhost'; +$db_name = 'my_database'; +$db_user = 'my_database_user'; +$db_pass = 'my_password'; +$db_port = '3306'; + +//------------------------------------------------------------------------------ +// Don't edit below this line +//------------------------------------------------------------------------------ + +/** + * 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.class.php"); +} + +set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__)); + +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."); +} |