Beispiel #1
0
<?php

require_once "php/install_functions.php";
if (isset($_POST['step']) || !dbConfigExists() || !canConnect() || !isPopulated()) {
    #echo("hola");
    require_once "views/installation/install.php";
    die;
}
// include the configs / constants for the database connection
require_once "config/db.php";
//HEADER
require_once "views/header.html";
$jar = False;
$create = False;
if (isset($_GET["jar"])) {
    $jar = True;
} elseif (isset($_GET["create"])) {
    $create = True;
}
//NAV
require_once "views/index/nav.php";
//CONTENT
if (isset($_GET["jar"])) {
    require_once "views/index/jar.php";
} elseif (isset($_GET["create"])) {
    require_once "views/index/create.php";
} else {
    require_once "views/index/server.php";
}
//FOOTER
require_once "views/footer.html";
Beispiel #2
0
switch ($step) {
    case 0:
        // Step 0, Welcome Screen
        #Check dbConfigExists and have valid data (ie not default data)
        #if exists, jumps to step 2
        #if dont, jumps to step 1
        if (dbConfigExists() && canConnect() && isPopulated()) {
            echo addError("Instalation already Exist!", "403");
            #require_once("views/installation/error.php");
            die;
        }
        require_once "views/installation/phase0.php";
        break;
    case 1:
        // Step 1, Config Setup
        if (dbConfigExists() && canConnect() && isPopulated()) {
            echo addError("Instalation already Exist!", "403");
            die;
        }
        #Creates config file if it doesnt exist (if exists exit??)
        if (!dbConfigExists()) {
            copy("config/db-sample.php", "config/db.php");
        }
        #Ask for database settings (DB_HOST, DB_USER, DB_PASS, DB_NAME)
        #jumps to step 2
        require_once "views/installation/phase1.php";
        break;
    case 2:
        // Step 2, Initial Data
        #Try to connects to the database
        #if cant connect show error message (possible mysql not installed, or wrong configs..)