DEFINE('PUBLIC_SCHEMA', 'public'); DEFINE('DEV_SCHEMA', 'public'); DEFINE('TEST_SCHEMA', 'public'); DEFINE('LIVE_SCHEMA', 'public'); /************* DB ACCESS *****************/ if (file_exists(BASE.CONFIGS.'config.db.inc')) { require BASE.CONFIGS.'config.db.inc'; } /************* CORE HOST SETTINGS *****************/ if (file_exists(BASE.CONFIGS.'config.host.inc')) { require BASE.CONFIGS.'config.host.inc'; } /************* OTHER PATHS *****************/ if (file_exists(BASE.CONFIGS.'config.path.inc')) { require BASE.CONFIGS.'config.path.inc'; } // set the USE_DATABASE var, if there is nothing set, we assume TRUE $USE_DATABASE = defined('USE_DATABASE') ? USE_DATABASE : true; // live frontend pages // ** missing live domains ** // get the name without the port list($HOST_NAME) = array_pad(explode(':', $_SERVER['HTTP_HOST'], 2), 2, null); if (!isset($DB_HOST[$HOST_NAME]) && $USE_DATABASE) { echo 'No matching DB config found. Contact Admin
'; exit -1; } // set HOST name DEFINE('HOST_NAME', $HOST_NAME); // set SSL on if ((array_key_exists('HTTPS', $_SERVER) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) { DEFINE('HOST_SSL', true); DEFINE('HOST_PROTOCOL', 'https://'); } else { DEFINE('HOST_SSL', false); DEFINE('HOST_PROTOCOL', 'http://'); } // define the static names DEFINE('LOGIN_DB', $DB_HOST[$HOST_NAME]); DEFINE('MAIN_DB', $DB_HOST[$HOST_NAME]); DEFINE('DB_SCHEMA', $DB_PATH[$HOST_NAME]); // DEFINE('TARGET_DB', $DB_TARGET_HOST[$HOST_NAME]); // DEFINE('URL_REDIRECT_DB', $DB_URL_REDIRECT_HOST[$HOST_NAME]); // next three if top is not set // DEFINE('TEST_SCHEMA', $DB_CONFIG[MAIN_DB]['db_schema']); // DEFINE('DEV_SCHEMA', $DB_CONFIG[MAIN_DB]['db_schema']); // DEFINE('PUBLIC_SCHEMA', $DB_CONFIG[TARGET_DB]['db_schema']); DEFINE('LOGIN_DB_SCHEMA', PUBLIC_SCHEMA); // where the edit* tables are DEFINE('GLOBAL_DB_SCHEMA', PUBLIC_SCHEMA); // where global tables are that are used by all schemas (eg queue tables for online, etc) DEFINE('TARGET', $LOCATION[$HOST_NAME]); // DEFINE('CSV_PATH', $PATHS[TARGET]['csv_path']); // DEFINE('EXPORT_SCRIPT', $PATHS[TARGET]['perl_bin']); // DEFINE('REDIRECT_URL', $PATHS[TARGET]['redirect_url']); DEFINE('DEBUG', $DEBUG_FLAG[$HOST_NAME]); DEFINE('SITE_LANG', $SITE_LANG[$HOST_NAME]); DEFINE('SHOW_ALL_ERRORS', true); // show all errors if debug_all & show_error_handling are enabled /************* GENERAL PAGE TITLE ********/ DEFINE('G_TITLE', ''); /************ STYLE SHEETS / JS **********/ DEFINE('ADMIN_STYLESHEET', 'edit.css'); DEFINE('ADMIN_JAVASCRIPT', 'edit.js'); DEFINE('STYLESHEET', 'frontend.css'); DEFINE('JAVASCRIPT', 'frontend.js'); // anything optional /************* INTERNAL ******************/ // any other global definitons here // DEFINE('SOME_ID', ); /************* CONVERT *******************/ $paths = array ( '/bin', '/usr/bin', '/usr/local/bin' ); // find convert foreach ($paths as $path) { if (file_exists($path.DS.'convert') && is_file($path.DS.'convert')) { // image magick convert location DEFINE('CONVERT', $path.DS.'convert'); } } // turn off debug if debug flag is OFF if (defined('DEBUG') && DEBUG == false) { $ECHO_ALL = 0; $DEBUG_ALL = 0; $PRINT_ALL = 0; $DB_DEBUG = 0; $ENABLE_ERROR_HANDLING = 0; } else { $ECHO_ALL = 0; $DEBUG_ALL = 1; $PRINT_ALL = 1; $DB_DEBUG = 1; } // read auto loader require BASE.LIB.'autoloader.php'; // __END__