return $ext;
}
+ /** Set the path of the file for webserver load
+ * @return string path of the sql dump file
+ */
+ function importServerPath() {
+ return "adminer.sql";
+ }
+
/** Print homepage
* @return bool whether to print default homepage
*/
if (!isset($_GET["import"])) {
$query = $_POST["query"];
} elseif ($_POST["webfile"]) {
- $fp = @fopen((file_exists("adminer.sql")
- ? "adminer.sql"
- : "compress.zlib://adminer.sql.gz"
+ $sql_file_path = $adminer->importServerPath();
+ $fp = @fopen((file_exists($sql_file_path)
+ ? $sql_file_path
+ : "compress.zlib://{$sql_file_path}.gz"
), "rb");
$query = ($fp ? fread($fp, 1e6) : false);
} else {
);
echo "</div></fieldset>\n";
echo "<fieldset><legend>" . lang('From server') . "</legend><div>";
- echo lang('Webserver file %s', "<code>adminer.sql" . (extension_loaded("zlib") ? "[.gz]" : "") . "</code>");
+ echo lang('Webserver file %s', "<code>" . h($adminer->importServerPath()) . (extension_loaded("zlib") ? "[.gz]" : "") . "</code>");
echo ' <input type="submit" name="webfile" value="' . lang('Run file') . '">';
echo "</div></fieldset>\n";
echo "<p>";
return $this->_applyPlugin(__FUNCTION__, $args);
}
+ function importServerPath() {
+ $args = func_get_args();
+ return $this->_applyPlugin(__FUNCTION__, $args);
+ }
+
function homepage() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);