]> git.mxchange.org Git - friendica.git/commitdiff
load $a->config from db
authorFabio Comuni <fabrix.xm@gmail.com>
Mon, 13 Jun 2011 10:51:36 +0000 (12:51 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Mon, 13 Jun 2011 10:51:36 +0000 (12:51 +0200)
index.php

index 534cb93f7cf4ee38148030f55fefac6aa42878cc..9bca1527bfc99f1926d89fdc1280475e0ad2b465 100644 (file)
--- a/index.php
+++ b/index.php
@@ -29,7 +29,6 @@ $install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false
 
 @include(".htconfig.php");
 
-
 $lang = get_language();
        
 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);
 
 
+/**
+ * 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.