]> git.mxchange.org Git - friendica.git/blobdiff - index.php
Merge remote-tracking branch 'CatoTH/master' into req245
[friendica.git] / index.php
index 0cf74365c6db7a6d40d54e11f363909044554fc9..442173eeb84e1c5d5ee973668056e84bfb9bc302 100644 (file)
--- a/index.php
+++ b/index.php
@@ -11,7 +11,6 @@
  * bootstrap the application
  *
  */
-try {
 
 require_once('boot.php');
 
@@ -39,11 +38,10 @@ load_translation_table($lang);
  */
 
 require_once("dba.php");
-$db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
-        unset($db_host, $db_user, $db_pass, $db_data);
-
 
 if(! $install) {
+       $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
@@ -97,6 +95,10 @@ if((x($_SESSION,'language')) && ($_SESSION['language'] !== $lang)) {
 if(x($_GET,'zrl')) {
        $_SESSION['my_url'] = $_GET['zrl'];
        $a->query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string);
+       if(! $install) {
+               $arr = array('zrl' => $_SESSION['my_url'], 'url' => $a->cmd);
+               call_hooks('zrl_init',$arr);
+       }
 }
 
 /**
@@ -361,19 +363,13 @@ $profile = $a->profile;
 
 header("Content-type: text/html; charset=utf-8");
 
-$template = 'view/' . current_theme() . '/' 
+$template = 'view/theme/' . current_theme() . '/' 
        . ((x($a->page,'template')) ? $a->page['template'] : 'default' ) . '.php';
 
 if(file_exists($template))
        require_once($template);
 else
-       require_once(str_replace(current_theme() . '/', '', $template));
+       require_once(str_replace('theme/' . current_theme() . '/', '', $template));
 
 session_write_close();
 exit;
-} catch(Exception $ex) {
-// it may fail because logger uses the db, 
-// but give it a try: 
-logger('exception caught at index.php: '.$ex->getMessage()); 
-system_unavailable(); 
-}
\ No newline at end of file