Example #1
0
            $add_character = "\r\n";
        } else {
            if (empty($add_character)) {
                $add_character = $GLOBALS['crlf'];
            } else {
                if (get_magic_quotes_gpc()) {
                    $add_character = stripslashes($add_character);
                }
                $add_character = str_replace('\\r', "\r", $add_character);
                $add_character = str_replace('\\n', "\n", $add_character);
                $add_character = str_replace('\\t', "\t", $add_character);
            }
        }
        // end if
        $tmp_buffer = '';
        get_table_csv($db, $table, $limit_from, $limit_to, $separator, $enclosed, $escaped, 'my_csvhandler');
        $dump_buffer .= $tmp_buffer;
    }
    // end 'csv case
}
// end building the dump
/**
 * "Displays" the dump...
 */
// 1. as a bzipped file
if (isset($bzip) && $bzip == 'bzip') {
    if (@function_exists('bzcompress')) {
        echo bzcompress($dump_buffer);
    }
} else {
    if (isset($gzip) && $gzip == 'gzip') {
Example #2
0
    } else {
        echo "{$sql_insert};{$crlf}";
    }
}
if ($what != "csv") {
    print "{$crlf}/* -------------------------------------------------------- {$crlf}";
    print "  {$cfgProgName} {$cfgVersion} DB Dump{$crlf}";
    print "  http://www.greatbridge.org/project/phppgadmin/{$crlf}";
    print "  {$strHost}: " . $cfgServer['host'];
    if (!empty($cfgServer['port'])) {
        print ":" . $cfgServer['port'];
    }
    print "{$crlf}  {$strDatabase}: {$db}{$crlf}";
    print "  {$strTableStructure} {$cfgQuotes}{$table}{$cfgQuotes} {$crlf}";
    print "  " . date("Y-d-m H:m:i") . $crlf;
    print "-------------------------------------------------------- */ {$crlf} {$crlf}";
    print get_table_def($link, $table, $crlf) . "{$crlf}";
    if ($what == "data") {
        print "{$crlf}/* -------------------------------------------------------- {$crlf}";
        print "  {$strDumpingData} {$cfgQuotes}{$table}{$cfgQuotes} {$crlf}";
        print "-------------------------------------------------------- */ {$crlf}";
        get_table_content($link, $table, "my_handler");
    }
} else {
    // $what != "csv"
    get_table_csv($link, $table, $separator, "my_csvhandler");
}
if (empty($asfile)) {
    print "</pre></div>\n";
    include "footer.inc.php";
}