Fixed compression bug.

This commit is contained in:
Garvin Hicking
2003-03-10 18:12:27 +00:00
parent 1dabf69496
commit 2dd72bc5e3
2 changed files with 11 additions and 7 deletions

View File

@@ -6,6 +6,10 @@ $Id$
$Source$ $Source$
2003-03-10 Garvin Hicking <me@supergarv.de> 2003-03-10 Garvin Hicking <me@supergarv.de>
* tbl_dump.php3, tbl_properties_export.php3, css/phpmyadmin.css.php3,
lang/*:
Added new table export format by Michal Cihar. db_details_export.php3
should be adapted to the new layout somewhen. Fixed Compression.
* header.inc.php3, header_printview.inc.php3, index.php3, * header.inc.php3, header_printview.inc.php3, index.php3,
left.php3, queryframe.php3, querywindow.php3, left.php3, queryframe.php3, querywindow.php3,
transformation_wrapper.php3, css/phpmyadmin.css.php3, transformation_wrapper.php3, css/phpmyadmin.css.php3,

View File

@@ -82,7 +82,7 @@ $crlf = PMA_whichCrlf();
* Ensure zipped formats are associated with the download feature * Ensure zipped formats are associated with the download feature
*/ */
if (empty($asfile) if (empty($asfile)
&& (!empty($zip) || !empty($gzip) || !empty($bzip))) { && (isset($compression) && ($compression == 'zip' | $compression == 'gzip' | $compression == 'bzip'))) {
$asfile = 1; $asfile = 1;
} }
@@ -136,13 +136,13 @@ else {
// If dump is going to be copressed, set correct mime_type and add // If dump is going to be copressed, set correct mime_type and add
// compression to extension // compression to extension
if (isset($bzip) && $bzip == 'bzip') { if (isset($compression) && $compression == 'bzip') {
$ext .= '.bz2'; $ext .= '.bz2';
$mime_type = 'application/x-bzip'; $mime_type = 'application/x-bzip';
} else if (isset($gzip) && $gzip == 'gzip') { } else if (isset($compression) && $compression == 'gzip') {
$ext .= '.gz'; $ext .= '.gz';
$mime_type = 'application/x-gzip'; $mime_type = 'application/x-gzip';
} else if (isset($zip) && $zip == 'zip') { } else if (isset($compression) && $compression == 'zip') {
$ext .= '.zip'; $ext .= '.zip';
$mime_type = 'application/x-zip'; $mime_type = 'application/x-zip';
} }
@@ -369,7 +369,7 @@ if (!empty($asfile)) {
// Do the compression // Do the compression
// 1. as a gzipped file // 1. as a gzipped file
if (isset($zip) && $zip == 'zip') { if (isset($compression) && $compression == 'zip') {
if (PMA_PHP_INT_VERSION >= 40000 && @function_exists('gzcompress')) { if (PMA_PHP_INT_VERSION >= 40000 && @function_exists('gzcompress')) {
if ($what == 'csv' || $what == 'excel') { if ($what == 'csv' || $what == 'excel') {
$extbis = '.csv'; $extbis = '.csv';
@@ -384,7 +384,7 @@ if (!empty($asfile)) {
} }
} }
// 2. as a bzipped file // 2. as a bzipped file
else if (isset($bzip) && $bzip == 'bzip') { else if (isset($compression) && $compression == 'bzip') {
if (PMA_PHP_INT_VERSION >= 40004 && @function_exists('bzcompress')) { if (PMA_PHP_INT_VERSION >= 40004 && @function_exists('bzcompress')) {
$dump_buffer = bzcompress($dump_buffer); $dump_buffer = bzcompress($dump_buffer);
if ($dump_buffer === -8) { if ($dump_buffer === -8) {
@@ -396,7 +396,7 @@ if (!empty($asfile)) {
} }
} }
// 3. as a gzipped file // 3. as a gzipped file
else if (isset($gzip) && $gzip == 'gzip') { else if (isset($compression) && $compression == 'gzip') {
if (PMA_PHP_INT_VERSION >= 40004 && @function_exists('gzencode')) { if (PMA_PHP_INT_VERSION >= 40004 && @function_exists('gzencode')) {
// without the optional parameter level because it bug // without the optional parameter level because it bug
$dump_buffer = gzencode($dump_buffer); $dump_buffer = gzencode($dump_buffer);