1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-14 10:34:01 +02:00

Change directory structure

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@682 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-06-13 20:55:19 +00:00
parent 2f910b937e
commit e1bc7af8f3
77 changed files with 60 additions and 61 deletions

BIN
adminer/arrow.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 B

70
adminer/call.inc.php Normal file
View File

@@ -0,0 +1,70 @@
<?php
page_header(lang('Call') . ": " . htmlspecialchars($_GET["call"]), $error);
$routine = routine($_GET["call"], (isset($_GET["callf"]) ? "FUNCTION" : "PROCEDURE"));
$in = array();
$out = array();
foreach ($routine["fields"] as $i => $field) {
if (substr($field["inout"], -3) == "OUT") {
$out[$i] = "@" . idf_escape($field["field"]) . " AS " . idf_escape($field["field"]);
}
if (!$field["inout"] || substr($field["inout"], 0, 2) == "IN") {
$in[] = $i;
}
}
if (!$error && $_POST) {
$call = array();
foreach ($routine["fields"] as $key => $field) {
if (in_array($key, $in)) {
$val = process_input($key, $field);
if ($val === false) {
$val = "''";
}
if (isset($out[$key])) {
$dbh->query("SET @" . idf_escape($field["field"]) . " = " . $val);
}
}
$call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val);
}
$result = $dbh->multi_query((isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . idf_escape($_GET["call"]) . "(" . implode(", ", $call) . ")");
if (!$result) {
echo "<p class='error'>" . htmlspecialchars($dbh->error) . "</p>\n";
} else {
do {
$result = $dbh->store_result();
if (is_object($result)) {
select($result);
} else {
echo "<p class='message'>" . lang('Routine has been called, %d row(s) affected.', $dbh->affected_rows) . "</p>\n";
}
} while ($dbh->next_result());
if ($out) {
select($dbh->query("SELECT " . implode(", ", $out)));
}
}
}
?>
<form action="" method="post">
<?php
if ($in) {
echo "<table cellspacing='0'>\n";
foreach ($in as $key) {
$field = $routine["fields"][$key];
echo "<tr><th>" . htmlspecialchars($field["field"]) . "</th>";
$value = $_POST["fields"][$key];
if (strlen($value) && ($field["type"] == "enum" || $field["type"] == "set")) {
$value = intval($value);
}
input($key, $field, $value); // param name can be empty
echo "</td></tr>\n";
}
echo "</table>\n";
}
?>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Call'); ?>" />
</p>
</form>

162
adminer/create.inc.php Normal file
View File

@@ -0,0 +1,162 @@
<?php
$partition_by = array('HASH', 'LINEAR HASH', 'KEY', 'LINEAR KEY', 'RANGE', 'LIST');
if (strlen($_GET["create"])) {
$orig_fields = fields($_GET["create"]);
}
if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] && !$_POST["down"]) {
if ($_POST["drop"]) {
query_redirect("DROP TABLE " . idf_escape($_GET["create"]), substr($SELF, 0, -1), lang('Table has been dropped.'));
} else {
$auto_increment_index = " PRIMARY KEY";
if (strlen($_GET["create"]) && strlen($_POST["fields"][$_POST["auto_increment_col"]]["orig"])) {
foreach (indexes($_GET["create"]) as $index) {
foreach ($index["columns"] as $column) {
if ($column === $_POST["fields"][$_POST["auto_increment_col"]]["orig"]) {
$auto_increment_index = "";
break 2;
}
}
if ($index["type"] == "PRIMARY") {
$auto_increment_index = " UNIQUE";
}
}
}
$fields = array();
ksort($_POST["fields"]);
$after = "FIRST";
foreach ($_POST["fields"] as $key => $field) {
if (strlen($field["field"]) && isset($types[$field["type"]])) {
$fields[] = (!strlen($_GET["create"]) ? "\n" : (strlen($field["orig"]) ? "\nCHANGE " . idf_escape($field["orig"]) . " " : "\nADD "))
. idf_escape($field["field"]) . process_type($field)
. ($field["null"] ? " NULL" : " NOT NULL") // NULL for timestamp
. (strlen($_GET["create"]) && strlen($field["orig"]) && isset($orig_fields[$field["orig"]]["default"]) && $field["type"] != "timestamp" ? " DEFAULT '" . $dbh->escape_string($orig_fields[$field["orig"]]["default"]) . "'" : "") //! timestamp
. ($key == $_POST["auto_increment_col"] ? " AUTO_INCREMENT$auto_increment_index" : "")
. " COMMENT '" . $dbh->escape_string($field["comment"]) . "'"
. (strlen($_GET["create"]) ? " $after" : "")
;
$after = "AFTER " . idf_escape($field["field"]);
} elseif (strlen($field["orig"])) {
$fields[] = "\nDROP " . idf_escape($field["orig"]);
}
}
$status = ($_POST["Engine"] ? "ENGINE='" . $dbh->escape_string($_POST["Engine"]) . "'" : "")
. ($_POST["Collation"] ? " COLLATE '" . $dbh->escape_string($_POST["Collation"]) . "'" : "")
. (strlen($_POST["Auto_increment"]) ? " AUTO_INCREMENT=" . intval($_POST["Auto_increment"]) : "")
. " COMMENT='" . $dbh->escape_string($_POST["Comment"]) . "'"
;
if (in_array($_POST["partition_by"], $partition_by)) {
$partitions = array();
if ($_POST["partition_by"] == 'RANGE' || $_POST["partition_by"] == 'LIST') {
foreach (array_filter($_POST["partition_names"]) as $key => $val) {
$value = $_POST["partition_values"][$key];
$partitions[] = "\nPARTITION $val VALUES " . ($_POST["partition_by"] == 'RANGE' ? "LESS THAN" : "IN") . (strlen($value) ? " ($value)" : " MAXVALUE"); //! SQL injection
}
}
$status .= "\nPARTITION BY $_POST[partition_by]($_POST[partition])" . ($partitions ? " (" . implode(",", $partitions) . "\n)" : ($_POST["partitions"] ? " PARTITIONS " . intval($_POST["partitions"]) : ""));
} elseif ($dbh->server_info >= 5.1 && strlen($_GET["create"])) {
$status .= "\nREMOVE PARTITIONING";
}
$location = $SELF . "table=" . urlencode($_POST["name"]);
if (strlen($_GET["create"])) {
query_redirect("ALTER TABLE " . idf_escape($_GET["create"]) . implode(",", $fields) . ",\nRENAME TO " . idf_escape($_POST["name"]) . ",\n$status", $location, lang('Table has been altered.'));
} else {
query_redirect("CREATE TABLE " . idf_escape($_POST["name"]) . " (" . implode(",", $fields) . "\n) $status", $location, lang('Table has been created.'));
}
}
}
page_header((strlen($_GET["create"]) ? lang('Alter table') : lang('Create table')), $error, array("table" => $_GET["create"]), $_GET["create"]);
$engines = array();
$result = $dbh->query("SHOW ENGINES");
while ($row = $result->fetch_assoc()) {
if ($row["Support"] == "YES" || $row["Support"] == "DEFAULT") {
$engines[] = $row["Engine"];
}
}
$result->free();
if ($_POST) {
$row = $_POST;
if ($row["auto_increment_col"]) {
$row["fields"][$row["auto_increment_col"]]["auto_increment"] = true;
}
process_fields($row["fields"]);
} elseif (strlen($_GET["create"])) {
$row = table_status($_GET["create"]);
table_comment($row);
$row["name"] = $_GET["create"];
$row["fields"] = array_values($orig_fields);
if ($dbh->server_info >= 5.1) {
$from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = '" . $dbh->escape_string($_GET["db"]) . "' AND TABLE_NAME = '" . $dbh->escape_string($_GET["create"]) . "'";
$result = $dbh->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
list($row["partition_by"], $row["partitions"], $row["partition"]) = $result->fetch_row();
$result->free();
$row["partition_names"] = array();
$row["partition_values"] = array();
$result = $dbh->query("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $from AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");
while ($row1 = $result->fetch_assoc()) {
$row["partition_names"][] = $row1["PARTITION_NAME"];
$row["partition_values"][] = $row1["PARTITION_DESCRIPTION"];
}
$result->free();
$row["partition_names"][] = "";
}
} else {
$row = array("fields" => array(array("field" => "")), "partition_names" => array(""));
}
$collations = collations();
$suhosin = floor(extension_loaded("suhosin") ? (min(ini_get("suhosin.request.max_vars"), ini_get("suhosin.post.max_vars")) - 13) / 8 : 0);
if ($suhosin && count($row["fields"]) > $suhosin) {
echo "<p class='error'>" . htmlspecialchars(lang('Maximum number of allowed fields exceeded. Please increase %s and %s.', 'suhosin.post.max_vars', 'suhosin.request.max_vars')) . "</p>\n";
}
?>
<form action="" method="post" id="form">
<p>
<?php echo lang('Table name'); ?>: <input name="name" maxlength="64" value="<?php echo htmlspecialchars($row["name"]); ?>" />
<select name="Engine"><option value="">(<?php echo lang('engine'); ?>)</option><?php echo optionlist($engines, $row["Engine"]); ?></select>
<select name="Collation"><option value="">(<?php echo lang('collation'); ?>)</option><?php echo optionlist($collations, $row["Collation"]); ?></select>
<input type="submit" value="<?php echo lang('Save'); ?>" />
</p>
<table cellspacing="0" id="edit-fields">
<?php $column_comments = edit_fields($row["fields"], $collations, "TABLE", $suhosin); ?>
</table>
<p>
<?php echo lang('Auto Increment'); ?>: <input name="Auto_increment" size="4" value="<?php echo intval($row["Auto_increment"]); ?>" />
<?php echo lang('Comment'); ?>: <input name="Comment" value="<?php echo htmlspecialchars($row["Comment"]); ?>" maxlength="60" />
<script type="text/javascript">// <![CDATA[
document.write('<label><input type="checkbox"<?php if ($column_comments) { ?> checked="checked"<?php } ?> onclick="column_comments_click(this.checked);" /><?php echo lang('Show column comments'); ?></label>');
// ]]></script>
</p>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Save'); ?>" />
<?php if (strlen($_GET["create"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
</p>
<?php
if ($dbh->server_info >= 5.1) {
$partition_table = ereg('RANGE|LIST', $row["partition_by"]);
?>
<fieldset><legend><?php echo lang('Partition by'); ?></legend>
<p>
<select name="partition_by" onchange="partition_by_change(this);"><option></option><?php echo optionlist($partition_by, $row["partition_by"]); ?></select>
(<input name="partition" value="<?php echo htmlspecialchars($row["partition"]); ?>" />)
<?php echo lang('Partitions'); ?>: <input name="partitions" size="2" value="<?php echo htmlspecialchars($row["partitions"]); ?>"<?php echo ($partition_table || !$row["partition_by"] ? " class='hidden'" : ""); ?> />
</p>
<table cellspacing="0" id="partition-table"<?php echo ($partition_table ? "" : " class='hidden'"); ?>>
<thead><tr><th><?php echo lang('Partition name'); ?></th><th><?php echo lang('Values'); ?></th></tr></thead>
<?php
foreach ($row["partition_names"] as $key => $val) {
echo '<tr>';
echo '<td><input name="partition_names[]" value="' . htmlspecialchars($val) . '"' . ($key == count($row["partition_names"]) - 1 ? ' onchange="partition_name_change(this);"' : '') . ' /></td>';
echo '<td><input name="partition_values[]" value="' . htmlspecialchars($row["partition_values"][$key]) . '" /></td>';
echo "</tr>\n";
}
?>
</table>
</fieldset>
<?php } ?>
</form>

32
adminer/createv.inc.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
$dropped = false;
if ($_POST && !$error) {
if (strlen($_GET["createv"])) {
$dropped = query_redirect("DROP VIEW " . idf_escape($_GET["createv"]), substr($SELF, 0, -1), lang('View has been dropped.'), $_POST["drop"], !$_POST["dropped"]);
}
if (!$_POST["drop"]) {
query_redirect("CREATE VIEW " . idf_escape($_POST["name"]) . " AS\n$_POST[select]", $SELF . "view=" . urlencode($_POST["name"]), (strlen($_GET["createv"]) ? lang('View has been altered.') : lang('View has been created.')));
}
}
page_header((strlen($_GET["createv"]) ? lang('Alter view') : lang('Create view')), $error, array("view" => $_GET["createv"]), $_GET["createv"]);
$row = array();
if ($_POST) {
$row = $_POST;
} elseif (strlen($_GET["createv"])) {
$row = view($_GET["createv"]);
$row["name"] = $_GET["createv"];
}
?>
<form action="" method="post">
<p><textarea name="select" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["select"]); ?></textarea></p>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<?php if ($dropped) { ?><input type="hidden" name="dropped" value="1" /><?php } ?>
<?php echo lang('Name'); ?>: <input name="name" value="<?php echo htmlspecialchars($row["name"]); ?>" maxlength="64" />
<input type="submit" value="<?php echo lang('Save'); ?>" />
<?php if (strlen($_GET["createv"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
</p>
</form>

BIN
adminer/cross.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 B

76
adminer/database.inc.php Normal file
View File

@@ -0,0 +1,76 @@
<?php
if ($_POST && !$error) {
if ($_POST["drop"]) {
unset($_SESSION["databases"][$_GET["server"]]);
query_redirect("DROP DATABASE " . idf_escape($_GET["db"]), substr(preg_replace('~db=[^&]*&~', '', $SELF), 0, -1), lang('Database has been dropped.'));
} elseif ($_GET["db"] !== $_POST["name"]) {
unset($_SESSION["databases"][$_GET["server"]]);
$dbs = explode("\n", str_replace("\r", "", $_POST["name"]));
$failed = false;
foreach ($dbs as $db) {
if (count($dbs) == 1 || strlen($db)) {
if (!queries("CREATE DATABASE " . idf_escape($db) . ($_POST["collation"] ? " COLLATE '" . $dbh->escape_string($_POST["collation"]) . "'" : ""))) {
$failed = true;
}
$last = $db;
}
}
if (query_redirect(queries(), $SELF . "db=" . urlencode($last), lang('Database has been created.'), !strlen($_GET["db"]), false, $failed)) {
$result = $dbh->query("SHOW TABLES");
while ($row = $result->fetch_row()) {
if (!queries("RENAME TABLE " . idf_escape($row[0]) . " TO " . idf_escape($_POST["name"]) . "." . idf_escape($row[0]))) {
break;
}
}
$result->free();
if (!$row) {
queries("DROP DATABASE " . idf_escape($_GET["db"]));
}
query_redirect(queries(), preg_replace('~db=[^&]*&~', '', $SELF) . "db=" . urlencode($_POST["name"]), lang('Database has been renamed.'), !$row, false, $row);
}
} else {
if (!$_POST["collation"]) {
redirect(substr($SELF, 0, -1));
}
query_redirect("ALTER DATABASE " . idf_escape($_POST["name"]) . " COLLATE '" . $dbh->escape_string($_POST["collation"]) . "'", substr($SELF, 0, -1), lang('Database has been altered.'));
}
}
page_header(strlen($_GET["db"]) ? lang('Alter database') : lang('Create database'), $error, array(), $_GET["db"]);
$collations = collations();
$name = $_GET["db"];
$collate = array();
if ($_POST) {
$name = $_POST["name"];
$collate = $_POST["collation"];
} else {
if (!strlen($_GET["db"])) {
$result = $dbh->query("SHOW GRANTS");
while ($row = $result->fetch_row()) {
if (preg_match('~ ON (`(([^\\\\`]+|``|\\\\.)*)%`\\.\\*)?~', $row[0], $match) && $match[1]) {
$name = stripcslashes(idf_unescape($match[2]));
break;
}
}
$result->free();
} elseif (($result = $dbh->query("SHOW CREATE DATABASE " . idf_escape($_GET["db"])))) {
$create = $dbh->result($result, 1);
if (preg_match('~ COLLATE ([^ ]+)~', $create, $match)) {
$collate = $match[1];
} elseif (preg_match('~ CHARACTER SET ([^ ]+)~', $create, $match)) {
$collate = $collations[$match[1]][0];
}
$result->free();
}
}
?>
<form action="" method="post">
<p>
<input name="name" value="<?php echo htmlspecialchars($name); ?>" maxlength="64" />
<select name="collation"><option value="">(<?php echo lang('collation'); ?>)</option><?php echo optionlist($collations, $collate); ?></select>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Save'); ?>" />
<?php if (strlen($_GET["db"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
</p>
</form>

113
adminer/db.inc.php Normal file
View File

@@ -0,0 +1,113 @@
<?php
$tables_views = array_merge((array) $_POST["tables"], (array) $_POST["views"]);
if ($tables_views && !$error) {
$result = true;
$message = "";
$dbh->query("SET foreign_key_checks = 0");
if (isset($_POST["truncate"])) {
if ($_POST["tables"]) {
foreach ($_POST["tables"] as $table) {
if (!queries("TRUNCATE " . idf_escape($table))) {
$result = false;
break;
}
}
$message = lang('Tables have been truncated.');
}
} elseif (isset($_POST["move"])) {
$rename = array();
foreach ($tables_views as $table) {
$rename[] = idf_escape($table) . " TO " . idf_escape($_POST["target"]) . "." . idf_escape($table);
}
$result = queries("RENAME TABLE " . implode(", ", $rename));
$message = lang('Tables have been moved.');
} elseif ((!isset($_POST["drop"]) || !$_POST["views"] || queries("DROP VIEW " . implode(", ", array_map('idf_escape', $_POST["views"]))))
&& (!$_POST["tables"] || ($result = queries((isset($_POST["optimize"]) ? "OPTIMIZE" : (isset($_POST["check"]) ? "CHECK" : (isset($_POST["repair"]) ? "REPAIR" : (isset($_POST["drop"]) ? "DROP" : "ANALYZE")))) . " TABLE " . implode(", ", array_map('idf_escape', $_POST["tables"])))))
) {
if (isset($_POST["drop"])) {
$message = lang('Tables have been dropped.');
} else {
while ($row = $result->fetch_assoc()) {
$message .= htmlspecialchars("$row[Table]: $row[Msg_text]") . "<br />";
}
}
}
query_redirect(queries(), substr($SELF, 0, -1), $message, $result, false, !$result);
}
page_header(lang('Database') . ": " . htmlspecialchars($_GET["db"]), $error, false);
echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Alter database') . "</a></p>\n";
echo '<p><a href="' . htmlspecialchars($SELF) . 'schema=">' . lang('Database schema') . "</a></p>\n";
echo "<h3>" . lang('Tables and views') . "</h3>\n";
$result = $dbh->query("SHOW TABLE STATUS");
if (!$result->num_rows) {
echo "<p class='message'>" . lang('No tables.') . "</p>\n";
} else {
echo "<form action='' method='post'>\n";
echo "<table cellspacing='0' class='nowrap'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="form_check(this, /^(tables|views)\[/);" /></td><th>' . lang('Table') . '</th><td>' . lang('Engine') . '</td><td>' . lang('Collation') . '</td><td>' . lang('Data Length') . '</td><td>' . lang('Index Length') . '</td><td>' . lang('Data Free') . '</td><td>' . lang('Auto Increment') . '</td><td>' . lang('Rows') . '</td><td>' . lang('Comment') . "</td></tr></thead>\n";
while ($row = $result->fetch_assoc()) {
$name = $row["Name"];
table_comment($row);
echo '<tr' . odd() . '><td><input type="checkbox" name="' . (isset($row["Rows"]) ? 'tables' : 'views') . '[]" value="' . htmlspecialchars($name) . '"' . (in_array($name, $tables_views, true) ? ' checked="checked"' : '') . ' onclick="form_uncheck(\'check-all\');" /></td>';
if (isset($row["Rows"])) {
echo '<th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($name) . '">' . htmlspecialchars($name) . "</a></th><td>$row[Engine]</td><td>$row[Collation]</td>";
foreach (array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create", "Rows" => "select") as $key => $link) {
$val = number_format($row[$key], 0, '.', lang(','));
echo '<td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($name) . '">' . str_replace(" ", "&nbsp;", ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val)) . '</a>' : '&nbsp;') . '</td>';
}
echo "<td>" . (strlen(trim($row["Comment"])) ? htmlspecialchars($row["Comment"]) : "&nbsp;") . "</td>";
} else {
echo '<th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($name) . '">' . htmlspecialchars($name) . '</a></th><td colspan="8"><a href="' . htmlspecialchars($SELF) . "select=" . urlencode($name) . '">' . lang('View') . '</a></td>';
}
echo "</tr>\n";
}
echo "</table>\n";
echo "<p><input type='hidden' name='token' value='$token' /><input type='submit' value='" . lang('Analyze') . "' /> <input type='submit' name='optimize' value='" . lang('Optimize') . "' /> <input type='submit' name='check' value='" . lang('Check') . "' /> <input type='submit' name='repair' value='" . lang('Repair') . "' /> <input type='submit' name='truncate' value='" . lang('Truncate') . "'$confirm /> <input type='submit' name='drop' value='" . lang('Drop') . "'$confirm /></p>\n";
$dbs = get_databases();
if (count($dbs) != 1) {
$db = (isset($_POST["target"]) ? $_POST["target"] : $_GET["db"]);
echo "<p>" . lang('Move to other database') . ($dbs ? ": <select name='target'>" . optionlist($dbs, $db) . "</select>" : ': <input name="target" value="' . htmlspecialchars($db) . '" />') . " <input type='submit' name='move' value='" . lang('Move') . "' /></p>\n";
}
echo "</form>\n";
}
$result->free();
if ($dbh->server_info >= 5) {
echo '<p><a href="' . htmlspecialchars($SELF) . 'createv=">' . lang('Create view') . "</a></p>\n";
echo "<h3>" . lang('Routines') . "</h3>\n";
$result = $dbh->query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = '" . $dbh->escape_string($_GET["db"]) . "'");
if ($result->num_rows) {
echo "<table cellspacing='0'>\n";
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>" . htmlspecialchars($row["ROUTINE_TYPE"]) . "</td>";
echo '<th><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . htmlspecialchars($row["ROUTINE_NAME"]) . '</a></th>';
echo '<td><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a></td>";
echo "</tr>\n";
}
echo "</table>\n";
}
$result->free();
echo '<p><a href="' . htmlspecialchars($SELF) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . htmlspecialchars($SELF) . 'function=">' . lang('Create function') . "</a></p>\n";
}
if ($dbh->server_info >= 5.1 && ($result = $dbh->query("SHOW EVENTS"))) {
echo "<h3>" . lang('Events') . "</h3>\n";
if ($result->num_rows) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "</th><td>" . lang('Schedule') . "</td><td>" . lang('Start') . "</td><td>" . lang('End') . "</td></tr></thead>\n";
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo '<th><a href="' . htmlspecialchars($SELF) . 'event=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th>";
echo "<td>" . ($row["Execute at"] ? lang('At given time') . "</td><td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "</td><td>$row[Starts]") . "</td>";
echo "<td>$row[Ends]</td>";
echo "</tr>\n";
}
echo "</table>\n";
}
$result->free();
echo '<p><a href="' . htmlspecialchars($SELF) . 'event=">' . lang('Create event') . "</a></p>\n";
}

39
adminer/default.css Normal file
View File

@@ -0,0 +1,39 @@
body { color: #000; background: #fff; line-height: 1.25em; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0; font-size: 90%; }
a { color: blue; }
a:visited { color: navy; }
a:hover { color: red; }
h1 { font-size: 100%; margin: 0; padding: .8em 1em; border-bottom: 1px solid #999; font-weight: normal; color: #777; background: #eee; }
h1 a:link, h1 a:visited { font-size: 150%; color: #777; text-decoration: none; font-style: italic; margin-right: 1ex; }
h2 { font-size: 150%; margin: 0 0 20px -18px; padding: .8em 1em; border-bottom: 1px solid #000; color: #000; font-weight: normal; background: #ddf; }
h3 { font-weight: normal; font-size: 130%; margin: .8em 0; }
table { margin: 0 20px .8em 0; border: 0; border-top: 1px solid #999; border-left: 1px solid #999; font-size: 90%; }
td, th { margin-bottom: 1em; border: 0; border-right: 1px solid #999; border-bottom: 1px solid #999; padding: .2em .3em; }
th { background: #eee; }
fieldset { display: inline; vertical-align: top; padding: .5em .8em; margin: 0 .5em .5em 0; border: 1px solid #999; }
p { margin: 0 20px 1em 0; }
img { vertical-align: middle; border: 0; }
code { background: #eee; }
.js .hidden { display: none; }
.popup { position: absolute; }
.nowrap { white-space: nowrap; }
.wrap { white-space: normal; }
.error { color: red; background: #fee; padding: .5em .8em; }
.message { color: green; background: #efe; padding: .5em .8em; }
.char { color: #007F00; }
.date { color: #7F007F; }
.enum { color: #007F7F; }
.binary { color: red; }
.odd td { background: #F5F5F5; }
.time { color: Silver; font-size: 70%; float: right; margin-top: -3em; }
.function { text-align: right; }
tr:hover td { background: #ddf; }
thead tr:hover td { background: transparent; }
#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; overflow: auto; overflow-y: hidden; white-space: nowrap; }
#menu p { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; }
#menu form { margin: 0; }
#content { margin: 2em 0 0 21em; padding: 10px 20px 20px 0; }
#lang { position: absolute; top: 0; left: 0; line-height: 1.8em; padding: .3em 1em; }
#breadcrumb { white-space: nowrap; position: absolute; top: 0; left: 21em; background: #eee; height: 2em; line-height: 1.8em; padding: 0 1em; margin: 0 0 0 -18px; }
#schema { margin-left: 60px; position: relative; }
#schema .table { border: 1px solid Silver; padding: 0 2px; cursor: move; position: absolute; }
#schema .references { position: absolute; }

BIN
adminer/down.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 B

4
adminer/download.inc.php Normal file
View File

@@ -0,0 +1,4 @@
<?php
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=" . friendly_url("$_GET[download]-" . implode("_", $_GET["where"])) . "." . friendly_url($_GET["field"]));
echo $dbh->result($dbh->query("SELECT " . idf_escape($_GET["field"]) . " FROM " . idf_escape($_GET["download"]) . " WHERE " . implode(" AND ", where($_GET)) . " LIMIT 1"));

188
adminer/dump.inc.php Normal file
View File

@@ -0,0 +1,188 @@
<?php
function tar_file($filename, $contents) {
$return = pack("a100a8a8a8a12a12", $filename, 644, 0, 0, decoct(strlen($contents)), decoct(time()));
$checksum = 8*32; // space for checksum itself
for ($i=0; $i < strlen($return); $i++) {
$checksum += ord($return{$i});
}
$return .= sprintf("%06o", $checksum) . "\0 ";
return $return . str_repeat("\0", 512 - strlen($return)) . $contents . str_repeat("\0", 511 - (strlen($contents) + 511) % 512);
}
if ($_POST) {
$ext = dump_headers((strlen($_GET["dump"]) ? $_GET["dump"] : $_GET["db"]), (!strlen($_GET["db"]) || count((array) $_POST["tables"] + (array) $_POST["data"]) > 1));
if ($_POST["format"] != "csv") {
$max_packet = 1048576; // default, minimum is 1024
echo "SET NAMES utf8;\n";
echo "SET foreign_key_checks = 0;\n";
echo "SET time_zone = '" . $dbh->escape_string($dbh->result($dbh->query("SELECT @@time_zone"))) . "';\n";
echo "\n";
}
$style = $_POST["db_style"];
foreach ((strlen($_GET["db"]) ? array($_GET["db"]) : (array) $_POST["databases"]) as $db) {
if ($dbh->select_db($db)) {
if ($_POST["format"] != "csv" && ereg('CREATE', $style) && ($result = $dbh->query("SHOW CREATE DATABASE " . idf_escape($db)))) {
if ($style == "DROP+CREATE") {
echo "DROP DATABASE IF EXISTS " . idf_escape($db) . ";\n";
}
$create = $dbh->result($result, 1);
echo ($style == "CREATE+ALTER" ? preg_replace('~^CREATE DATABASE ~', '\\0IF NOT EXISTS ', $create) : $create) . ";\n";
$result->free();
}
if ($style && $_POST["format"] != "csv") {
echo "USE " . idf_escape($db) . ";\n\n";
$out = "";
if ($dbh->server_info >= 5) {
foreach (array("FUNCTION", "PROCEDURE") as $routine) {
$result = $dbh->query("SHOW $routine STATUS WHERE Db = '" . $dbh->escape_string($db) . "'");
while ($row = $result->fetch_assoc()) {
$out .= $dbh->result($dbh->query("SHOW CREATE $routine " . idf_escape($row["Name"])), 2) . ";;\n\n";
}
$result->free();
}
}
if ($dbh->server_info >= 5.1) {
$result = $dbh->query("SHOW EVENTS");
while ($row = $result->fetch_assoc()) {
$out .= $dbh->result($dbh->query("SHOW CREATE EVENT " . idf_escape($row["Name"])), 3) . ";;\n\n";
}
$result->free();
}
echo ($out ? "DELIMITER ;;\n\n$out" . "DELIMITER ;\n\n" : "");
}
if ($_POST["table_style"] || $_POST["data_style"]) {
$views = array();
$result = $dbh->query("SHOW TABLE STATUS");
while ($row = $result->fetch_assoc()) {
$table = (!strlen($_GET["db"]) || in_array($row["Name"], (array) $_POST["tables"]));
$data = (!strlen($_GET["db"]) || in_array($row["Name"], (array) $_POST["data"]));
if ($table || $data) {
if (isset($row["Engine"])) {
if ($ext == "tar") {
ob_start();
}
dump_table($row["Name"], ($table ? $_POST["table_style"] : ""));
if ($data) {
dump_data($row["Name"], $_POST["data_style"]);
}
if ($ext == "tar") {
echo tar_file((strlen($_GET["db"]) ? "" : "$db/") . "$row[Name].csv", ob_get_clean());
} elseif ($_POST["format"] != "csv") {
echo "\n";
}
} elseif ($_POST["format"] != "csv") {
$views[] = $row["Name"];
}
}
}
$result->free();
foreach ($views as $view) {
dump_table($view, $_POST["table_style"], true);
}
}
if ($style == "CREATE+ALTER" && $_POST["format"] != "csv") {
$query = "SELECT TABLE_NAME, ENGINE, TABLE_COLLATION, TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE()";
?>
DELIMITER ;;
CREATE PROCEDURE adminer_drop () BEGIN
DECLARE _table_name, _engine, _table_collation varchar(64);
DECLARE _table_comment varchar(64);
DECLARE done bool DEFAULT 0;
DECLARE tables CURSOR FOR <?php echo $query; ?>;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
OPEN tables;
REPEAT
FETCH tables INTO _table_name, _engine, _table_collation, _table_comment;
IF NOT done THEN
CASE _table_name<?php
$result = $dbh->query($query);
while ($row = $result->fetch_assoc()) {
$comment = $dbh->escape_string($row["ENGINE"] == "InnoDB" ? preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["TABLE_COMMENT"]) : $row["TABLE_COMMENT"]);
echo "
WHEN '" . $dbh->escape_string($row["TABLE_NAME"]) . "' THEN
" . (isset($row["ENGINE"]) ? "IF _engine != '$row[ENGINE]' OR _table_collation != '$row[TABLE_COLLATION]' OR _table_comment != '$comment' THEN
ALTER TABLE " . idf_escape($row["TABLE_NAME"]) . " ENGINE=$row[ENGINE] COLLATE=$row[TABLE_COLLATION] COMMENT='$comment';
END IF" : "BEGIN END") . ";";
}
$result->free();
?>
ELSE
SET @alter_table = CONCAT('DROP TABLE `', REPLACE(_table_name, '`', '``'), '`');
PREPARE alter_command FROM @alter_table;
EXECUTE alter_command; -- returns "can't return a result set in the given context" with MySQL extension
DROP PREPARE alter_command;
END CASE;
END IF;
UNTIL done END REPEAT;
CLOSE tables;
END;;
DELIMITER ;
CALL adminer_drop;
DROP PROCEDURE adminer_drop;
<?php
}
}
}
exit;
}
page_header(lang('Export'), "", (strlen($_GET["export"]) ? array("table" => $_GET["export"]) : array()), $_GET["db"]);
?>
<form action="" method="post">
<table cellspacing="0">
<?php
$db_style = array('USE', 'DROP+CREATE', 'CREATE');
$table_style = array('DROP+CREATE', 'CREATE');
$data_style = array('TRUNCATE+INSERT', 'INSERT', 'INSERT+UPDATE');
if ($dbh->server_info >= 5) {
$db_style[] = 'CREATE+ALTER';
$table_style[] = 'CREATE+ALTER';
}
echo "<tr><th>" . lang('Output') . "</th><td>$dump_output</td></tr>\n";
echo "<tr><th>" . lang('Format') . "</th><td>$dump_format</td></tr>\n";
echo "<tr><th>" . lang('Database') . "</th><td><select name='db_style'><option></option>" . optionlist($db_style, (strlen($_GET["db"]) ? '' : 'CREATE')) . "</select></td></tr>\n";
echo "<tr><th>" . lang('Tables') . "</th><td><select name='table_style'><option></option>" . optionlist($table_style, 'DROP+CREATE') . "</select></td></tr>\n";
echo "<tr><th>" . lang('Data') . "</th><td><select name='data_style'><option></option>" . optionlist($data_style, 'INSERT') . "</select></td></tr>\n";
?>
</table>
<p><input type="submit" value="<?php echo lang('Export'); ?>" /></p>
<?php
if (!strlen($_GET["db"])) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th align='left'><label><input type='checkbox' id='check-databases' checked='checked' onclick='form_check(this, /^databases\\[/);' />" . lang('Database') . "</label></th></tr></thead>\n";
foreach (get_databases() as $db) {
if ($db != "information_schema" || $dbh->server_info < 5) {
echo '<tr><td><label><input type="checkbox" name="databases[]" value="' . htmlspecialchars($db) . '" checked="checked" onclick="form_uncheck(\'check-databases\');" />' . htmlspecialchars($db) . "</label></td></tr>\n";
}
}
echo "</table>\n";
}
if (strlen($_GET["db"])) {
$checked = (strlen($_GET["dump"]) ? "" : " checked='checked'");
echo "<table cellspacing='0'>\n";
echo "<thead><tr>";
echo "<th align='left'><label><input type='checkbox' id='check-tables'$checked onclick='form_check(this, /^tables\\[/);' />" . lang('Tables') . "</label></th>";
echo "<th align='right'><label>" . lang('Data') . "<input type='checkbox' id='check-data'$checked onclick='form_check(this, /^data\\[/);' /></label></th>";
echo "</tr></thead>\n";
$views = "";
$result = $dbh->query("SHOW TABLE STATUS");
while ($row = $result->fetch_assoc()) {
$checked = (strlen($_GET["dump"]) && $row["Name"] != $_GET["dump"] ? '' : " checked='checked'");
$print = '<tr><td><label><input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . "\"$checked onclick=\"form_uncheck('check-tables');\" />" . htmlspecialchars($row["Name"]) . "</label></td>";
if (!$row["Engine"]) {
$views .= "$print</tr>\n";
} else {
echo "$print<td align='right'><label>" . ($row["Engine"] == "InnoDB" && $row["Rows"] ? lang('~ %s', $row["Rows"]) : $row["Rows"]) . '<input type="checkbox" name="data[]" value="' . htmlspecialchars($row["Name"]) . "\"$checked onclick=\"form_uncheck('check-data');\" /></label></td></tr>\n";
}
}
echo "$views</table>\n";
}
?>
</form>

105
adminer/edit.inc.php Normal file
View File

@@ -0,0 +1,105 @@
<?php
$where = (isset($_GET["select"]) ? (count($_POST["check"]) == 1 ? where_check($_POST["check"][0]) : array()) : where($_GET));
$update = ($where && !$_POST["clone"]);
$fields = fields($_GET["edit"]);
foreach ($fields as $name => $field) {
if (isset($_GET["default"]) ? $field["auto_increment"] || preg_match('~text|blob~', $field["type"]) : !isset($field["privileges"][$update ? "update" : "insert"])) {
unset($fields[$name]);
}
}
if ($_POST && !$error && !isset($_GET["select"])) {
$location = ($_POST["insert"] ? $_SERVER["REQUEST_URI"] : $SELF . (isset($_GET["default"]) ? "table=" : "select=") . urlencode($_GET["edit"]));
if (isset($_POST["delete"])) {
query_redirect("DELETE FROM " . idf_escape($_GET["edit"]) . " WHERE " . implode(" AND ", $where) . " LIMIT 1", $location, lang('Item has been deleted.'));
} else {
$set = array();
foreach ($fields as $name => $field) {
$val = process_input($name, $field);
if (!isset($_GET["default"])) {
if ($val !== false || !$update) {
$set[] = "\n" . idf_escape($name) . " = " . ($val !== false ? $val : "''");
}
} elseif ($val !== false) {
if ($field["type"] == "timestamp" && $val != "NULL") { //! doesn't allow DEFAULT NULL and no ON UPDATE
$set[] = "\nMODIFY " . idf_escape($name) . " timestamp" . ($field["null"] ? " NULL" : "") . " DEFAULT $val" . ($_POST["on_update"][bracket_escape($name)] ? " ON UPDATE CURRENT_TIMESTAMP" : "");
} else {
$set[] = "\nALTER " . idf_escape($name) . ($val == "NULL" ? " DROP DEFAULT" : " SET DEFAULT $val");
}
}
}
if (!$set) {
redirect($location);
}
if (isset($_GET["default"])) {
query_redirect("ALTER TABLE " . idf_escape($_GET["edit"]) . implode(",", $set), $location, lang('Default values has been set.'));
} elseif ($update) {
query_redirect("UPDATE " . idf_escape($_GET["edit"]) . " SET" . implode(",", $set) . "\nWHERE " . implode(" AND ", $where) . " LIMIT 1", $location, lang('Item has been updated.'));
} else {
query_redirect("INSERT INTO " . idf_escape($_GET["edit"]) . " SET" . implode(",", $set), $location, lang('Item has been inserted.'));
}
}
}
page_header((isset($_GET["default"]) ? lang('Default values') : ($_GET["where"] || (isset($_GET["select"]) && !$_POST["clone"]) ? lang('Edit') : lang('Insert'))), $error, array((isset($_GET["default"]) ? "table" : "select") => $_GET["edit"]), $_GET["edit"]);
unset($row);
if ($_POST["save"]) {
$row = (array) $_POST["fields"];
} elseif ($where) {
$select = array();
foreach ($fields as $name => $field) {
if (isset($field["privileges"]["select"])) {
$select[] = ($_POST["clone"] && $field["auto_increment"] ? "'' AS " : ($field["type"] == "enum" || $field["type"] == "set" ? "1*" . idf_escape($name) . " AS " : "")) . idf_escape($name);
}
}
$row = array();
if ($select) {
$result = $dbh->query("SELECT " . implode(", ", $select) . " FROM " . idf_escape($_GET["edit"]) . " WHERE " . implode(" AND ", $where) . " LIMIT 1");
$row = $result->fetch_assoc();
$result->free();
}
}
?>
<form action="" method="post" enctype="multipart/form-data">
<?php
if ($fields) {
unset($create);
echo "<table cellspacing='0'>\n";
foreach ($fields as $name => $field) {
echo "<tr><th>" . htmlspecialchars($name) . "</th>";
$value = (!isset($row) ? ($_POST["clone"] && $field["auto_increment"] ? "" : ($where ? $field["default"] : null))
: (strlen($row[$name]) && ($field["type"] == "enum" || $field["type"] == "set") ? intval($row[$name]) : $row[$name])
);
input($name, $field, $value);
if (isset($_GET["default"]) && $field["type"] == "timestamp") {
if (!isset($create) && !$_POST) {
//! disable sql_mode NO_FIELD_OPTIONS
$create = $dbh->result($dbh->query("SHOW CREATE TABLE " . idf_escape($_GET["edit"])), 1);
}
$checked = ($_POST ? $_POST["on_update"][bracket_escape($name)] : preg_match("~\n\\s*" . preg_quote(idf_escape($name), '~') . " timestamp.* on update CURRENT_TIMESTAMP~i", $create));
echo '<label><input type="checkbox" name="on_update[' . htmlspecialchars(bracket_escape($name)) . ']" value="1"' . ($checked ? ' checked="checked"' : '') . ' />' . lang('ON UPDATE CURRENT_TIMESTAMP') . '</label>';
}
echo "</td></tr>\n";
}
echo "</table>\n";
}
?>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="hidden" name="save" value="1" />
<?php
if (isset($_GET["select"])) {
hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"]));
}
if ($fields) {
echo '<input type="submit" value="' . lang('Save') . '" />';
if (!isset($_GET["default"]) && !isset($_GET["select"])) {
echo '<input type="submit" name="insert" value="' . ($update ? lang('Save and continue edit') : lang('Save and insert next')) . '" />';
}
}
if ($update) {
echo ' <input type="submit" name="delete" value="' . lang('Delete') . '"' . $confirm . '/>';
}
?>
</p>
</form>

54
adminer/event.inc.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
$intervals = array("YEAR", "QUARTER", "MONTH", "DAY", "HOUR", "MINUTE", "WEEK", "SECOND", "YEAR_MONTH", "DAY_HOUR", "DAY_MINUTE", "DAY_SECOND", "HOUR_MINUTE", "HOUR_SECOND", "MINUTE_SECOND");
$statuses = array("ENABLED" => "ENABLE", "DISABLED" => "DISABLE", "SLAVESIDE_DISABLED" => "DISABLE ON SLAVE");
if ($_POST && !$error) {
if ($_POST["drop"]) {
query_redirect("DROP EVENT " . idf_escape($_GET["event"]), substr($SELF, 0, -1), lang('Event has been dropped.'));
} elseif (in_array($_POST["INTERVAL_FIELD"], $intervals) && in_array($_POST["STATUS"], $statuses)) {
$schedule = "\nON SCHEDULE " . ($_POST["INTERVAL_VALUE"]
? "EVERY '" . $dbh->escape_string($_POST["INTERVAL_VALUE"]) . "' $_POST[INTERVAL_FIELD]"
. ($_POST["STARTS"] ? " STARTS '" . $dbh->escape_string($_POST["STARTS"]) . "'" : "")
. ($_POST["ENDS"] ? " ENDS '" . $dbh->escape_string($_POST["ENDS"]) . "'" : "") //! ALTER EVENT doesn't drop ENDS - MySQL bug #39173
: "AT '" . $dbh->escape_string($_POST["STARTS"]) . "'"
) . " ON COMPLETION" . ($_POST["ON_COMPLETION"] ? "" : " NOT") . " PRESERVE"
;
query_redirect((strlen($_GET["event"])
? "ALTER EVENT " . idf_escape($_GET["event"]) . $schedule
. ($_GET["event"] != $_POST["EVENT_NAME"] ? "\nRENAME TO " . idf_escape($_POST["EVENT_NAME"]) : "")
: "CREATE EVENT " . idf_escape($_POST["EVENT_NAME"]) . $schedule
) . "\n$_POST[STATUS] COMMENT '" . $dbh->escape_string($_POST["EVENT_COMMENT"])
. "' DO\n$_POST[EVENT_DEFINITION]"
, substr($SELF, 0, -1), (strlen($_GET["event"]) ? lang('Event has been altered.') : lang('Event has been created.')));
}
}
page_header((strlen($_GET["event"]) ? lang('Alter event') . ": " . htmlspecialchars($_GET["event"]) : lang('Create event')), $error);
$row = array();
if ($_POST) {
$row = $_POST;
} elseif (strlen($_GET["event"])) {
$result = $dbh->query("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = '" . $dbh->escape_string($_GET["db"]) . "' AND EVENT_NAME = '" . $dbh->escape_string($_GET["event"]) . "'");
$row = $result->fetch_assoc();
$row["STATUS"] = $statuses[$row["STATUS"]];
$result->free();
}
?>
<form action="" method="post">
<table cellspacing="0">
<tr><th><?php echo lang('Name'); ?></th><td><input name="EVENT_NAME" value="<?php echo htmlspecialchars($row["EVENT_NAME"]); ?>" maxlength="64" /></td></tr>
<tr><th><?php echo lang('Start'); ?></th><td><input name="STARTS" value="<?php echo htmlspecialchars("$row[EXECUTE_AT]$row[STARTS]"); ?>" /></td></tr>
<tr><th><?php echo lang('End'); ?></th><td><input name="ENDS" value="<?php echo htmlspecialchars($row["ENDS"]); ?>" /></td></tr>
<tr><th><?php echo lang('Every'); ?></th><td><input name="INTERVAL_VALUE" value="<?php echo htmlspecialchars($row["INTERVAL_VALUE"]); ?>" size="6" /> <select name="INTERVAL_FIELD"><?php echo optionlist($intervals, $row["INTERVAL_FIELD"]); ?></select></td></tr>
<tr><th><?php echo lang('Status'); ?></th><td><select name="STATUS"><?php echo optionlist($statuses, $row["STATUS"]); ?></select></td></tr>
<tr><th><?php echo lang('Comment'); ?></th><td><input name="EVENT_COMMENT" value="<?php echo htmlspecialchars($row["EVENT_COMMENT"]); ?>" maxlength="64" /></td></tr>
<tr><th>&nbsp;</th><td><label><input type="checkbox" name="ON_COMPLETION" value="PRESERVE"<?php echo ($row["ON_COMPLETION"] == "PRESERVE" ? " checked='checked'" : ""); ?> /><?php echo lang('On completion preserve'); ?></label></td></tr>
</table>
<p><textarea name="EVENT_DEFINITION" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["EVENT_DEFINITION"]); ?></textarea></p>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Save'); ?>" />
<?php if (strlen($_GET["event"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
</p>
</form>

BIN
adminer/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

81
adminer/foreign.inc.php Normal file
View File

@@ -0,0 +1,81 @@
<?php
if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-js"]) {
if ($_POST["drop"]) {
query_redirect("ALTER TABLE " . idf_escape($_GET["foreign"]) . "\nDROP FOREIGN KEY " . idf_escape($_GET["name"]), $SELF . "table=" . urlencode($_GET["foreign"]), lang('Foreign key has been dropped.'));
} else {
$source = array_filter($_POST["source"], 'strlen');
ksort($source);
$target = array();
foreach ($source as $key => $val) {
$target[$key] = $_POST["target"][$key];
}
query_redirect("ALTER TABLE " . idf_escape($_GET["foreign"])
. (strlen($_GET["name"]) ? "\nDROP FOREIGN KEY " . idf_escape($_GET["name"]) . "," : "")
. "\nADD FOREIGN KEY (" . implode(", ", array_map('idf_escape', $source)) . ") REFERENCES " . idf_escape($_POST["table"]) . " (" . implode(", ", array_map('idf_escape', $target)) . ")"
. (in_array($_POST["on_delete"], $on_actions) ? " ON DELETE $_POST[on_delete]" : "")
. (in_array($_POST["on_update"], $on_actions) ? " ON UPDATE $_POST[on_update]" : "")
, $SELF . "table=" . urlencode($_GET["foreign"]), (strlen($_GET["name"]) ? lang('Foreign key has been altered.') : lang('Foreign key has been created.')));
}
}
page_header(lang('Foreign key'), $error, array("table" => $_GET["foreign"]), $_GET["foreign"]);
$tables = array();
$result = $dbh->query("SHOW TABLE STATUS");
while ($row = $result->fetch_assoc()) {
if ($row["Engine"] == "InnoDB") {
$tables[] = $row["Name"];
}
}
$result->free();
if ($_POST) {
$row = $_POST;
ksort($row["source"]);
if ($_POST["add"]) {
$row["source"][] = "";
} elseif ($_POST["change"] || $_POST["change-js"]) {
$row["target"] = array();
}
} elseif (strlen($_GET["name"])) {
$foreign_keys = foreign_keys($_GET["foreign"]);
$row = $foreign_keys[$_GET["name"]];
$row["source"][] = "";
} else {
$row = array("table" => $_GET["foreign"], "source" => array(""));
}
$source = get_vals("SHOW COLUMNS FROM " . idf_escape($_GET["foreign"])); //! no text and blob
$target = ($_GET["foreign"] === $row["table"] ? $source : get_vals("SHOW COLUMNS FROM " . idf_escape($row["table"])));
?>
<form action="" method="post">
<p>
<?php echo lang('Target table'); ?>:
<select name="table" onchange="this.form['change-js'].value = '1'; this.form.submit();"><?php echo optionlist($tables, $row["table"]); ?></select>
<input type="hidden" name="change-js" value="" />
</p>
<noscript><p><input type="submit" name="change" value="<?php echo lang('Change'); ?>" /></p></noscript>
<table cellspacing="0">
<thead><tr><th><?php echo lang('Source'); ?></th><th><?php echo lang('Target'); ?></th></tr></thead>
<?php
$j = 0;
foreach ($row["source"] as $key => $val) {
echo "<tr>";
echo "<td><select name='source[" . intval($key) . "]'" . ($j == count($row["source"]) - 1 ? " onchange='foreign_add_row(this);'" : "") . "><option></option>" . optionlist($source, $val) . "</select></td>";
echo "<td><select name='target[" . intval($key) . "]'>" . optionlist($target, $row["target"][$key]) . "</select></td>";
echo "</tr>\n";
$j++;
}
?>
</table>
<p>
<?php echo lang('ON DELETE'); ?>: <select name="on_delete"><option></option><?php echo optionlist($on_actions, $row["on_delete"]); ?></select>
<?php echo lang('ON UPDATE'); ?>: <select name="on_update"><option></option><?php echo optionlist($on_actions, $row["on_update"]); ?></select>
</p>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Save'); ?>" />
<?php if (strlen($_GET["name"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
</p>
<noscript><p><input type="submit" name="add" value="<?php echo lang('Add column'); ?>" /></p></noscript>
</form>

268
adminer/functions.js Normal file
View File

@@ -0,0 +1,268 @@
document.body.className = 'js';
function toggle(id) {
var el = document.getElementById(id);
el.className = (el.className == 'hidden' ? '' : 'hidden');
return true;
}
function popup(el) {
el.getElementsByTagName('span')[0].className = 'popup';
}
function popdown(el) {
el.getElementsByTagName('span')[0].className = 'hidden';
}
function verify_version(version) {
document.cookie = 'adminer_version=0';
var script = document.createElement('script');
script.src = 'http://www.adminer.org/version.php?version=' + version;
document.body.appendChild(script);
}
function load_jush() {
var script = document.createElement('script');
script.src = '../externals/jush/jush.js';
script.onload = function () {
jush.style('../externals/jush/jush.css');
jush.highlight_tag('pre');
jush.highlight_tag('code');
}
script.onreadystatechange = function () {
if (script.readyState == 'loaded' || script.readyState == 'complete') {
script.onload();
}
}
document.body.appendChild(script);
}
function form_check(el, name) {
var elems = el.form.elements;
for (var i=0; i < elems.length; i++) {
if (name.test(elems[i].name)) {
elems[i].checked = el.checked;
}
}
}
function form_uncheck(id) {
document.getElementById(id).checked = false;
}
function where_change(op) {
for (var i=0; i < op.form.elements.length; i++) {
var el = op.form.elements[i];
if (el.name == op.name.substr(0, op.name.length - 4) + '[val]') {
el.className = (/NULL$/.test(op.options[op.selectedIndex].text) ? 'hidden' : '');
}
}
}
function select_add_row(field) {
var row = field.parentNode.cloneNode(true);
var selects = row.getElementsByTagName('select');
for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/[a-z]\[[0-9]+/, '$&1');
selects[i].selectedIndex = 0;
}
var inputs = row.getElementsByTagName('input');
if (inputs.length) {
inputs[0].name = inputs[0].name.replace(/[a-z]\[[0-9]+/, '$&1');
inputs[0].value = '';
inputs[0].className = '';
}
field.parentNode.parentNode.appendChild(row);
field.onchange = function () { };
}
var added = '.', row_count;
function editing_add_row(button, allowed) {
if (allowed && row_count >= allowed) {
return false;
}
var match = /([0-9]+)(\.[0-9]+)?/.exec(button.name);
var x = match[0] + (match[2] ? added.substr(match[2].length) : added) + '1';
var row = button.parentNode.parentNode;
var row2 = row.cloneNode(true);
var tags = row.getElementsByTagName('select');
var tags2 = row2.getElementsByTagName('select');
for (var i=0; i < tags.length; i++) {
tags[i].name = tags[i].name.replace(/([0-9.]+)/, x);
tags2[i].selectedIndex = tags[i].selectedIndex;
}
tags = row.getElementsByTagName('input');
tags2 = row2.getElementsByTagName('input');
for (var i=0; i < tags.length; i++) {
if (tags[i].name == 'auto_increment_col') {
tags[i].value = x;
tags2[i].checked = tags[i].checked;
tags[i].checked = false;
}
tags[i].name = tags[i].name.replace(/([0-9.]+)/, x);
if (/\[(orig|field|comment)/.test(tags[i].name)) {
tags[i].value = '';
}
}
row.parentNode.insertBefore(row2, row);
tags[0].focus();
added += '0';
row_count++;
return true;
}
function editing_remove_row(button) {
var field = button.form[button.name.replace(/drop_col(.+)/, 'fields$1[field]')];
field.parentNode.removeChild(field);
button.parentNode.parentNode.style.display = 'none';
return true;
}
function editing_type_change(type) {
var name = type.name.substr(0, type.name.length - 6);
for (var i=0; i < type.form.elements.length; i++) {
var el = type.form.elements[i];
if (el.name == name + '[collation]') {
el.className = (/char|text|enum|set/.test(type.options[type.selectedIndex].text) ? '' : 'hidden');
}
if (el.name == name + '[unsigned]') {
el.className = (/int|float|double|decimal/.test(type.options[type.selectedIndex].text) ? '' : 'hidden');
}
}
}
function column_comments_click(checked) {
var trs = document.getElementById('edit-fields').getElementsByTagName('tr');
for (var i=0; i < trs.length; i++) {
trs[i].getElementsByTagName('td')[5].className = (checked ? '' : 'hidden');
}
}
function partition_by_change(el) {
var partition_table = /RANGE|LIST/.test(el.options[el.selectedIndex].text);
el.form['partitions'].className = (partition_table || !el.selectedIndex ? 'hidden' : '');
document.getElementById('partition-table').className = (partition_table ? '' : 'hidden');
}
function partition_name_change(el) {
var row = el.parentNode.parentNode.cloneNode(true);
row.firstChild.firstChild.value = '';
el.parentNode.parentNode.parentNode.appendChild(row);
el.onchange = function () {};
}
function foreign_add_row(field) {
var row = field.parentNode.parentNode.cloneNode(true);
var selects = row.getElementsByTagName('select');
for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/\]/, '1$&');
selects[i].selectedIndex = 0;
}
field.parentNode.parentNode.parentNode.appendChild(row);
field.onchange = function () { };
}
function indexes_add_row(field) {
var row = field.parentNode.parentNode.cloneNode(true);
var spans = row.getElementsByTagName('span');
row.getElementsByTagName('td')[1].innerHTML = '<span>' + spans[spans.length - 1].innerHTML + '</span>';
var selects = row.getElementsByTagName('select');
for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/indexes\[[0-9]+/, '$&1');
selects[i].selectedIndex = 0;
}
var input = row.getElementsByTagName('input')[0];
input.name = input.name.replace(/indexes\[[0-9]+/, '$&1');
input.value = '';
field.parentNode.parentNode.parentNode.appendChild(row);
field.onchange = function () { };
}
function indexes_add_column(field) {
var column = field.parentNode.cloneNode(true);
var select = column.getElementsByTagName('select')[0];
select.name = select.name.replace(/\]\[[0-9]+/, '$&1');
select.selectedIndex = 0;
var input = column.getElementsByTagName('input')[0];
input.name = input.name.replace(/\]\[[0-9]+/, '$&1');
input.value = '';
field.parentNode.parentNode.appendChild(column);
field.onchange = function () { };
}
var that, x, y, em, table_pos;
function schema_mousedown(el, event) {
that = el;
x = event.clientX - el.offsetLeft;
y = event.clientY - el.offsetTop;
}
function schema_mousemove(ev) {
if (that !== undefined) {
ev = ev || event;
var left = (ev.clientX - x) / em;
var top = (ev.clientY - y) / em;
var divs = that.getElementsByTagName('div');
var line_set = { };
for (var i=0; i < divs.length; i++) {
if (divs[i].className == 'references') {
var div2 = document.getElementById((divs[i].id.substr(0, 4) == 'refs' ? 'refd' : 'refs') + divs[i].id.substr(4));
var ref = (table_pos[divs[i].title] ? table_pos[divs[i].title] : [ div2.parentNode.offsetTop / em, 0 ]);
var left1 = -1;
var is_top = true;
var id = divs[i].id.replace(/^ref.(.+)-.+/, '$1');
if (divs[i].parentNode != div2.parentNode) {
left1 = Math.min(0, ref[1] - left) - 1;
divs[i].style.left = left1 + 'em';
divs[i].getElementsByTagName('div')[0].style.width = -left1 + 'em';
var left2 = Math.min(0, left - ref[1]) - 1;
div2.style.left = left2 + 'em';
div2.getElementsByTagName('div')[0].style.width = -left2 + 'em';
is_top = (div2.offsetTop + ref[0] * em > divs[i].offsetTop + top * em);
}
if (!line_set[id]) {
var line = document.getElementById(divs[i].id.replace(/^....(.+)-[0-9]+$/, 'refl$1'));
var shift = ev.clientY - y - that.offsetTop;
line.style.left = (left + left1) + 'em';
if (is_top) {
line.style.top = (line.offsetTop + shift) / em + 'em';
}
if (divs[i].parentNode != div2.parentNode) {
line = line.getElementsByTagName('div')[0];
line.style.height = (line.offsetHeight + (is_top ? -1 : 1) * shift) / em + 'em';
}
line_set[id] = true;
}
}
}
that.style.left = left + 'em';
that.style.top = top + 'em';
}
}
function schema_mouseup(ev) {
if (that !== undefined) {
ev = ev || event;
table_pos[that.firstChild.firstChild.firstChild.data] = [ (ev.clientY - y) / em, (ev.clientX - x) / em ];
that = undefined;
var date = new Date();
date.setMonth(date.getMonth() + 1);
var s = '';
for (var key in table_pos) {
s += '_' + key + ':' + Math.round(table_pos[key][0] * 10000) / 10000 + 'x' + Math.round(table_pos[key][1] * 10000) / 10000;
}
document.cookie = 'schema=' + encodeURIComponent(s.substr(1)) + '; expires=' + date + '; path=' + location.pathname + location.search;
}
}

View File

@@ -0,0 +1,76 @@
<?php
$ignore = array("server", "username", "password");
$session_name = session_name();
if (ini_get("session.use_trans_sid") && isset($_POST[$session_name])) {
$ignore[] = $session_name;
}
if (isset($_POST["server"])) {
if (isset($_COOKIE[$session_name]) || isset($_POST[$session_name])) {
session_regenerate_id();
$_SESSION["usernames"][$_POST["server"]] = $_POST["username"];
$_SESSION["passwords"][$_POST["server"]] = $_POST["password"];
$_SESSION["tokens"][$_POST["server"]] = rand(1, 1e6);
if (count($_POST) == count($ignore)) {
$location = ((string) $_GET["server"] === $_POST["server"] ? remove_from_uri() : preg_replace('~^[^?]*/([^?]*).*~', '\\1', $_SERVER["REQUEST_URI"]) . (strlen($_POST["server"]) ? '?server=' . urlencode($_POST["server"]) : ''));
if (!isset($_COOKIE[$session_name])) {
$location .= (strpos($location, "?") === false ? "?" : "&") . SID;
}
header("Location: " . (strlen($location) ? $location : "."));
exit;
}
if ($_POST["token"]) {
$_POST["token"] = $_SESSION["tokens"][$_POST["server"]];
}
}
$_GET["server"] = $_POST["server"];
} elseif (isset($_POST["logout"])) {
if ($_POST["token"] != $_SESSION["tokens"][$_GET["server"]]) {
page_header(lang('Logout'), lang('Invalid CSRF token. Send the form again.'));
page_footer("db");
exit;
} else {
unset($_SESSION["usernames"][$_GET["server"]]);
unset($_SESSION["passwords"][$_GET["server"]]);
unset($_SESSION["databases"][$_GET["server"]]);
unset($_SESSION["tokens"][$_GET["server"]]);
unset($_SESSION["history"][$_GET["server"]]);
redirect(substr($SELF, 0, -1), lang('Logout successful.'));
}
}
function auth_error($exception = null) {
global $ignore, $dbh;
$username = $_SESSION["usernames"][$_GET["server"]];
unset($_SESSION["usernames"][$_GET["server"]]);
page_header(lang('Login'), (isset($username) ? htmlspecialchars($exception ? $exception->getMessage() : ($dbh ? $dbh : lang('Invalid credentials.'))) : (isset($_POST["server"]) ? lang('Sessions must be enabled.') : ($_POST ? lang('Session expired, please login again.') : ""))), null);
?>
<form action="" method="post">
<table cellspacing="0">
<tr><th><?php echo lang('Server'); ?></th><td><input name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /></td></tr>
<tr><th><?php echo lang('Username'); ?></th><td><input name="username" value="<?php echo htmlspecialchars($username); ?>" /></td></tr>
<tr><th><?php echo lang('Password'); ?></th><td><input type="password" name="password" /></td></tr>
</table>
<p>
<?php
hidden_fields($_POST, $ignore); // expired session
foreach ($_FILES as $key => $val) {
echo '<input type="hidden" name="files[' . htmlspecialchars($key) . ']" value="' . ($val["error"] ? $val["error"] : base64_encode(file_get_contents($val["tmp_name"]))) . '" />';
}
?>
<input type="submit" value="<?php echo lang('Login'); ?>" />
</p>
</form>
<?php
page_footer("auth");
}
$username = &$_SESSION["usernames"][$_GET["server"]];
if (!isset($username)) {
$username = $_GET["username"];
}
$dbh = (isset($username) ? connect() : '');
unset($username);
if (is_string($dbh)) {
auth_error();
exit;
}

View File

@@ -0,0 +1,25 @@
<?php
function connect_error() {
global $dbh, $SELF, $VERSION;
if (strlen($_GET["db"])) {
page_header(lang('Database') . ": " . htmlspecialchars($_GET["db"]), lang('Invalid database.'), false);
} else {
page_header(lang('Select database'), "", null);
echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Create new database') . "</a></p>\n";
echo '<p><a href="' . htmlspecialchars($SELF) . 'privileges=">' . lang('Privileges') . "</a></p>\n";
echo '<p><a href="' . htmlspecialchars($SELF) . 'processlist=">' . lang('Process list') . "</a></p>\n";
echo "<p>" . lang('MySQL version: %s through PHP extension %s', "<b" . ($dbh->server_info < 4.1 ? " class='binary'" : "") . ">$dbh->server_info</b>", "<b>$dbh->extension</b>") . "</p>\n";
echo "<p>" . lang('Logged as: %s', "<b>" . htmlspecialchars($dbh->result($dbh->query("SELECT USER()"))) . "</b>") . "</p>\n";
}
page_footer("db");
}
$dbh->query("SET SQL_QUOTE_SHOW_CREATE=1");
if (!(strlen($_GET["db"]) ? $dbh->select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]))) {
if (strlen($_GET["db"])) {
unset($_SESSION["databases"][$_GET["server"]]);
}
connect_error();
exit;
}
$dbh->query("SET CHARACTER SET utf8");

View File

@@ -0,0 +1,113 @@
<?php
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
global $SELF, $LANG, $VERSION;
header("Content-Type: text/html; charset=utf-8");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $LANG; ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="robots" content="noindex" />
<title><?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . " - " . lang('Adminer'); ?></title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="default.css<?php // Ondrej Valka, http://valka.info ?>" />
<?php if (file_exists("adminer.css")) { ?>
<link rel="stylesheet" type="text/css" href="adminer.css" />
<?php } ?>
</head>
<body onload="load_jush();<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verify_version('$VERSION');"); ?>">
<script type="text/javascript" src="functions.js"></script>
<div id="content">
<?php
if (isset($breadcrumb)) {
$link = substr(preg_replace('~db=[^&]*&~', '', $SELF), 0, -1);
echo '<p id="breadcrumb"><a href="' . (strlen($link) ? htmlspecialchars($link) : ".") . '">' . (isset($_GET["server"]) ? htmlspecialchars($_GET["server"]) : lang('Server')) . '</a> &raquo; ';
if (is_array($breadcrumb)) {
if (strlen($_GET["db"])) {
echo '<a href="' . htmlspecialchars(substr($SELF, 0, -1)) . '">' . htmlspecialchars($_GET["db"]) . '</a> &raquo; ';
}
foreach ($breadcrumb as $key => $val) {
if (strlen($val)) {
echo '<a href="' . htmlspecialchars("$SELF$key=") . ($key != "privileges" ? urlencode($val) : "") . '">' . htmlspecialchars($val) . '</a> &raquo; ';
}
}
}
echo "$title</p>\n";
}
echo "<h2>$title" . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . "</h2>\n";
if ($_SESSION["messages"]) {
echo "<p class='message'>" . implode("</p>\n<p class='message'>", $_SESSION["messages"]) . "</p>\n";
$_SESSION["messages"] = array();
}
$databases = &$_SESSION["databases"][$_GET["server"]];
if (strlen($_GET["db"]) && $databases && !in_array($_GET["db"], $databases, true)) {
$databases = null;
}
if (isset($databases) && !isset($_GET["sql"]) && !isset($_SESSION["coverage"])) {
session_write_close();
}
if ($error) {
echo "<p class='error'>$error</p>\n";
}
}
function page_footer($missing = false) {
global $SELF, $dbh, $VERSION;
?>
</div>
<?php switch_lang(); ?>
<div id="menu">
<h1><a href="http://www.adminer.org/"><?php echo lang('Adminer'); ?></a> <?php echo $VERSION; ?></h1>
<div class="version"><a href='http://www.adminer.org/#download' id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? htmlspecialchars($_COOKIE["adminer_version"]) : ""); ?></a></div>
<?php if ($missing != "auth") { ?>
<form action="" method="post">
<p>
<a href="<?php echo htmlspecialchars($SELF); ?>sql="><?php echo lang('SQL command'); ?></a>
<a href="<?php echo htmlspecialchars($SELF); ?>dump=<?php echo urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]); ?>"><?php echo lang('Dump'); ?></a>
<input type="hidden" name="token" value="<?php echo $_SESSION["tokens"][$_GET["server"]]; ?>" />
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>" />
</p>
</form>
<form action="">
<p><?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /><?php } ?>
<?php if (get_databases()) { ?>
<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option><?php echo optionlist(get_databases(), $_GET["db"]); ?></select>
<?php } else { ?>
<input name="db" value="<?php echo htmlspecialchars($_GET["db"]); ?>" /> <input type="submit" value="<?php echo lang('Use'); ?>" />
<?php } ?>
<?php if (isset($_GET["sql"])) { ?><input type="hidden" name="sql" value="" /><?php } ?>
<?php if (isset($_GET["schema"])) { ?><input type="hidden" name="schema" value="" /><?php } ?>
<?php if (isset($_GET["dump"])) { ?><input type="hidden" name="dump" value="" /><?php } ?>
</p>
<?php if (get_databases()) { ?>
<noscript><p><input type="submit" value="<?php echo lang('Use'); ?>" /></p></noscript>
<?php } ?>
</form>
<?php
if ($missing != "db" && strlen($_GET["db"])) {
$result = $dbh->query("SHOW TABLE STATUS");
if (!$result->num_rows) {
echo "<p class='message'>" . lang('No tables.') . "</p>\n";
} else {
echo "<p>\n";
while ($row = $result->fetch_assoc()) {
echo '<a href="' . htmlspecialchars($SELF) . 'select=' . urlencode($row["Name"]) . '">' . lang('select') . '</a> ';
echo '<a href="' . htmlspecialchars($SELF) . (isset($row["Rows"]) ? 'table' : 'view') . '=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a><br />\n";
}
echo "</p>\n";
}
echo '<p><a href="' . htmlspecialchars($SELF) . 'create=">' . lang('Create new table') . "</a></p>\n";
$result->free();
}
}
?>
</div>
</body>
</html>
<?php
}

View File

@@ -0,0 +1,230 @@
<?php
function input($name, $field, $value, $separator = "</td><td>") { //! pass empty separator if there are no functions in the whole table
global $types;
$name = htmlspecialchars(bracket_escape($name));
echo "<td" . ($separator ? " class='function'" : "") . ">";
if ($field["type"] == "enum") {
echo ($separator ? "&nbsp;$separator" : "") . (isset($_GET["select"]) ? ' <label><input type="radio" name="fields[' . $name . ']" value="-1" checked="checked" /><em>' . lang('original') . '</em></label>' : "");
if ($field["null"] || isset($_GET["default"])) {
echo ' <label><input type="radio" name="fields[' . $name . ']" value=""' . (($field["null"] ? isset($value) : strlen($value)) || isset($_GET["select"]) ? '' : ' checked="checked"') . ' />' . ($field["null"] ? '<em>NULL</em>' : '') . '</label>';
}
if (!isset($_GET["default"])) {
echo '<input type="radio" name="fields[' . $name . ']" value="0"' . ($value === 0 ? ' checked="checked"' : '') . ' />';
}
preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val));
$checked = (is_int($value) ? $value == $i+1 : $value === $val);
echo ' <label><input type="radio" name="fields[' . $name . ']" value="' . (isset($_GET["default"]) ? (strlen($val) ? htmlspecialchars($val) : " ") : $i+1) . '"' . ($checked ? ' checked="checked"' : '') . ' />' . htmlspecialchars($val) . '</label>';
}
} else {
$first = ($field["null"] || isset($_GET["default"])) + isset($_GET["select"]);
$onchange = ($first ? ' onchange="var f = this.form[\'function[' . addcslashes($name, "\r\n'\\") . ']\']; if (' . $first . ' > f.selectedIndex) f.selectedIndex = ' . $first . ';"' : '');
$options = array("");
if (!isset($_GET["default"])) {
if (preg_match('~char|date|time~', $field["type"])) {
$options = (preg_match('~char~', $field["type"]) ? array("", "md5", "sha1", "password", "uuid") : array("", "now"));
}
if (!isset($_GET["call"]) && (isset($_GET["select"]) || where($_GET))) {
if (preg_match('~int|float|double|decimal~', $field["type"])) {
$options = array("", "+", "-");
}
if (preg_match('~date~', $field["type"])) {
$options[] = "+ interval";
$options[] = "- interval";
}
if (preg_match('~time~', $field["type"])) {
$options[] = "addtime";
$options[] = "subtime";
}
}
}
if ($field["null"] || isset($_GET["default"])) {
array_unshift($options, "NULL");
}
echo (count($options) > 1 || isset($_GET["select"]) ? '<select name="function[' . $name . ']">' . (isset($_GET["select"]) ? '<option value="orig">' . lang('original') . '</option>' : '') . optionlist($options, (isset($value) ? (string) $_POST["function"][$name] : null)) . '</select>' : ($separator ? "&nbsp;" : "")) . $separator;
if ($field["type"] == "set") { //! 64 bits
preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val));
$checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true));
echo ' <label><input type="checkbox" name="fields[' . $name . '][' . $i . ']" value="' . (isset($_GET["default"]) ? htmlspecialchars($val) : 1 << $i) . '"' . ($checked ? ' checked="checked"' : '') . $onchange . ' />' . htmlspecialchars($val) . '</label>';
}
} elseif (strpos($field["type"], "text") !== false) {
echo '<textarea name="fields[' . $name . ']" cols="50" rows="12"' . $onchange . '>' . htmlspecialchars($value) . '</textarea>';
} elseif (preg_match('~binary|blob~', $field["type"])) {
echo (ini_get("file_uploads") ? '<input type="file" name="' . $name . '"' . $onchange . ' />' : lang('File uploads are disabled.') . ' ');
} else {
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? ($match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
echo '<input name="fields[' . $name . ']" value="' . htmlspecialchars($value) . '"' . ($maxlength ? " maxlength='$maxlength'" : "") . $onchange . ' />';
}
}
}
function process_input($name, $field) {
global $dbh;
$idf = bracket_escape($name);
$function = $_POST["function"][$idf];
$value = $_POST["fields"][$idf];
if ($field["type"] == "enum" ? $value == -1 : $function == "orig") {
return false;
} elseif ($field["type"] == "enum" || $field["auto_increment"] ? !strlen($value) : $function == "NULL") {
return "NULL";
} elseif ($field["type"] == "enum") {
return (isset($_GET["default"]) ? "'" . $dbh->escape_string($value) . "'" : intval($value));
} elseif ($field["type"] == "set") {
return (isset($_GET["default"]) ? "'" . implode(",", array_map(array($dbh, 'escape_string'), (array) $value)) . "'" : array_sum((array) $value));
} elseif (preg_match('~binary|blob~', $field["type"])) {
$file = get_file($idf);
if (!is_string($file)) {
return false; //! report errors
}
return "_binary'" . (is_string($file) ? $dbh->escape_string($file) : "") . "'";
} elseif ($field["type"] == "timestamp" && $value == "CURRENT_TIMESTAMP") {
return $value;
} elseif (preg_match('~^(now|uuid)$~', $function)) {
return "$function()";
} elseif (preg_match('~^[+-]$~', $function)) {
return idf_escape($name) . " $function '" . $dbh->escape_string($value) . "'";
} elseif (preg_match('~^[+-] interval$~', $function)) {
return idf_escape($name) . " $function " . (preg_match("~^([0-9]+|'[0-9.: -]') [A-Z_]+$~i", $value) ? $value : "'" . $dbh->escape_string($value) . "'") . "";
} elseif (preg_match('~^(addtime|subtime)$~', $function)) {
return "$function(" . idf_escape($name) . ", '" . $dbh->escape_string($value) . "')";
} elseif (preg_match('~^(md5|sha1|password)$~', $function)) {
return "$function('" . $dbh->escape_string($value) . "')";
} else {
return "'" . $dbh->escape_string($value) . "'";
}
}
function edit_type($key, $field, $collations) {
global $types, $unsigned, $inout;
?>
<td><select name="<?php echo $key; ?>[type]" onchange="editing_type_change(this);"><?php echo optionlist(array_keys($types), $field["type"]); ?></select></td>
<td><input name="<?php echo $key; ?>[length]" value="<?php echo htmlspecialchars($field["length"]); ?>" size="3" /></td>
<td><?php echo "<select name=\"$key" . '[collation]"' . (preg_match('~char|text|enum|set~', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')</option>' . optionlist($collations, $field["collation"]) . '</select>' . ($unsigned ? " <select name=\"$key" . '[unsigned]"' . (!$field["type"] || preg_match('~int|float|double|decimal~', $field["type"]) ? "" : " class='hidden'") . '>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : ''); ?></td>
<?php
}
function process_type($field, $collate = "COLLATE") {
global $dbh, $enum_length, $unsigned;
return " $field[type]"
. ($field["length"] && !preg_match('~^date|time$~', $field["type"]) ? "(" . process_length($field["length"]) . ")" : "")
. (preg_match('~int|float|double|decimal~', $field["type"]) && in_array($field["unsigned"], $unsigned) ? " $field[unsigned]" : "")
. (preg_match('~char|text|enum|set~', $field["type"]) && $field["collation"] ? " $collate '" . $dbh->escape_string($field["collation"]) . "'" : "")
;
}
function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0) {
global $inout;
$column_comments = false;
foreach ($fields as $field) {
if (strlen($field["comment"])) {
$column_comments = true;
}
}
?>
<thead><tr>
<?php if ($type == "PROCEDURE") { ?><td><?php echo lang('IN-OUT'); ?></td><?php } ?>
<th><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?></th>
<td><?php echo lang('Type'); ?></td>
<td><?php echo lang('Length'); ?></td>
<td><?php echo lang('Options'); ?></td>
<?php if ($type == "TABLE") { ?>
<td><?php echo lang('NULL'); ?></td>
<td><input type="radio" name="auto_increment_col" value="" /><?php echo lang('Auto Increment'); ?></td>
<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><?php echo lang('Comment'); ?></td>
<?php } ?>
<td><input type="image" name="add[0]" src="plus.gif" alt="+" title="<?php echo lang('Add next'); ?>" /><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script></td>
</tr></thead>
<?php
foreach ($fields as $i => $field) {
$i++;
$display = (isset($_POST["add"][$i-1]) || (isset($field["field"]) && !$_POST["drop_col"][$i]));
?>
<tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
<?php if ($type == "PROCEDURE") { ?><td><select name="fields[<?php echo $i; ?>][inout]"><?php echo optionlist($inout, $field["inout"]); ?></select></td><?php } ?>
<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo htmlspecialchars($field["field"]); ?>" maxlength="64" /><?php } ?><input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo htmlspecialchars($field[($_POST ? "orig" : "field")]); ?>" /></th>
<?php edit_type("fields[$i]", $field, $collations); ?>
<?php if ($type == "TABLE") { ?>
<td><input type="checkbox" name="fields[<?php echo $i; ?>][null]" value="1"<?php if ($field["null"]) { ?> checked="checked"<?php } ?> /></td>
<td><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked="checked"<?php } ?> /></td>
<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><input name="fields[<?php echo $i; ?>][comment]" value="<?php echo htmlspecialchars($field["comment"]); ?>" maxlength="255" /></td>
<?php } ?>
<?php
echo "<td><input type='image' name='add[$i]' src='plus.gif' alt='+' title='" . lang('Add next') . "' onclick='return !editing_add_row(this, $allowed);' />";
echo "&nbsp;<input type='image' name='drop_col[$i]' src='cross.gif' alt='x' title='" . lang('Remove') . "' onclick='return !editing_remove_row(this);' />";
echo "&nbsp;<input type='image' name='up[$i]' src='up.gif' alt='^' title='" . lang('Move up') . "' />";
echo "&nbsp;<input type='image' name='down[$i]' src='down.gif' alt='v' title='" . lang('Move down') . "' />";
echo "</td>\n</tr>\n";
}
return $column_comments;
}
function process_fields(&$fields) {
ksort($fields);
$offset = 0;
if ($_POST["up"]) {
$last = 0;
foreach ($fields as $key => $field) {
if (key($_POST["up"]) == $key) {
unset($fields[$key]);
array_splice($fields, $last, 0, array($field));
break;
}
if (isset($field["field"])) {
$last = $offset;
}
$offset++;
}
}
if ($_POST["down"]) {
$found = false;
foreach ($fields as $key => $field) {
if (isset($field["field"]) && $found) {
unset($fields[key($_POST["down"])]);
array_splice($fields, $offset, 0, array($found));
break;
}
if (key($_POST["down"]) == $key) {
$found = $field;
}
$offset++;
}
}
$fields = array_values($fields);
if ($_POST["add"]) {
array_splice($fields, key($_POST["add"]), 0, array(array()));
}
}
function normalize_enum($match) {
return "'" . str_replace("'", "''", addcslashes(stripcslashes(str_replace($match[0]{0} . $match[0]{0}, $match[0]{0}, substr($match[0], 1, -1))), '\\')) . "'";
}
function routine($name, $type) {
global $dbh, $enum_length, $inout;
$aliases = array("bit" => "tinyint", "bool" => "tinyint", "boolean" => "tinyint", "integer" => "int", "double precision" => "float", "real" => "float", "dec" => "decimal", "numeric" => "decimal", "fixed" => "decimal", "national char" => "char", "national varchar" => "varchar");
$type_pattern = "([a-z]+)(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";
$pattern = "\\s*(" . ($type == "FUNCTION" ? "" : implode("|", $inout)) . ")?\\s*(?:`((?:[^`]+|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
$create = $dbh->result($dbh->query("SHOW CREATE $type " . idf_escape($name)), 2);
preg_match("~\\(((?:$pattern\\s*,?)*)\\)" . ($type == "FUNCTION" ? "\\s*RETURNS\\s+$type_pattern" : "") . "\\s*(.*)~is", $create, $match);
$fields = array();
preg_match_all("~$pattern\\s*,?~is", $match[1], $matches, PREG_SET_ORDER);
foreach ($matches as $i => $param) {
$data_type = strtolower($param[4]);
$fields[$i] = array(
"field" => str_replace("``", "`", $param[2]) . $param[3],
"type" => (isset($aliases[$data_type]) ? $aliases[$data_type] : $data_type),
"length" => preg_replace_callback("~$enum_length~s", 'normalize_enum', $param[5]),
"unsigned" => strtolower(preg_replace('~\\s+~', ' ', trim("$param[7] $param[6]"))),
"inout" => strtoupper($param[1]),
"collation" => strtolower($param[8]),
);
}
if ($type != "FUNCTION") {
return array("fields" => $fields, "definition" => $match[10]);
}
$returns = array("type" => $match[10], "length" => $match[11], "unsigned" => $match[13], "collation" => $match[14]);
return array("fields" => $fields, "returns" => $returns, "definition" => $match[15]);
}

View File

@@ -0,0 +1,178 @@
<?php
function dump_csv($row) {
foreach ($row as $key => $val) {
if (preg_match("~[\"\n,]~", $val) || (isset($val) && !strlen($val))) {
$row[$key] = '"' . str_replace('"', '""', $val) . '"';
}
}
echo implode(",", $row) . "\n";
}
function dump_table($table, $style, $is_view = false) {
global $dbh;
if ($_POST["format"] == "csv") {
echo "\xef\xbb\xbf";
if ($style) {
dump_csv(array_keys(fields($table)));
}
} elseif ($style) {
$result = $dbh->query("SHOW CREATE TABLE " . idf_escape($table));
if ($result) {
if ($style == "DROP+CREATE") {
echo "DROP " . ($is_view ? "VIEW" : "TABLE") . " IF EXISTS " . idf_escape($table) . ";\n";
}
$create = $dbh->result($result, 1);
$result->free();
echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n";
}
if ($style == "CREATE+ALTER" && !$is_view) {
$query = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, COLLATION_NAME, COLUMN_TYPE, EXTRA, COLUMN_COMMENT FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '" . $dbh->escape_string($table) . "' ORDER BY ORDINAL_POSITION";
?>
DELIMITER ;;
CREATE PROCEDURE adminer_alter () BEGIN
DECLARE _column_name, _collation_name, _column_type, after varchar(64) DEFAULT '';
DECLARE _column_default longtext;
DECLARE _is_nullable char(3);
DECLARE _extra varchar(20);
DECLARE _column_comment varchar(255);
DECLARE done, set_after bool DEFAULT 0;
DECLARE add_columns text DEFAULT '<?php
$fields = array();
$result = $dbh->query($query);
$after = "";
while ($row = $result->fetch_assoc()) {
$row["default"] = (isset($row["COLUMN_DEFAULT"]) ? "'" . $dbh->escape_string($row["COLUMN_DEFAULT"]) . "'" : "NULL");
$row["after"] = $dbh->escape_string($after); //! rgt AFTER lft, lft AFTER id doesn't work
$row["alter"] = $dbh->escape_string(idf_escape($row["COLUMN_NAME"])
. " $row[COLUMN_TYPE]"
. ($row["COLLATION_NAME"] ? " COLLATE $row[COLLATION_NAME]" : "")
. (isset($row["COLUMN_DEFAULT"]) ? " DEFAULT $row[default]" : "")
. ($row["IS_NULLABLE"] == "YES" ? "" : " NOT NULL")
. ($row["EXTRA"] ? " $row[EXTRA]" : "")
. ($row["COLUMN_COMMENT"] ? " COMMENT '" . $dbh->escape_string($row["COLUMN_COMMENT"]) . "'" : "")
. ($after ? " AFTER " . idf_escape($after) : " FIRST")
);
echo ", ADD $row[alter]";
$fields[] = $row;
$after = $row["COLUMN_NAME"];
}
$result->free();
?>';
DECLARE columns CURSOR FOR <?php echo $query; ?>;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
SET @alter_table = '';
OPEN columns;
REPEAT
FETCH columns INTO _column_name, _column_default, _is_nullable, _collation_name, _column_type, _extra, _column_comment;
IF NOT done THEN
SET set_after = 1;
CASE _column_name<?php
foreach ($fields as $row) {
echo "
WHEN '" . $dbh->escape_string($row["COLUMN_NAME"]) . "' THEN
SET add_columns = REPLACE(add_columns, ', ADD $row[alter]', '');
IF NOT (_column_default <=> $row[default]) OR _is_nullable != '$row[IS_NULLABLE]' OR _collation_name != '$row[COLLATION_NAME]' OR _column_type != '$row[COLUMN_TYPE]' OR _extra != '$row[EXTRA]' OR _column_comment != '" . $dbh->escape_string($row["COLUMN_COMMENT"]) . "' OR after != '$row[after]' THEN
SET @alter_table = CONCAT(@alter_table, ', MODIFY $row[alter]');
END IF;"; //! don't replace in comment
}
?>
ELSE
SET @alter_table = CONCAT(@alter_table, ', DROP ', _column_name);
SET set_after = 0;
END CASE;
IF set_after THEN
SET after = _column_name;
END IF;
END IF;
UNTIL done END REPEAT;
CLOSE columns;
IF @alter_table != '' OR add_columns != '' THEN
SET @alter_table = CONCAT('ALTER TABLE <?php echo idf_escape($table); ?>', SUBSTR(CONCAT(add_columns, @alter_table), 2));
PREPARE alter_command FROM @alter_table;
EXECUTE alter_command;
DROP PREPARE alter_command;
END IF;
END;;
DELIMITER ;
CALL adminer_alter;
DROP PROCEDURE adminer_alter;
<?php
//! indexes
}
if ($dbh->server_info >= 5) {
$result = $dbh->query("SHOW TRIGGERS LIKE '" . $dbh->escape_string(addcslashes($table, "%_")) . "'");
if ($result->num_rows) {
echo "DELIMITER ;;\n\n";
while ($row = $result->fetch_assoc()) {
echo "CREATE TRIGGER " . idf_escape($row["Trigger"]) . " $row[Timing] $row[Event] ON " . idf_escape($row["Table"]) . " FOR EACH ROW $row[Statement];;\n\n";
}
echo "DELIMITER ;\n\n";
}
$result->free();
}
}
}
function dump_data($table, $style, $select = "") {
global $dbh, $max_packet;
if ($style) {
if ($_POST["format"] != "csv" && $style == "TRUNCATE+INSERT") {
echo "TRUNCATE " . idf_escape($table) . ";\n";
}
$result = $dbh->query(($select ? $select : "SELECT * FROM " . idf_escape($table))); //! enum and set as numbers, binary as _binary, microtime
if ($result) {
$length = 0;
while ($row = $result->fetch_assoc()) {
if ($_POST["format"] == "csv") {
dump_csv($row);
} else {
$insert = "INSERT INTO " . idf_escape($table) . ($select ? " (" . implode(", ", array_map('idf_escape', array_keys($row))) . ")" : "") . " VALUES ";
$row2 = array();
foreach ($row as $key => $val) {
$row2[$key] = (isset($val) ? "'" . $dbh->escape_string($val) . "'" : "NULL");
}
if ($style == "INSERT+UPDATE") {
$set = array();
foreach ($row as $key => $val) {
$set[] = idf_escape($key) . " = " . (isset($val) ? "'" . $dbh->escape_string($val) . "'" : "NULL");
}
echo "$insert (" . implode(", ", $row2) . ") ON DUPLICATE KEY UPDATE " . implode(", ", $set) . ";\n";
} else {
$s = "(" . implode(", ", $row2) . ")";
if (!$length) {
echo $insert, $s;
$length = strlen($insert) + strlen($s);
} else {
$length += 2 + strlen($s);
if ($length < $max_packet) {
echo ", ", $s;
} else {
echo ";\n", $insert, $s;
$length = strlen($insert) + strlen($s);
}
}
}
}
}
if ($_POST["format"] != "csv" && $style != "INSERT+UPDATE" && $result->num_rows) {
echo ";\n";
}
$result->free();
}
}
}
function dump_headers($identifier, $multi_table = false) {
$filename = (strlen($identifier) ? friendly_url($identifier) : "dump");
$ext = ($_POST["format"] == "sql" ? "sql" : ($multi_table ? "tar" : "csv"));
header("Content-Type: " . ($ext == "tar" ? "application/x-tar" : ($ext == "sql" || $_POST["output"] != "file" ? "text/plain" : "text/csv")) . "; charset=utf-8");
header("Content-Disposition: " . ($_POST["output"] == "file" ? "attachment" : "inline") . "; filename=$filename.$ext");
return $ext;
}
$dump_output = "<select name='output'><option value='text'>" . lang('open') . "</option><option value='file'>" . lang('save') . "</option></select>";
$dump_format = "<select name='format'><option value='sql'>" . lang('SQL') . "</option><option value='csv'>" . lang('CSV') . "</option></select>";
$max_packet = 0;

View File

@@ -0,0 +1,252 @@
<?php
function idf_escape($idf) {
return "`" . str_replace("`", "``", $idf) . "`";
}
function idf_unescape($idf) {
return str_replace("``", "`", $idf);
}
function bracket_escape($idf, $back = false) {
static $trans = array(':' => ':1', ']' => ':2', '[' => ':3');
return strtr($idf, ($back ? array_flip($trans) : $trans));
}
function optionlist($options, $selected = null) {
$return = "";
foreach ($options as $k => $v) {
if (is_array($v)) {
$return .= '<optgroup label="' . htmlspecialchars($k) . '">';
}
foreach ((is_array($v) ? $v : array($v)) as $val) {
$return .= '<option' . ($val === $selected ? ' selected="selected"' : '') . '>' . htmlspecialchars($val) . '</option>';
}
if (is_array($v)) {
$return .= '</optgroup>';
}
}
return $return;
}
function get_vals($query, $column = 0) {
global $dbh;
$return = array();
$result = $dbh->query($query);
if ($result) {
while ($row = $result->fetch_row()) {
$return[] = $row[$column];
}
$result->free();
}
return $return;
}
function unique_idf($row, $indexes) {
foreach ($indexes as $index) {
if ($index["type"] == "PRIMARY" || $index["type"] == "UNIQUE") {
$return = array();
foreach ($index["columns"] as $key) {
if (!isset($row[$key])) {
continue 2;
}
$return[] = urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($row[$key]);
}
return $return;
}
}
$return = array();
foreach ($row as $key => $val) {
$return[] = (isset($val) ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key));
}
return $return;
}
function where($where) {
global $dbh;
$return = array();
foreach ((array) $where["where"] as $key => $val) {
$key = bracket_escape($key, "back");
$return[] = (preg_match('~^[A-Z0-9_]+\\(`(?:[^`]+|``)+`\\)$~', $key) ? $key : idf_escape($key)) . " = BINARY '" . $dbh->escape_string($val) . "'"; //! enum and set, columns looking like functions
}
foreach ((array) $where["null"] as $key) {
$key = bracket_escape($key, "back");
$return[] = (preg_match('~^[A-Z0-9_]+\\(`(?:[^`]+|``)+`\\)$~', $key) ? $key : idf_escape($key)) . " IS NULL";
}
return $return;
}
function where_check($val) {
parse_str($val, $check);
return where($check);
}
function process_length($length) {
global $enum_length;
return (preg_match("~^\\s*(?:$enum_length)(?:\\s*,\\s*(?:$enum_length))*\\s*\$~", $length) && preg_match_all("~$enum_length~", $length, $matches) ? implode(",", $matches[0]) : preg_replace('~[^0-9,+-]~', '', $length));
}
function redirect($location, $message = null) {
if (isset($message)) {
$_SESSION["messages"][] = $message;
}
if (strlen(SID)) {
$location .= (strpos($location, "?") === false ? "?" : "&") . SID;
}
header("Location: " . (strlen($location) ? $location : "."));
exit;
}
function query_redirect($query, $location, $message, $redirect = true, $execute = true, $failed = false) {
global $dbh, $error, $SELF;
$id = "sql-" . count($_SESSION["messages"]);
$sql = "";
if ($query) {
$sql = " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><span id='$id' class='hidden'><br /><code class='jush-sql'>" . htmlspecialchars($query) . '</code><br /><a href="' . htmlspecialchars($SELF) . 'sql=&amp;history=' . count($_SESSION["history"][$_GET["server"]][$_GET["db"]]) . '">' . lang('Edit') . '</a></span>';
$_SESSION["history"][$_GET["server"]][$_GET["db"]][] = $query;
}
if ($execute) {
$failed = !$dbh->query($query);
}
if ($failed) {
$error = htmlspecialchars($dbh->error) . $sql;
return false;
}
if ($redirect) {
redirect($location, $message . $sql);
}
return true;
}
function queries($query = null) {
global $dbh;
static $queries = array();
if (!isset($query)) {
return implode(";\n", $queries);
}
$queries[] = $query;
return $dbh->query($query);
}
function remove_from_uri($param = "") {
$param = "($param|" . session_name() . ")";
return preg_replace("~\\?$param=[^&]*&~", '?', preg_replace("~\\?$param=[^&]*\$|&$param=[^&]*~", '', $_SERVER["REQUEST_URI"]));
}
function print_page($page) {
echo " " . ($page == $_GET["page"] ? $page + 1 : '<a href="' . htmlspecialchars(remove_from_uri("page") . ($page ? "&page=$page" : "")) . '">' . ($page + 1) . "</a>");
}
function get_file($key) {
if (isset($_POST["files"][$key])) {
$length = strlen($_POST["files"][$key]);
return ($length && $length < 4 ? intval($_POST["files"][$key]) : base64_decode($_POST["files"][$key]));
}
return (!$_FILES[$key] || $_FILES[$key]["error"] ? $_FILES[$key]["error"] : file_get_contents($_FILES[$key]["tmp_name"]));
}
function odd($s = ' class="odd"') {
static $i = 0;
if (!$s) { // reset counter
$i = -1;
}
return ($i++ % 2 ? $s : '');
}
function select($result, $dbh2 = null) {
global $SELF;
if (!$result->num_rows) {
echo "<p class='message'>" . lang('No rows.') . "</p>\n";
} else {
echo "<table cellspacing='0' class='nowrap'>\n";
$links = array();
$indexes = array();
$columns = array();
$blobs = array();
$types = array();
odd('');
for ($i=0; $row = $result->fetch_row(); $i++) {
if (!$i) {
echo "<thead><tr>";
for ($j=0; $j < count($row); $j++) {
$field = $result->fetch_field();
if (strlen($field->orgtable)) {
if (!isset($indexes[$field->orgtable])) {
$indexes[$field->orgtable] = array();
foreach (indexes($field->orgtable, $dbh2) as $index) {
if ($index["type"] == "PRIMARY") {
$indexes[$field->orgtable] = array_flip($index["columns"]);
break;
}
}
$columns[$field->orgtable] = $indexes[$field->orgtable];
}
if (isset($columns[$field->orgtable][$field->orgname])) {
unset($columns[$field->orgtable][$field->orgname]);
$indexes[$field->orgtable][$field->orgname] = $j;
$links[$j] = $field->orgtable;
}
}
if ($field->charsetnr == 63) {
$blobs[$j] = true;
}
$types[$j] = $field->type;
echo "<th>" . htmlspecialchars($field->name) . "</th>";
}
echo "</tr></thead>\n";
}
echo "<tr" . odd() . ">";
foreach ($row as $key => $val) {
if (!isset($val)) {
$val = "<i>NULL</i>";
} else {
if ($blobs[$key] && !is_utf8($val)) {
$val = "<i>" . lang('%d byte(s)', strlen($val)) . "</i>"; //! link to download
} elseif (!strlen(trim($val))) {
$val = "&nbsp;";
} else {
$val = nl2br(htmlspecialchars($val));
if ($types[$key] == 254) {
$val = "<code>$val</code>";
}
}
if (isset($links[$key]) && !$columns[$links[$key]]) {
$link = "edit=" . urlencode($links[$key]);
foreach ($indexes[$links[$key]] as $col => $j) {
$link .= "&amp;where" . urlencode("[" . bracket_escape($col) . "]") . "=" . urlencode($row[$j]);
}
$val = '<a href="' . htmlspecialchars($SELF) . $link . '">' . $val . '</a>';
}
}
echo "<td>$val</td>";
}
echo "</tr>\n";
}
echo "</table>\n";
}
$result->free();
}
function is_utf8($val) {
return (preg_match('~~u', $val) && !preg_match('~[\\0-\\x8\\xB\\xC\\xE-\\x1F]~', $val));
}
function shorten_utf8($string, $length) {
preg_match("~^(.{0,$length})(.?)~su", $string, $match);
return nl2br(htmlspecialchars($match[1])) . ($match[2] ? "<em>...</em>" : "");
}
function friendly_url($val) {
return preg_replace('~[^a-z0-9_]~i', '-', $val);
}
function hidden_fields($process, $ignore = array()) {
while (list($key, $val) = each($process)) {
if (is_array($val)) {
foreach ($val as $k => $v) {
$process[$key . "[$k]"] = $v;
}
} elseif (!in_array($key, $ignore)) {
echo '<input type="hidden" name="' . htmlspecialchars($key) . '" value="' . htmlspecialchars($val) . '" />';
}
}
}

View File

@@ -0,0 +1,68 @@
<?php
$langs = array(
'en' => 'English', // Jakub Vrána - http://php.vrana.cz
'cs' => 'Čeština', // Jakub Vrána - http://php.vrana.cz
'sk' => 'Slovenčina', // Ivan Suchy - http://www.ivansuchy.com
'nl' => 'Nederlands', // Maarten Balliauw - http://blog.maartenballiauw.be
'es' => 'Español', // Klemens Häckel - http://clickdimension.wordpress.com
'de' => 'Deutsch', // Klemens Häckel - http://clickdimension.wordpress.com
'zh' => '简体中文', // Mr. Lodar
'fr' => 'Français', // Francis Gagné
'it' => 'Italiano', // Alessandro Fiorotto, Paolo Asperti
'et' => 'Eesti', // Priit Kallas
'ru' => 'Русский язык', // Juraj Hajdúch
);
function lang($idf, $number = null) {
global $LANG, $translations;
$translation = $translations[$idf];
if (is_array($translation) && $translation) {
$pos = ($number == 1 ? 0 : ((!$number || $number >= 5) && ereg('cs|sk|ru', $LANG) ? 2 : 1));
$translation = $translation[$pos];
}
$args = func_get_args();
array_shift($args);
return vsprintf((isset($translation) ? $translation : $idf), $args);
}
function switch_lang() {
global $LANG, $langs;
echo "<form action=''>\n<div id='lang'>";
hidden_fields($_GET, array('lang'));
echo lang('Language') . ": <select name='lang' onchange='this.form.submit();'>";
foreach ($langs as $lang => $val) {
echo "<option value='$lang'" . ($LANG == $lang ? " selected='selected'" : "") . ">$val</option>";
}
echo "</select>\n<noscript><div style='display: inline;'><input type='submit' value='" . lang('Use') . "' /></div></noscript>\n</div>\n</form>\n";
}
if (isset($_GET["lang"])) {
$_COOKIE["lang"] = $_GET["lang"];
$_SESSION["lang"] = $_GET["lang"];
}
$LANG = "en";
if (isset($langs[$_COOKIE["lang"]])) {
setcookie("lang", $_GET["lang"], strtotime("+1 month"), preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]));
$LANG = $_COOKIE["lang"];
} elseif (isset($langs[$_SESSION["lang"]])) {
$LANG = $_SESSION["lang"];
} else {
$accept_language = array();
preg_match_all('~([-a-z_]+)(;q=([0-9.]+))?~', strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"]), $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$accept_language[str_replace("_", "-", $match[1])] = (isset($match[3]) ? $match[3] : 1);
}
arsort($accept_language);
foreach ($accept_language as $key => $q) {
if (isset($langs[$key])) {
$LANG = $key;
break;
}
$key = preg_replace('~-.*~', '', $key);
if (!isset($accept_language[$key]) && isset($langs[$key])) {
$LANG = $key;
break;
}
}
}

View File

@@ -0,0 +1,317 @@
<?php
if (extension_loaded("mysqli")) {
class Min_DB extends MySQLi {
var $extension = "MySQLi";
function Min_DB() {
parent::init();
}
function connect($server, $username, $password) {
list($host, $port) = explode(":", $server, 2);
return @$this->real_connect(
(strlen($server) ? $host : ini_get("mysqli.default_host")),
(strlen("$server$username") ? $username : ini_get("mysqli.default_user")),
(strlen("$server$username$password") ? $password : ini_get("mysqli.default_pw")),
null,
(is_numeric($port) ? $port : ini_get("mysqli.default_port")),
(!is_numeric($port) ? $port : null)
);
}
function result($result, $field = 0) {
if (!$result) {
return false;
}
$row = $result->_result->fetch_array();
return $row[$field];
}
// minification compatibility start
function select_db($database) {
return parent::select_db($database);
}
function query($query) {
$result = parent::query($query);
return (is_object($result) ? new Min_Result($result) : $result);
}
function multi_query($query) {
return parent::multi_query($query);
}
function store_result() {
$result = parent::store_result();
return (is_object($result) ? new Min_Result($result) : $result);
}
function next_result() {
return parent::next_result();
}
function escape_string($string) {
return parent::escape_string($string);
}
}
class Min_Result {
var $_result, $num_rows;
function __construct($result) {
$this->_result = $result;
$this->num_rows = $result->num_rows;
}
function fetch_assoc() {
return $this->_result->fetch_assoc();
}
function fetch_row() {
return $this->_result->fetch_row();
}
function fetch_field() {
return $this->_result->fetch_field();
}
function free() {
return $this->_result->free();
}
// minification compatibility end
}
} elseif (extension_loaded("mysql")) {
class Min_DB {
var $extension = "MySQL", $_link, $_result, $server_info, $affected_rows, $error;
function connect($server, $username, $password) {
$this->_link = @mysql_connect(
(strlen($server) ? $server : ini_get("mysql.default_host")),
(strlen("$server$username") ? $username : ini_get("mysql.default_user")),
(strlen("$server$username$password") ? $password : ini_get("mysql.default_password")),
true,
131072 // CLIENT_MULTI_RESULTS for CALL
);
if ($this->_link) {
$this->server_info = mysql_get_server_info($this->_link);
} else {
$this->error = mysql_error();
}
return (bool) $this->_link;
}
function select_db($database) {
return mysql_select_db($database, $this->_link);
}
function query($query) {
$result = @mysql_query($query, $this->_link); // mute mysql.trace_mode
if (!$result) {
$this->error = mysql_error($this->_link);
return false;
} elseif ($result === true) {
$this->affected_rows = mysql_affected_rows($this->_link);
return true;
}
return new Min_Result($result);
}
function multi_query($query) {
return $this->_result = $this->query($query);
}
function store_result() {
return $this->_result;
}
function next_result() {
return false;
}
function result($result, $field = 0) {
if (!$result) {
return false;
}
return mysql_result($result->_result, 0, $field);
}
function escape_string($string) {
return mysql_real_escape_string($string, $this->_link);
}
}
class Min_Result {
var $_result, $_offset = 0, $num_rows;
function Min_Result($result) {
$this->_result = $result;
$this->num_rows = mysql_num_rows($result);
}
function fetch_assoc() {
return mysql_fetch_assoc($this->_result);
}
function fetch_row() {
return mysql_fetch_row($this->_result);
}
function fetch_field() {
$row = mysql_fetch_field($this->_result, $this->_offset++);
$row->orgtable = $row->table;
$row->orgname = $row->name;
$row->charsetnr = ($row->blob ? 63 : 0);
return $row;
}
function free() {
return mysql_free_result($this->_result);
}
}
} elseif (extension_loaded("pdo_mysql")) {
class Min_DB extends Min_PDO {
var $extension = "PDO_MySQL";
function connect($server, $username, $password) {
$this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:([0-9])~', ';port=\\1', $server)), $username, $password);
$this->server_info = $this->result($this->query("SELECT VERSION()"));
return true;
}
}
} else {
page_header(lang('No MySQL extension'), lang('None of supported PHP extensions (%s) are available.', 'MySQLi, MySQL, PDO_MySQL'), null);
page_footer("auth");
exit;
}
$types = array(
"tinyint" => 3, "smallint" => 5, "mediumint" => 8, "int" => 10, "bigint" => 20,
"float" => 12, "double" => 21, "decimal" => 66,
"date" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4,
"char" => 255, "varchar" => 65535,
"binary" => 255, "varbinary" => 65535,
"tinytext" => 255, "text" => 65535, "mediumtext" => 16777215, "longtext" => 4294967295,
"tinyblob" => 255, "blob" => 65535, "mediumblob" => 16777215, "longblob" => 4294967295,
"enum" => 65535, "set" => 64,
);
$unsigned = array("", "unsigned", "zerofill", "unsigned zerofill");
function connect() {
$dbh = new Min_DB;
return ($dbh->connect($_GET["server"], $_SESSION["usernames"][$_GET["server"]], $_SESSION["passwords"][$_GET["server"]]) ? $dbh : $dbh->error);
}
function get_databases() {
$return = &$_SESSION["databases"][$_GET["server"]];
if (!isset($return)) {
flush();
$return = get_vals("SHOW DATABASES");
}
return $return;
}
function table_status($table) {
global $dbh;
$result = $dbh->query("SHOW TABLE STATUS LIKE '" . $dbh->escape_string(addcslashes($table, "%_")) . "'");
$return = $result->fetch_assoc();
$result->free();
return $return;
}
function fields($table) {
global $dbh;
$return = array();
$result = $dbh->query("SHOW FULL COLUMNS FROM " . idf_escape($table));
if ($result) {
while ($row = $result->fetch_assoc()) {
preg_match('~^([^( ]+)(?:\\((.+)\\))?( unsigned)?( zerofill)?$~', $row["Type"], $match);
$return[$row["Field"]] = array(
"field" => $row["Field"],
"type" => $match[1],
"length" => $match[2],
"unsigned" => ltrim($match[3] . $match[4]),
"default" => (strlen($row["Default"]) || ereg("char", $match[1]) ? $row["Default"] : null),
"null" => ($row["Null"] == "YES"),
"auto_increment" => ($row["Extra"] == "auto_increment"),
"collation" => $row["Collation"],
"privileges" => array_flip(explode(",", $row["Privileges"])),
"comment" => $row["Comment"],
"primary" => ($row["Key"] == "PRI"),
);
}
$result->free();
}
return $return;
}
function indexes($table, $dbh2 = null) {
global $dbh;
if (!is_object($dbh2)) {
$dbh2 = $dbh;
}
$return = array();
$result = $dbh2->query("SHOW INDEX FROM " . idf_escape($table));
if ($result) {
while ($row = $result->fetch_assoc()) {
$return[$row["Key_name"]]["type"] = ($row["Key_name"] == "PRIMARY" ? "PRIMARY" : ($row["Index_type"] == "FULLTEXT" ? "FULLTEXT" : ($row["Non_unique"] ? "INDEX" : "UNIQUE")));
$return[$row["Key_name"]]["columns"][$row["Seq_in_index"]] = $row["Column_name"];
$return[$row["Key_name"]]["lengths"][$row["Seq_in_index"]] = $row["Sub_part"];
}
$result->free();
}
return $return;
}
function foreign_keys($table) {
global $dbh, $on_actions;
static $pattern = '(?:[^`]+|``)+';
$return = array();
$result = $dbh->query("SHOW CREATE TABLE " . idf_escape($table));
if ($result) {
$create_table = $dbh->result($result, 1);
$result->free();
preg_match_all("~CONSTRAINT `($pattern)` FOREIGN KEY \\(((?:`$pattern`,? ?)+)\\) REFERENCES `($pattern)`(?:\\.`($pattern)`)? \\(((?:`$pattern`,? ?)+)\\)(?: ON DELETE (" . implode("|", $on_actions) . "))?(?: ON UPDATE (" . implode("|", $on_actions) . "))?~", $create_table, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
preg_match_all("~`($pattern)`~", $match[2], $source);
preg_match_all("~`($pattern)`~", $match[5], $target);
$return[$match[1]] = array(
"db" => idf_unescape(strlen($match[4]) ? $match[3] : $match[4]),
"table" => idf_unescape(strlen($match[4]) ? $match[4] : $match[3]),
"source" => array_map('idf_unescape', $source[1]),
"target" => array_map('idf_unescape', $target[1]),
"on_delete" => $match[6],
"on_update" => $match[7],
);
}
}
return $return;
}
function view($name) {
global $dbh;
return array("select" => preg_replace('~^(?:[^`]+|`[^`]*`)* AS ~U', '', $dbh->result($dbh->query("SHOW CREATE VIEW " . idf_escape($name)), 1)));
}
function collations() {
global $dbh;
$return = array();
$result = $dbh->query("SHOW COLLATION");
while ($row = $result->fetch_assoc()) {
if ($row["Default"] && $return[$row["Charset"]]) {
array_unshift($return[$row["Charset"]], $row["Collation"]);
} else {
$return[$row["Charset"]][] = $row["Collation"];
}
}
$result->free();
return $return;
}
function table_comment(&$row) {
if ($row["Engine"] == "InnoDB") {
$row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]);
}
}

View File

@@ -0,0 +1,84 @@
<?php
if (extension_loaded('pdo')) {
class Min_PDO extends PDO {
var $_result, $server_info, $affected_rows, $error;
function __construct() {
}
function dsn($dsn, $username, $password) {
set_exception_handler('auth_error'); // try/catch is not compatible with PHP 4
parent::__construct($dsn, $username, $password);
restore_exception_handler();
$this->setAttribute(13, array('Min_PDOStatement')); // PDO::ATTR_STATEMENT_CLASS
}
function select_db($database) {
return $this->query("USE " . idf_escape($database));
}
function query($query) {
$result = parent::query($query);
if (!$result) {
$errorInfo = $this->errorInfo();
$this->error = $errorInfo[2];
return false;
}
$this->_result = $result;
if (!$result->columnCount()) {
$this->affected_rows = $result->rowCount();
return true;
}
$result->num_rows = $result->rowCount();
return $result;
}
function multi_query($query) {
return $this->query($query);
}
function store_result() {
return ($this->_result->columnCount() ? $this->_result : true);
}
function next_result() {
return $this->_result->nextRowset();
}
function result($result, $field = 0) {
if (!$result) {
return false;
}
$row = $result->fetch();
return $row[$field];
}
function escape_string($string) {
return substr($this->quote($string), 1, -1);
}
}
class Min_PDOStatement extends PDOStatement {
var $_offset = 0, $num_rows;
function fetch_assoc() {
return $this->fetch(2); // PDO::FETCH_ASSOC
}
function fetch_row() {
return $this->fetch(3); // PDO::FETCH_NUM
}
function fetch_field() {
$row = (object) $this->getColumnMeta($this->_offset++);
$row->orgtable = $row->table;
$row->orgname = $row->name;
$row->charsetnr = (in_array("blob", $row->flags) ? 63 : 0);
return $row;
}
function free() {
// $this->__destruct() is not callable
}
}
}

View File

@@ -0,0 +1,264 @@
<?php
if (extension_loaded($_GET["sqlite_version"] == 2 ? "sqlite" : "sqlite3")) {
if ($_GET["sqlite_version"] == 2) {
class Min_SQLite extends SQLiteDatabase {
var $extension = "SQLite";
function open($filename) {
parent::__construct($filename);
}
function query($query) {
$result = @parent::query($query, SQLITE_BOTH, $error);
if (!$result) {
$this->error = $error;
return false;
} elseif ($result === true) {
$this->affected_rows = parent::changes();
return true;
}
return new Min_Result($result);
}
function escape_string($string) {
return sqlite_escape_string($string);
}
function result($result, $field = 0) {
if (!$result) {
return false;
}
$row = $result->_result->fetch();
return $row[$field];
}
}
class Min_Result {
var $_result, $num_rows;
function __construct($result) {
$this->_result = $result;
$this->num_rows = $result->numRows();
}
function fetch_assoc() {
return $this->_result->fetch(SQLITE_ASSOC);
}
function fetch_row() {
return $this->_result->fetch(SQLITE_NUM);
}
function fetch_field() {
static $column = -1;
$column++;
return (object) array(
"name" => parent::fieldName($column),
//! type, orgtable, charsetnr
);
}
function free() {
}
}
} else {
class Min_SQLite extends SQLite3 {
var $extension = "SQLite3";
function open($filename) {
parent::__construct($filename);
}
function query($query) {
$result = @parent::query($query);
if (!$result) {
$this->error = parent::lastErrorMsg();
return false;
} elseif ($result === true) {
$this->affected_rows = parent::changes();
return true;
}
return new Min_Result($result);
}
function escape_string($string) {
return parent::escapeString($string);
}
function result($result, $field = 0) {
if (!$result) {
return false;
}
$row = $result->_result->fetchArray();
return $row[$field];
}
}
class Min_Result {
var $_result, $num_rows;
function __construct($result) {
$this->_result = $result;
//! $this->num_rows = ;
}
function fetch_assoc() {
return $this->_result->fetchArray(SQLITE3_ASSOC);
}
function fetch_row() {
return $this->_result->fetchArray(SQLITE3_NUM);
}
function fetch_field() {
static $column = -1;
$column++;
return (object) array(
"name" => parent::columnName($column),
"type" => parent::columnType($column),
//! orgtable, charsetnr
);
}
function free() {
return $this->_result->finalize();
}
}
}
class Min_DB extends Min_SQLite {
function __construct() {
}
function select_db($filename) {
set_exception_handler('connect_error'); // try/catch is not compatible with PHP 4
$this->open($filename);
restore_exception_handler();
$this->server_info = $this->result($this->query("SELECT sqlite_version()"));
return true;
}
function multi_query($query) {
return $this->_result = $this->query($query);
}
function store_result() {
return $this->_result;
}
function next_result() {
return false;
}
}
} elseif (extension_loaded("pdo_sqlite")) {
class Min_DB extends Min_PDO {
var $extension = "PDO_SQLite";
function select_db($filename) {
set_exception_handler('connect_error'); // try/catch is not compatible with PHP 4
parent::__construct(($_GET["sqlite_version"] == 2 ? "sqlite2" : "sqlite") . ":$filename");
restore_exception_handler();
$this->setAttribute(13, array('Min_PDOStatement')); // PDO::ATTR_STATEMENT_CLASS
$this->server_info = $this->result($this->query("SELECT sqlite_version()"));
return true;
}
}
}
$types = array("text" => 0, "numeric" => 0, "integer" => 0, "real" => 0, "blob" => 0);
$unsigned = array();
function connect() {
return new Min_DB;
}
function get_databases() {
return array();
}
function table_status($table) {
return array();
}
function fields($table) {
global $dbh;
$return = array();
$result = $dbh->query("PRAGMA table_info(" . idf_escape($table) . ")");
while ($row = $result->fetch_assoc()) {
preg_match('~^([^( ]+)(?:\\((.+)\\))?$~', $row["Type"], $match);
$return[$row["Field"]] = array(
"field" => $row["name"],
"type" => $match[1],
"length" => $match[2],
"default" => $row["dflt_value"],
"null" => !$row["notnull"],
"auto_increment" => false, //!
"collation" => $row["Collation"], //!
"comment" => "", //!
"primary" => $row["pk"],
);
}
$result->free();
return $return;
}
function indexes($table, $dbh2 = null) {
global $dbh;
$return = array();
$result = $dbh->query("PRAGMA index_list(" . idf_escape($table) . ")");
while ($row = $result->fetch_assoc()) {
$return[$row["name"]]["type"] = ($row["unique"] ? "UNIQUE" : "INDEX");
$result1 = $dbh->query("PRAGMA index_info(" . idf_escape($row["name"]) . ")");
while ($row1 = $result1->fetch_assoc()) {
$return[$row["name"]]["columns"][$row1["seqno"]] = $row1["name"];
}
$result1->free();
}
$result->free();
//! detect primary key from table definition
return $return;
}
function foreign_keys($table) {
global $dbh, $on_actions;
static $pattern = '(?:[^`]+|``)+';
$return = array();
$result = $dbh->query("SHOW CREATE TABLE " . idf_escape($table));
if ($result) {
$create_table = $dbh->result($result, 1);
$result->free();
preg_match_all("~CONSTRAINT `($pattern)` FOREIGN KEY \\(((?:`$pattern`,? ?)+)\\) REFERENCES `($pattern)`(?:\\.`($pattern)`)? \\(((?:`$pattern`,? ?)+)\\)(?: ON DELETE (" . implode("|", $on_actions) . "))?(?: ON UPDATE (" . implode("|", $on_actions) . "))?~", $create_table, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
preg_match_all("~`($pattern)`~", $match[2], $source);
preg_match_all("~`($pattern)`~", $match[5], $target);
$return[$match[1]] = array(
"db" => idf_unescape(strlen($match[4]) ? $match[3] : $match[4]),
"table" => idf_unescape(strlen($match[4]) ? $match[4] : $match[3]),
"source" => array_map('idf_unescape', $source[1]),
"target" => array_map('idf_unescape', $target[1]),
"on_delete" => $match[6],
"on_update" => $match[7],
);
}
}
return $return;
}
function view($name) {
global $dbh;
return array("select" => preg_replace('~^(?:[^`]+|`[^`]*`)* AS ~iU', '', $dbh->result($dbh->query("SELECT sql FROM sqlite_master WHERE name = '" . $dbh->escape_string($name) . "'"), 0)));
}
function collations() {
return get_vals("PRAGMA collation_list", 1);
}
function table_comment(&$row) {
}

View File

@@ -0,0 +1,2 @@
<?php
$VERSION = "1.11.0-dev";

134
adminer/index.php Normal file
View File

@@ -0,0 +1,134 @@
<?php
/** Adminer - Compact MySQL management
* @link http://www.adminer.org/
* @author Jakub Vrana, http://php.vrana.cz/
* @copyright 2007 Jakub Vrana
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/
error_reporting(E_ALL & ~E_NOTICE);
if (!ini_get("session.auto_start")) {
session_name("adminer_sid");
session_set_cookie_params(0, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]));
session_start();
}
if (isset($_SESSION["coverage"])) {
function save_coverage() {
foreach (xdebug_get_code_coverage() as $filename => $lines) {
foreach ($lines as $l => $val) {
if (!$_SESSION["coverage"][$filename][$l] || $val > 0) {
$_SESSION["coverage"][$filename][$l] = $val;
}
}
}
}
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
register_shutdown_function('save_coverage');
if ($_GET["start"]) {
return;
}
}
if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST);
while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
if (is_array($v)) {
$process[$key][stripslashes($k)] = $v;
$process[] = &$process[$key][stripslashes($k)];
} else {
$process[$key][stripslashes($k)] = stripslashes($v);
}
}
}
unset($process);
}
set_magic_quotes_runtime(false);
$SELF = preg_replace('~^[^?]*/([^?]*).*~', '\\1?', $_SERVER["REQUEST_URI"]) . (strlen($_GET["server"]) ? 'server=' . urlencode($_GET["server"]) . '&' : '') . (strlen($_GET["db"]) ? 'db=' . urlencode($_GET["db"]) . '&' : '');
include "./include/version.inc.php";
include "./include/functions.inc.php";
include "./include/lang.inc.php";
include "./lang/$LANG.inc.php";
include "./include/design.inc.php";
include "./include/pdo.inc.php";
include "./include/mysql.inc.php";
include "./include/auth.inc.php";
include "./include/connect.inc.php";
include "./include/editing.inc.php";
include "./include/export.inc.php";
if (isset($_GET["download"])) {
include "./download.inc.php";
} else { // outputs footer
$on_actions = array("RESTRICT", "CASCADE", "SET NULL", "NO ACTION");
$enum_length = '\'(?:\'\'|[^\'\\\\]+|\\\\.)*\'|"(?:""|[^"\\\\]+|\\\\.)*"';
$inout = array("IN", "OUT", "INOUT");
$confirm = " onclick=\"return confirm('" . lang('Are you sure?') . "');\"";
$error = "";
if (isset($_GET["table"])) {
include "./table.inc.php";
} elseif (isset($_GET["view"])) {
include "./view.inc.php";
} elseif (isset($_GET["schema"])) {
include "./schema.inc.php";
} elseif (isset($_GET["dump"])) {
include "./dump.inc.php";
} elseif (isset($_GET["privileges"])) {
include "./privileges.inc.php";
} else { // uses CSRF token
$token = $_SESSION["tokens"][$_GET["server"]];
if ($_POST) {
if ($_POST["token"] != $token) {
$error = lang('Invalid CSRF token. Send the form again.');
}
} elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
$error = lang('Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.');
}
if (isset($_GET["default"])) {
$_GET["edit"] = $_GET["default"];
}
if (isset($_GET["select"]) && $_POST && (!$_POST["delete"] && !$_POST["export"] && !$_POST["import"] && !$_POST["save"])) {
$_GET["edit"] = $_GET["select"];
}
if (isset($_GET["callf"])) {
$_GET["call"] = $_GET["callf"];
}
if (isset($_GET["function"])) {
$_GET["procedure"] = $_GET["function"];
}
if (isset($_GET["sql"])) {
include "./sql.inc.php";
} elseif (isset($_GET["edit"])) {
include "./edit.inc.php";
} elseif (isset($_GET["create"])) {
include "./create.inc.php";
} elseif (isset($_GET["indexes"])) {
include "./indexes.inc.php";
} elseif (isset($_GET["database"])) {
include "./database.inc.php";
} elseif (isset($_GET["call"])) {
include "./call.inc.php";
} elseif (isset($_GET["foreign"])) {
include "./foreign.inc.php";
} elseif (isset($_GET["createv"])) {
include "./createv.inc.php";
} elseif (isset($_GET["event"])) {
include "./event.inc.php";
} elseif (isset($_GET["procedure"])) {
include "./procedure.inc.php";
} elseif (isset($_GET["trigger"])) {
include "./trigger.inc.php";
} elseif (isset($_GET["user"])) {
include "./user.inc.php";
} elseif (isset($_GET["processlist"])) {
include "./processlist.inc.php";
} elseif (isset($_GET["select"])) {
include "./select.inc.php";
} else {
include "./db.inc.php";
}
}
page_footer();
}

88
adminer/indexes.inc.php Normal file
View File

@@ -0,0 +1,88 @@
<?php
$index_types = array("PRIMARY", "UNIQUE", "INDEX", "FULLTEXT");
$indexes = indexes($_GET["indexes"]);
if ($_POST && !$error && !$_POST["add"]) {
$alter = array();
foreach ($_POST["indexes"] as $index) {
if (in_array($index["type"], $index_types)) {
$columns = array();
$lengths = array();
$set = array();
ksort($index["columns"]);
foreach ($index["columns"] as $key => $column) {
if (strlen($column)) {
$length = $index["lengths"][$key];
$set[] = idf_escape($column) . ($length ? "(" . intval($length) . ")" : "");
$columns[count($columns) + 1] = $column;
$lengths[count($lengths) + 1] = ($length ? $length : null);
}
}
if ($columns) {
foreach ($indexes as $name => $existing) {
ksort($existing["columns"]);
ksort($existing["lengths"]);
if ($index["type"] == $existing["type"] && $existing["columns"] === $columns && $existing["lengths"] === $lengths) {
unset($indexes[$name]);
continue 2;
}
}
$alter[] = "\nADD $index[type]" . ($index["type"] == "PRIMARY" ? " KEY" : "") . " (" . implode(", ", $set) . ")";
}
}
}
foreach ($indexes as $name => $existing) {
$alter[] = "\nDROP INDEX " . idf_escape($name);
}
if (!$alter) {
redirect($SELF . "table=" . urlencode($_GET["indexes"]));
}
query_redirect("ALTER TABLE " . idf_escape($_GET["indexes"]) . implode(",", $alter), $SELF . "table=" . urlencode($_GET["indexes"]), lang('Indexes has been altered.'));
}
page_header(lang('Indexes'), $error, array("table" => $_GET["indexes"]), $_GET["indexes"]);
$fields = array_keys(fields($_GET["indexes"]));
$row = array("indexes" => $indexes);
if ($_POST) {
$row = $_POST;
if ($_POST["add"]) {
foreach ($row["indexes"] as $key => $index) {
if (strlen($index["columns"][count($index["columns"])])) {
$row["indexes"][$key]["columns"][] = "";
}
}
$index = end($row["indexes"]);
if ($index["type"] || array_filter($index["columns"], 'strlen') || array_filter($index["lengths"], 'strlen')) {
$row["indexes"][] = array("columns" => array(1 => ""));
}
}
} else {
foreach ($row["indexes"] as $key => $index) {
$row["indexes"][$key]["columns"][] = "";
}
$row["indexes"][] = array("columns" => array(1 => ""));
}
?>
<form action="" method="post">
<table cellspacing="0">
<thead><tr><th><?php echo lang('Index Type'); ?></th><th><?php echo lang('Column (length)'); ?></th></tr></thead>
<?php
$j = 0;
foreach ($row["indexes"] as $index) {
echo "<tr><td><select name='indexes[$j][type]'" . ($j == count($row["indexes"]) - 1 ? " onchange='indexes_add_row(this);'" : "") . "><option></option>" . optionlist($index_types, $index["type"]) . "</select></td><td>\n";
ksort($index["columns"]);
foreach ($index["columns"] as $i => $column) {
echo "<span><select name='indexes[$j][columns][$i]'" . ($i == count($index["columns"]) ? " onchange='indexes_add_column(this);'" : "") . "><option></option>" . optionlist($fields, $column) . "</select>";
echo "<input name='indexes[$j][lengths][$i]' size='2' value=\"" . htmlspecialchars($index["lengths"][$i]) . "\" /> </span>\n";
}
echo "</td></tr>\n";
$j++;
}
?>
</table>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Alter indexes'); ?>" />
</p>
<noscript><p><input type="submit" name="add" value="<?php echo lang('Add next'); ?>" /></p></noscript>
</form>

218
adminer/lang/cs.inc.php Normal file
View File

@@ -0,0 +1,218 @@
<?php
$translations = array(
'Login' => 'Přihlásit se',
'Adminer' => 'Adminer',
'Logout successful.' => 'Odhlášení proběhlo v pořádku.',
'Invalid credentials.' => 'Neplatné přihlašovací údaje.',
'Server' => 'Server',
'Username' => 'Uživatel',
'Password' => 'Heslo',
'Select database' => 'Vybrat databázi',
'Invalid database.' => 'Nesprávná databáze.',
'Create new database' => 'Vytvořit novou databázi',
'Table has been dropped.' => 'Tabulka byla odstraněna.',
'Table has been altered.' => 'Tabulka byla změněna.',
'Table has been created.' => 'Tabulka byla vytvořena.',
'Alter table' => 'Pozměnit tabulku',
'Create table' => 'Vytvořit tabulku',
'Table name' => 'Název tabulky',
'engine' => 'úložiště',
'collation' => 'porovnávání',
'Column name' => 'Název sloupce',
'Type' => 'Typ',
'Length' => 'Délka',
'NULL' => 'NULL',
'Auto Increment' => 'Auto Increment',
'Options' => 'Volby',
'Save' => 'Uložit',
'Drop' => 'Odstranit',
'Database has been dropped.' => 'Databáze byla odstraněna.',
'Database has been created.' => 'Databáze byla vytvořena.',
'Database has been renamed.' => 'Databáze byla přejmenována.',
'Database has been altered.' => 'Databáze byla změněna.',
'Alter database' => 'Pozměnit databázi',
'Create database' => 'Vytvořit databázi',
'SQL command' => 'SQL příkaz',
'Dump' => 'Export',
'Logout' => 'Odhlásit',
'database' => 'databáze',
'Use' => 'Vybrat',
'No tables.' => 'Žádné tabulky.',
'select' => 'vypsat',
'Create new table' => 'Vytvořit novou tabulku',
'Item has been deleted.' => 'Položka byla smazána.',
'Item has been updated.' => 'Položka byla aktualizována.',
'Item has been inserted.' => 'Položka byla vložena.',
'Edit' => 'Upravit',
'Insert' => 'Vložit',
'Save and insert next' => 'Uložit a vložit další',
'Delete' => 'Smazat',
'Database' => 'Databáze',
'Routines' => 'Procedury a funkce',
'Indexes has been altered.' => 'Indexy byly změněny.',
'Indexes' => 'Indexy',
'Alter indexes' => 'Pozměnit indexy',
'Add next' => 'Přidat další',
'Language' => 'Jazyk',
'Select' => 'Vypsat',
'New item' => 'Nová položka',
'Search' => 'Vyhledat',
'Sort' => 'Setřídit',
'ASC' => 'vzestupně',
'DESC' => 'sestupně',
'Limit' => 'Limit',
'No rows.' => 'Žádné řádky.',
'Action' => 'Akce',
'edit' => 'upravit',
'Page' => 'Stránka',
'Query executed OK, %d row(s) affected.' => array('Příkaz proběhl v pořádku, byl změněn %d záznam.', 'Příkaz proběhl v pořádku, byly změněny %d záznamy.', 'Příkaz proběhl v pořádku, bylo změněno %d záznamů.'),
'Error in query' => 'Chyba v dotazu',
'Execute' => 'Provést',
'Table' => 'Tabulka',
'Foreign keys' => 'Cizí klíče',
'Triggers' => 'Triggery',
'View' => 'Pohled',
'Unable to select the table' => 'Nepodařilo se vypsat tabulku',
'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odešlete formulář znovu.',
'Comment' => 'Komentář',
'Default values has been set.' => 'Výchozí hodnoty byly nastaveny.',
'Default values' => 'Výchozí hodnoty',
'BOOL' => 'BOOL',
'Show column comments' => 'Zobrazit komentáře sloupců',
'%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtů'),
'No commands to execute.' => 'Žádné příkazy k vykonání.',
'Unable to upload a file.' => 'Nepodařilo se nahrát soubor.',
'File upload' => 'Nahrání souboru',
'File uploads are disabled.' => 'Nahrávání souborů není povoleno.',
'Routine has been called, %d row(s) affected.' => array('Procedura byla zavolána, byl změněn %d záznam.', 'Procedura byla zavolána, byly změněny %d záznamy.', 'Procedura byla zavolána, bylo změněno %d záznamů.'),
'Call' => 'Zavolat',
'No MySQL extension' => 'Žádná MySQL extenze',
'None of supported PHP extensions (%s) are available.' => 'Není dostupná žádná z podporovaných PHP extenzí (%s).',
'Sessions must be enabled.' => 'Session proměnné musí být povolené.',
'Session expired, please login again.' => 'Session vypršela, přihlašte se prosím znovu.',
'Text length' => 'Délka textů',
'Foreign key has been dropped.' => 'Cizí klíč byl odstraněn.',
'Foreign key has been altered.' => 'Cizí klíč byl změněn.',
'Foreign key has been created.' => 'Cizí klíč byl vytvořen.',
'Foreign key' => 'Cizí klíč',
'Target table' => 'Cílová tabulka',
'Change' => 'Změnit',
'Source' => 'Zdroj',
'Target' => 'Cíl',
'Add column' => 'Přidat sloupec',
'Alter' => 'Změnit',
'Add foreign key' => 'Přidat cizí klíč',
'ON DELETE' => 'Při smazání',
'ON UPDATE' => 'Při změně',
'Index Type' => 'Typ indexu',
'Column (length)' => 'Sloupec (délka)',
'View has been dropped.' => 'Pohled byl odstraněn.',
'View has been altered.' => 'Pohled byl změněn.',
'View has been created.' => 'Pohled byl vytvořen.',
'Alter view' => 'Pozměnit pohled',
'Create view' => 'Vytvořit pohled',
'Name' => 'Název',
'Process list' => 'Seznam procesů',
'%d process(es) has been killed.' => array('Byl ukončen %d proces.', 'Byly ukončeny %d procesy.', 'Bylo ukončeno %d procesů.'),
'Kill' => 'Ukončit',
'IN-OUT' => 'IN-OUT',
'Parameter name' => 'Název parametru',
'Database schema' => 'Schéma databáze',
'Create procedure' => 'Vytvořit proceduru',
'Create function' => 'Vytvořit funkci',
'Routine has been dropped.' => 'Procedura byla odstraněna.',
'Routine has been altered.' => 'Procedura byla změněna.',
'Routine has been created.' => 'Procedura byla vytvořena.',
'Alter function' => 'Změnit funkci',
'Alter procedure' => 'Změnit proceduru',
'Return type' => 'Návratový typ',
'Add trigger' => 'Přidat trigger',
'Trigger has been dropped.' => 'Trigger byl odstraněn.',
'Trigger has been altered.' => 'Trigger byl změněn.',
'Trigger has been created.' => 'Trigger byl vytvořen.',
'Alter trigger' => 'Změnit trigger',
'Create trigger' => 'Vytvořit trigger',
'Time' => 'Čas',
'Event' => 'Událost',
'MySQL version: %s through PHP extension %s' => 'Verze MySQL: %s přes PHP extenzi %s',
'%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
'~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'Při změně aktuální čas',
'Remove' => 'Odebrat',
'Are you sure?' => 'Opravdu?',
'Privileges' => 'Oprávnění',
'Create user' => 'Vytvořit uživatele',
'User has been dropped.' => 'Uživatel byl odstraněn.',
'User has been altered.' => 'Uživatel byl změněn.',
'User has been created.' => 'Uživatel byl vytvořen.',
'Hashed' => 'Zahašované',
'Column' => 'Sloupec',
'Routine' => 'Procedura',
'Grant' => 'Povolit',
'Revoke' => 'Zakázat',
'Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.' => 'Příliš velká POST data. Zmenšete data nebo zvyšte hodnotu konfigurační direktivy "post_max_size".',
'Logged as: %s' => 'Přihlášen jako: %s',
'Move up' => 'Přesunout nahoru',
'Move down' => 'Přesunout dolů',
'Functions' => 'Funkce',
'Aggregation' => 'Agregace',
'Export' => 'Export',
'Output' => 'Výstup',
'open' => 'otevřít',
'save' => 'uložit',
'Format' => 'Formát',
'SQL' => 'SQL',
'CSV' => 'CSV',
'Tables' => 'Tabulky',
'Data' => 'Data',
'Event has been dropped.' => 'Událost byla odstraněna.',
'Event has been altered.' => 'Událost byla změněna.',
'Event has been created.' => 'Událost byla vytvořena.',
'Alter event' => 'Pozměnit událost',
'Create event' => 'Vytvořit událost',
'At given time' => 'V daný čas',
'Every' => 'Každých',
'Events' => 'Události',
'Schedule' => 'Plán',
'Start' => 'Začátek',
'End' => 'Konec',
'Status' => 'Stav',
'On completion preserve' => 'Po dokončení zachovat',
'Tables and views' => 'Tabulky a pohledy',
'Data Length' => 'Velikost dat',
'Index Length' => 'Velikost indexů',
'Data Free' => 'Volné místo',
'Collation' => 'Porovnávání',
'Analyze' => 'Analyzovat',
'Optimize' => 'Optimalizovat',
'Check' => 'Zkontrolovat',
'Repair' => 'Opravit',
'Truncate' => 'Promazat',
'Tables have been truncated.' => 'Tabulky byly promazány.',
'Rows' => 'Řádků',
',' => ' ',
'Tables have been moved.' => 'Tabulky byly přesunuty',
'Move to other database' => 'Přesunout do jiné databáze',
'Move' => 'Přesunout',
'Engine' => 'Úložiště',
'Save and continue edit' => 'Uložit a pokračovat v editaci',
'clone' => 'klonovat',
'original' => 'původní',
'%d item(s) have been affected.' => array('Byl ovlivněn %d záznam.', 'Byly ovlivněny %d záznamy.', 'Bylo ovlivněno %d záznamů.'),
'whole result' => 'celý výsledek',
'Tables have been dropped.' => 'Tabulky byly odstraněny.',
'Clone' => 'Klonovat',
'Partition by' => 'Rozdělit podle',
'Partitions' => 'Oddíly',
'Partition name' => 'Název oddílu',
'Values' => 'Hodnoty',
'%d row(s) has been imported.' => array('Byl importován %d záznam.', 'Byly importovány %d záznamy.', 'Bylo importováno %d záznamů.'),
'CSV Import' => 'Import CSV',
'Import' => 'Import',
'Table structure' => 'Struktura tabulky',
'Select table' => 'Vypsat tabulku',
'Stop on error' => 'Zastavit při chybě',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Byl překročen maximální povolený počet polí. Zvyšte prosím %s a %s.',
'(anywhere)' => '(kdekoliv)',
'%.3f s' => '%.3f s',
);

217
adminer/lang/de.inc.php Normal file
View File

@@ -0,0 +1,217 @@
<?php
$translations = array(
'Login' => 'Login',
'Adminer' => 'Adminer',
'Logout successful.' => 'Abmeldung erfolgreich.',
'Invalid credentials.' => 'Ungültige Anmelde-Informationen.',
'Server' => 'Server',
'Username' => 'Benutzer',
'Password' => 'Passwort',
'Select database' => 'Datenbank auswählen',
'Invalid database.' => 'Datenbank ungültig.',
'Create new database' => 'Neue Datenbank',
'Table has been dropped.' => 'Tabelle entfernt.',
'Table has been altered.' => 'Tabelle geändert.',
'Table has been created.' => 'Tabelle erstellt.',
'Alter table' => 'Tabelle ändern',
'Create table' => 'Neue Tabelle erstellen',
'Table name' => 'Name der Tabelle',
'engine' => 'Motor',
'collation' => 'Kollation',
'Column name' => 'Spaltenname',
'Type' => 'Typ',
'Length' => 'Länge',
'NULL' => 'NULL',
'Auto Increment' => 'Auto-Inkrement',
'Options' => 'Optionen',
'Save' => 'Speichern',
'Drop' => 'Entfernen',
'Database has been dropped.' => 'Datenbank entfernt.',
'Database has been created.' => 'Datenbank erstellt.',
'Database has been renamed.' => 'Datenbank umbenannt.',
'Database has been altered.' => 'Datenbank geändert.',
'Alter database' => 'Datenbank ändern',
'Create database' => 'Neue Datenbank',
'SQL command' => 'SQL-Query',
'Dump' => 'Export',
'Logout' => 'Abmelden',
'database' => 'Datenbank',
'Use' => 'Benutzung',
'No tables.' => 'Keine Tabellen.',
'select' => 'zeigen',
'Create new table' => 'Neue Tabelle',
'Item has been deleted.' => 'Datensatz gelöscht.',
'Item has been updated.' => 'Datensatz geändert.',
'Item has been inserted.' => 'Datensatz hinzugefügt.',
'Edit' => 'Ändern',
'Insert' => 'Hinzufügen',
'Save and insert next' => 'Speichern und nächsten hinzufügen',
'Delete' => 'Entfernen',
'Database' => 'Datenbank',
'Routines' => 'Prozeduren',
'Indexes has been altered.' => 'Indizes geändert.',
'Indexes' => 'Indizes',
'Alter indexes' => 'Indizes ändern',
'Add next' => 'Hinzufügen',
'Language' => 'Sprache',
'Select' => 'Daten zeigen von',
'New item' => 'Neuer Datensatz',
'Search' => 'Suchen',
'Sort' => 'Ordnen',
'DESC' => 'absteigend',
'Limit' => 'Begrenzung',
'No rows.' => 'Keine Daten.',
'Action' => 'Aktion',
'edit' => 'ändern',
'Page' => 'Seite',
'Query executed OK, %d row(s) affected.' => array('Abfrage ausgeführt, %d Datensatz betroffen.', 'Abfrage ausgeführt, %d Datensätze betroffen.'),
'Error in query' => 'Fehler in der SQL-Abfrage',
'Execute' => 'Ausführen',
'Table' => 'Tabelle',
'Foreign keys' => 'Fremdschlüssel',
'Triggers' => 'Trigger',
'View' => 'View',
'Unable to select the table' => 'Tabelle kann nicht ausgewählt werden',
'Invalid CSRF token. Send the form again.' => 'CSRF Token ungültig. Bitte die Formulardaten erneut abschicken.',
'Comment' => 'Kommentar',
'Default values has been set.' => 'Standard Vorgabewerte sind erstellt worden.',
'Default values' => 'Vorgabewerte festlegen',
'BOOL' => 'BOOL',
'Show column comments' => 'Spaltenkomentare zeigen',
'%d byte(s)' => array('%d Byte', '%d Bytes'),
'No commands to execute.' => 'Kein Kommando vorhanden.',
'Unable to upload a file.' => 'Unmöglich Dateien hochzuladen.',
'File upload' => 'Datei importieren',
'File uploads are disabled.' => 'Importieren von Dateien abgeschaltet.',
'Routine has been called, %d row(s) affected.' => array('Kommando SQL ausgeführt, %d Datensatz betroffen.', 'Kommando SQL ausgeführt, %d Datensätze betroffen.'),
'Call' => 'Aufrufen',
'No MySQL extension' => 'Keine MySQL-Erweiterungen installiert',
'None of supported PHP extensions (%s) are available.' => 'Keine der unterstützten PHP-Erweiterungen (%s) ist vorhanden.',
'Sessions must be enabled.' => 'Sitzungen müssen aktiviert sein.',
'Session expired, please login again.' => 'Sitzungsdauer abgelaufen, bitte erneut anmelden.',
'Text length' => 'Textlänge',
'Foreign key has been dropped.' => 'Fremdschlüssel entfernt.',
'Foreign key has been altered.' => 'Fremdschlüssel geändert.',
'Foreign key has been created.' => 'Fremdschlüssel erstellt.',
'Foreign key' => 'Fremdschlüssel',
'Target table' => 'Zieltabelle',
'Change' => 'Ändern',
'Source' => 'Ursprung',
'Target' => 'Ziel',
'Add column' => 'Spalte hinzufügen',
'Alter' => 'Ändern',
'Add foreign key' => 'Fremdschlüssel hinzufügen',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => 'Index-Typ',
'Column (length)' => 'Spalte (Länge)',
'View has been dropped.' => 'View entfernt.',
'View has been altered.' => 'View geändert.',
'View has been created.' => 'View erstellt.',
'Alter view' => 'View ändern',
'Create view' => 'Neue View erstellen',
'Name' => 'Name',
'Process list' => 'Prozessliste',
'%d process(es) has been killed.' => array('%d Prozess gestoppt.', '%d Prozesse gestoppt.'),
'Kill' => 'Anhalten',
'IN-OUT' => 'IN-OUT',
'Parameter name' => 'Name des Parameters',
'Database schema' => 'Datenbankschema',
'Create procedure' => 'Neue Prozedur',
'Create function' => 'Neue Funktion',
'Routine has been dropped.' => 'Prozedur entfernt.',
'Routine has been altered.' => 'Prozedur geändert.',
'Routine has been created.' => 'Prozedur erstellt.',
'Alter function' => 'Funktion ändern',
'Alter procedure' => 'Prozedur ändern',
'Return type' => 'Typ des Rückgabewertes',
'Add trigger' => 'Trigger hinzufügen',
'Trigger has been dropped.' => 'Trigger entfernt.',
'Trigger has been altered.' => 'Trigger geändert.',
'Trigger has been created.' => 'Trigger erstellt.',
'Alter trigger' => 'Trigger ändern',
'Create trigger' => 'Trigger hinzufügen',
'Time' => 'Zeitpunkt',
'Event' => 'Ereignis',
'MySQL version: %s through PHP extension %s' => 'Version MySQL: %s, mit PHP-Erweiterung %s',
'%d row(s)' => array('%d Datensatz', '%d Datensätze'),
'~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Entfernen',
'Are you sure?' => 'Sind Sie sicher ?',
'Privileges' => 'Rechte',
'Create user' => 'Neuer Benutzer',
'User has been dropped.' => 'Benutzer entfernt.',
'User has been altered.' => 'Benutzer geändert.',
'User has been created.' => 'Benutzer erstellt.',
'Hashed' => 'Gehashed',
'Column' => 'Spalte',
'Routine' => 'Routine',
'Grant' => 'Erlauben',
'Revoke' => 'Verbieten',
'Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.' => 'POST data zu gross. Reduzieren Sie die Grösse oder vergrössern Sie den Wert "post_max_size" in der Konfiguration.',
'Logged as: %s' => 'Angemeldet als: %s',
'Move up' => 'Nach oben',
'Move down' => 'Nach unten',
'Functions' => 'Funktionen',
'Aggregation' => 'Aggregationen',
'Export' => 'Exportieren',
'Output' => 'Ergebnis',
'open' => 'zeigen',
'save' => 'Datei',
'Format' => 'Format',
'SQL' => 'SQL',
'CSV' => 'CSV',
'Tables' => 'Tabellen',
'Data' => 'Daten',
'Event has been dropped.' => 'Ereignis entfernt.',
'Event has been altered.' => 'Ereignis geändert.',
'Event has been created.' => 'Ereignis erstellt.',
'Alter event' => 'Ereignis ändern',
'Create event' => 'Ereignis erstellen',
'At given time' => 'Zur angegebenen Zeit',
'Every' => 'Jede',
'Events' => 'Ereignisse',
'Schedule' => 'Zeitplan',
'Start' => 'Start',
'End' => 'Ende',
'Status' => 'Status',
'On completion preserve' => 'Nach der Ausführung erhalten',
'Tables and views' => 'Tabellen und Views',
'Data Length' => 'Datengrösse',
'Index Length' => 'Indexgrösse',
'Data Free' => 'Freier Bereich',
'Collation' => 'Collation',
'Analyze' => 'Analysieren',
'Optimize' => 'Optimisieren',
'Check' => 'Prüfen',
'Repair' => 'Reparieren',
'Truncate' => 'Entleeren (truncate)',
'Tables have been truncated.' => 'Tabellen sind entleert worden (truncate).',
'Rows' => 'Datensätze',
',' => ' ',
'Tables have been moved.' => 'Tabellen verschoben.',
'Move to other database' => 'In andere Datenbank verschieben',
'Move' => 'Verschieben',
'Engine' => 'Motor',
'Save and continue edit' => 'Speichern und weiter bearbeiten',
'clone' => 'klonen',
'original' => 'original',
'Tables have been dropped.' => 'Tabellen wurden entfernt (drop).',
'%d item(s) have been affected.' => array('%d Artikel betroffen.', '%d Artikel betroffen.'),
'whole result' => 'gesamtes Resultat',
'Clone' => 'Klonen',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Die maximal erlaubte Anzahl der Felder ist überschritten. Bitte %s und %s erhöhen.',
'Partition by' => 'Partitionieren um',
'Partitions' => 'Partitionen',
'Partition name' => 'Name der Partition',
'Values' => 'Werte',
'%d row(s) has been imported.' => array('%d Datensatz importiert.', '%d Datensätze wurden importiert.'),
'Table structure' => 'Tabellensruktur',
'(anywhere)' => '(beliebig)',
'CSV Import' => 'Importiere CSV',
'Import' => 'Importieren',
'Stop on error' => 'Bei Fehler anhaltan',
'Select table' => 'Tabelle auswählen',
'%.3f s' => '%.3f s',
);

10
adminer/lang/en.inc.php Normal file
View File

@@ -0,0 +1,10 @@
<?php
$translations = array(
'Query executed OK, %d row(s) affected.' => array('Query executed OK, %d row affected.', 'Query executed OK, %d rows affected.'),
'%d byte(s)' => array('%d byte', '%d bytes'),
'Routine has been called, %d row(s) affected.' => array('Routine has been called, %d row affected.', 'Routine has been called, %d rows affected.'),
'%d process(es) has been killed.' => array('%d process has been killed.', '%d processes have been killed.'),
'%d row(s)' => array('%d row', '%d rows'),
'%d item(s) have been affected.' => array('%d item have been affected.', '%d items have been affected.'),
'%d row(s) has been imported.' => array('%d row has been imported.', '%d rows has been imported.'),
);

217
adminer/lang/es.inc.php Normal file
View File

@@ -0,0 +1,217 @@
<?php
$translations = array(
'Login' => 'Login',
'Adminer' => 'Adminer',
'Logout successful.' => 'Salida exitosa.',
'Invalid credentials.' => 'Autenticación fallada.',
'Server' => 'Servidor',
'Username' => 'Usuario',
'Password' => 'Contraseña',
'Select database' => 'Seleccionar Base de datos',
'Invalid database.' => 'Base de datos inválida.',
'Create new database' => 'Nueva Base de datos',
'Table has been dropped.' => 'Tabla eliminada.',
'Table has been altered.' => 'Tabla modificada.',
'Table has been created.' => 'Tabla creada.',
'Alter table' => 'Modificar tabla',
'Create table' => 'Crear tabla',
'Table name' => 'Nombre de tabla',
'engine' => 'motor',
'collation' => 'colación',
'Column name' => 'Nombre de columna',
'Type' => 'Tipo',
'Length' => 'Longitud',
'NULL' => 'NULL',
'Auto Increment' => 'Auto increment',
'Options' => 'Opciones',
'Save' => 'Guardar',
'Drop' => 'Eliminar',
'Database has been dropped.' => 'Base de datos eliminada.',
'Database has been created.' => 'Base de datos creada.',
'Database has been renamed.' => 'Base de datos renombrada.',
'Database has been altered.' => 'Base de datos modificada.',
'Alter database' => 'Modificar Base de datos',
'Create database' => 'Crear Base de datos',
'SQL command' => 'Comando SQL',
'Dump' => 'Export',
'Logout' => 'Logout',
'database' => 'base de datos',
'Use' => 'Uso',
'No tables.' => 'No existen tablas.',
'select' => 'registros',
'Create new table' => 'Nueva tabla',
'Item has been deleted.' => 'Registro eliminado.',
'Item has been updated.' => 'Registro modificado.',
'Item has been inserted.' => 'Registro insertado.',
'Edit' => 'Modificar',
'Insert' => 'Agregar',
'Save and insert next' => 'Guardar e insertar otro',
'Delete' => 'Eliminar',
'Database' => 'Base de datos',
'Routines' => 'Procedimientos',
'Indexes has been altered.' => 'Indices modificados.',
'Indexes' => 'Indices',
'Alter indexes' => 'Modificar indices',
'Add next' => 'Agregar',
'Language' => 'Idioma',
'Select' => 'Mostrar Registros',
'New item' => 'Nuevo Registro',
'Search' => 'Buscar',
'Sort' => 'Ordenar',
'DESC' => 'descendiente',
'Limit' => 'Limit',
'No rows.' => 'No hay filas.',
'Action' => 'Acción',
'edit' => 'modificar',
'Page' => 'Página',
'Query executed OK, %d row(s) affected.' => array('Consulta ejecutada, %d registro afectado.', 'Consulta ejecutada, %d registros afectados.'),
'Error in query' => 'Error en consulta',
'Execute' => 'Ejecutar',
'Table' => 'Tabla',
'Foreign keys' => 'Claves foráneas',
'Triggers' => 'Triggers',
'View' => 'Vistas',
'Unable to select the table' => 'No posible seleccionar la tabla',
'Invalid CSRF token. Send the form again.' => 'Token CSRF inválido. Vuelva a enviar los datos del formulario.',
'Comment' => 'Comentario',
'Default values has been set.' => 'Valores por omisión establecidos.',
'Default values' => 'Establecer valores por omisión',
'BOOL' => 'BOOL',
'Show column comments' => 'Mostrar comentario de columnas',
'%d byte(s)' => array('%d byte', '%d bytes'),
'No commands to execute.' => 'No hay comando a ejecutar.',
'Unable to upload a file.' => 'No posible subir archivos.',
'File upload' => 'Importar archivo',
'File uploads are disabled.' => 'Importación de archivos deshablilitado.',
'Routine has been called, %d row(s) affected.' => array('Consulta ejecutada, %d registro afectado.', 'Consulta ejecutada, %d registros afectados.'),
'Call' => 'Llamar',
'No MySQL extension' => 'No hay extension MySQL',
'None of supported PHP extensions (%s) are available.' => 'Ninguna de las extensiones PHP soportadas (%s) está disponible.',
'Sessions must be enabled.' => 'Deben estar habilitadas las sesiones.',
'Session expired, please login again.' => 'Sesion expirada, favor loguéese de nuevo.',
'Text length' => 'Longitud de texto',
'Foreign key has been dropped.' => 'Clave foránea eliminada.',
'Foreign key has been altered.' => 'Clave foránea modificada.',
'Foreign key has been created.' => 'Clave foránea creada.',
'Foreign key' => 'Clave foránea',
'Target table' => 'Tabla destino',
'Change' => 'Modificar',
'Source' => 'Origen',
'Target' => 'Destino',
'Add column' => 'Agregar columna',
'Alter' => 'Modificar',
'Add foreign key' => 'Agregar clave foránea',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => 'Tipo de índice',
'Column (length)' => 'Columna (longitud)',
'View has been dropped.' => 'Vista eliminada.',
'View has been altered.' => 'Vista modificada.',
'View has been created.' => 'Vista creada.',
'Alter view' => 'Modificar vista',
'Create view' => 'Cear vista',
'Name' => 'Nombre',
'Process list' => 'Lista de procesos',
'%d process(es) has been killed.' => array('%d proceso detenido.', '%d procesos detenidos.'),
'Kill' => 'Detener',
'IN-OUT' => 'IN-OUT',
'Parameter name' => 'Nombre de Parametro',
'Database schema' => 'Esquema de base de datos',
'Create procedure' => 'Crear procedimiento',
'Create function' => 'Crear función',
'Routine has been dropped.' => 'Procedimiento eliminado.',
'Routine has been altered.' => 'Procedimiento modificado.',
'Routine has been created.' => 'Procedimiento creado.',
'Alter function' => 'Modificar Función',
'Alter procedure' => 'Modificar procedimiento',
'Return type' => 'Tipo de valor retornado',
'Add trigger' => 'Agregar trigger',
'Trigger has been dropped.' => 'Trigger eliminado.',
'Trigger has been altered.' => 'Trigger modificado.',
'Trigger has been created.' => 'Trigger creado.',
'Alter trigger' => 'Modificar Trigger',
'Create trigger' => 'Agregar Trigger',
'Time' => 'Tiempo',
'Event' => 'Evento',
'MySQL version: %s through PHP extension %s' => 'Versión MySQL: %s a través de extensión PHP %s',
'%d row(s)' => array('%d fila', '%d filas'),
'~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Eliminar',
'Are you sure?' => 'Está seguro?',
'Privileges' => 'Privilegios',
'Create user' => 'Crear Usuario',
'User has been dropped.' => 'Usuario eliminado.',
'User has been altered.' => 'Usuario modificado.',
'User has been created.' => 'Usuario creado.',
'Hashed' => 'Hash',
'Column' => 'Columna',
'Routine' => 'Rutina',
'Grant' => 'Conceder',
'Revoke' => 'Impedir',
'Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.' => 'POST data demasiado grande. Reduzca el tamaño o aumente la directiva de configuración "post_max_size".',
'Logged as: %s' => 'Logeado como: %s',
'Move up' => 'Mover arriba',
'Move down' => 'Mover abajo',
'Functions' => 'Funciones',
'Aggregation' => 'Agregaciones',
'Export' => 'Exportar',
'Output' => 'Salida',
'open' => 'mostrar',
'save' => 'archivo',
'Format' => 'Formato',
'SQL' => 'SQL',
'CSV' => 'CSV',
'Tables' => 'Tablas',
'Data' => 'Datos',
'Event has been dropped.' => 'Evento eliminado.',
'Event has been altered.' => 'Evento modificado.',
'Event has been created.' => 'Evento creado.',
'Alter event' => 'Modificar Evento',
'Create event' => 'Crear Evento',
'At given time' => 'A hora determinada',
'Every' => 'Cada',
'Events' => 'Eventos',
'Schedule' => 'Agendamiento',
'Start' => 'Inicio',
'End' => 'Fin',
'Status' => 'Estado',
'On completion preserve' => 'Al completar preservar',
'Tables and views' => 'Tablas y vistas',
'Data Length' => 'Longitud de datos',
'Index Length' => 'Longitud de índice',
'Data Free' => 'Espacio libre',
'Collation' => 'Collation',
'Analyze' => 'Analizar',
'Optimize' => 'Optimizar',
'Check' => 'Comprobar',
'Repair' => 'Reparar',
'Truncate' => 'Vaciar',
'Tables have been truncated.' => 'Tablas vaciadas (truncate).',
'Rows' => 'Filas',
',' => ' ',
'Tables have been moved.' => 'Se movieron las tablas.',
'Move to other database' => 'mover a otra base de datos',
'Move' => 'Mover',
'Engine' => 'Motor',
'Save and continue edit' => 'Guardar y continuar editando',
'clone' => 'clonar',
'original' => 'original',
'Tables have been dropped.' => 'Las tablas fueron eliminados.',
'%d item(s) have been affected.' => array('%d item afectado.', '%d itemes afectados.'),
'whole result' => 'resultado completo',
'Clone' => 'Clonar',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Cantida máxima de campos permitidos excedidos. Favor aumente %s y %s.',
'Partition by' => 'Particionar por',
'Partitions' => 'Particiones',
'Partition name' => 'Nombre de Partición',
'Values' => 'Valores',
'%d row(s) has been imported.' => array('%d fila importada.', '%d filas importada.'),
'Table structure' => 'Estructura de la Tabla',
'(anywhere)' => '(cualquier lugar)',
'CSV Import' => 'Importar CSV',
'Import' => 'Importar',
'Stop on error' => 'Parar en caso de error',
'Select table' => 'Seleccionar tabla',
'%.3f s' => '%.3f s',
);

217
adminer/lang/et.inc.php Normal file
View File

@@ -0,0 +1,217 @@
<?php
$translations = array(
'Login' => 'Logi sisse',
'Adminer' => 'Andmebaasi haldaja',
'Logout successful.' => 'Väljalogimine õnnestus.',
'Invalid credentials.' => 'Ebasobivad andmed.',
'Server' => 'Server',
'Username' => 'Kasutajanimi',
'Password' => 'Parool',
'Select database' => 'Vali andmebaas',
'Invalid database.' => 'Sobimatu andmebaas.',
'Create new database' => 'Loo uus andmebaas',
'Table has been dropped.' => 'Tabel on edukalt kustutatud.',
'Table has been altered.' => 'Tabeli andmed on edukalt muudetud.',
'Table has been created.' => 'Tabel on edukalt loodud.',
'Alter table' => 'Muuda tabeli struktuuri',
'Create table' => 'Loo uus tabel',
'Table name' => 'Tabeli nimi',
'engine' => 'Mootor',
'collation' => 'Tähetabel',
'Column name' => 'Veeru nimi',
'Type' => 'Tüüp',
'Length' => 'Pikkus',
'NULL' => 'NULL',
'Auto Increment' => 'Automaatselt suurenev',
'Options' => 'Valikud',
'Save' => 'Sisesta',
'Drop' => 'Kustuta',
'Database has been dropped.' => 'Andmebaas on edukalt kustutatud.',
'Database has been created.' => 'Andmebaas on edukalt loodud.',
'Database has been renamed.' => 'Andmebaas on edukalt ümber nimetatud.',
'Database has been altered.' => 'Andmebaasi struktuuri uuendamine õnnestus.',
'Alter database' => 'Muuda andmebaasi',
'Create database' => 'Loo uus andmebaas',
'SQL command' => 'SQL-Päring',
'Dump' => 'Ekspordi',
'Logout' => 'Logi välja',
'database' => 'Andmebaas',
'Use' => 'Kasuta',
'No tables.' => 'Tabeleid ei leitud.',
'select' => 'kuva',
'Create new table' => 'Loo uus tabel',
'Item has been deleted.' => 'Kustutamine õnnestus.',
'Item has been updated.' => 'Uuendamine õnnestus.',
'Item has been inserted.' => 'Lisamine õnnestus.',
'Edit' => 'Muuda',
'Insert' => 'Sisesta',
'Save and insert next' => 'Sisesta ja lisa järgmine',
'Delete' => 'Kustuta',
'Database' => 'Andmebaas',
'Routines' => 'Protseduurid',
'Indexes has been altered.' => 'Indeksite andmed on edukalt uuendatud.',
'Indexes' => 'Indeksid',
'Alter indexes' => 'Muuda indekseid',
'Add next' => 'Lisa järgmine',
'Language' => 'Keel',
'Select' => 'Kuva',
'New item' => 'Lisa kirje',
'Search' => 'Otsi',
'Sort' => 'Sordi',
'DESC' => 'Kahanevalt',
'Limit' => 'Piira kirjete hulka',
'No rows.' => 'Sissekanded puuduvad.',
'Action' => 'Tegevus',
'edit' => 'muuda',
'Page' => 'Lehekülg',
'Query executed OK, %d row(s) affected.' => array('Päring õnnestus, mõjutatatud ridu: %d.', 'Päring õnnestus, mõjutatatud ridu: %d.'),
'Error in query' => 'SQL-päringus esines viga',
'Execute' => 'Käivita',
'Table' => 'Tabel',
'Foreign keys' => 'Võõrvõtmed (foreign key)',
'Triggers' => 'Päästikud (trigger)',
'View' => 'Vaata',
'Unable to select the table' => 'Tabeli valimine ebaõnnestus',
'Invalid CSRF token. Send the form again.' => 'Sobimatu CSRF, palun saadke vorm uuesti.',
'Comment' => 'Kommentaar',
'Default values has been set.' => 'Vaimimisi väärtused on edukalt määratud.',
'Default values' => 'Vaikimisi väärtused',
'BOOL' => 'Jah/Ei (BOOL)',
'Show column comments' => 'Kuva veeru kommentaarid',
'%d byte(s)' => array('%d bait', '%d baiti'),
'No commands to execute.' => 'Käsk puudub.',
'Unable to upload a file.' => 'Faili üleslaadimine pole võimalik.',
'File upload' => 'Faili üleslaadimine',
'File uploads are disabled.' => 'Faili üleslaadimine on keelatud.',
'Routine has been called, %d row(s) affected.' => array('Protseduur täideti edukalt, mõjutatud ridu: %d.', 'Protseduur täideti edukalt, mõjutatud ridu: %d.'),
'Call' => 'Käivita',
'No MySQL extension' => 'Ei leitud MySQL laiendust',
'None of supported PHP extensions (%s) are available.' => 'Serveris pole ühtegi toetatud PHP laiendustest (%s).',
'Sessions must be enabled.' => 'Sessioonid peavad olema lubatud.',
'Session expired, please login again.' => 'Sessioon on aegunud, palun logige uuesti sisse.',
'Text length' => 'Teksti pikkus',
'Foreign key has been dropped.' => 'Võõrvõti on edukalt kustutatud.',
'Foreign key has been altered.' => 'Võõrvõtme andmed on edukalt muudetud.',
'Foreign key has been created.' => 'Võõrvõri on edukalt loodud.',
'Foreign key' => 'Võõrvõti',
'Target table' => 'Siht-tabel',
'Change' => 'Muuda',
'Source' => 'Allikas',
'Target' => 'Sihtkoht',
'Add column' => 'Lisa veerg',
'Alter' => 'Muuda',
'Add foreign key' => 'Lisa võõrvõti',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => 'Indeksi tüüp',
'Column (length)' => 'Veerg (pikkus)',
'View has been dropped.' => 'Vaade (VIEW) on edukalt kustutatud.',
'View has been altered.' => 'Vaade (VIEW) on edukalt muudetud.',
'View has been created.' => 'Vaade (VIEW) on edukalt loodud.',
'Alter view' => 'Muuda vaadet (VIEW)',
'Create view' => 'Loo uus vaade (VIEW)',
'Name' => 'Nimi',
'Process list' => 'Protsesside nimekiri',
'%d process(es) has been killed.' => array('Protsess on edukalt peatatud (%d).', 'Valitud protsessid (%d) on edukalt peatatud.'),
'Kill' => 'Peata',
'IN-OUT' => 'IN-OUT',
'Parameter name' => 'Parameetri nimi',
'Database schema' => 'Andmebaasi skeem',
'Create procedure' => 'Loo uus protseduur',
'Create function' => 'Loo uus funktsioon',
'Routine has been dropped.' => 'Protseduur on edukalt kustutatud.',
'Routine has been altered.' => 'Protseduuri andmed on edukalt muudetud.',
'Routine has been created.' => 'Protseduur on edukalt loodud.',
'Alter function' => 'Muuda funktsiooni',
'Alter procedure' => 'Muuda protseduuri',
'Return type' => 'Tagastustüüp',
'Add trigger' => 'Lisa päästik (TRIGGER)',
'Trigger has been dropped.' => 'Päästik on edukalt kustutatud.',
'Trigger has been altered.' => 'Päästiku andmed on edukalt uuendatud.',
'Trigger has been created.' => 'Uus päästik on edukalt loodud.',
'Alter trigger' => 'Muuda päästiku andmeid',
'Create trigger' => 'Loo uus päästik (TRIGGER)',
'Time' => 'Aeg',
'Event' => 'Sündmus',
'%d row(s)' => array('%d rida', '%d rida'),
'~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Eemalda',
'Are you sure?' => 'Kas oled kindel?',
'Privileges' => 'Õigused',
'Create user' => 'Loo uus kasutaja',
'User has been dropped.' => 'Kasutaja on edukalt kustutatud.',
'User has been altered.' => 'Kasutaja andmed on edukalt muudetud.',
'User has been created.' => 'Kasutaja on edukalt lisatud.',
'Hashed' => 'Häshitud (Hashed)',
'Column' => 'Veerg',
'Routine' => 'Protseduur',
'Grant' => 'Anna',
'Revoke' => 'Eemalda',
'MySQL version: %s through PHP extension %s' => 'MySQL versioon: %s, kasutatud PHP moodul: %s',
'Logged as: %s' => 'Sisse logitud: %s',
'Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.' => 'POST-andmete maht on liialt suur. Palun vähendage andmeid või suurendage "post_max_size" php-seadet.',
'Move up' => 'Liiguta ülespoole',
'Move down' => 'Liiguta allapoole',
'Export' => 'Ekspordi',
'Tables' => 'Tabelid',
'Data' => 'Andmed',
'Output' => 'Väljund',
'open' => 'näita brauseris',
'save' => 'salvesta failina',
'Format' => 'Formaat',
'SQL' => 'SQL',
'CSV' => 'CSV',
'Functions' => 'Funktsioonid',
'Aggregation' => 'Liitmine',
'Event has been dropped.' => 'Sündmus on edukalt kustutatud.',
'Event has been altered.' => 'Sündmuse andmed on edukalt uuendatud.',
'Event has been created.' => 'Sündmus on edukalt loodud.',
'Alter event' => 'Muuda sündmuse andmeid',
'Create event' => 'Loo uus sündmus (EVENT)',
'Start' => 'Alusta',
'End' => 'Lõpeta',
'Every' => 'Iga',
'Status' => 'Staatus',
'On completion preserve' => 'Lõpetamisel jäta sündmus alles',
'Events' => 'Sündmused (EVENTS)',
'Schedule' => 'Ajakava',
'At given time' => 'Antud ajahetkel',
'Save and continue edit' => 'Salvesta ja jätka muutmist',
'original' => 'originaal',
'Tables have been truncated.' => 'Validud tabelid on edukalt tühjendatud.',
'Tables have been moved.' => 'Valitud tabelid on edukalt liigutatud.',
'Tables have been dropped.' => 'Valitud tabelid on edukalt kustutatud.',
'Tables and views' => 'Tabelid ja vaated',
'Engine' => 'Implementatsioon',
'Collation' => 'Tähetabel',
'Data Length' => 'Andmete pikkus',
'Index Length' => 'Indeksi pikkus',
'Data Free' => 'Vaba ruumi',
'Rows' => 'Ridu',
',' => ',',
'Analyze' => 'Analüüsi',
'Optimize' => 'Optimeeri',
'Check' => 'Kontrolli',
'Repair' => 'Paranda',
'Truncate' => 'Tühjenda',
'Move to other database' => 'Liiguta teise andmebaasi',
'Move' => 'Liiguta',
'%d item(s) have been affected.' => array('Mõjutatud kirjeid: %d.', 'Mõjutatud kirjeid: %d.'),
'whole result' => 'Täielikud tulemused',
'clone' => 'Klooni',
'Clone' => 'Kloon',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Maksimaalne väljade arv ületatud. Palun suurendage %s ja %s.',
'Partition by' => 'Partitsiooni',
'Partitions' => 'Partitsioonid',
'Partition name' => 'Partitsiooni nimi',
'Values' => 'Väärtused',
'%d row(s) has been imported.' => array('Imporditi %d rida', 'Imporditi %d rida'),
'Table structure' => 'Tabeli struktuur',
'(anywhere)' => '(vahet pole)',
'CSV Import' => 'Impordi CSV',
'Import' => 'Impordi',
'Stop on error' => 'Peatuda vea esinemisel',
'Select table' => 'Vali tabel',
'%.3f s' => '%.3f s',
);

216
adminer/lang/fr.inc.php Normal file
View File

@@ -0,0 +1,216 @@
<?php
$translations = array(
'Login' => 'Authentification',
'Adminer' => 'Adminer',
'Logout successful.' => 'Aurevoir!',
'Invalid credentials.' => 'Authentification échoué',
'Server' => 'Serveur',
'Username' => 'Utilisateur',
'Password' => 'Mot de passe',
'Select database' => 'Selectionner la base de donnée',
'Invalid database.' => 'Base de donnée invalide',
'Create new database' => 'Créer une base de donnée',
'Table has been dropped.' => 'Table effacée',
'Table has been altered.' => 'Table modifiée',
'Table has been created.' => 'Table créée.',
'Alter table' => 'Modifier la table',
'Create table' => 'Créer une table',
'Table name' => 'Nom de la table',
'engine' => 'moteur',
'collation' => 'collation',
'Column name' => 'Nombre de colonne',
'Type' => 'Type',
'Length' => 'Longeur',
'NULL' => 'NULL',
'Auto Increment' => 'Auto increment',
'Options' => 'Options',
'Save' => 'Sauvegarder',
'Drop' => 'Effacer',
'Database has been dropped.' => 'Base de données effacée.',
'Database has been created.' => 'Base de données créée.',
'Database has been renamed.' => 'Base de données renommée.',
'Database has been altered.' => 'Base de données modifiée.',
'Alter database' => 'Modifier la base de données',
'Create database' => 'Créer une base de données',
'SQL command' => 'Requête SQL',
'Dump' => 'Exporter',
'Logout' => 'Déconnexion',
'database' => 'base de données',
'Use' => 'Utiliser',
'No tables.' => 'Aucunes tables.',
'select' => 'select',
'Create new table' => 'Créer une table',
'Item has been deleted.' => 'Élément supprimé.',
'Item has been updated.' => 'Élément modifié.',
'Item has been inserted.' => 'Élément inseré.',
'Edit' => 'Modifier',
'Insert' => 'Insérer',
'Save and insert next' => 'Sauvegarder et insérer le prochain',
'Delete' => 'Effacer',
'Database' => 'Base de données',
'Routines' => 'Routines',
'Indexes has been altered.' => 'Index modifiés.',
'Indexes' => 'Index',
'Alter indexes' => 'Modifier les index',
'Add next' => 'Ajouter le prochain',
'Language' => 'Langues',
'Select' => 'Select',
'New item' => 'Nouvel élément',
'Search' => 'Rechercher',
'Sort' => 'Ordonner',
'Limit' => 'Limit',
'No rows.' => 'Aucun résultat',
'Action' => 'Action',
'edit' => 'modifier',
'Page' => 'Page',
'Query executed OK, %d row(s) affected.' => array('Requête exécutée, %d ligne affecteé.', 'Requête exécutée, %d lignes affectées.'),
'Error in query' => 'Erreur dans la requête',
'Execute' => 'Exécuter',
'Table' => 'Table',
'Foreign keys' => 'Clé externe',
'Triggers' => 'Triggers',
'View' => 'Vue',
'Unable to select the table' => 'Impossible de sélectionner la table',
'Invalid CSRF token. Send the form again.' => 'Token CSRF invalide. Veuillez réenvoyer le formulaire.',
'Comment' => 'Commentaire',
'Default values has been set.' => 'Valeur par défaut établie .',
'Default values' => 'Valeurs par défaut',
'BOOL' => 'BOOL',
'Show column comments' => 'Voir les commentaires sur les colonnes',
'%d byte(s)' => array('%d byte', '%d bytes'),
'No commands to execute.' => 'Aucune commande à exécuter.',
'Unable to upload a file.' => 'Impossible d\'importer le fichier.',
'File upload' => 'Importer un fichier',
'File uploads are disabled.' => 'Import de fichier désactivé.',
'Routine has been called, %d row(s) affected.' => array('Routine exécutée, %d ligne modifiée.', 'Routine exécutée, %d lignes modifiées.'),
'Call' => 'Appeler',
'No MySQL extension' => 'Extension MySQL introuvable',
'None of supported PHP extensions (%s) are available.' => 'Aucune des extensions PHP supportées (%s) n\'est disponible.',
'Sessions must be enabled.' => 'Veuillez activer les sessions.',
'Session expired, please login again.' => 'Session expirée, veuillez vous enregistrer à nouveau.',
'Text length' => 'Longueur du texte',
'Foreign key has been dropped.' => 'Clé externe effacée.',
'Foreign key has been altered.' => 'Clé externe modifiée.',
'Foreign key has been created.' => 'Clé externe créée.',
'Foreign key' => 'Clé externe',
'Target table' => 'Table visée',
'Change' => 'Modifier',
'Source' => 'Source',
'Target' => 'Cible',
'Add column' => 'Ajouter une colonne',
'Alter' => 'Modifier',
'Add foreign key' => 'Ajouter une clé externe',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => 'Type d\'index',
'Column (length)' => 'Colonne (longueur)',
'View has been dropped.' => 'Vue effacée.',
'View has been altered.' => 'Vue modifiée.',
'View has been created.' => 'Vue créée.',
'Alter view' => 'Modifier une vue',
'Create view' => 'Créer une vue',
'Name' => 'Nom',
'Process list' => 'Liste de processus',
'%d process(es) has been killed.' => array('%d processus arrêté.', '%d processus arrêtés.'),
'Kill' => 'Arrêter',
'IN-OUT' => 'IN-OUT',
'Parameter name' => 'Nom du Paramêtre',
'Database schema' => 'Schéma de la base de données',
'Create procedure' => 'Créer une procédure',
'Create function' => 'Créer une fonction',
'Routine has been dropped.' => 'Procédure éliminée.',
'Routine has been altered.' => 'Procédure modifiée.',
'Routine has been created.' => 'Procédure créée.',
'Alter function' => 'Modifié la fonction',
'Alter procedure' => 'Modifié la procédure',
'Return type' => 'Type de retour',
'Add trigger' => 'Ajouter un trigger',
'Trigger has been dropped.' => 'Trigger éliminé.',
'Trigger has been altered.' => 'Trigger modifié.',
'Trigger has been created.' => 'Trigger créé.',
'Alter trigger' => 'Modifier un trigger',
'Create trigger' => 'Ajouter un trigger',
'Time' => 'Temps',
'Event' => 'Évènement',
'%d row(s)' => array('%d ligne', '%d lignes'),
'~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Effacer',
'Are you sure?' => 'Êtes-vous certain?',
'Privileges' => 'Privilège',
'Create user' => 'Créer un utilisateur',
'User has been dropped.' => 'Utilisateur éffacé.',
'User has been altered.' => 'Utilisateur modifié.',
'User has been created.' => 'Utilisateur créé.',
'Hashed' => 'Haché',
'Column' => 'Colonne',
'Routine' => 'Routine',
'Grant' => 'Grant',
'Revoke' => 'Revoke',
'MySQL version: %s through PHP extension %s' => 'Version de MySQL: %s utilisant l\'extension %s',
'Logged as: %s' => 'Authentifié en tant que %s',
'Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.' => 'Donnée POST trop grande . Réduire la taille des données ou modifier le "post_max_size" dans la configuration de PHP.',
'Move up' => 'Déplacer vers le haut',
'Move down' => 'Déplacer vers le bas',
'Export' => 'Exporter',
'Tables' => 'Tables',
'Data' => 'Donnée',
'Output' => 'Sortie',
'open' => 'ouvrir',
'save' => 'sauvegarder',
'Format' => 'Formatter',
'SQL' => 'SQL',
'CSV' => 'CVS',
'Functions' => 'Fonctions',
'Aggregation' => 'Agrégation',
'Event has been dropped.' => 'L\'évènement a été supprimé.',
'Event has been altered.' => 'L\'évènement a été modifié.',
'Event has been created.' => 'L\'évènement a été créé.',
'Alter event' => 'Modifier un évènement',
'Create event' => 'Créer un évènement',
'Start' => 'Démarrer',
'End' => 'Terminer',
'Every' => 'Chaque',
'Status' => 'Status',
'On completion preserve' => 'Conserver quand complété',
'Events' => 'Évènement',
'Schedule' => 'Horaire',
'At given time' => 'À un moment précis',
'Save and continue edit' => 'Sauvegarder et continuer l\'édition',
'original' => 'original',
'Tables have been truncated.' => 'Les tables ont été tronquées',
'Tables have been moved.' => 'Les tables ont été déplacées',
'Tables have been dropped.' => 'Les tables ont été effacées',
'Tables and views' => 'Tables et vues',
'Engine' => 'Moteur',
'Collation' => 'Collation',
'Data Length' => 'Longeur des données',
'Index Length' => 'Longeur de l\'index',
'Data Free' => 'Vide',
'Rows' => 'Rangés',
',' => ',',
'Analyze' => 'Analyser',
'Optimize' => 'Opitimiser',
'Check' => 'Vérifier',
'Repair' => 'Réparer',
'Truncate' => 'Tronquer',
'Move to other database' => 'Déplacer dans une autre base de données',
'Move' => 'Déplacer',
'%d item(s) have been affected.' => array('%d élément ont été modifié.', '%d éléments ont été modifié.'),
'whole result' => 'résultat entier',
'clone' => 'cloner',
'Clone' => 'Cloner',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Le nombre de champs maximum est dépassé. Veuillez augmenter %s et %s',
'Partition by' => 'Partitionné par',
'Partitions' => 'Partitions',
'Partition name' => 'Nom de la partition',
'Values' => 'Valeurs',
'%d row(s) has been imported.' => array('%d ligne a été importé','%d lignes ont été importé'),
'Table structure' => 'Structure de la table',
'(anywhere)' => '(n\'importe où)',
'CSV Import' => 'Importation CVS',
'Import' => 'Importer',
'Stop on error' => 'Arrêt sur erreur',
'Select table' => 'Selectionner la table',
'%.3f s' => '%.3f s',
);

216
adminer/lang/it.inc.php Normal file
View File

@@ -0,0 +1,216 @@
<?php
$translations = array(
'Login' => 'Autenticazione',
'Adminer' => 'Adminer',
'Logout successful.' => 'Uscita effettuata con successo.',
'Invalid credentials.' => 'Credenziali non valide.',
'Server' => 'Server',
'Username' => 'Utente',
'Password' => 'Password',
'Select database' => 'Seleziona database',
'Invalid database.' => 'Database non valido.',
'Create new database' => 'Crea nuovo database',
'Table has been dropped.' => 'Tabella eliminata.',
'Table has been altered.' => 'Tabella modificata.',
'Table has been created.' => 'Tabella creata.',
'Alter table' => 'Modifica tabella',
'Create table' => 'Crea tabella',
'Table name' => 'Nome tabella',
'engine' => 'motore',
'collation' => 'collazione',
'Column name' => 'Nome colonna',
'Type' => 'Tipo',
'Length' => 'Lunghezza',
'NULL' => 'NULL',
'Auto Increment' => 'Auto incremento',
'Options' => 'Opzioni',
'Save' => 'Salva',
'Drop' => 'Elimina',
'Database has been dropped.' => 'Database eliminato.',
'Database has been created.' => 'Database creato.',
'Database has been renamed.' => 'Database rinominato.',
'Database has been altered.' => 'Database modificato.',
'Alter database' => 'Modifica database',
'Create database' => 'Crea database',
'SQL command' => 'Comando SQL',
'Dump' => 'Dump',
'Logout' => 'Esci',
'database' => 'database',
'Use' => 'Usa',
'No tables.' => 'No tabelle.',
'select' => 'seleziona',
'Create new table' => 'Crea nuova tabella',
'Item has been deleted.' => 'Elemento eliminato.',
'Item has been updated.' => 'Elemento aggiornato.',
'Item has been inserted.' => 'Elemento inserito.',
'Edit' => 'Modifica',
'Insert' => 'Inserisci',
'Save and insert next' => 'Salva e inserisci un altro',
'Delete' => 'Elimina',
'Database' => 'Database',
'Routines' => 'Routine',
'Indexes has been altered.' => 'Indici modificati.',
'Indexes' => 'Indici',
'Alter indexes' => 'Modifica indici',
'Add next' => 'Aggiungi altro',
'Language' => 'Lingua',
'Select' => 'Seleziona',
'New item' => 'Nuovo elemento',
'Search' => 'Cerca',
'Sort' => 'Ordina',
'Limit' => 'Limite',
'No rows.' => 'Nessuna riga.',
'Action' => 'Azione',
'edit' => 'modifica',
'Page' => 'Pagina',
'Query executed OK, %d row(s) affected.' => array('Esecuzione della query OK, %d riga interessata.', 'Esecuzione della query OK, %d righe interessate.'),
'Error in query' => 'Errore nella query',
'Execute' => 'Esegui',
'Table' => 'Tabella',
'Foreign keys' => 'Chiavi esterne',
'Triggers' => 'Trigger',
'View' => 'Vedi',
'Unable to select the table' => 'Selezione della tabella non riuscita',
'Invalid CSRF token. Send the form again.' => 'Token CSRF non valido. Reinvia la richiesta.',
'Comment' => 'Commento',
'Default values has been set.' => 'Valore predefinito impostato.',
'Default values' => 'Valori predefiniti',
'BOOL' => 'BOOL',
'Show column comments' => 'Mostra i commenti delle colonne',
'%d byte(s)' => array('%d byte', '%d bytes'),
'No commands to execute.' => 'Nessun commando da eseguire.',
'Unable to upload a file.' => 'Caricamento del file non riuscito.',
'File upload' => 'Caricamento file',
'File uploads are disabled.' => 'Caricamento file disabilitato.',
'Routine has been called, %d row(s) affected.' => array('Routine chiamata, %d riga interessata.', 'Routine chiamata, %d righe interessate.'),
'Call' => 'Chiama',
'No MySQL extension' => 'Estensioni MySQL non presenti',
'None of supported PHP extensions (%s) are available.' => 'Nessuna delle estensioni PHP supportate (%s) disponibile.',
'Sessions must be enabled.' => 'Le sessioni devono essere abilitate.',
'Session expired, please login again.' => 'Sessione scaduta, autenticarsi di nuovo.',
'Text length' => 'Lunghezza testo',
'Foreign key has been dropped.' => 'Foreign key eliminata.',
'Foreign key has been altered.' => 'Foreign key modificata.',
'Foreign key has been created.' => 'Foreign key creata.',
'Foreign key' => 'Foreign key',
'Target table' => 'Tabella obiettivo',
'Change' => 'Cambia',
'Source' => 'Sorgente',
'Target' => 'Obiettivo',
'Add column' => 'Aggiungi colonna',
'Alter' => 'Modifica',
'Add foreign key' => 'Aggiungi foreign key',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => 'Tipo indice',
'Column (length)' => 'Colonna (lunghezza)',
'View has been dropped.' => 'Vista eliminata.',
'View has been altered.' => 'Vista modificata.',
'View has been created.' => 'Vista creata.',
'Alter view' => 'Modifica vista',
'Create view' => 'Crea vista',
'Name' => 'Nome',
'Process list' => 'Elenco processi',
'%d process(es) has been killed.' => array('%d processo interrotto.', '%d processi interrotti.'),
'Kill' => 'Interrompi',
'IN-OUT' => 'IN-OUT',
'Parameter name' => 'Nome parametro',
'Database schema' => 'Schema database',
'Create procedure' => 'Crea procedura',
'Create function' => 'Crea funzione',
'Routine has been dropped.' => 'Routine eliminata.',
'Routine has been altered.' => 'Routine modificata.',
'Routine has been created.' => 'Routine creata.',
'Alter function' => 'Modifica funzione',
'Alter procedure' => 'Modifica procedura',
'Return type' => 'Return type',
'Add trigger' => 'Aggiungi trigger',
'Trigger has been dropped.' => 'Trigger eliminato.',
'Trigger has been altered.' => 'Trigger modificato.',
'Trigger has been created.' => 'Trigger creato.',
'Alter trigger' => 'Modifica trigger',
'Create trigger' => 'Crea trigger',
'Time' => 'Orario',
'Event' => 'Evento',
'MySQL version: %s through PHP extension %s' => 'Versione MySQL: %s via estensione PHP %s',
'%d row(s)' => array('%d riga', '%d righe'),
'~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Rimuovi',
'Are you sure?' => 'Sicuro?',
'Privileges' => 'Privilegi',
'Create user' => 'Crea utente',
'User has been dropped.' => 'Utente eliminato.',
'User has been altered.' => 'Utente modificato.',
'User has been created.' => 'Utente creato.',
'Hashed' => 'Hashed',
'Column' => 'Colonna',
'Routine' => 'Routine',
'Grant' => 'Permetti',
'Revoke' => 'Revoca',
'Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.' => 'Troppi dati via POST. Ridurre i dati o aumentare la direttiva di configurazione "post_max_size".',
'Logged as: %s' => 'Autenticato come: %s',
'Move up' => 'Sposta su',
'Move down' => 'Sposta giu',
'Functions' => 'Funzioni',
'Aggregation' => 'Aggregazione',
'Export' => 'Esporta',
'Output' => 'Risultato',
'open' => 'apri',
'save' => 'salva',
'Format' => 'Formato',
'SQL' => 'SQL',
'CSV' => 'CSV',
'Tables' => 'Tabelle',
'Data' => 'Dati',
'Event has been dropped.' => 'Evento eliminato.',
'Event has been altered.' => 'Evento modificato.',
'Event has been created.' => 'Evento creato.',
'Alter event' => 'Modifica evento',
'Create event' => 'Crea evento',
'Start' => 'Inizio',
'End' => 'Fine',
'Every' => 'Ogni',
'Status' => 'Stato',
'On completion preserve' => 'Al termine preservare',
'Events' => 'Eventi',
'Schedule' => 'Pianifica',
'At given time' => 'A tempo prestabilito',
'Save and continue edit' => 'Salva e continua',
'original' => 'originale',
'Tables have been truncated.' => 'Le tabelle sono state svuotate.',
'Tables have been moved.' => 'Le tabelle sono state spostate.',
'Tables have been dropped.' => 'Le tabelle sono state eliminate.',
'Tables and views' => 'Tabelle e viste',
'Engine' => 'Motore',
'Collation' => 'Collazione',
'Data Length' => 'Lunghezza dato',
'Index Length' => 'Lunghezza indice',
'Data Free' => 'Dati liberi',
'Rows' => 'Righe',
',' => '.',
'Analyze' => 'Analizza',
'Optimize' => 'Ottimizza',
'Check' => 'Controlla',
'Repair' => 'Ripara',
'Truncate' => 'Svuota',
'Move to other database' => 'Sposta in altro database',
'Move' => 'Sposta',
'%d item(s) have been affected.' => array('Il risultato consiste in %d elemento', 'Il risultato consiste in %d elementi'),
'whole result' => 'intero risultato',
'clone' => 'clona',
'Clone' => 'Clona',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Troppi campi. Per favore aumentare %s e %s.',
'Partition by' => 'Partiziona per',
'Partitions' => 'Partizioni',
'Partition name' => 'Nome partizione',
'Values' => 'Valori',
'%d row(s) has been imported.' => array('%d riga importata.','%d righe importate.'),
'Table structure' => 'Struttura tabella',
'(anywhere)' => '(ovunque)',
'CSV Import' => 'Importa da CSV',
'Import' => 'Importa',
'Stop on error' => 'Stop su errore',
'Select table' => 'Scegli tabella',
'%.3f s' => '%.3f s',
);

217
adminer/lang/nl.inc.php Normal file
View File

@@ -0,0 +1,217 @@
<?php
$translations = array(
'Login' => 'Inloggen',
'Adminer' => 'Adminer',
'Logout successful.' => 'Uitloggen geslaagd.',
'Invalid credentials.' => 'Ongeldige logingegevens.',
'Server' => 'Server',
'Username' => 'Gebruikersnaam',
'Password' => 'Wachtwoord',
'Select database' => 'Database selecteren',
'Invalid database.' => 'Ongeldige database.',
'Create new database' => 'Nieuwe database',
'Table has been dropped.' => 'Tabel verwijderd.',
'Table has been altered.' => 'Tabel aangepast.',
'Table has been created.' => 'Tabel aangemaakt.',
'Alter table' => 'Tabel aanpassen',
'Create table' => 'Tabel aanmaken',
'Table name' => 'Tabelnaam',
'engine' => 'engine',
'collation' => 'collation',
'Column name' => 'Kolomnaam',
'Type' => 'Type',
'Length' => 'Lengte',
'NULL' => 'NULL',
'Auto Increment' => 'Auto nummering',
'Options' => 'Opties',
'Save' => 'Opslaan',
'Drop' => 'Verwijderen',
'Database has been dropped.' => 'Database verwijderd.',
'Database has been created.' => 'Database aangemaakt.',
'Database has been renamed.' => 'Database hernoemd.',
'Database has been altered.' => 'Database aangepast.',
'Alter database' => 'Database aanpassen',
'Create database' => 'Database aanmaken',
'SQL command' => 'SQL opdracht',
'Dump' => 'Exporteer',
'Logout' => 'Uitloggen',
'database' => 'database',
'Use' => 'Gebruik',
'No tables.' => 'Geen tabellen.',
'select' => 'kies',
'Create new table' => 'Nieuwe tabel',
'Item has been deleted.' => 'Item verwijderd.',
'Item has been updated.' => 'Item aangepast.',
'Item has been inserted.' => 'Item toegevoegd.',
'Edit' => 'Bewerk',
'Insert' => 'Toevoegen',
'Save and insert next' => 'Opslaan, daarna toevoegen',
'Delete' => 'Verwijderen',
'Database' => 'Database',
'Routines' => 'Procedures',
'Indexes has been altered.' => 'Index aangepast.',
'Indexes' => 'Indexen',
'Alter indexes' => 'Indexen aanpassen',
'Add next' => 'Volgende toevoegen',
'Language' => 'Taal',
'Select' => 'Kies',
'New item' => 'Nieuw item',
'Search' => 'Zoeken',
'Sort' => 'Sorteren',
'DESC' => 'Aflopend',
'Limit' => 'Beperk',
'No rows.' => 'Geen rijen.',
'Action' => 'Acties',
'edit' => 'bewerk',
'Page' => 'Pagina',
'Query executed OK, %d row(s) affected.' => array('Query uitgevoerd, %d rij geraakt.', 'Query uitgevoerd, %d rijen geraakt.'),
'Error in query' => 'Fout in query',
'Execute' => 'Uitvoeren',
'Table' => 'Tabel',
'Foreign keys' => 'Foreign keys',
'Triggers' => 'Triggers',
'View' => 'View',
'Unable to select the table' => 'Onmogelijk tabel te selecteren',
'Invalid CSRF token. Send the form again.' => 'Ongeldig CSRF token. Verstuur het formulier opnieuw.',
'Comment' => 'Commentaar',
'Default values has been set.' => 'Standaard waarde ingesteld.',
'Default values' => 'Standaard waarden',
'BOOL' => 'BOOL',
'Show column comments' => 'Kolomcommentaar weergeven',
'%d byte(s)' => array('%d byte', '%d bytes'),
'No commands to execute.' => 'Geen opdrachten uit te voeren.',
'Unable to upload a file.' => 'Onmogelijk bestand te uploaden.',
'File upload' => 'Bestand uploaden',
'File uploads are disabled.' => 'Bestanden uploaden is uitgeschakeld.',
'Routine has been called, %d row(s) affected.' => array('Procedure uitgevoerd, %d rij geraakt.', 'Procedure uitgevoerd, %d rijen geraakt.'),
'Call' => 'Uitvoeren',
'No MySQL extension' => 'Geen MySQL extensie',
'None of supported PHP extensions (%s) are available.' => 'Geen geldige PHP extensies beschikbaar (%s).',
'Sessions must be enabled.' => 'Siessies moeten geactiveerd zijn.',
'Session expired, please login again.' => 'Uw sessie is verlopen. Gelieve opnieuw in te loggen.',
'Text length' => 'Tekst lengte',
'Foreign key has been dropped.' => 'Foreign key verwijderd.',
'Foreign key has been altered.' => 'Foreign key aangepast.',
'Foreign key has been created.' => 'Foreign key aangemaakt.',
'Foreign key' => 'Foreign key',
'Target table' => 'Doeltabel',
'Change' => 'Veranderen',
'Source' => 'Bron',
'Target' => 'Doel',
'Add column' => 'Kolom toevoegen',
'Alter' => 'Aanpassen',
'Add foreign key' => 'Foreign key aanmaken',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => 'Index type',
'Column (length)' => 'Kolom (lengte)',
'View has been dropped.' => 'View verwijderd.',
'View has been altered.' => 'View aangepast.',
'View has been created.' => 'View aangemaakt.',
'Alter view' => 'View aanpassen',
'Create view' => 'View aanmaken',
'Name' => 'Naam',
'Process list' => 'Proceslijst',
'%d process(es) has been killed.' => array('%d proces gestopt.', '%d processen gestopt.'),
'Kill' => 'Stoppen',
'IN-OUT' => 'IN-OUT',
'Parameter name' => 'Parameternaam',
'Database schema' => 'Database schema',
'Create procedure' => 'Procedure aanmaken',
'Create function' => 'Functie aanmaken',
'Routine has been dropped.' => 'Procedure verwijderd.',
'Routine has been altered.' => 'Procedure aangepast.',
'Routine has been created.' => 'Procedure aangemaakt.',
'Alter function' => 'Functie aanpassen',
'Alter procedure' => 'Procedure aanpassen',
'Return type' => 'Return type',
'Add trigger' => 'Trigger aanmaken',
'Trigger has been dropped.' => 'Trigger verwijderd.',
'Trigger has been altered.' => 'Trigger aangepast.',
'Trigger has been created.' => 'Trigger aangemaakt.',
'Alter trigger' => 'Trigger aanpassen',
'Create trigger' => 'Trigger aanmaken',
'Time' => 'Time',
'Event' => 'Event',
'MySQL version: %s through PHP extension %s' => 'MySQL versie: %s met PHP extensie %s',
'%d row(s)' => array('%d rij', '%d rijen'),
'~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => 'Verwijderen',
'Are you sure?' => 'Weet u het zeker?',
'Privileges' => 'Rechten',
'Create user' => 'Gebruiker aanmaken',
'User has been dropped.' => 'Gebruiker verwijderd.',
'User has been altered.' => 'Gebruiker aangepast.',
'User has been created.' => 'Gebruiker aangemaakt.',
'Hashed' => 'Gehashed',
'Column' => 'Kolom',
'Routine' => 'Routine',
'Grant' => 'Toekennen',
'Revoke' => 'Intrekken',
'Logged as: %s' => 'Aangemeld als: %s',
'Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.' => 'POST-data is te groot. Verklein de hoeveelheid data of verhoog de "post_max_size" configuratie.',
'Move up' => 'Omhoog',
'Move down' => 'Omlaag',
'Export' => 'Exporteren',
'Tables' => 'Tabellen',
'Data' => 'Data',
'Output' => 'Uitvoer',
'open' => 'openen',
'save' => 'opslaan',
'Format' => 'Formaat',
'SQL' => 'SQL',
'CSV' => 'CSV',
'Functions' => 'Functies',
'Aggregation' => 'Totalen',
'Event has been dropped.' => 'Event werd verwijderd.',
'Event has been altered.' => 'Event werd aangepast.',
'Event has been created.' => 'Event werd aangemaakt.',
'Alter event' => 'Event aanpassen',
'Create event' => 'Event aanmaken',
'Start' => 'Start',
'End' => 'Stop',
'Every' => 'Iedere',
'Status' => 'Status',
'On completion preserve' => 'Bewaren na voltooiing',
'Events' => 'Events',
'Schedule' => 'Schedule',
'At given time' => 'Op aangegeven tijd',
'Save and continue edit' => 'Opslaan en verder bewerken',
'original' => 'origineel',
'Tables have been truncated.' => 'Tabellen werden geleegd.',
'Tables have been moved.' => 'Tabellen werden verplaatst.',
'Tables have been dropped.' => 'Tabellen werden verwijderd.',
'Tables and views' => 'Tabellen en views',
'Engine' => 'Engine',
'Collation' => 'Collatie',
'Data Length' => 'Data lengte',
'Index Length' => 'Index lengte',
'Data Free' => 'Data Vrij',
'Rows' => 'Rijen',
',' => '.',
'Analyze' => 'Analyseer',
'Optimize' => 'Optimaliseer',
'Check' => 'Controleer',
'Repair' => 'Herstel',
'Truncate' => 'Legen',
'Move to other database' => 'Verplaats naar andere database',
'Move' => 'Verplaats',
'%d item(s) have been affected.' => array('%d item aangepast.', '%d items aangepast.'),
'whole result' => 'volledig resultaat',
'clone' => 'dupliceer',
'Clone' => 'Dupliceer',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Maximum aantal velden bereikt. Verhoog %s en %s.',
'Partition by' => 'Partitioneren op',
'Partitions' => 'Partities',
'Partition name' => 'Partitie naam',
'Values' => 'Waarden',
'%d row(s) has been imported.' => array('%d rij werd geïmporteerd.', '%d rijen werden geïmporteerd.'),
'Table structure' => 'Tabelstructuur',
'(anywhere)' => '(overal)',
'CSV Import' => 'CSV Import',
'Import' => 'Importeren',
'Stop on error' => 'Stoppen bij fout',
'Select table' => 'Selecteer tabel',
'%.3f s' => '%.3f s',
);

217
adminer/lang/ru.inc.php Normal file
View File

@@ -0,0 +1,217 @@
<?php
$translations = array(
'Login' => 'Записаться',
'Adminer' => 'Adminer',
'Logout successful.' => 'Логаут в порядке.',
'Invalid credentials.' => 'Недействительное заявительное факты.',
'Server' => 'Сервер',
'Username' => 'Имя',
'Password' => 'Пароль',
'Select database' => 'Выбрать базу данных',
'Invalid database.' => 'Плохая база данных.',
'Create new database' => 'Создать новую базу данных',
'Table has been dropped.' => 'Таблица была снята.',
'Table has been altered.' => 'Таблица была изменена.',
'Table has been created.' => 'Таблица была создана.',
'Alter table' => 'Изменить таблицу',
'Create table' => 'Создать таблицу',
'Table name' => 'Имя таблицы',
'engine' => 'тип',
'collation' => 'сравнение',
'Column name' => 'Имя поля',
'Type' => 'Тип',
'Length' => 'Длина',
'NULL' => 'NULL',
'Auto Increment' => 'Auto Increment',
'Options' => 'Действие',
'Save' => 'Сохранить',
'Drop' => 'Устранить',
'Database has been dropped.' => 'База данных была снята.',
'Database has been created.' => 'База данных была создана.',
'Database has been renamed.' => 'База данных была переименована.',
'Database has been altered.' => 'База данных была изменена.',
'Alter database' => 'Изменить базу данных',
'Create database' => 'Создать базу данных',
'SQL command' => 'SQL запрос',
'Dump' => 'Экспорт',
'Logout' => 'Выписаться',
'database' => 'база данных',
'Use' => 'Выбрать',
'No tables.' => 'Никакое таблице.',
'select' => 'выписать',
'Create new table' => 'Создать новую таблицу',
'Item has been deleted.' => 'Запись был стеренный.',
'Item has been updated.' => 'Запись был актуализированный.',
'Item has been inserted.' => 'Запись был вставнный.',
'Edit' => 'Обработать',
'Insert' => 'Вставить',
'Save and insert next' => 'Уложить и вставить другой',
'Delete' => 'Стереть',
'Database' => 'База данных',
'Routines' => 'Процедуры и функции',
'Indexes has been altered.' => 'Индексы изменены.',
'Indexes' => 'Индексы',
'Alter indexes' => 'Изменить индексы',
'Add next' => 'Добавить другое',
'Language' => 'Язык',
'Select' => 'Выписать',
'New item' => 'Новый запись',
'Search' => 'Поиск',
'Sort' => 'Сортировать',
'DESC' => 'в нисходящем порядке',
'Limit' => 'Лимит',
'No rows.' => 'Никакое записи.',
'Action' => 'Действие',
'edit' => 'обработать',
'Page' => 'Страница',
'Query executed OK, %d row(s) affected.' => array('Запрос в порядке, изменен %d запись.', 'Запрос в порядке, изменены %d записи.', 'Запрос в порядке, изменены %d записи.'),
'Error in query' => 'Ошибка в запросe',
'Execute' => 'Сделать',
'Table' => 'Таблица',
'Foreign keys' => 'Иностранные ключи',
'Triggers' => 'Триггеры',
'View' => 'Взгляд',
'Unable to select the table' => 'Не удалось выписать таблицу',
'Invalid CSRF token. Send the form again.' => 'Недействительный токен CSRF. Отправите формуляр ещё один раз.',
'Comment' => 'Комментарий',
'Default values has been set.' => 'Исходные данные были зафиксированы.',
'Default values' => 'Исходные данные',
'BOOL' => 'BOOL',
'Show column comments' => 'Изобразить комментарии для колонки',
'%d byte(s)' => array('%d байт', '%d байты', '%d байтов'),
'No commands to execute.' => 'Никакое запросы для выполнение команды.',
'Unable to upload a file.' => 'Не удалось записать файл.',
'File upload' => 'Записать файл',
'File uploads are disabled.' => 'Записывать файлы запрещено.',
'Routine has been called, %d row(s) affected.' => array('Процедура была вызвана, был изменен %d запись.', 'Процедура была вызвана, были изменены %d записы.', 'Процедура была вызвана, было изменено %d записов.'),
'Call' => 'Вызвать',
'No MySQL extension' => 'Никакая MySQL растяжка',
'None of supported PHP extensions (%s) are available.' => 'Нет никакая из поощрених PHP растяжении (%s).',
'Sessions must be enabled.' => 'Сессион должно быть разрешенное.',
'Session expired, please login again.' => 'Сессион прошла, записаться ещё один раз.',
'Text length' => 'Длина текстов',
'Foreign key has been dropped.' => 'Иностранный ключ был удалена.',
'Foreign key has been altered.' => 'Иностранный ключ был актуализированный.',
'Foreign key has been created.' => 'Иностранный ключ был создан.',
'Foreign key' => 'Иностранный ключ',
'Target table' => 'Финишная таблица',
'Change' => 'Изменить',
'Source' => 'Источник',
'Target' => 'Цель',
'Add column' => 'Добавить колонку',
'Alter' => 'Изменить',
'Add foreign key' => 'Добавить иностранный ключ',
'ON DELETE' => 'При стирание',
'ON UPDATE' => 'При актуализации',
'Index Type' => 'Тип индекса',
'Column (length)' => 'Колонка (длина)',
'View has been dropped.' => 'Взгляд был удален.',
'View has been altered.' => 'Взгляд был изменен.',
'View has been created.' => 'Взгляд был создан.',
'Alter view' => 'Изменить взгляд',
'Create view' => 'Создать взгляд',
'Name' => 'Имя',
'Process list' => 'Список процессов',
'%d process(es) has been killed.' => array('Был завершён %d процесс.', 'Было завершёно %d процессов.', 'Было завершёно %d процессов.'),
'Kill' => 'Завершить',
'IN-OUT' => 'IN-OUT',
'Parameter name' => 'Имя параметра',
'Database schema' => 'Схема базы данных',
'Create procedure' => 'Создать процедуру',
'Create function' => 'Создать функцию',
'Routine has been dropped.' => 'Процедура была удалена.',
'Routine has been altered.' => 'Процедура была изменена.',
'Routine has been created.' => 'Процедура была создана.',
'Alter function' => 'Изменить функцию',
'Alter procedure' => 'Изменить процедуру',
'Return type' => 'Возвратный тип',
'Add trigger' => 'Добавить триггер',
'Trigger has been dropped.' => 'Триггер был удален.',
'Trigger has been altered.' => 'Триггер был изменен.',
'Trigger has been created.' => 'Триггер был создан.',
'Alter trigger' => 'Изменить триггер',
'Create trigger' => 'Создать триггер',
'Time' => 'Время',
'Event' => 'Событие',
'MySQL version: %s through PHP extension %s' => 'Версия MySQL: %s через PHP растяжение %s',
'%d row(s)' => array('%d строка', '%d строки', '%d строков'),
'~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'При перемене актуального время',
'Remove' => 'Изъять',
'Are you sure?' => 'Уверен?',
'Privileges' => 'Полномочие',
'Create user' => 'Создать пользователа',
'User has been dropped.' => 'Пользователь был удален.',
'User has been altered.' => 'Пользователь был изменен.',
'User has been created.' => 'Пользователь был создан.',
'Hashed' => 'это хэш',
'Column' => 'Колонка',
'Routine' => 'Процедура',
'Grant' => 'Позволить',
'Revoke' => 'Запретить',
'Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.' => 'Очень большое POST данные. Уменьшите данные или увеличите параметр конфигурацной директивы "post_max_size".',
'Logged as: %s' => 'Записанный как: %s',
'Move up' => 'Переместить вверх',
'Move down' => 'Переместить вниз',
'Functions' => 'Функции',
'Aggregation' => 'Агрегация',
'Export' => 'Експорт',
'Output' => 'Выход',
'open' => 'открыть',
'save' => 'уложить',
'Format' => 'Формат',
'SQL' => 'SQL',
'CSV' => 'CSV',
'Tables' => 'Таблицы',
'Data' => 'Данные',
'Event has been dropped.' => 'Событие была удален.',
'Event has been altered.' => 'Событие была изменена.',
'Event has been created.' => 'Событие была создана.',
'Alter event' => 'Изменить событие',
'Create event' => 'Создать событие',
'At given time' => 'В данное время',
'Every' => 'Через каждых',
'Events' => 'События',
'Schedule' => 'План',
'Start' => 'Начало',
'End' => 'Конец',
'Status' => 'Состояние',
'On completion preserve' => 'По доделке сохранить',
'Tables and views' => 'Таблицы и взгляды',
'Data Length' => 'Объём данных',
'Index Length' => 'Объём индексов',
'Data Free' => 'Свободные место',
'Collation' => 'Сравнение',
'Analyze' => 'Анализировать',
'Optimize' => 'Оптимизировать',
'Check' => 'Проверить',
'Repair' => 'Поправить',
'Truncate' => 'Перемазать',
'Tables have been truncated.' => 'Таблицы были перемазание.',
'Rows' => 'Строков',
',' => ' ',
'Tables have been moved.' => 'Таблицы были переместены.',
'Move to other database' => 'Переместить в другою базу данных',
'Move' => 'Переместить',
'Engine' => 'Тип',
'Save and continue edit' => 'Уложить и продолжать редактирование',
'clone' => 'клонировать',
'original' => 'исходный',
'%d item(s) have been affected.' => array('Был причинено %d запись.', 'Были причинены %d записы.', 'Было причинено %d записов.'),
'whole result' => 'весь результат',
'Tables have been dropped.' => 'Таблицы были устранены.',
'Clone' => 'Клонировать',
'Partition by' => 'Разделить по',
'Partitions' => 'Разделы',
'Partition name' => 'Имя раздела',
'Values' => 'Параметры',
'%d row(s) has been imported.' => array('Был импортирован %d v.', 'Были импортированы %d записы.', 'Было импортировано %d записов.'),
'CSV Import' => 'Импорт CSV',
'Import' => 'Импорт',
'Table structure' => 'Структура таблици',
'Select table' => 'Выписать таблицу',
'Stop on error' => 'Прекратить при ошибке',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Было пересечено максимальные количество поля. Нарастите %s и %s.',
'(anywhere)' => '(в любом месте)',
'%.3f s' => '%.3f s',
);

217
adminer/lang/sk.inc.php Normal file
View File

@@ -0,0 +1,217 @@
<?php
$translations = array(
'Login' => 'Prihlásiť sa',
'Adminer' => 'Adminer',
'Logout successful.' => 'Odhlásenie prebehlo v poriadku.',
'Invalid credentials.' => 'Neplatné prihlasovacie údaje.',
'Server' => 'Server',
'Username' => 'Používateľ',
'Password' => 'Heslo',
'Select database' => 'Vybrať databázu',
'Invalid database.' => 'Nesprávna databáza.',
'Create new database' => 'Vytvoriť novú databázu',
'Table has been dropped.' => 'Tabuľka bola odstránená.',
'Table has been altered.' => 'Tabuľka bola zmenená.',
'Table has been created.' => 'Tabuľka bola vytvorená.',
'Alter table' => 'Zmeniť tabuľku',
'Create table' => 'Vytvoriť tabuľku',
'Table name' => 'Názov tabuľky',
'engine' => 'úložisko',
'collation' => 'porovnávanie',
'Column name' => 'Názov stĺpca',
'Type' => 'Typ',
'Length' => 'Dĺžka',
'NULL' => 'NULL',
'Auto Increment' => 'Auto Increment',
'Options' => 'Voľby',
'Save' => 'Uložiť',
'Drop' => 'Odstrániť',
'Database has been dropped.' => 'Databáza bola odstránená.',
'Database has been created.' => 'Databáza bola vytvorená.',
'Database has been renamed.' => 'Databáza bola premenovaná.',
'Database has been altered.' => 'Databáza bola zmenená.',
'Alter database' => 'Zmeniť databázu',
'Create database' => 'Vytvoriť databázu',
'SQL command' => 'SQL príkaz',
'Dump' => 'Export',
'Logout' => 'Odhlásiť',
'database' => 'databáza',
'Use' => 'Vybrať',
'No tables.' => 'Žiadne tabuľky.',
'select' => 'vypísať',
'Create new table' => 'Vytvoriť novú tabuľku',
'Item has been deleted.' => 'Položka bola vymazaná.',
'Item has been updated.' => 'Položka bola aktualizovaná.',
'Item has been inserted.' => 'Položka bola vložená.',
'Edit' => 'Upraviť',
'Insert' => 'Vložiť',
'Save and insert next' => 'Uložiť a vložiť ďalší',
'Delete' => 'Zmazať',
'Database' => 'Databáza',
'Routines' => 'Procedúry',
'Indexes has been altered.' => 'Indexy boli zmenené.',
'Indexes' => 'Indexy',
'Alter indexes' => 'Zmeniť indexy',
'Add next' => 'Pridať ďalší',
'Language' => 'Jazyk',
'Select' => 'Vypísať',
'New item' => 'Nová položka',
'Search' => 'Vyhľadať',
'Sort' => 'Zotriediť',
'DESC' => 'zostupne',
'Limit' => 'Limit',
'No rows.' => 'Žiadne riadky.',
'Action' => 'Akcia',
'edit' => 'upraviť',
'Page' => 'Stránka',
'Query executed OK, %d row(s) affected.' => array('Príkaz prebehol v poriadku, bol zmenený %d záznam.', 'Príkaz prebehol v poriadku boli zmenené %d záznamy.', 'Príkaz prebehol v poriadku bolo zmenených %d záznamov.'),
'Error in query' => 'Chyba v dotaze',
'Execute' => 'Vykonať',
'Table' => 'Tabuľka',
'Foreign keys' => 'Cudzie kľúče',
'Triggers' => 'Triggery',
'View' => 'Pohľad',
'Unable to select the table' => 'Tabuľku sa nepodarilo vypísať',
'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odošlite formulár znova.',
'Comment' => 'Komentár',
'Default values has been set.' => 'Východzie hodnoty boli nastavené.',
'Default values' => 'Východzie hodnoty',
'BOOL' => 'BOOL',
'Show column comments' => 'Zobraziť komentáre stĺpcov',
'%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtov'),
'No commands to execute.' => 'Žiadne príkazy na vykonanie.',
'Unable to upload a file.' => 'Súbor sa nepodarilo nahrať.',
'File upload' => 'Nahranie súboru',
'File uploads are disabled.' => 'Nahrávánie súborov nie je povolené.',
'Routine has been called, %d row(s) affected.' => array('Procedúra bola zavolaná, bol zmenený %d záznam.', 'Procedúra bola zavolaná, boli zmenené %d záznamy.', 'Procedúra bola zavolaná, bolo zmenených %d záznamov.'),
'Call' => 'Zavolať',
'No MySQL extension' => 'Žiadne MySQL rozšírenie',
'None of supported PHP extensions (%s) are available.' => 'Nie je dostupné žiadne z podporovaných rozšírení (%s).',
'Sessions must be enabled.' => 'Session premenné musia byť povolené.',
'Session expired, please login again.' => 'Session vypršala, prihláste sa prosím znova.',
'Text length' => 'Dĺžka textov',
'Foreign key has been dropped.' => 'Cudzí kľúč bol odstránený.',
'Foreign key has been altered.' => 'Cudzí kľúč bol zmenený.',
'Foreign key has been created.' => 'Cudzí kľúč bol vytvorený.',
'Foreign key' => 'Cudzí kľúč',
'Target table' => 'Cieľová tabuľka',
'Change' => 'Zmeniť',
'Source' => 'Zdroj',
'Target' => 'Cieľ',
'Add column' => 'Pridať stĺpec',
'Alter' => 'Zmeniť',
'Add foreign key' => 'Pridať cudzí kľúč',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => 'Typ indexu',
'Column (length)' => 'Stĺpec (dĺžka)',
'View has been dropped.' => 'Pohľad bol odstránený.',
'View has been altered.' => 'Pohľad bol zmenený.',
'View has been created.' => 'Pohľad bol vytvorený.',
'Alter view' => 'Zmeniť pohľad',
'Create view' => 'Vytvoriť pohľad',
'Name' => 'Názov',
'Process list' => 'Zoznam procesov',
'%d process(es) has been killed.' => array('Bol ukončený %d proces.', 'Boli ukončené %d procesy.', 'Bolo ukončených %d procesov.'),
'Kill' => 'Ukončiť',
'IN-OUT' => 'IN-OUT',
'Parameter name' => 'Názov parametra',
'Database schema' => 'Schéma databázy',
'Create procedure' => 'Vytvoriť procedúru',
'Create function' => 'Vytvoriť funkciu',
'Routine has been dropped.' => 'Procedúra bola odstránená.',
'Routine has been altered.' => 'Procedúra bola zmenená.',
'Routine has been created.' => 'Procedúra bola vytvorená.',
'Alter function' => 'Zmeniť funkciu',
'Alter procedure' => 'Zmeniť procedúru',
'Return type' => 'Návratový typ',
'Add trigger' => 'Pridať trigger',
'Trigger has been dropped.' => 'Trigger bol odstránený.',
'Trigger has been altered.' => 'Trigger bol zmenený.',
'Trigger has been created.' => 'Trigger bol vytvorený.',
'Alter trigger' => 'Zmeniť trigger',
'Create trigger' => 'Vytvoriť trigger',
'Time' => 'Čas',
'Event' => 'Udalosť',
'MySQL version: %s through PHP extension %s' => 'Verzia MySQL: %s cez PHP rozšírenie %s',
'%d row(s)' => array('%d riadok', '%d riadky', '%d riadkov'),
'~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'Pri zmene aktuálny čas',
'Remove' => 'Odobrať',
'Are you sure?' => 'Naozaj?',
'Privileges' => 'Oprávnenia',
'Create user' => 'Vytvoriť používateľa',
'User has been dropped.' => 'Používateľ bol odstránený.',
'User has been altered.' => 'Používateľ bol zmenený.',
'User has been created.' => 'Používateľ bol vytvorený.',
'Hashed' => 'Zahašované',
'Column' => 'Stĺpec',
'Routine' => 'Procedúra',
'Grant' => 'Povoliť',
'Revoke' => 'Zakázať',
'Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.' => 'Príliš veľké POST dáta. Zmenšite dáta alebo zvýšte hodnotu konfiguračej direktívy "post_max_size".',
'Logged as: %s' => 'Prihlásený ako: %s',
'Move up' => 'Presunúť hore',
'Move down' => 'Presunúť dolu',
'Functions' => 'Funkcie',
'Aggregation' => 'Agregácia',
'Export' => 'Export',
'Output' => 'Výstup',
'open' => 'otvoriť',
'save' => 'uložiť',
'Format' => 'Formát',
'SQL' => 'SQL',
'CSV' => 'CSV',
'Tables' => 'Tabuľky',
'Data' => 'Dáta',
'Event has been dropped.' => 'Udalosť bola odstránená.',
'Event has been altered.' => 'Udalosť bola zmenená.',
'Event has been created.' => 'Udalosť bola vytvorená.',
'Alter event' => 'Upraviť udalosť',
'Create event' => 'Vytvoriť udalosť',
'At given time' => 'V stanovený čas',
'Every' => 'Každých',
'Events' => 'Udalosti',
'Schedule' => 'Plán',
'Start' => 'Začiatok',
'End' => 'Koniec',
'Status' => 'Stav',
'On completion preserve' => 'Po dokončení zachovat',
'Save and continue edit' => 'Uložiť a pokračovať v úpravách',
'original' => 'originál',
'Tables have been truncated.' => 'Tabuľka bola vyprázdnená',
'Tables have been moved.' => 'Tabuľka bola presunutá',
'Tables have been dropped.' => 'Tabuľka bola odstránená',
'Tables and views' => 'Tabuľky a pohľady',
'Engine' => 'Typ',
'Collation' => 'Porovnávanie',
'Data Length' => 'Veľkosť dát',
'Index Length' => 'Veľkosť indexu',
'Data Free' => 'Voľné miesto',
'Rows' => 'Riadky',
',' => ' ',
'Analyze' => 'Analyzovať',
'Optimize' => 'Optimalizovať',
'Check' => 'Skontrolovať',
'Repair' => 'Opraviť',
'Truncate' => 'Vyprázdniť',
'Move to other database' => 'Presunúť do inej databázy',
'Move' => 'Presunúť',
'%d item(s) have been affected.' => '%d položiek bolo ovplyvnených.',
'whole result' => 'celý výsledok',
'clone' => 'klonovať',
'Clone' => 'Klonovať',
'Partition by' => 'Rozdeliť podľa',
'Partitions' => 'Oddiely',
'Partition name' => 'Názov oddielu',
'Values' => 'Hodnoty',
'%d row(s) has been imported.' => array('Bol importovaný %d záznam.', 'Boli importované %d záznamy.', 'Bolo importovaných %d záznamov.'),
'CSV Import' => 'Import CSV',
'Import' => 'Import',
'Table structure' => 'Štruktúra tabuľky',
'Select table' => 'Vypísať tabuľku',
'Stop on error' => 'Zastaviť pri chybe',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Bol prekročený maximálny počet povolených polí. Zvýšte prosím %s a %s.',
'(anywhere)' => '(kdekoľvek)',
'%.3f s' => '%.3f s',
);

217
adminer/lang/zh.inc.php Normal file
View File

@@ -0,0 +1,217 @@
<?php
$translations = array(
'Login' => '登录',
'Adminer' => 'Adminer',
'Logout successful.' => '注销成功。',
'Invalid credentials.' => '无效凭据。',
'Server' => '服务器',
'Username' => '用户名',
'Password' => '密码',
'Select database' => '选择数据库',
'Invalid database.' => '无效数据库。',
'Create new database' => '创建新数据库',
'Table has been dropped.' => '已丢弃表。',
'Table has been altered.' => '已更改表。',
'Table has been created.' => '已创建表。',
'Alter table' => '更改表',
'Create table' => '创建表',
'Table name' => '表名',
'engine' => '引擎',
'collation' => '校对',
'Column name' => '列名',
'Type' => '类型',
'Length' => '长度',
'NULL' => 'NULL',
'Auto Increment' => '自动增量',
'Options' => '选项',
'Save' => '保存',
'Drop' => '丢弃',
'Database has been dropped.' => '已丢弃数据库。',
'Database has been created.' => '已创建数据库。',
'Database has been renamed.' => '已重命名数据库。',
'Database has been altered.' => '已更改数据库。',
'Alter database' => '更改数据库',
'Create database' => '创建数据库',
'SQL command' => 'SQL命令',
'Dump' => '导入/导出',
'Logout' => '注销',
'database' => '数据库',
'Use' => '使用',
'No tables.' => '没有表。',
'select' => '选择',
'Create new table' => '创建新表',
'Item has been deleted.' => '已删除项目。',
'Item has been updated.' => '已更新项目。',
'Item has been inserted.' => '已插入项目。',
'Edit' => '编辑',
'Insert' => '插入',
'Save and insert next' => '保存并插入下一个',
'Delete' => '删除',
'Database' => '数据库',
'Routines' => '子程序',
'Indexes has been altered.' => '已更改索引。',
'Indexes' => '索引',
'Alter indexes' => '更改索引',
'Add next' => '添加下一个',
'Language' => '语言',
'Select' => '选择',
'New item' => '新建项',
'Search' => '搜索',
'Sort' => '排序',
'DESC' => '降序',
'Limit' => '限定',
'No rows.' => '没有行。',
'Action' => '动作',
'edit' => '编辑',
'Page' => '页面',
'Query executed OK, %d row(s) affected.' => '执行查询OK%d 行受影响',
'Error in query' => '查询出错',
'Execute' => '执行',
'Table' => '表',
'Foreign keys' => '外键',
'Triggers' => '触发器',
'View' => '视图',
'Unable to select the table' => '不能选择该表',
'Invalid CSRF token. Send the form again.' => '无效 CSRF 令牌。重新发送表单。',
'Comment' => '注释',
'Default values has been set.' => '默认值已设置。',
'Default values' => '默认值',
'BOOL' => 'BOOL',
'Show column comments' => '显示列注释',
'%d byte(s)' => '%d 字节',
'No commands to execute.' => '没有命令执行。',
'Unable to upload a file.' => '不能上传文件。',
'File upload' => '文件上传',
'File uploads are disabled.' => '文件上传被禁用。',
'Routine has been called, %d row(s) affected.' => '子程序被调用,%d 行被影响',
'Call' => '调用',
'No MySQL extension' => '没有MySQL扩展',
'None of supported PHP extensions (%s) are available.' => '没有支持的 PHP 扩展可用(%s。',
'Sessions must be enabled.' => '会话必须被启用。',
'Session expired, please login again.' => '会话已过期,请重新登录。',
'Text length' => '文本长度',
'Foreign key has been dropped.' => '已删除外键。',
'Foreign key has been altered.' => '已更改外键。',
'Foreign key has been created.' => '已创建外键。',
'Foreign key' => '外键',
'Target table' => '目标表',
'Change' => '更改',
'Source' => '源',
'Target' => '目标',
'Add column' => '增加列',
'Alter' => '更改',
'Add foreign key' => '添加外键',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => '索引类型',
'Column (length)' => '列(长度)',
'View has been dropped.' => '已丢弃视图。',
'View has been altered.' => '已更改视图。',
'View has been created.' => '已创建视图。',
'Alter view' => '更改视图',
'Create view' => '创建视图',
'Name' => '名称',
'Process list' => '进程列表',
'%d process(es) has been killed.' => '%d 个进程被终止',
'Kill' => '终止',
'IN-OUT' => 'IN-OUT',
'Parameter name' => '参数名',
'Database schema' => '数据库概要',
'Create procedure' => '创建过程',
'Create function' => '创建函数',
'Routine has been dropped.' => '已丢弃子程序。',
'Routine has been altered.' => '已更改子程序。',
'Routine has been created.' => '已创建子程序。',
'Alter function' => '更改函数',
'Alter procedure' => '更改过程',
'Return type' => '返回类型',
'Add trigger' => '创建触发器',
'Trigger has been dropped.' => '已丢弃触发器。',
'Trigger has been altered.' => '已更改触发器。',
'Trigger has been created.' => '已创建触发器。',
'Alter trigger' => '更改触发器',
'Create trigger' => '创建触发器',
'Time' => '时间',
'Event' => '事件',
'MySQL version: %s through PHP extension %s' => 'MySQL 版本:%s 通过 PHP 扩展 %s',
'%d row(s)' => '%d 行',
'~ %s' => '~ %s',
'ON UPDATE CURRENT_TIMESTAMP' => 'ON UPDATE CURRENT_TIMESTAMP',
'Remove' => '移除',
'Are you sure?' => '你确定吗?',
'Privileges' => '权限',
'Create user' => '创建用户',
'User has been dropped.' => '已丢弃用户。',
'User has been altered.' => '已更改用户。',
'User has been created.' => '已创建用户。',
'Hashed' => 'Hashed',
'Column' => '列',
'Routine' => '子程序',
'Grant' => '授权',
'Revoke' => '废除',
'Logged as: %s' => '登录为:%s',
'Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.' => '太大的 POST 数据。减少数据或者增加 “post_max_size” 配置命令。',
'Move up' => '上移',
'Move down' => '下移',
'Export' => '导出',
'Tables' => '表',
'Data' => '数据',
'Output' => '输出',
'open' => '打开',
'save' => '保存',
'Format' => '格式',
'SQL' => 'SQL',
'CSV' => 'CVS',
'Functions' => '函数',
'Aggregation' => '集合',
'Event has been dropped.' => '已丢弃事件。',
'Event has been altered.' => '已更改事件。',
'Event has been created.' => '已创建事件。',
'Alter event' => '更改事件',
'Create event' => '创建事件',
'Start' => '开始',
'End' => '结束',
'Every' => '每',
'Status' => '状态',
'On completion preserve' => '完成后保存',
'Events' => '事件',
'Schedule' => '调度',
'At given time' => '在指定时间',
'Tables have been truncated.' => '已清空表。',
'Tables have been moved.' => '已转移表。',
'Tables and views' => '表和视图',
'Engine' => '引擎',
'Collation' => '校对',
'Data Length' => '数据长度',
'Index Length' => '索引长度',
'Data Free' => '数据空闲',
'Rows' => '行数',
',' => ',',
'Analyze' => '分析',
'Optimize' => '优化',
'Check' => '检查',
'Repair' => '修复',
'Truncate' => '清空',
'Move to other database' => '转移到其它数据库',
'Move' => '转移',
'Save and continue edit' => '保存并继续编辑',
'original' => '原始',
'%d item(s) have been affected.' => '%d 个项目受到影响。',
'whole result' => '所有结果',
'clone' => '克隆',
'Tables have been dropped.' => '已丢弃表。',
'Clone' => '克隆',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => '超过最大允许的域的值。请增加 %s 和 %s 。',
'Partition by' => '分区类型',
'Partitions' => '分区',
'Partition name' => '分区名',
'Values' => '值',
'%d row(s) has been imported.' => '%d 行已导入。',
'Table structure' => '表结构',
'(anywhere)' => '(任意位置)',
'CSV Import' => 'CSV 导入',
'Import' => '导入',
'Stop on error' => '出错时停止',
'Select table' => '选择表',
'%.3f s' => '%.3f s',
);

BIN
adminer/plus.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 B

View File

@@ -0,0 +1,23 @@
<?php
page_header(lang('Privileges'));
echo '<p><a href="' . htmlspecialchars($SELF) . 'user=">' . lang('Create user') . "</a></p>";
$result = $dbh->query("SELECT User, Host FROM mysql.user ORDER BY Host, User");
if (!$result) {
?>
<form action=""><p>
<?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /><?php } ?>
<?php echo lang('Username'); ?>: <input name="user" />
<?php echo lang('Server'); ?>: <input name="host" value="localhost" />
<input type="hidden" name="grant" value="" />
<input type="submit" value="<?php echo lang('Edit'); ?>" />
</p></form>
<?php
$result = $dbh->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
}
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>&nbsp;</th><th>" . lang('Username') . "</th><th>" . lang('Server') . "</th></tr></thead>\n";
while ($row = $result->fetch_assoc()) {
echo '<tr' . odd() . '><td><a href="' . htmlspecialchars($SELF) . 'user=' . urlencode($row["User"]) . '&amp;host=' . urlencode($row["Host"]) . '">' . lang('edit') . '</a></td><td>' . htmlspecialchars($row["User"]) . "</td><td>" . htmlspecialchars($row["Host"]) . "</td></tr>\n";
}
echo "</table>\n";
$result->free();

52
adminer/procedure.inc.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
$routine = (isset($_GET["function"]) ? "FUNCTION" : "PROCEDURE");
$dropped = false;
if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] && !$_POST["down"]) {
if (strlen($_GET["procedure"])) {
$dropped = query_redirect("DROP $routine " . idf_escape($_GET["procedure"]), substr($SELF, 0, -1), lang('Routine has been dropped.'), $_POST["drop"], !$_POST["dropped"]);
}
if (!$_POST["drop"]) {
$set = array();
$fields = array_filter((array) $_POST["fields"], 'strlen');
ksort($fields);
foreach ($fields as $field) {
if (strlen($field["field"])) {
$set[] = (in_array($field["inout"], $inout) ? "$field[inout] " : "") . idf_escape($field["field"]) . process_type($field, "CHARACTER SET");
}
}
query_redirect("CREATE $routine " . idf_escape($_POST["name"])
. " (" . implode(", ", $set) . ")"
. (isset($_GET["function"]) ? " RETURNS" . process_type($_POST["returns"], "CHARACTER SET") : "")
. "\n$_POST[definition]"
, substr($SELF, 0, -1), (strlen($_GET["procedure"]) ? lang('Routine has been altered.') : lang('Routine has been created.')));
}
}
page_header((strlen($_GET["procedure"]) ? (isset($_GET["function"]) ? lang('Alter function') : lang('Alter procedure')) . ": " . htmlspecialchars($_GET["procedure"]) : (isset($_GET["function"]) ? lang('Create function') : lang('Create procedure'))), $error);
$collations = get_vals("SHOW CHARACTER SET");
$row = array("fields" => array());
if ($_POST) {
$row = $_POST;
$row["fields"] = (array) $row["fields"];
process_fields($row["fields"]);
} elseif (strlen($_GET["procedure"])) {
$row = routine($_GET["procedure"], $routine);
$row["name"] = $_GET["procedure"];
}
?>
<form action="" method="post" id="form">
<table cellspacing="0">
<?php edit_fields($row["fields"], $collations, $routine); ?>
<?php if (isset($_GET["function"])) { ?><tr><td><?php echo lang('Return type'); ?></td><?php echo edit_type("returns", $row["returns"], $collations); ?></tr><?php } ?>
</table>
<p><textarea name="definition" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["definition"]); ?></textarea></p>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<?php if ($dropped) { ?><input type="hidden" name="dropped" value="1" /><?php } ?>
<?php echo lang('Name'); ?>: <input name="name" value="<?php echo htmlspecialchars($row["name"]); ?>" maxlength="64" />
<input type="submit" value="<?php echo lang('Save'); ?>" />
<?php if (strlen($_GET["procedure"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
</p>
</form>

View File

@@ -0,0 +1,31 @@
<?php
if ($_POST && !$error) {
$killed = 0;
foreach ((array) $_POST["kill"] as $val) {
if (queries("KILL " . intval($val))) {
$killed++;
}
}
query_redirect(queries(), $SELF . "processlist=", lang('%d process(es) has been killed.', $killed), $killed || !$_POST["kill"], false, !$killed && $_POST["kill"]);
}
page_header(lang('Process list'), $error);
?>
<form action="" method="post">
<table cellspacing="0">
<?php
$result = $dbh->query("SHOW PROCESSLIST");
for ($i=0; $row = $result->fetch_assoc(); $i++) {
if (!$i) {
echo "<thead><tr lang='en'><th>&nbsp;</th><th>" . implode("</th><th>", array_keys($row)) . "</th></tr></thead>\n";
}
echo "<tr" . odd() . "><td><input type='checkbox' name='kill[]' value='$row[Id]' /></td><td>" . implode("</td><td>", $row) . "</td></tr>\n";
}
$result->free();
?>
</table>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Kill'); ?>" />
</p>
</form>

113
adminer/schema.inc.php Normal file
View File

@@ -0,0 +1,113 @@
<?php
page_header(lang('Database schema'), "", array(), $_GET["db"]);
$table_pos = array();
$table_pos_js = array();
preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~', $_COOKIE["schema"], $matches, PREG_SET_ORDER); //! ':' in table name
foreach ($matches as $i => $match) {
$table_pos[$match[1]] = array($match[2], $match[3]);
$table_pos_js[] = "\n\t'" . addcslashes($match[1], "\r\n'\\") . "': [ $match[2], $match[3] ]";
}
$top = 0;
$base_left = -1;
$schema = array();
$referenced = array();
$lefts = array();
$result = $dbh->query("SHOW TABLE STATUS");
while ($row = $result->fetch_assoc()) {
if (!isset($row["Engine"])) { // view
continue;
}
$pos = 0;
$schema[$row["Name"]]["fields"] = array();
foreach (fields($row["Name"]) as $name => $field) {
$pos += 1.25;
$field["pos"] = $pos;
$schema[$row["Name"]]["fields"][$name] = $field;
}
$schema[$row["Name"]]["pos"] = ($table_pos[$row["Name"]] ? $table_pos[$row["Name"]] : array($top, 0));
if ($row["Engine"] == "InnoDB") {
foreach (foreign_keys($row["Name"]) as $val) {
if (!$val["db"]) {
$left = $base_left;
if ($table_pos[$row["Name"]][1] || $table_pos[$row["Name"]][1]) {
$left = min($table_pos[$row["Name"]][1], $table_pos[$val["table"]][1]) - 1;
} else {
$base_left -= .1;
}
while ($lefts[(string) $left]) {
$left -= .0001;
}
$schema[$row["Name"]]["references"][$val["table"]][(string) $left] = array($val["source"], $val["target"]);
$referenced[$val["table"]][$row["Name"]][(string) $left] = $val["target"];
$lefts[(string) $left] = true;
}
}
}
$top = max($top, $schema[$row["Name"]]["pos"][0] + 2.5 + $pos);
}
$result->free();
?>
<div id="schema" style="height: <?php echo $top; ?>em;">
<script type="text/javascript">
table_pos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
em = document.getElementById('schema').offsetHeight / <?php echo $top; ?>;
document.onmousemove = schema_mousemove;
document.onmouseup = schema_mouseup;
</script>
<?php
foreach ($schema as $name => $table) {
echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;' onmousedown='schema_mousedown(this, event);'>";
echo '<a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($name) . '"><strong>' . htmlspecialchars($name) . "</strong></a><br />\n";
foreach ($table["fields"] as $field) {
$val = htmlspecialchars($field["field"]);
if (preg_match('~char|text~', $field["type"])) {
$val = "<span class='char'>$val</span>";
} elseif (preg_match('~date|time|year~', $field["type"])) {
$val = "<span class='date'>$val</span>";
} elseif (preg_match('~binary|blob~', $field["type"])) {
$val = "<span class='binary'>$val</span>";
} elseif (preg_match('~enum|set~', $field["type"])) {
$val = "<span class='enum'>$val</span>";
}
echo ($field["primary"] ? "<em>$val</em>" : $val) . "<br />\n";
}
foreach ((array) $table["references"] as $target_name => $refs) {
foreach ($refs as $left => $ref) {
$left1 = $left - $table_pos[$name][1];
$i = 0;
foreach ($ref[0] as $source) {
echo '<div class="references" title="' . htmlspecialchars($target_name) . "\" id='refs$left-" . ($i++) . "' style='left: $left1" . "em; top: " . $table["fields"][$source]["pos"] . "em; padding-top: .5em;'><div style='border-top: 1px solid Gray; width: " . (-$left1) . "em;'></div></div>\n";
}
}
}
foreach ((array) $referenced[$name] as $target_name => $refs) {
foreach ($refs as $left => $columns) {
$left1 = $left - $table_pos[$name][1];
$i = 0;
foreach ($columns as $target) {
echo '<div class="references" title="' . htmlspecialchars($target_name) . "\" id='refd$left-" . ($i++) . "' style='left: $left1" . "em; top: " . $table["fields"][$target]["pos"] . "em; height: 1.25em; background: url(arrow.gif) no-repeat right center;'><div style='height: .5em; border-bottom: 1px solid Gray; width: " . (-$left1) . "em;'></div></div>\n";
}
}
}
echo "</div>\n";
}
foreach ($schema as $name => $table) {
foreach ((array) $table["references"] as $target_name => $refs) {
foreach ($refs as $left => $ref) {
$min_pos = $top;
$max_pos = -10;
foreach ($ref[0] as $key => $source) {
$pos1 = $table["pos"][0] + $table["fields"][$source]["pos"];
$pos2 = $schema[$target_name]["pos"][0] + $schema[$target_name]["fields"][$ref[1][$key]]["pos"];
$min_pos = min($min_pos, $pos1, $pos2);
$max_pos = max($max_pos, $pos1, $pos2);
}
echo "<div class='references' id='refl$left' style='left: $left" . "em; top: $min_pos" . "em; padding: .5em 0;' /><div style='border-right: 1px solid Gray; margin-top: 1px; height: " . ($max_pos - $min_pos) . "em;'></div></div>\n";
}
}
}
?>
</div>

306
adminer/select.inc.php Normal file
View File

@@ -0,0 +1,306 @@
<?php
$functions = array("char_length", "from_unixtime", "hex", "lower", "round", "sec_to_time", "time_to_sec", "unix_timestamp", "upper");
$grouping = array("avg", "count", "distinct", "group_concat", "max", "min", "sum");
$table_status = table_status($_GET["select"]);
$indexes = indexes($_GET["select"]);
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL");
if (eregi('^(MyISAM|Maria)$', $table_status["Engine"])) {
$operators[] = "AGAINST";
}
$fields = fields($_GET["select"]);
$rights = array();
$columns = array();
unset($text_length);
foreach ($fields as $key => $field) {
if (isset($field["privileges"]["select"])) {
$columns[] = $key;
if (preg_match('~text|blob~', $field["type"])) {
$text_length = (isset($_GET["text_length"]) ? $_GET["text_length"] : "100");
}
}
$rights += $field["privileges"];
}
$select = array();
$group = array();
foreach ((array) $_GET["columns"] as $key => $val) {
if ($val["fun"] == "count" || (in_array($val["col"], $columns, true) && (!$val["fun"] || in_array($val["fun"], $functions) || in_array($val["fun"], $grouping)))) {
$select[$key] = (in_array($val["col"], $columns, true) ? (!$val["fun"] ? idf_escape($val["col"]) : ($val["fun"] == "distinct" ? "COUNT(DISTINCT " : strtoupper("$val[fun](")) . idf_escape($val["col"]) . ")") : "COUNT(*)");
if (!in_array($val["fun"], $grouping)) {
$group[] = $select[$key];
}
}
}
$where = array();
foreach ($indexes as $i => $index) {
if ($index["type"] == "FULLTEXT" && strlen($_GET["fulltext"][$i])) {
$where[] = "MATCH (" . implode(", ", array_map('idf_escape', $index["columns"])) . ") AGAINST ('" . $dbh->escape_string($_GET["fulltext"][$i]) . "'" . (isset($_GET["boolean"][$i]) ? " IN BOOLEAN MODE" : "") . ")";
}
}
foreach ((array) $_GET["where"] as $val) {
if (strlen("$val[col]$val[val]") && in_array($val["op"], $operators)) {
if ($val["op"] == "AGAINST") {
$where[] = "MATCH (" . idf_escape($val["col"]) . ") AGAINST ('" . $dbh->escape_string($val["val"]) . "' IN BOOLEAN MODE)";
} elseif (ereg('IN$', $val["op"]) && !strlen($in = process_length($val["val"]))) {
$where[] = "0";
} else {
$cond = " $val[op]" . (ereg('NULL$', $val["op"]) ? "" : (ereg('IN$', $val["op"]) ? " ($in)" : " '" . $dbh->escape_string($val["val"]) . "'")); //! this searches in numeric values too
if (strlen($val["col"])) {
$where[] = idf_escape($val["col"]) . $cond;
} else {
$cols = array();
foreach ($fields as $name => $field) {
if (is_numeric($val["val"]) || !ereg('int|float|double|decimal', $field["type"])) {
$cols[] = $name;
}
}
$where[] = ($cols ? "(" . implode("$cond OR ", array_map('idf_escape', $cols)) . "$cond)" : "0");
}
}
}
}
$order = array();
foreach ((array) $_GET["order"] as $key => $val) {
if (in_array($val, $columns, true) || in_array($val, $select, true)) {
$order[] = idf_escape($val) . (isset($_GET["desc"][$key]) ? " DESC" : "");
}
}
$limit = (isset($_GET["limit"]) ? $_GET["limit"] : "30");
$from = "FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : "") . ($group && count($group) < count($select) ? " GROUP BY " . implode(", ", $group) : "") . ($order ? " ORDER BY " . implode(", ", $order) : "") . (strlen($limit) ? " LIMIT " . intval($limit) . (intval($_GET["page"]) ? " OFFSET " . ($limit * $_GET["page"]) : "") : "");
if ($_POST && !$error) {
if ($_POST["export"]) {
dump_headers($_GET["select"]);
dump_table($_GET["select"], "");
$query = "SELECT " . ($select ? implode(", ", $select) : "*") . " FROM " . idf_escape($_GET["select"]);
if (is_array($_POST["check"])) {
foreach ($_POST["check"] as $val) {
dump_data($_GET["select"], "INSERT", "$query WHERE " . implode(" AND ", where_check($val)) . " LIMIT 1");
}
} else {
dump_data($_GET["select"], "INSERT", $query . ($where ? " WHERE " . implode(" AND ", $where) : ""));
}
exit;
}
if (!$_POST["import"]) { // edit
$result = true;
$affected = 0;
$command = ($_POST["delete"] ? ($_POST["all"] && !$where ? "TRUNCATE " : "DELETE FROM ") : ($_POST["clone"] ? "INSERT INTO " : "UPDATE ")) . idf_escape($_GET["select"]);
if (!$_POST["delete"]) {
$set = array();
foreach ($fields as $name => $field) {
$val = process_input($name, $field);
if ($_POST["clone"]) {
$set[] = ($val !== false ? $val : idf_escape($name));
} elseif ($val !== false) {
$set[] = "\n" . idf_escape($name) . " = $val";
}
}
$command .= ($_POST["clone"] ? "\nSELECT " . implode(", ", $set) . " FROM " . idf_escape($_GET["select"]) : " SET" . implode(",", $set));
}
if (!$_POST["delete"] && !$set) {
// nothing
} elseif ($_POST["all"]) {
$result = queries($command . ($where ? " WHERE " . implode(" AND ", $where) : ""));
$affected = $dbh->affected_rows;
} else {
foreach ((array) $_POST["check"] as $val) {
parse_str($val, $check);
$result = queries($command . " WHERE " . implode(" AND ", where($check)) . " LIMIT 1");
if (!$result) {
break;
}
$affected += $dbh->affected_rows;
}
}
query_redirect(queries(), remove_from_uri("page"), lang('%d item(s) have been affected.', $affected), $result, false, !$result);
//! display edit page in case of an error
} elseif (is_string($file = get_file("csv_file"))) {
$file = preg_replace("~^\xEF\xBB\xBF~", '', $file); //! character set
$cols = "";
$rows = array(); //! packet size
preg_match_all('~("[^"]*"|[^"\\n]+)+~', $file, $matches);
foreach ($matches[0] as $key => $val) {
$row = array();
preg_match_all('~(("[^"]*")+|[^,]*),~', "$val,", $matches2);
if (!$key && !array_diff($matches2[1], array_keys($fields))) { //! doesn't work with column names containing ",\n
$cols = " (" . implode(", ", array_map('idf_escape', $matches2[1])) . ")";
} else {
foreach ($matches2[1] as $col) {
$row[] = (!strlen($col) ? "NULL" : "'" . $dbh->escape_string(str_replace('""', '"', preg_replace('~^".*"$~s', '', $col))) . "'");
}
$rows[] = "(" . implode(", ", $row) . ")";
}
}
$result = queries("INSERT INTO " . idf_escape($_GET["select"]) . "$cols VALUES " . implode(", ", $rows));
query_redirect(queries(), remove_from_uri("page"), lang('%d row(s) has been imported.', $dbh->affected_rows), $result, false, !$result);
} else {
$error = lang('Unable to upload a file.');
}
}
page_header(lang('Select') . ": " . htmlspecialchars($_GET["select"]), $error);
echo "<p>";
if (isset($rights["insert"])) {
//! pass search values forth and back
echo '<a href="' . htmlspecialchars($SELF) . 'edit=' . urlencode($_GET['select']) . '">' . lang('New item') . '</a> ';
}
echo '<a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($_GET['select']) . '">' . lang('Table structure') . '</a>';
echo "</p>\n";
if (!$columns) {
echo "<p class='error'>" . lang('Unable to select the table') . ($fields ? "" : ": " . htmlspecialchars($dbh->error)) . ".</p>\n";
} else {
echo "<form action='' id='form'>\n";
echo "<fieldset><legend>" . lang('Select') . "</legend>\n";
if (strlen($_GET["server"])) {
echo '<input type="hidden" name="server" value="' . htmlspecialchars($_GET["server"]) . '" />';
}
echo '<input type="hidden" name="db" value="' . htmlspecialchars($_GET["db"]) . '" />';
echo '<input type="hidden" name="select" value="' . htmlspecialchars($_GET["select"]) . '" />';
echo "\n";
$i = 0;
$fun_group = array(lang('Functions') => $functions, lang('Aggregation') => $grouping);
foreach ($select as $key => $val) {
$val = $_GET["columns"][$key];
echo "<div><select name='columns[$i][fun]'><option></option>" . optionlist($fun_group, $val["fun"]) . "</select>";
echo "<select name='columns[$i][col]'><option></option>" . optionlist($columns, $val["col"]) . "</select></div>\n";
$i++;
}
echo "<div><select name='columns[$i][fun]' onchange='this.nextSibling.onchange();'><option></option>" . optionlist($fun_group) . "</select>";
echo "<select name='columns[$i][col]' onchange='select_add_row(this);'><option></option>" . optionlist($columns) . "</select></div>\n";
echo "</fieldset>\n";
echo "<fieldset><legend>" . lang('Search') . "</legend>\n";
foreach ($indexes as $i => $index) {
if ($index["type"] == "FULLTEXT") {
echo "(<i>" . implode("</i>, <i>", array_map('htmlspecialchars', $index["columns"])) . "</i>) AGAINST";
echo ' <input name="fulltext[' . $i . ']" value="' . htmlspecialchars($_GET["fulltext"][$i]) . '" />';
echo "<label><input type='checkbox' name='boolean[$i]' value='1'" . (isset($_GET["boolean"][$i]) ? " checked='checked'" : "") . " />" . lang('BOOL') . "</label>";
echo "<br />\n";
}
}
$i = 0;
foreach ((array) $_GET["where"] as $val) {
if (strlen("$val[col]$val[val]") && in_array($val["op"], $operators)) {
echo "<div><select name='where[$i][col]'><option value=''>" . lang('(anywhere)') . "</option>" . optionlist($columns, $val["col"]) . "</select>";
echo "<select name='where[$i][op]' onchange='where_change(this);'>" . optionlist($operators, $val["op"]) . "</select>";
echo "<input name='where[$i][val]' value=\"" . htmlspecialchars($val["val"]) . '"' . (ereg('NULL$', $val["op"]) ? " class='hidden'" : "") . " /></div>\n";
$i++;
}
}
echo "<div><select name='where[$i][col]' onchange='select_add_row(this);'><option value=''>" . lang('(anywhere)') . "</option>" . optionlist($columns) . "</select>";
echo "<select name='where[$i][op]' onchange='where_change(this);'>" . optionlist($operators) . "</select>";
echo "<input name='where[$i][val]' /></div>\n";
echo "</fieldset>\n";
echo "<fieldset><legend>" . lang('Limit') . "</legend><div>";
echo hidden_fields(array("order" => (array) $_GET["order"], "desc" => (array) $_GET["desc"]));
echo "<input name='limit' size='3' value=\"" . htmlspecialchars($limit) . "\" /></div></fieldset>\n";
if (isset($text_length)) {
echo "<fieldset><legend>" . lang('Text length') . "</legend><div><input name='text_length' size='3' value=\"" . htmlspecialchars($text_length) . "\" /></div></fieldset>\n";
}
echo "<fieldset><legend>" . lang('Action') . "</legend><div><input type='submit' value='" . lang('Select') . "' /></div></fieldset>\n";
echo "</form>\n";
$query = "SELECT " . ($select ? (count($group) < count($select) ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) : "*") . " $from";
echo "<p><code class='jush-sql'>" . htmlspecialchars($query) . "</code> <a href='" . htmlspecialchars($SELF) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a></p>\n";
$result = $dbh->query($query);
if (!$result) {
echo "<p class='error'>" . htmlspecialchars($dbh->error) . "</p>\n";
} else {
echo "<form action='' method='post' enctype='multipart/form-data'>\n";
if (!$result->num_rows) {
echo "<p class='message'>" . lang('No rows.') . "</p>\n";
} else {
$foreign_keys = array();
foreach (foreign_keys($_GET["select"]) as $foreign_key) {
foreach ($foreign_key["source"] as $val) {
$foreign_keys[$val][] = $foreign_key;
}
}
echo "<table cellspacing='0' class='nowrap'>\n";
for ($j=0; $row = $result->fetch_assoc(); $j++) {
if (!$j) {
echo '<thead><tr><td><input type="checkbox" id="all-page" onclick="form_check(this, /check/);" /></td>';
foreach ($row as $key => $val) {
$pos = array_search($key, (array) $_GET["order"]);
$uri = remove_from_uri($pos !== false ? "(order|desc)%5B$pos%5D" : "");
$pos2 = 0;
if ($_GET["order"]) {
$pos2 = max(array_keys($_GET["order"]));
$pos2 += ($pos2 !== $pos ? 1 : 0);
}
echo '<th onmouseover="popup(this);" onmouseout="popdown(this);"><a href="' . htmlspecialchars(remove_from_uri('(order|desc)[^=]*') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"] == array($key) && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '">' . htmlspecialchars($key) . '</a><span class="hidden">';
echo '<a href="' . htmlspecialchars("$uri&order%5B$pos2%5D=" . urlencode($key)) . "\"><img src='up.gif' alt='^' title='" . lang('ASC') . "' /></a>";
echo '<a href="' . htmlspecialchars("$uri&order%5B$pos2%5D=" . urlencode($key) . "&desc%5B$pos2%5D=1") . "\"><img src='down.gif' alt='v' title='" . lang('DESC') . "' /></a>";
echo '</span></th>';
}
echo "</tr></thead>\n";
}
$unique_idf = implode('&amp;', unique_idf($row, $indexes));
echo '<tr' . odd() . '><td><input type="checkbox" name="check[]" value="' . $unique_idf . '" onclick="this.form[\'all\'].checked = false; form_uncheck(\'all-page\');" />' . (count($select) == count($group) && $_GET["db"] != "information_schema" ? ' <a href="' . htmlspecialchars($SELF) . 'edit=' . urlencode($_GET['select']) . '&amp;' . $unique_idf . '">' . lang('edit') . '</a></td>' : '');
foreach ($row as $key => $val) {
if (!isset($val)) {
$val = "<i>NULL</i>";
} elseif (preg_match('~blob|binary~', $fields[$key]["type"]) && !is_utf8($val)) {
$val = '<a href="' . htmlspecialchars($SELF) . 'download=' . urlencode($_GET["select"]) . '&amp;field=' . urlencode($key) . '&amp;' . $unique_idf . '">' . lang('%d byte(s)', strlen($val)) . '</a>';
} else {
if (!strlen(trim($val))) {
$val = "&nbsp;";
} elseif (intval($text_length) > 0 && preg_match('~blob|text~', $fields[$key]["type"])) {
$val = shorten_utf8($val, intval($text_length));
} else {
$val = nl2br(htmlspecialchars($val));
if ($fields[$key]["type"] == "char") {
$val = "<code>$val</code>";
}
}
foreach ((array) $foreign_keys[$key] as $foreign_key) {
if (count($foreign_keys[$key]) == 1 || count($foreign_key["source"]) == 1) {
$val = "\">$val</a>";
foreach ($foreign_key["source"] as $i => $source) {
$val = "&amp;where%5B$i%5D%5Bcol%5D=" . urlencode($foreign_key["target"][$i]) . "&amp;where%5B$i%5D%5Bop%5D=%3D&amp;where%5B$i%5D%5Bval%5D=" . urlencode($row[$source]) . $val;
}
$val = '<a href="' . htmlspecialchars(strlen($foreign_key["db"]) ? preg_replace('~([?&]db=)[^&]+~', '\\1' . urlencode($foreign_key["db"]), $SELF) : $SELF) . 'select=' . htmlspecialchars($foreign_key["table"]) . $val; // InnoDB supports non-UNIQUE keys
break;
}
}
}
echo "<td>$val</td>";
}
echo "</tr>\n";
}
echo "</table>\n";
echo "<p>";
$found_rows = (intval($limit) ? $dbh->result($dbh->query(count($group) < count($select) ? " SELECT FOUND_ROWS()" : "SELECT COUNT(*) FROM " . idf_escape($_GET["select"]) . ($where ? " WHERE " . implode(" AND ", $where) : ""))) : $result->num_rows);
if (intval($limit) && $found_rows > $limit) {
$max_page = floor(($found_rows - 1) / $limit);
echo lang('Page') . ":";
print_page(0);
if ($_GET["page"] > 3) {
echo " ...";
}
for ($i = max(1, $_GET["page"] - 2); $i < min($max_page, $_GET["page"] + 3); $i++) {
print_page($i);
}
if ($_GET["page"] + 3 < $max_page) {
echo " ...";
}
print_page($max_page);
}
echo " (" . lang('%d row(s)', $found_rows) . ') <label><input type="checkbox" name="all" value="1" />' . lang('whole result') . "</label></p>\n";
echo ($_GET["db"] != "information_schema" ? "<fieldset><legend>" . lang('Edit') . "</legend><div><input type='submit' value='" . lang('Edit') . "' /> <input type='submit' name='clone' value='" . lang('Clone') . "' /> <input type='submit' name='delete' value='" . lang('Delete') . "'$confirm /></div></fieldset>\n" : "");
echo "<fieldset><legend>" . lang('Export') . "</legend><div>$dump_output $dump_format <input type='submit' name='export' value='" . lang('Export') . "' /></div></fieldset>\n";
}
$result->free();
echo "<fieldset><legend>" . lang('CSV Import') . "</legend><div><input type='hidden' name='token' value='$token' /><input type='file' name='csv_file' /> <input type='submit' name='import' value='" . lang('Import') . "' /></div></fieldset>\n";
echo "</form>\n";
}
}

89
adminer/sql.inc.php Normal file
View File

@@ -0,0 +1,89 @@
<?php
if (isset($_POST["query"])) {
setcookie("highlight", $_POST["highlight"], strtotime("+1 month"), preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]));
$_COOKIE["highlight"] = $_POST["highlight"];
}
page_header(lang('SQL command'), $error);
if (!$error && $_POST) {
if (is_string($query = (isset($_POST["query"]) ? $_POST["query"] : get_file("sql_file")))) {
@set_time_limit(0);
$query = str_replace("\r", "", $query);
$delimiter = ";";
$offset = 0;
$empty = true;
$space = "(\\s+|/\\*.*\\*/|(#|-- )[^\n]*\n|--\n)";
$dbh2 = (strlen($_GET["db"]) ? connect() : null); // connection for exploring indexes (to not replace FOUND_ROWS()) //! PDO - silent error
if (is_object($dbh2)) {
$dbh2->select_db($_GET["db"]);
}
while (rtrim($query)) {
if (!$offset && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
$delimiter = $match[1];
$query = substr($query, strlen($match[0]));
} elseif (preg_match('(' . preg_quote($delimiter) . '|[\'`"]|/\\*|-- |#|$)', $query, $match, PREG_OFFSET_CAPTURE, $offset)) {
if ($match[0][0] && $match[0][0] != $delimiter) {
$pattern = ($match[0][0] == "-- " || $match[0][0] == "#" ? '~.*~' : ($match[0][0] == "/*" ? '~.*\\*/~sU' : '~\\G([^\\\\' . $match[0][0] . ']+|\\\\.)*(' . $match[0][0] . '|$)~s'));
preg_match($pattern, $query, $match, PREG_OFFSET_CAPTURE, $match[0][1] + 1);
$offset = $match[0][1] + strlen($match[0][0]);
} else {
$empty = false;
echo "<pre class='jush-sql'>" . htmlspecialchars(trim(substr($query, 0, $match[0][1]))) . "</pre>\n";
flush();
$start = explode(" ", microtime());
//! don't allow changing of character_set_results, convert encoding of displayed query
if (!$dbh->multi_query(substr($query, 0, $match[0][1]))) {
echo "<p class='error'>" . lang('Error in query') . ": " . htmlspecialchars($dbh->error) . "</p>\n";
if ($_POST["error_stops"]) {
break;
}
} else {
$end = explode(" ", microtime());
echo "<p class='time'>" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . "</p>\n";
do {
$result = $dbh->store_result();
if (is_object($result)) {
select($result, $dbh2);
} else {
if (preg_match("~^$space*(CREATE|DROP)$space+(DATABASE|SCHEMA)\\b~isU", $query)) {
unset($_SESSION["databases"][$_GET["server"]]);
}
echo "<p class='message'>" . lang('Query executed OK, %d row(s) affected.', $dbh->affected_rows) . "</p>\n";
}
} while ($dbh->next_result());
}
$query = substr($query, $match[0][1] + strlen($match[0][0]));
$offset = 0;
}
}
}
if ($empty) {
echo "<p class='message'>" . lang('No commands to execute.') . "</p>\n";
}
} else {
echo "<p class='error'>" . lang('Unable to upload a file.') . "</p>\n";
}
}
?>
<form action="" method="post">
<p><textarea name="query" rows="20" cols="80" style="width: 98%;"><?php echo htmlspecialchars($_POST ? $_POST["query"] : (strlen($_GET["history"]) ? $_SESSION["history"][$_GET["server"]][$_GET["db"]][$_GET["history"]] : $_GET["sql"])); ?></textarea></p>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Execute'); ?>" />
<label><input type="checkbox" name="error_stops" value="1"<?php echo ($_POST["error_stops"] ? " checked='checked'" : ""); ?> /><?php echo lang('Stop on error'); ?></label>
</p>
</form>
<?php
if (!ini_get("file_uploads")) {
echo "<p>" . lang('File uploads are disabled.') . "</p>\n";
} else { ?>
<form action="" method="post" enctype="multipart/form-data">
<p>
<?php echo lang('File upload'); ?>: <input type="file" name="sql_file" />
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Execute'); ?>" />
</p>
</form>
<?php } ?>

76
adminer/table.inc.php Normal file
View File

@@ -0,0 +1,76 @@
<?php
$result = $dbh->query("SHOW COLUMNS FROM " . idf_escape($_GET["table"]));
if (!$result) {
$error = htmlspecialchars($dbh->error);
}
page_header(lang('Table') . ": " . htmlspecialchars($_GET["table"]), $error);
if ($result) {
$table_status = table_status($_GET["table"]);
$auto_increment_only = true;
echo "<table cellspacing='0'>\n";
while ($row = $result->fetch_assoc()) {
if (!$row["auto_increment"]) {
$auto_increment_only = false;
}
echo "<tr><th>" . htmlspecialchars($row["Field"]) . "</th><td>$row[Type]" . ($row["Null"] == "YES" ? " <i>NULL</i>" : "") . "</td></tr>\n";
}
echo "</table>\n";
$result->free();
echo "<p>";
echo '<a href="' . htmlspecialchars($SELF) . 'create=' . urlencode($_GET["table"]) . '">' . lang('Alter table') . '</a>';
echo ($auto_increment_only ? '' : ' <a href="' . htmlspecialchars($SELF) . 'default=' . urlencode($_GET["table"]) . '">' . lang('Default values') . '</a>');
echo ' <a href="' . htmlspecialchars($SELF) . 'select=' . urlencode($_GET["table"]) . '">' . lang('Select table') . '</a>';
echo ' <a href="' . htmlspecialchars($SELF) . 'edit=' . urlencode($_GET["table"]) . '">' . lang('New item') . '</a>';
echo "</p>\n";
echo "<h3>" . lang('Indexes') . "</h3>\n";
$indexes = indexes($_GET["table"]);
if ($indexes) {
echo "<table cellspacing='0'>\n";
foreach ($indexes as $index) {
ksort($index["columns"]);
$print = array();
foreach ($index["columns"] as $key => $val) {
$print[] = "<i>" . htmlspecialchars($val) . "</i>" . ($index["lengths"][$key] ? "(" . $index["lengths"][$key] . ")" : "");
}
echo "<tr><td>$index[type]</td><td>" . implode(", ", $print) . "</td></tr>\n";
}
echo "</table>\n";
}
echo '<p><a href="' . htmlspecialchars($SELF) . 'indexes=' . urlencode($_GET["table"]) . '">' . lang('Alter indexes') . "</a></p>\n";
if ($table_status["Engine"] == "InnoDB") {
echo "<h3>" . lang('Foreign keys') . "</h3>\n";
$foreign_keys = foreign_keys($_GET["table"]);
if ($foreign_keys) {
echo "<table cellspacing='0'>\n";
foreach ($foreign_keys as $name => $foreign_key) {
echo "<tr>";
echo "<td><i>" . implode("</i>, <i>", array_map('htmlspecialchars', $foreign_key["source"])) . "</i></td>";
$link = (strlen($foreign_key["db"]) ? "<strong>" . htmlspecialchars($foreign_key["db"]) . "</strong>." : "") . htmlspecialchars($foreign_key["table"]);
echo '<td><a href="' . htmlspecialchars(strlen($foreign_key["db"]) ? preg_replace('~db=[^&]*~', "db=" . urlencode($foreign_key["db"]), $SELF) : $SELF) . "table=" . urlencode($foreign_key["table"]) . "\">$link</a>";
echo "(<em>" . implode("</em>, <em>", array_map('htmlspecialchars', $foreign_key["target"])) . "</em>)</td>";
echo '<td>' . (!strlen($foreign_key["db"]) ? '<a href="' . htmlspecialchars($SELF) . 'foreign=' . urlencode($_GET["table"]) . '&amp;name=' . urlencode($name) . '">' . lang('Alter') . '</a>' : '&nbsp;') . '</td>';
echo "</tr>\n";
}
echo "</table>\n";
}
echo '<p><a href="' . htmlspecialchars($SELF) . 'foreign=' . urlencode($_GET["table"]) . '">' . lang('Add foreign key') . "</a></p>\n";
}
}
if ($dbh->server_info >= 5) {
echo "<h3>" . lang('Triggers') . "</h3>\n";
$result = $dbh->query("SHOW TRIGGERS LIKE '" . $dbh->escape_string(addcslashes($_GET["table"], "%_")) . "'");
if ($result->num_rows) {
echo "<table cellspacing='0'>\n";
while ($row = $result->fetch_assoc()) {
echo "<tr valign='top'><td>$row[Timing]</td><td>$row[Event]</td><th>" . htmlspecialchars($row["Trigger"]) . "</th><td><a href=\"" . htmlspecialchars($SELF) . 'trigger=' . urlencode($_GET["table"]) . '&amp;name=' . urlencode($row["Trigger"]) . '">' . lang('Alter') . "</a></td></tr>\n";
}
echo "</table>\n";
}
$result->free();
echo '<p><a href="' . htmlspecialchars($SELF) . 'trigger=' . urlencode($_GET["table"]) . '">' . lang('Add trigger') . "</a></p>\n";
}

45
adminer/trigger.inc.php Normal file
View File

@@ -0,0 +1,45 @@
<?php
$trigger_time = array("BEFORE", "AFTER");
$trigger_event = array("INSERT", "UPDATE", "DELETE");
$dropped = false;
if ($_POST && !$error) {
if (strlen($_GET["name"])) {
$dropped = query_redirect("DROP TRIGGER " . idf_escape($_GET["name"]), $SELF . "table=" . urlencode($_GET["trigger"]), lang('Trigger has been dropped.'), $_POST["drop"], !$_POST["dropped"]);
}
if (!$_POST["drop"]) {
if (in_array($_POST["Timing"], $trigger_time) && in_array($_POST["Event"], $trigger_event)) {
query_redirect("CREATE TRIGGER " . idf_escape($_POST["Trigger"]) . " $_POST[Timing] $_POST[Event] ON " . idf_escape($_GET["trigger"]) . " FOR EACH ROW\n$_POST[Statement]", $SELF . "table=" . urlencode($_GET["trigger"]), (strlen($_GET["name"]) ? lang('Trigger has been altered.') : lang('Trigger has been created.')));
}
}
}
page_header((strlen($_GET["name"]) ? lang('Alter trigger') . ": " . htmlspecialchars($_GET["name"]) : lang('Create trigger')), $error, array("table" => $_GET["trigger"]));
$row = array("Trigger" => "$_GET[trigger]_bi");
if ($_POST) {
$row = $_POST;
} elseif (strlen($_GET["name"])) {
$result = $dbh->query("SHOW TRIGGERS LIKE '" . $dbh->escape_string(addcslashes($_GET["trigger"], "%_")) . "'");
while ($row = $result->fetch_assoc()) {
if ($row["Trigger"] === $_GET["name"]) {
break;
}
}
$result->free();
}
?>
<form action="" method="post" id="form">
<table cellspacing="0">
<tr><th><?php echo lang('Time'); ?></th><td><select name="Timing" onchange="if (/^<?php echo htmlspecialchars(preg_quote($_GET["trigger"], "/")); ?>_[ba][iud]$/.test(this.form['Trigger'].value)) this.form['Trigger'].value = '<?php echo htmlspecialchars(addcslashes($_GET["trigger"], "\r\n'\\")); ?>_' + this.value.charAt(0).toLowerCase() + this.form['Event'].value.charAt(0).toLowerCase();"><?php echo optionlist($trigger_time, $row["Timing"]); ?></select></td></tr>
<tr><th><?php echo lang('Event'); ?></th><td><select name="Event" onchange="this.form['Timing'].onchange();"><?php echo optionlist($trigger_event, $row["Event"]); ?></select></td></tr>
<tr><th><?php echo lang('Name'); ?></th><td><input name="Trigger" value="<?php echo htmlspecialchars($row["Trigger"]); ?>" maxlength="64" /></td></tr>
</table>
<p><textarea name="Statement" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["Statement"]); ?></textarea></p>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<?php if ($dropped) { ?><input type="hidden" name="dropped" value="1" /><?php } ?>
<input type="submit" value="<?php echo lang('Save'); ?>" />
<?php if (strlen($_GET["name"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
</p>
</form>

BIN
adminer/up.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 B

174
adminer/user.inc.php Normal file
View File

@@ -0,0 +1,174 @@
<?php
$privileges = array("" => array("All privileges" => ""));
$result = $dbh->query("SHOW PRIVILEGES");
while ($row = $result->fetch_assoc()) {
if ($row["Privilege"] == "Grant option") {
$privileges[""]["Grant option"] = $row["Comment"];
} else {
foreach (explode(",", $row["Context"]) as $context) {
$privileges[$context][$row["Privilege"]] = $row["Comment"];
}
}
}
$result->free();
$privileges["Server Admin"] += $privileges["File access on server"];
$privileges["Databases"]["Create routine"] = $privileges["Procedures"]["Create routine"];
$privileges["Columns"] = array();
foreach (array("Select", "Insert", "Update", "References") as $val) {
$privileges["Columns"][$val] = $privileges["Tables"][$val];
}
unset($privileges["Server Admin"]["Usage"]);
unset($privileges["Procedures"]["Create routine"]);
foreach ($privileges["Tables"] as $key => $val) {
unset($privileges["Databases"][$key]);
}
function grant($grant, $columns) {
return preg_replace('~(GRANT OPTION)\\([^)]*\\)~', '\\1', implode("$columns, ", $grant) . $columns);
}
$new_grants = array();
if ($_POST) {
foreach ($_POST["objects"] as $key => $val) {
$new_grants[$val] = ((array) $new_grants[$val]) + ((array) $_POST["grants"][$key]);
}
}
$grants = array();
$old_pass = "";
if (isset($_GET["host"]) && ($result = $dbh->query("SHOW GRANTS FOR '" . $dbh->escape_string($_GET["user"]) . "'@'" . $dbh->escape_string($_GET["host"]) . "'"))) { //! Use information_schema for MySQL 5 - column names in column privileges are not escaped
while ($row = $result->fetch_row()) {
if (preg_match('~GRANT (.*) ON (.*) TO ~', $row[0], $match) && preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~', $match[1], $matches, PREG_SET_ORDER)) { //! escape the part between ON and TO
foreach ($matches as $val) {
$grants["$match[2]$val[2]"][$val[1]] = true;
if (preg_match('~ WITH GRANT OPTION~', $row[0])) { //! don't check inside strings and identifiers
$grants["$match[2]$val[2]"]["GRANT OPTION"] = true;
}
}
}
if (preg_match("~ IDENTIFIED BY PASSWORD '([^']+)~", $row[0], $match)) {
$old_pass = $match[1];
}
}
$result->free();
}
if ($_POST && !$error) {
$old_user = (isset($_GET["host"]) ? $dbh->escape_string($_GET["user"]) . "'@'" . $dbh->escape_string($_GET["host"]) : "");
$new_user = $dbh->escape_string($_POST["user"]) . "'@'" . $dbh->escape_string($_POST["host"]);
$pass = $dbh->escape_string($_POST["pass"]);
if ($_POST["drop"]) {
query_redirect("DROP USER '$old_user'", $SELF . "privileges=", lang('User has been dropped.'));
} else {
if ($old_user == $new_user) {
queries("SET PASSWORD FOR '$new_user' = " . ($_POST["hashed"] ? "'$pass'" : "PASSWORD('$pass')"));
} else {
$error = !queries(($dbh->server_info < 5 ? "GRANT USAGE ON *.* TO" : "CREATE USER") . " '$new_user' IDENTIFIED BY" . ($_POST["hashed"] ? " PASSWORD" : "") . " '$pass'");
}
if (!$error) {
$revoke = array();
foreach ($new_grants as $object => $grant) {
if (isset($_GET["grant"])) {
$grant = array_filter($grant);
}
$grant = array_keys($grant);
if (isset($_GET["grant"])) {
$revoke = array_diff(array_keys(array_filter($new_grants[$object], 'strlen')), $grant);
} elseif ($old_user == $new_user) {
$old_grant = array_keys((array) $grants[$object]);
$revoke = array_diff($old_grant, $grant);
$grant = array_diff($grant, $old_grant);
unset($grants[$object]);
}
if (preg_match('~^(.+)\\s*(\\(.*\\))?$~U', $object, $match) && (
($grant && !queries("GRANT " . grant($grant, $match[2]) . " ON $match[1] TO '$new_user'")) //! SQL injection
|| ($revoke && !queries("REVOKE " . grant($revoke, $match[2]) . " ON $match[1] FROM '$new_user'"))
)) {
$error = true;
break;
}
}
}
if (!$error && isset($_GET["host"])) {
if ($old_user != $new_user) {
queries("DROP USER '$old_user'");
} elseif (!isset($_GET["grant"])) {
foreach ($grants as $object => $revoke) {
if (preg_match('~^(.+)(\\(.*\\))?$~U', $object, $match)) {
queries("REVOKE " . grant(array_keys($revoke), $match[2]) . " ON $match[1] FROM '$new_user'");
}
}
}
}
query_redirect(queries(), $SELF . "privileges=", (isset($_GET["host"]) ? lang('User has been altered.') : lang('User has been created.')), !$error, false, $error);
if ($old_user != $new_user) {
$dbh->query("DROP USER '$new_user'");
}
}
}
page_header((isset($_GET["host"]) ? lang('Username') . ": " . htmlspecialchars("$_GET[user]@$_GET[host]") : lang('Create user')), $error, array("privileges" => lang('Privileges')));
if ($_POST) {
$row = $_POST;
$grants = $new_grants;
} else {
$row = $_GET + array("host" => "localhost");
$row["pass"] = $old_pass;
if (strlen($old_pass)) {
$row["hashed"] = true;
}
$grants[""] = true;
}
?>
<form action="" method="post">
<table cellspacing="0">
<tr><th><?php echo lang('Username'); ?></th><td><input name="user" maxlength="16" value="<?php echo htmlspecialchars($row["user"]); ?>" /></td></tr>
<tr><th><?php echo lang('Server'); ?></th><td><input name="host" maxlength="60" value="<?php echo htmlspecialchars($row["host"]); ?>" /></td></tr>
<tr><th><?php echo lang('Password'); ?></th><td><input id="pass" name="pass" value="<?php echo htmlspecialchars($row["pass"]); ?>" /><?php if (!$row["hashed"]) { ?><script type="text/javascript">document.getElementById('pass').type = 'password';</script><?php } ?> <label><input type="checkbox" name="hashed" value="1"<?php if ($row["hashed"]) { ?> checked="checked"<?php } ?> onclick="this.form['pass'].type = (this.checked ? 'text' : 'password');" /><?php echo lang('Hashed'); ?></label></td></tr>
</table>
<?php
//! MAX_* limits, REQUIRE
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th colspan='2'>" . lang('Privileges') . "</th>";
$i = 0;
foreach ($grants as $object => $grant) {
echo '<th>' . ($object != "*.*" ? '<input name="objects[' . $i . ']" value="' . htmlspecialchars($object) . '" size="10" />' : '<input type="hidden" name="objects[' . $i . ']" value="*.*" size="10" />*.*') . '</th>'; //! separate db, table, columns, PROCEDURE|FUNCTION, routine
//! JS checkbox for all
$i++;
}
echo "</tr></thead>\n";
foreach (array(
"" => "",
"Server Admin" => lang('Server'),
"Databases" => lang('Database'),
"Tables" => lang('Table'),
"Columns" => lang('Column'),
"Procedures" => lang('Routine'),
) as $context => $desc) {
foreach ((array) $privileges[$context] as $privilege => $comment) {
echo "<tr" . odd() . "><td" . ($desc ? ">$desc</td><td" : " colspan='2'") . ' title="' . htmlspecialchars($comment) . '"><i>' . htmlspecialchars($privilege) . "</i></td>";
$i = 0;
foreach ($grants as $object => $grant) {
$name = '"grants[' . $i . '][' . htmlspecialchars(strtoupper($privilege)) . ']"';
$value = $grant[strtoupper($privilege)];
if ($context == "Server Admin" && $object != (isset($grants["*.*"]) ? "*.*" : "")) {
echo "<td>&nbsp;</td>";
} elseif (isset($_GET["grant"])) {
echo "<td><select name=$name><option></option><option value='1'" . ($value ? " selected='selected'" : "") . ">" . lang('Grant') . "</option><option value='0'" . ($value == "0" ? " selected='selected'" : "") . ">" . lang('Revoke') . "</option></select></td>";
} else {
echo "<td align='center'><input type='checkbox' name=$name value='1'" . ($value ? " checked='checked'" : "") . " /></td>";
}
$i++;
}
echo "</tr>\n";
}
}
echo "</table>\n";
?>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>" />
<input type="submit" value="<?php echo lang('Save'); ?>" />
<?php if (isset($_GET["host"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?> /><?php } ?>
</p>
</form>

5
adminer/view.inc.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
page_header(lang('View') . ": " . htmlspecialchars($_GET["view"]));
$view = view($_GET["view"]);
echo "<pre class='jush-sql'>" . htmlspecialchars($view["select"]) . "</pre>\n";
echo '<p><a href="' . htmlspecialchars($SELF) . 'createv=' . urlencode($_GET["view"]) . '">' . lang('Alter view') . "</a></p>\n";