예제 #1
0
파일: install.php 프로젝트: horrabin/opendb
function install_check_mysql_collation_mismatch()
{
    $buffer = '';
    $default_collation = get_opendb_table_column_collation_mismatches($table_colation_mismatch, $table_column_colation_mismatch);
    if (is_not_empty_array($table_colation_mismatch) || is_not_empty_array($table_column_colation_mismatch)) {
        $buffer .= "<h3>MYSQL Collation Mismatch</h3>\n";
        $buffer .= "<p class=\"installwarning\">This OpenDb installation has table and/or table column collation mismatches.  This may or may not\n\t\t\t\tbe indicative of a problem.  Check out the <a href=\"https://github.com/pellcorp/opendb/wiki/Mysql_Collation_Mismatch_Error\">OpenDb website topic</a> \n\t\t\t\tfor more information.</p>";
        $buffer .= "<p>The database default or prevalent table collation (where the database default cannot be derived) \n\t\t\t\tis <strong>{$default_collation}</strong>.  The following table and/or table columns do not match:</p>";
        $buffer .= "<table>";
        $buffer .= "<tr class=\"navbar\"><th>Table</th><th>Column</th><th>Collation</th></tr>";
        $table_r = fetch_opendb_table_list_r();
        while (list(, $table) = each($table_r)) {
            if (isset($table_colation_mismatch[$table])) {
                $buffer .= "<tr><td class=\"prompt\">{$table}</td><td class=\"prompt\">&nbsp;</td><td class=\"data\">" . $table_colation_mismatch[$table] . "</td></tr>";
            }
            if (isset($table_column_colation_mismatch[$table])) {
                while (list($column, $collation) = each($table_column_colation_mismatch[$table])) {
                    $buffer .= "<tr><td class=\"prompt\">{$table}</td><td class=\"prompt\">{$column}</td><td class=\"data\">" . $collation . "</td></tr>";
                }
            }
        }
        $buffer .= "</table>";
    }
    return $buffer;
}
예제 #2
0
파일: index.php 프로젝트: horrabin/opendb
            $HTTP_VARS['tables'][] = $value;
        }
    }
    @reset($HTTP_VARS['tables']);
    while (list(, $table) = @each($HTTP_VARS['tables'])) {
        echo $CRLF . "#" . $CRLF;
        echo "# " . get_opendb_lang_var('dumping_data_for_table', 'table', $table) . $CRLF;
        echo "#" . $CRLF . $CRLF;
        get_table_content($table, $CRLF);
    }
} else {
    //if($HTTP_VARS['op'] == 'export')
    echo "<h3>Which tables should be backed up?</h3>";
    echo "<form method=\"POST\" action=\"{$PHP_SELF}\">" . "<input type=\"hidden\" name=\"type\" value=\"{$ADMIN_TYPE}\">" . "<input type=\"hidden\" name=\"op\" value=\"export\">" . "<input type=\"hidden\" name=\"mode\" value=\"job\">";
    echo "<ul class=\"checkboxGridOptionsVertical\">";
    $opendb_tables_r = fetch_opendb_table_list_r();
    while (list(, $table) = each($opendb_tables_r)) {
        // the cache tables cannot be backed up as they might contain
        // binary data, which we don't yet support.
        if (!ends_with($table, '_cache') && $table != 'php_session') {
            $checked = FALSE;
            if (strcasecmp(substr($table, 0, 2), 's_') !== 0) {
                $checked = TRUE;
            }
            echo "<li><input type=\"checkbox\" class=\"checkbox\" name=\"tables[]\" value=\"{$table}\" " . ($checked ? "CHECKED" : "") . ">{$table}</li>";
            $count++;
        }
    }
    echo "</ul>";
    echo "<ul class=\"actionButtons\">" . "<li><input type=\"button\" class=\"button\" value=\"" . get_opendb_lang_var('check_all') . "\" onClick=\"setCheckboxes(this.form, 'tables[]', true);\"></li>" . "<li><input type=\"button\" class=\"button\" value=\"" . get_opendb_lang_var('uncheck_all') . "\" onClick=\"setCheckboxes(this.form, 'tables[]', false);\"></li>" . "<li><input type=\"reset\" class=\"reset\" value=\"" . get_opendb_lang_var('reset') . "\"></li>" . "<li class=\"submitButton\"><input type=\"submit\" class=\"submit\" value=\"" . get_opendb_lang_var('submit') . "\"></li>" . "</ul>";
    echo "\n\t\t</form>";
예제 #3
0
파일: install.php 프로젝트: horrabin/opendb
/**
	Check whether opendb is installed or not installed.
	
	@return TRUE - if at least one table found
	@return FALSE - if no tables at all.
*/
function is_opendb_partially_installed()
{
    $table_list_r = fetch_opendb_table_list_r();
    reset($table_list_r);
    while (list(, $table) = each($table_list_r)) {
        // ignore release table
        if ($table != 's_opendb_release') {
            if (check_opendb_table($table)) {
                return TRUE;
            }
        }
    }
    //else - no tables found
    return FALSE;
}