Bzip2 import
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1041 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
afbba65f5c
commit
0a2d81d75a
|
@ -166,7 +166,10 @@ function get_file($key, $decompress = false) {
|
||||||
if (!$file || $file["error"]) {
|
if (!$file || $file["error"]) {
|
||||||
return $file["error"];
|
return $file["error"];
|
||||||
}
|
}
|
||||||
return file_get_contents($decompress && ereg('\\.gz$', $file["name"]) ? "compress.zlib://$file[tmp_name]" : $file["tmp_name"]); //! may not be reachable because of open_basedir
|
return file_get_contents($decompress && ereg('\\.gz$', $file["name"]) ? "compress.zlib://$file[tmp_name]"
|
||||||
|
: ($decompress && ereg('\\.bz2$', $file["name"]) ? "compress.bzip2://$file[tmp_name]"
|
||||||
|
: $file["tmp_name"]
|
||||||
|
)); //! may not be reachable because of open_basedir
|
||||||
}
|
}
|
||||||
|
|
||||||
function upload_error($error) {
|
function upload_error($error) {
|
||||||
|
|
|
@ -10,7 +10,10 @@ page_header(lang('SQL command'), $error);
|
||||||
if (!$error && $_POST) {
|
if (!$error && $_POST) {
|
||||||
$query = $_POST["query"];
|
$query = $_POST["query"];
|
||||||
if ($_POST["webfile"]) {
|
if ($_POST["webfile"]) {
|
||||||
$query = @file_get_contents(file_exists("adminer.sql") ? "adminer.sql" : "compress.zlib://adminer.sql.gz");
|
$query = @file_get_contents(file_exists("adminer.sql") ? "adminer.sql"
|
||||||
|
: (file_exists("adminer.sql.gz") ? "compress.zlib://adminer.sql.gz"
|
||||||
|
: "compress.bzip2://adminer.sql.bz2"
|
||||||
|
));
|
||||||
} elseif ($_POST["file"]) {
|
} elseif ($_POST["file"]) {
|
||||||
$query = get_file("sql_file", true);
|
$query = get_file("sql_file", true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue