Permalink
Browse files

Execute SQL file stored on server disk

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1015 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
jakubvrana
jakubvrana committed Aug 25, 2009
1 parent b349612 commit b2a7c7ac62e3db42e6b3acdd710e7f425685db49
Showing with 8 additions and 4 deletions.
  1. +1 −1 adminer/include/functions.inc.php
  2. +2 −0 adminer/lang/cs.inc.php
  3. +3 −1 adminer/sql.inc.php
  4. +2 −1 changes.txt
  5. +0 −1 todo.txt
@@ -164,7 +164,7 @@ function get_file($key) {
function upload_error($error) {
$max_size = ($error == UPLOAD_ERR_INI_SIZE ? ini_get("upload_max_filesize") : null); // post_max_size is checked in index.php
- return lang('Unable to upload a file.') . ($max_size ? " " . lang('Maximum allowed file size is %sB.', $max_size) : "");
+ return ($error ? lang('Unable to upload a file.') . ($max_size ? " " . lang('Maximum allowed file size is %sB.', $max_size) : "") : lang('File does not exist.'));
}
function odd($s = ' class="odd"') {
View
@@ -222,4 +222,6 @@
'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.',
'Clear' => 'Vyčistit',
'Editor' => 'Editor',
+ 'Webserver file %s' => 'Soubor %s na webovém serveru',
+ 'File does not exist.' => 'Soubor neexistuje.',
);
View
@@ -8,7 +8,7 @@
page_header(lang('SQL command'), $error);
if (!$error && $_POST) {
- $query = (isset($_POST["file"]) ? get_file("sql_file") : $_POST["query"]);
+ $query = ($_POST["webfile"] ? @file_get_contents("adminer.sql") : ($_POST["file"] ? get_file("sql_file") : $_POST["query"]));
if (is_string($query)) { // get_file() returns error as number
$query = str_replace("\r", "", $query); // parser looks for \n
$query = rtrim($query);
@@ -109,6 +109,8 @@
<input type="submit" name="file" value="<?php echo lang('Run file'); ?>">
<?php } ?>
+<p><?php echo lang('Webserver file %s', '<code>adminer.sql</code>'); ?> <input type="submit" name="webfile" value="<?php echo lang('Run file'); ?>">
+
<?php
if ($history) {
echo "<fieldset><legend>" . lang('History') . "</legend>\n";
View
@@ -1,5 +1,6 @@
-Adminer 2.1.0:
+Adminer 2.1.0-dev:
Edit default values directly in table creation
+Execute SQL file stored on server disk
Display column comments in table overview
Respect max_allowed_packet in CSV import
Click on row selects it
View
@@ -1,5 +1,4 @@
Bulk database drop
-Execute SQL file stored on server disk
Print CREATE+ALTER export instead of running it
Add whisperer to fields with foreign key
Highlight found fields

0 comments on commit b2a7c7a

Please sign in to comment.