}
// Check requirements
$req = new InstallRequirements();
$req->check();
if ($req->hasErrors()) {
    $hasErrorOtherThanDatabase = TRUE;
}
if ($databaseConfig) {
    $dbReq = new InstallRequirements();
    $dbReq->checkdatabase($databaseConfig, 'CiviCRM');
    if ($installType == 'drupal') {
        $dbReq->checkdatabase($drupalConfig, 'Drupal');
    }
}
// Actual processor
if (isset($_POST['go']) && !$req->hasErrors() && !$dbReq->hasErrors()) {
    // Confirm before reinstalling
    if (!isset($_POST['force_reinstall']) && $alreadyInstalled) {
        include $installDirPath . 'template.html';
    } else {
        $inst = new Installer();
        $inst->install($_POST);
    }
    // Show the config form
} else {
    include $installDirPath . 'template.html';
}
/**
 * This class checks requirements
 * Each of the requireXXX functions takes an argument which gives a user description of the test.  It's an array
 * of 3 parts:
Example #2
0
if ($req->hasErrors()) {
    $hasErrorOtherThanDatabase = true;
    $phpIniLocation = php_ini_loaded_file();
}
if ($databaseConfig) {
    $dbReq = new InstallRequirements();
    $dbReq->checkDatabase($databaseConfig);
}
if ($adminConfig) {
    $adminReq = new InstallRequirements();
    $adminReq->checkAdminConfig($adminConfig);
}
// Actual processor
$installFromCli = isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'install';
// CLI-install error message.  exit(1) will halt any makefile.
if ($installFromCli && ($req->hasErrors() || $dbReq->hasErrors())) {
    echo "Cannot install due to errors:\n";
    $req->listErrors();
    $dbReq->listErrors();
    exit(1);
}
if ((isset($_REQUEST['go']) || $installFromCli) && !$req->hasErrors() && !$dbReq->hasErrors() && $adminConfig['username'] && $adminConfig['password']) {
    // Confirm before reinstalling
    if (!$installFromCli && $alreadyInstalled) {
        include FRAMEWORK_NAME . '/dev/install/config-form.html';
    } else {
        $inst = new Installer();
        if ($_REQUEST) {
            $inst->install($_REQUEST);
        } else {
            $inst->install(array('db' => $databaseConfig, 'admin' => $adminConfig));