diff --git a/src/bootstrap.php b/src/bootstrap.php index bde32179..486c9b41 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -90,14 +90,7 @@ foreach($includes as $file) { $db = new psm\Service\Database(); // sanity check! -if(defined('PSM_INSTALL') && PSM_INSTALL) { - // install mode - if($db->status()) { - // connection established, attempt to load config. - // no biggie if it doesnt work because the user is still in the install module. - psm_load_conf(); - } -} else { +if(!defined('PSM_INSTALL') || !PSM_INSTALL) { if($db->getDbHost() === null) { // no config file has been loaded, redirect the user to the install header('Location: install.php'); diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php index 8b1f863c..829de923 100644 --- a/src/includes/functions.inc.php +++ b/src/includes/functions.inc.php @@ -136,9 +136,11 @@ function psm_get_conf($key, $alt = null) { function psm_load_conf() { global $db; - // load config from database into global scope $GLOBALS['sm_config'] = array(); + if(!defined('PSM_DB_PREFIX') || !$db->status()) { + return false; + } if(!$db->ifTableExists(PSM_DB_PREFIX.'config')) { return false; }