Beispiel #1
0
function do_install()
{
    // {{{
    if (isset($_POST['database_dsn'])) {
        install_process($_POST['database_dsn']);
    } else {
        if (file_exists("auto_install.conf")) {
            install_process(trim(file_get_contents("auto_install.conf")));
            unlink("auto_install.conf");
        } else {
            begin();
        }
    }
}
Beispiel #2
0
function do_install()
{
    // {{{
    if (file_exists("data/config/auto_install.conf.php")) {
        require_once "data/config/auto_install.conf.php";
        install_process();
    } else {
        if (@$_POST["database_type"] == "sqlite" && isset($_POST["database_name"])) {
            define('DATABASE_DSN', "sqlite:{$_POST["database_name"]}");
            define("DATABASE_KA", true);
            // Keep database connection alive
            install_process();
        } else {
            if (isset($_POST['database_type']) && isset($_POST['database_host']) && isset($_POST['database_user']) && isset($_POST['database_name'])) {
                define('DATABASE_DSN', "{$_POST['database_type']}:user={$_POST['database_user']};password={$_POST['database_password']};host={$_POST['database_host']};dbname={$_POST['database_name']}");
                define("DATABASE_KA", true);
                // Keep database connection alive
                install_process();
            } else {
                ask_questions();
            }
        }
    }
}
Beispiel #3
0
function do_install()
{
    // {{{
    if (isset($_POST['database_type']) && isset($_POST['database_host']) && isset($_POST['database_user']) && isset($_POST['database_name'])) {
        global $database_dsn;
        $database_dsn = "{$_POST['database_type']}:user={$_POST['database_user']};password={$_POST['database_password']};host={$_POST['database_host']};dbname={$_POST['database_name']}";
        install_process();
    } else {
        if (file_exists("auto_install.conf")) {
            install_process(trim(file_get_contents("auto_install.conf")));
            unlink("auto_install.conf");
        } else {
            begin();
        }
    }
}