load $a->config from db

This commit is contained in:
Fabio Comuni 2011-06-13 12:51:36 +02:00
parent d66056af9d
commit afd0f8e4d8

View file

@ -29,7 +29,6 @@ $install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false
@include(".htconfig.php"); @include(".htconfig.php");
$lang = get_language(); $lang = get_language();
load_translation_table($lang); load_translation_table($lang);
@ -45,6 +44,20 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
unset($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data);
/**
* Load configs from db. Overwrite configs from .htconfig.php
*/
$r = q("SELECT * FROM `config` WHERE `cat` IN ('system', 'config')");
foreach ($r as $c) {
if ($c['cat']=='config') {
$a->config[$c['k']] = $c['v'];
} else {
$a->config[$c['cat']][$c['k']] = $c['v'];
}
}
unset($r);
/** /**
* *
* Important stuff we always need to do. * Important stuff we always need to do.