Exemple #1
0
    case 'u5':
        ?>
            <h2><?php 
        echo _T("Check of the database");
        ?>
</h2>
            <p><?php 
        echo _T("Check the parameters and the existence of the database");
        ?>
</p>
    <?php 
        $permsdb_ok = true;
        if ($_POST['install_dbtype'] == 'sqlite') {
            $test = Galette\Core\Db::testConnectivity($_POST['install_dbtype']);
        } else {
            $test = Galette\Core\Db::testConnectivity($_POST['install_dbtype'], $_POST['install_dbuser'], $_POST['install_dbpass'], $_POST['install_dbhost'], $_POST['install_dbport'], $_POST['install_dbname']);
        }
        if ($test === true) {
            echo '<p id="infobox">' . _T("Connection to database successfull") . '</p>';
        } else {
            $permsdb_ok = false;
            echo '<div id="errorbox">';
            echo '<h1>' . _T("Unable to connect to the database") . '</h1>';
            echo '<p class="debuginfos">' . $test->getMessage() . '<span>' . $test->getTraceAsString() . '</span></p>';
            echo '</div>';
        }
        if (!$permsdb_ok) {
            ?>
            <p><?php 
            echo _T("Database can't be reached. Please go back to enter the connection parameters again.");
            ?>