Improve gzip export ratio (bug #387)

This commit is contained in:
Jakub Vrana 2014-02-23 18:02:43 -08:00
parent 990b3b8ccc
commit 7639ff8b95
3 changed files with 11 additions and 1 deletions

View file

@ -740,7 +740,7 @@ username.form['auth[driver]'].onchange();
($ext == "sql" || $output != "file" ? "text/plain" : "text/csv") . "; charset=utf-8"
)));
if ($output == "gz") {
ob_start('gzencode', 1e6);
ob_start('ob_gzencode', 1e6);
}
return $ext;
}

View file

@ -496,3 +496,12 @@ function doc_link($paths) {
);
return ($paths[$jush] ? "<a href='$urls[$jush]$paths[$jush]' target='_blank' rel='noreferrer'><sup>?</sup></a>" : "");
}
/** Wrap gzencode() for usage in ob_start()
* @param string
* @return string
*/
function ob_gzencode($string) {
// ob_start() callback recieves an optional parameter $phase but gzencode() accepts optional parameter $level
return gzencode($string);
}

View file

@ -1,4 +1,5 @@
Adminer 4.0.4-dev:
Improve gzip export ratio (bug #387)
MySQL: Respect daylight saving time in dump, bug since Adminer 3.6.4
SQLite: Display auto-created unique indexes, bug since Adminer 3.5.0
Editor: Fix login() method, bug since Adminer 4.0.0