aboutsummaryrefslogblamecommitdiff
path: root/conf.php
blob: 66e366d9d7b422b2f5dbcf31c3400f2e70755528 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13











                                                                                                          
  


                                                                       
  


                                                                  
  



                                                                        

                             
 
                                                                          
 
                                            
 
                                          
                                                 


                                    
     
                                                                                                                     
                                                                       
                                                                       

                                           
                        
                                                                       





                                                                    
                                                                   
<?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);

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

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

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

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.");
}

if (BRAINTREE_ENABLED) {
	require_once(__DIR__ . '/modules/braintree/lib/Braintree.php');

	Braintree_Configuration::environment(BRAINTREE_ENVIRONMENT);
	Braintree_Configuration::merchantId(BRAINTREE_MERCHANT);
	Braintree_Configuration::publicKey(BRAINTREE_KEY_PUBLIC);
	Braintree_Configuration::privateKey(BRAINTREE_KEY_PRIVATE);
}

require_once(__DIR__ . '/modules/PHPMailer/PHPMailerAutoload.php');