Esempio n. 1
0
        $db_user = $_POST['db_user'];
    } else {
        $problems[] = "Database user should be specified.";
    }
    if (isset($_POST['db_pass'])) {
        $db_pass = $_POST['db_pass'];
    } else {
        $problems[] = "Database password should be specified.";
    }
    if (isset($_POST['db_name'])) {
        $db_name = $_POST['db_name'];
    } else {
        $problems[] = "Database name should be specified.";
    }
    $db_prefix = isset($_POST['db_prefix']) ? $_POST['db_prefix'] : '';
    if ($inst->checkDBConnection($db_host, $db_port, $db_user, $db_pass, $db_name)) {
        if (count($problems) == 0) {
            $inst->createConfigFile("./codebase/php/config.php", $db_host, $db_port, $db_user, $db_pass, $db_name, $db_prefix);
            $inst->loadDump($db_host, $db_port, $db_user, $db_pass, $db_name, $db_prefix);
            $inst->removeInstallFiles();
            unlink(__FILE__);
            $inst->redirectTo("samples/01_simple_init.html");
        }
    } else {
        $problems[] = "Database connection is failed. Check database configuration.";
    }
}
if (!isset($_POST['db_host']) || count($problems) > 0) {
    ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
Esempio n. 2
0
 } else {
     $problems[] = "Database user should be specified.";
 }
 if (isset($_POST['db_pass'])) {
     $db_pass = $_POST['db_pass'];
 } else {
     $problems[] = "Database password should be specified.";
 }
 if (isset($_POST['db_name'])) {
     $db_name = $_POST['db_name'];
 } else {
     $problems[] = "Database name should be specified.";
 }
 $db_prefix = isset($_POST['db_prefix']) ? $_POST['db_prefix'] : '';
 $db_type = isset($_POST['db_type']) ? $_POST['db_type'] : 'MySQL';
 $conn = $inst->checkDBConnection($db_host, $db_port, $db_user, $db_pass, $db_name, $db_type);
 if ($conn === true) {
     if (count($problems) == 0) {
         $inst->copyFiles();
         $inst->createConfigFile("./codebase/php/config.php", $db_host, $db_port, $db_user, $db_pass, $db_name, $db_prefix, $db_type);
         $inst->loadDump($db_host, $db_port, $db_user, $db_pass, $db_name, $db_type, $db_prefix);
         $inst->removeInstallFiles();
         unlink(__FILE__);
         $inst->redirectTo("samples/01_simple_init.html");
     }
 } else {
     if (is_string($conn)) {
         $problems[] = $conn;
     } else {
         $problems[] = "Database connection is failed. Check database configuration.";
     }