]> git.mxchange.org Git - friendica.git/blobdiff - index.php
revup
[friendica.git] / index.php
index dc149436c16564c1a2cf7b6ad40ab821295da825..3e72baddc5a9d7ec278d9aa9b410da6e4e161564 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,7 +1,5 @@
 <?php
 
-error_reporting(E_ERROR | E_WARNING | E_PARSE);
-
 /**
  *
  * Friendika
@@ -29,22 +27,7 @@ $install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false
 
 @include(".htconfig.php");
 
-/**
- *
- * Get the language setting directly from system variables, bypassing get_config()
- * as database may not yet be configured.
- * 
- * If possible, we use the value from the browser.
- *
- */
-
-if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
-       $langs = preg_split("/[,-]/",$_SERVER['HTTP_ACCEPT_LANGUAGE'],2);
-       $lang = $langs[0];
-} else {
-       $lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
-}
-
+$lang = get_language();
        
 load_translation_table($lang);
 
@@ -59,6 +42,21 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
         unset($db_host, $db_user, $db_pass, $db_data);
 
 
+if(! $install) {
+
+       /**
+        * Load configs from db. Overwrite configs from .htconfig.php
+        */
+
+       load_config('config');
+       load_config('system');
+
+       require_once("session.php");
+       load_hooks();
+       call_hooks('init_1');
+}
+
+
 /**
  *
  * Important stuff we always need to do.
@@ -71,14 +69,6 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
  *
  */
 
-if(! $install) {
-       require_once("session.php");
-       load_hooks();
-       call_hooks('init_1');
-}
-
-
-
 require_once("datetime.php");
 
 $a->timezone = (($default_timezone) ? $default_timezone : 'UTC');