]> git.mxchange.org Git - friendica.git/blobdiff - mod/install.php
Merge commit 'mike/master'
[friendica.git] / mod / install.php
index 21a1b75138a0b99cf40260060030898f3c9d0542..dc91f848e6c74ea99f31b662ae7ee880a4a974ad 100644 (file)
@@ -5,6 +5,7 @@ function install_post(&$a) {
 
        global $db;
 
+       $urlpath = $a->get_path();
        $dbhost = notags(trim($_POST['dbhost']));
        $dbuser = notags(trim($_POST['dbuser']));
        $dbpass = notags(trim($_POST['dbpass']));
@@ -14,16 +15,16 @@ function install_post(&$a) {
 
        require_once("dba.php");
 
-       $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, $true);
+       $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, true);
 
        if(mysqli_connect_errno()) {
                $db = new dba($dbhost, $dbuser, $dbpass, '', true);
-               if(! mysql_connect_errno()) {
+               if(! mysqli_connect_errno()) {
                        $r = q("CREATE DATABASE '%s'",
                                        dbesc($dbdata)
                        );
                        if($r) 
-                               $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, $true);
+                               $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, true);
                }
                if(mysqli_connect_errno()) {
                        notice( t('Could not create/connect to database.') . EOL);
@@ -40,6 +41,7 @@ function install_post(&$a) {
                '$dbpass' => $dbpass,
                '$dbdata' => $dbdata,
                '$timezone' => $timezone,
+               '$urlpath' => $urlpath,
                '$phpath' => $phpath
        ));
        $result = file_put_contents('.htconfig.php', $txt);
@@ -63,14 +65,14 @@ function install_post(&$a) {
 
                notice( t('Database import succeeded.') . EOL 
                        . t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.') . EOL 
-                       . t('Please see the file INSTALL.') . EOL );
+                       . t('Please see the file "INSTALL.txt".') . EOL );
                goaway($a->get_baseurl() . '/register' );
        }
        else {
                $db = null; // start fresh
                notice( t('Database import failed.') . EOL
                        . t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL
-                       . t('Please see the file INSTALL.') . EOL );
+                       . t('Please see the file "INSTALL.txt".') . EOL );
        }
 }
 
@@ -102,6 +104,7 @@ function install_content(&$a) {
 
        $tpl = load_view_file('view/install_db.tpl');
        $o .= replace_macros($tpl, array(
+               '$baseurl' => $a->get_baseurl(),
                '$tzselect' => ((x($_POST,'timezone')) ? select_timezone($_POST['timezone']) : select_timezone()),
                '$submit' => t('Submit'),
                '$dbhost' => ((x($_POST,'dbhost')) ? notags(trim($_POST['dbhost'])) : 'localhost'),
@@ -148,9 +151,10 @@ function check_keys() {
 
        // Get private key
 
-       if(! $res)
-               $o .=  t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys') . EOL;
-
+       if(! $res) {
+               $o .= t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys') . EOL;
+               $o .= t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".') . EOL;
+       }
        return $o;
 
 }
@@ -168,7 +172,7 @@ function check_funcs() {
        if(! function_exists('mysqli_connect')) 
                notice( t('Error: mysqli PHP module required but not installed.') . EOL);       
        if((x($_SESSION,'sysmsg')) && strlen($_SESSION['sysmsg']))
-               notice( t('Please see the file "INSTALL".') . EOL);
+               notice( t('Please see the file "INSTALL.txt".') . EOL);
 }
 
 
@@ -180,7 +184,7 @@ function check_htconfig() {
                $o = t('The web installer needs to be able to create a file called ".htconfig.php" in the top folder of your web server and it is unable to do so.');
                $o .= t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.');
                $o .= t('Please check with your site documentation or support people to see if this situation can be corrected.');
-               $o .= t('If not, you may be required to perform a manual installation. Please see the file "INSTALL" for instructions.'); 
+               $o .= t('If not, you may be required to perform a manual installation. Please see the file "INSTALL.txt" for instructions.'); 
        }
 
        return $o;