<?php
function define_($name, $value) {
	if(!defined($name)) {
		define($name, $value);
	}
}

if(file_exists(dirname(__FILE__) . "/localconfig.inc")) {
	include dirname(__FILE__) . "/localconfig.inc";
}

/*
 * Customizeable settings
 */
define_("TEMPLATE_ROOT", "/var/www/templates/");
define_("DB_HOST", "db-primary");
define_("DB_USER", "root");
define_("DB_PASS", "");
define_("DB_DATABASE", "bifrost");
define_("IMAGE_DOMAIN", "bifrost-images");

/*
 * Composer vendor path
 */

define_("COMPOSER_VENDOR_PATH", "/usr/local/code/3rdparty/");

/*
 * Application settings. Do not edit!
 */

define("APP_ROOT", dirname(__FILE__) . "/");
define("LIB_ROOT", APP_ROOT . "libs/");
define("VIEW_ROOT", APP_ROOT . "views/");
define("LOGIC_ROOT", APP_ROOT . "business_logic/");
define("DEVTOOL_ROOT", APP_ROOT . "editor/");
function bifrost_autoload($class) {
	if(file_exists(LIB_ROOT . $class . ".inc")) {
		require_once (LIB_ROOT . $class . ".inc");
	}
}
function business_logic_autoload($class) {
	if(file_exists(LOGIC_ROOT . $class . ".inc")) {
		require_once (LOGIC_ROOT . $class . ".inc");
	}
}

spl_autoload_register("bifrost_autoload");
spl_autoload_register("business_logic_autoload");

require_once COMPOSER_VENDOR_PATH . 'vendor/autoload.php';



