1
0
mirror of https://github.com/vrana/adminer.git synced 2025-09-01 18:32:39 +02:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Jakub Vrana
7341756579 Show commands in navigation 2010-05-20 22:25:39 +02:00
Jakub Vrana
946eb154f6 ON DELETE action for foreign keys in Create table 2010-05-20 22:06:34 +02:00
107 changed files with 1913 additions and 6678 deletions

4
.gitignore vendored
View File

@@ -1,2 +1,2 @@
/adminer*.php
/editor*.php
adminer*.php
editor*.php

9
.gitmodules vendored
View File

@@ -4,12 +4,3 @@
[submodule "jsmin-php"]
path = externals/jsmin-php
url = git://github.com/rgrove/jsmin-php.git
[submodule "tinymce"]
path = externals/tinymce
url = git://github.com/tinymce/tinymce.git
[submodule "jquery-ui"]
path = externals/jquery-ui
url = git://github.com/jquery/jquery-ui.git
[submodule "jquery-timepicker"]
path = externals/jquery-timepicker
url = git://github.com/trentrichardson/jQuery-Timepicker-Addon.git

View File

@@ -57,13 +57,8 @@ if ($in) {
$name = $field["field"];
echo "<tr><th>" . $adminer->fieldName($field);
$value = $_POST["fields"][$name];
if ($value != "") {
if ($field["type"] == "enum") {
$value = +$value;
}
if ($field["type"] == "set") {
$value = array_sum($value);
}
if ($value != "" && ereg("enum|set", $field["type"])) {
$value = intval($value);
}
input($field, $value, (string) $_POST["function"][$name]); // param name can be empty
echo "\n";
@@ -72,6 +67,6 @@ if ($in) {
}
?>
<p>
<input type="submit" value="<?php echo lang('Call'); ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Call'); ?>">
</form>

View File

@@ -14,9 +14,6 @@ if ($TABLE != "") {
$orig_fields = fields($TABLE);
$orig_status = table_status($TABLE);
}
if ($_POST && !$_POST["fields"]) {
$_POST["fields"] = array();
}
if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"] && !$_POST["down"]) {
if ($_POST["drop"]) {
@@ -28,26 +25,27 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
$orig_field = reset($orig_fields);
$after = "FIRST";
foreach ($_POST["fields"] as $key => $field) {
$foreign_key = $foreign_keys[$field["type"]];
$type_field = (isset($foreign_key) ? $referencable_primary[$foreign_key] : $field); //! can collide with user defined type
$type_field = (isset($types[$field["type"]]) ? $field : $referencable_primary[$foreign_keys[$field["type"]]]);
if ($field["field"] != "") {
if (!$field["has_default"]) {
$field["default"] = null;
}
$default = eregi_replace(" *on update CURRENT_TIMESTAMP", "", $field["default"]);
if ($default != $field["default"]) { // preg_replace $count is available since PHP 5.1.0
$field["on_update"] = "CURRENT_TIMESTAMP";
$field["default"] = $default;
}
if ($key == $_POST["auto_increment_col"]) {
$field["auto_increment"] = true;
}
$process_field = process_field($field, $type_field);
if ($process_field != process_field($orig_field, $orig_field)) {
$fields[] = array($field["orig"], $process_field, $after);
}
if (isset($foreign_key)) {
$foreign[idf_escape($field["field"])] = ($TABLE != "" ? "ADD" : " ") . " FOREIGN KEY (" . idf_escape($field["field"]) . ") REFERENCES " . table($foreign_keys[$field["type"]]) . " (" . idf_escape($type_field["field"]) . ")" . (in_array($field["on_delete"], $on_actions) ? " ON DELETE $field[on_delete]" : "");
if ($type_field) {
if (!$field["has_default"]) {
$field["default"] = null;
}
$default = eregi_replace(" *on update CURRENT_TIMESTAMP", "", $field["default"]);
if ($default != $field["default"]) { // preg_replace $count is available since PHP 5.1.0
$field["on_update"] = "CURRENT_TIMESTAMP";
$field["default"] = $default;
}
if ($key == $_POST["auto_increment_col"]) {
$field["auto_increment"] = true;
}
$process_field = process_field($field, $type_field);
if ($process_field != process_field($orig_field, $orig_field)) {
$fields[] = array($field["orig"], $process_field, $after);
}
if (!isset($types[$field["type"]])) {
$foreign[] = ($TABLE != "" ? "ADD " : " ") . "FOREIGN KEY (" . idf_escape($field["field"]) . ") REFERENCES " . idf_escape($foreign_keys[$field["type"]]) . " (" . idf_escape($type_field["field"]) . ")" . (in_array($field["on_delete"], $on_actions) ? " ON DELETE $field[on_delete]" : "");
}
}
$after = "AFTER " . idf_escape($field["field"]);
} elseif ($field["orig"] != "") {
@@ -68,7 +66,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
}
$partitioning .= "\nPARTITION BY $_POST[partition_by]($_POST[partition])" . ($partitions // $_POST["partition"] can be expression, not only column
? " (" . implode(",", $partitions) . "\n)"
: ($_POST["partitions"] ? " PARTITIONS " . (+$_POST["partitions"]) : "")
: ($_POST["partitions"] ? " PARTITIONS " . intval($_POST["partitions"]) : "")
);
} elseif ($TABLE != "" && support("partitioning")) {
$partitioning .= "\nREMOVE PARTITIONING";
@@ -86,7 +84,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
$_POST["Comment"],
($_POST["Engine"] && $_POST["Engine"] != $orig_status["Engine"] ? $_POST["Engine"] : ""),
($_POST["Collation"] && $_POST["Collation"] != $orig_status["Collation"] ? $_POST["Collation"] : ""),
($_POST["Auto_increment"] != "" ? +$_POST["Auto_increment"] : ""),
($_POST["Auto_increment"] != "" ? preg_replace('~[^0-9]+~', '', $_POST["Auto_increment"]) : ""),
$partitioning
));
}
@@ -96,7 +94,7 @@ page_header(($TABLE != "" ? lang('Alter table') : lang('Create table')), $error,
$row = array(
"Engine" => $_COOKIE["adminer_engine"],
"fields" => array(array("field" => "", "type" => (isset($types["int"]) ? "int" : (isset($types["integer"]) ? "integer" : "")))),
"fields" => array(array("field" => "")),
"partition_names" => array(""),
);
if ($_POST) {
@@ -120,12 +118,13 @@ if ($_POST) {
$row["fields"][] = $field;
}
if (support("partitioning")) {
$from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . q(DB) . " AND TABLE_NAME = " . q($TABLE);
$result = $connection->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
$from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . $connection->quote(DB) . " AND TABLE_NAME = " . $connection->quote($TABLE);
$result = $connection->query("SELECT PARTITION_METHOD, PARTITION_ORDINAL_POSITION, PARTITION_EXPRESSION $from ORDER BY PARTITION_ORDINAL_POSITION LIMIT 1");
list($row["partition_by"], $row["partitions"], $row["partition"]) = $result->fetch_row();
$row["partition_names"] = array();
$row["partition_values"] = array();
foreach (get_rows("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $from AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION") as $row1) {
$result = $connection->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"];
}
@@ -152,21 +151,22 @@ foreach ($engines as $engine) {
<form action="" method="post" id="form">
<p>
<?php echo lang('Table name'); ?>: <input name="name" maxlength="64" value="<?php echo h($row["name"]); ?>">
<?php if ($TABLE == "" && !$_POST) { ?><script type='text/javascript'>document.getElementById('form')['name'].focus();</script><?php } ?>
<?php echo ($engines ? html_select("Engine", array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) : ""); ?>
<?php echo ($collations && !ereg("sqlite|mssql", $jush) ? html_select("Collation", array("" => "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?>
<?php echo ($collations ? html_select("Collation", array("" => "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?>
<input type="submit" value="<?php echo lang('Save'); ?>">
<table cellspacing="0" id="edit-fields" class="nowrap">
<?php $comments = edit_fields($row["fields"], $collations, "TABLE", $suhosin, $foreign_keys, $row["Comment"] != ""); ?>
</table>
<p>
<?php echo lang('Auto Increment'); ?>: <input name="Auto_increment" size="6" value="<?php echo h($row["Auto_increment"]); ?>">
<label class="jsonly"><input type="checkbox" onclick="columnShow(this.checked, 5);"><?php echo lang('Default values'); ?></label>
<?php echo (support("comment") ? checkbox("", "", $comments, lang('Comment'), "columnShow(this.checked, 6); toggle('Comment'); if (this.checked) this.form['Comment'].focus();") . ' <input id="Comment" name="Comment" value="' . h($row["Comment"]) . '" maxlength="60"' . ($comments ? '' : ' class="hidden"') . '>' : ''); ?>
<script type="text/javascript">
document.write('<label><input type="checkbox" onclick="columnShow(this.checked, 5);"><?php echo lang('Default values'); ?><\/label>');
</script>
<?php echo (support("comment") ? checkbox("", "", $comments, lang('Comment'), "columnShow(this.checked, 6); toggle('Comment');") . ' <input id="Comment" name="Comment" value="' . h($row["Comment"]) . '" maxlength="60"' . ($comments ? '' : ' class="hidden"') . '>' : ''); ?>
<p>
<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 } ?>
<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 } ?>
<?php
if (support("partitioning")) {
$partition_table = ereg('RANGE|LIST', $row["partition_by"]);
@@ -187,7 +187,5 @@ foreach ($row["partition_names"] as $key => $val) {
?>
</table>
</div></fieldset>
<?php
}
?>
<?php } ?>
</form>

View File

@@ -10,11 +10,11 @@ if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP c
$_GET["db"] = $_POST["name"];
queries_redirect(preg_replace('~db=[^&]*&~', '', ME) . "db=" . urlencode($_POST["name"]), lang('Database has been renamed.'), rename_database($_POST["name"], $_POST["collation"]));
} else {
$databases = explode("\n", str_replace("\r", "", $_POST["name"]));
$dbs = explode("\n", str_replace("\r", "", $_POST["name"]));
$success = true;
$last = "";
foreach ($databases as $db) {
if (count($databases) == 1 || $db != "") { // ignore empty lines but always try to create single database
foreach ($dbs as $db) {
if (count($dbs) == 1 || $db != "") { // ignore empty lines but always try to create single database
if (!create_database($db, $_POST["collation"])) {
$success = false;
}
@@ -28,7 +28,7 @@ if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP c
if (!$_POST["collation"]) {
redirect(substr(ME, 0, -1));
}
query_redirect("ALTER DATABASE " . idf_escape($_POST["name"]) . (eregi('^[a-z0-9_]+$', $_POST["collation"]) ? " COLLATE $_POST[collation]" : ""), substr(ME, 0, -1), lang('Database has been altered.'));
query_redirect("ALTER DATABASE " . idf_escape($_POST["name"]) . " COLLATE " . $connection->quote($_POST["collation"]), substr(ME, 0, -1), lang('Database has been altered.'));
}
}
@@ -57,18 +57,17 @@ if ($_POST) {
<p>
<?php
echo ($_POST["add_x"] || strpos($name, "\n")
? '<textarea id="name" name="name" rows="10" cols="40">' . h($name) . '</textarea><br>'
: '<input id="name" name="name" value="' . h($name) . '" maxlength="64">'
? '<textarea name="name" rows="10" cols="40">' . h($name) . '</textarea><br>'
: '<input name="name" value="' . h($name) . '" maxlength="64">'
) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $collate) : "");
?>
<script type='text/javascript'>document.getElementById('name').focus();</script>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php
if (DB != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n";
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
} elseif (!$_POST["add_x"] && $_GET["db"] == "") {
echo "<input type='image' name='add' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>\n";
}
?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form>

View File

@@ -4,7 +4,7 @@ $tables_views = array_merge((array) $_POST["tables"], (array) $_POST["views"]);
if ($tables_views && !$error && !$_POST["search"]) {
$result = true;
$message = "";
if ($jush == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"] || $_POST["copy"])) {
if ($jush == "sql" && count($_POST["tables"]) > 1 && ($_POST["drop"] || $_POST["truncate"])) {
queries("SET foreign_key_checks = 0"); // allows to truncate or drop several tables at once
}
if ($_POST["truncate"]) {
@@ -15,9 +15,6 @@ if ($tables_views && !$error && !$_POST["search"]) {
} elseif ($_POST["move"]) {
$result = move_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]);
$message = lang('Tables have been moved.');
} elseif ($_POST["copy"]) {
$result = copy_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]);
$message = lang('Tables have been copied.');
} elseif ($_POST["drop"]) {
if ($_POST["views"]) {
$result = drop_views($_POST["views"]);
@@ -35,132 +32,143 @@ if ($tables_views && !$error && !$_POST["search"]) {
}
page_header(($_GET["ns"] == "" ? lang('Database') . ": " . h(DB) : lang('Schema') . ": " . h($_GET["ns"])), $error, true);
if ($adminer->homepage()) {
if ($_GET["ns"] !== "") {
echo '<a href="' . h(ME) . 'schema=">' . lang('Database schema') . "</a>\n";
echo "<h3>" . lang('Tables and views') . "</h3>\n";
$tables_list = tables_list();
if (!$tables_list) {
echo "<p class='message'>" . lang('No tables.') . "\n";
} else {
echo "<form action='' method='post'>\n";
echo "<p>" . lang('Search data in tables') . ": <input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' name='search' value='" . lang('Search') . "'>\n";
if ($_POST["search"] && $_POST["query"] != "") {
search_tables();
}
echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);"><th>' . lang('Table') . '<td>' . lang('Engine') . '<td>' . lang('Collation') . '<td>' . lang('Data Length') . '<td>' . lang('Index Length') . '<td>' . lang('Data Free') . '<td>' . lang('Auto Increment') . '<td>' . lang('Rows') . (support("comment") ? '<td>' . lang('Comment') : '') . "</thead>\n";
foreach ($tables_list as $name => $type) {
$view = (isset($type) && !eregi("table", $type));
echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');");
echo '<th><a href="' . h(ME) . 'table=' . urlencode($name) . '">' . h($name) . '</a>';
if ($view) {
echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '">' . lang('View') . '</a>';
echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '">?</a>';
} else {
foreach (array("Engine" => "", "Collation" => "", "Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "auto_increment=1&create", "Rows" => "select") as $key => $link) {
echo ($link ? "<td align='right'><a href='" . h(ME . "$link=") . urlencode($name) . "' id='$key-" . h($name) . "'>?</a>" : "<td id='$key-" . h($name) . "'>&nbsp;");
}
echo '<p>' . ($_GET["ns"] == "" ? '<a href="' . h(ME) . 'database=">' . lang('Alter database') . "</a>\n" : "");
echo (support("scheme") ? "<a href='" . h(ME) . "scheme='>" . ($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema')) . "</a>\n" : "");
if ($_GET["ns"] !== "") {
echo '<a href="' . h(ME) . 'schema=">' . lang('Database schema') . "</a>\n";
$sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0);
echo "<h3>" . lang('Tables and views') . "</h3>\n";
$tables_list = tables_list();
if (!$tables_list) {
echo "<p class='message'>" . lang('No tables.') . "\n";
} else {
echo "<form action='' method='post'>\n";
echo "<p>" . lang('Search data in tables') . ": <input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' name='search' value='" . lang('Search') . "'>\n";
if ($_POST["search"] && $_POST["query"] != "") {
$_GET["where"][0]["op"] = "LIKE %%";
$_GET["where"][0]["val"] = $_POST["query"];
search_tables();
}
echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^(tables|views)\[/);"><th>' . lang('Table') . '<td>' . lang('Engine') . '<td>' . lang('Collation') . '<td>' . lang('Data Length') . '<td>' . lang('Index Length') . '<td>' . lang('Data Free') . '<td>' . lang('Auto Increment') . '<td>' . lang('Rows') . (support("comment") ? '<td>' . lang('Comment') : '') . "</thead>\n";
foreach ($tables_list as $name => $type) {
$view = (isset($type) && !eregi("table", $type));
echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');");
echo '<th><a href="' . h(ME) . 'table=' . urlencode($name) . '">' . h($name) . '</a>';
if ($view) {
echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '">' . lang('View') . '</a>';
echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '">?</a>';
} else {
echo "<td id='Engine-" . h($name) . "'>&nbsp;<td id='Collation-" . h($name) . "'>&nbsp;";
foreach (array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "auto_increment=1&create", "Rows" => "select") as $key => $link) {
echo "<td align='right'><a href='" . h(ME . "$link=") . urlencode($name) . "' id='$key-" . h($name) . "'>?</a>";
}
echo (support("comment") ? "<td id='Comment-" . h($name) . "'>&nbsp;" : "");
}
echo "<tr><td>&nbsp;<th>" . lang('%d in total', count($tables_list));
echo "<td>" . nbsp($jush == "sql" ? $connection->result("SELECT @@storage_engine") : "");
echo "<td>" . nbsp(db_collation(DB, collations()));
foreach (array("Data_length", "Index_length", "Data_free") as $key) {
echo "<td align='right' id='sum-$key'>&nbsp;";
echo (support("comment") ? "<td id='Comment-" . h($name) . "'>&nbsp;" : "");
}
echo "<tr><td>&nbsp;<th>" . lang('%d in total', count($tables_list));
echo "<td>" . $connection->result("SELECT @@storage_engine");
echo "<td>" . db_collation(DB, collations());
foreach ($sums as $key => $val) {
echo "<td align='right' id='sum-$key'>&nbsp;";
}
echo "</table>\n";
if (!information_schema(DB)) {
echo "<p><input type='hidden' name='token' value='$token'>" . ($jush == "sql" ? "<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') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables/) + ')');\"> <input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /tables|views/) + ')');\">\n";
$dbs = (support("scheme") ? schemas() : get_databases());
if (count($dbs) != 1 && $jush != "sqlite") {
$db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));
echo "<p>" . lang('Move to other database') . ($dbs ? ": " . html_select("target", $dbs, $db) : ': <input name="target" value="' . h($db) . '">') . " <input type='submit' name='move' value='" . lang('Move') . "'>\n";
}
}
echo "</form>\n";
}
echo '<p><a href="' . h(ME) . 'create=">' . lang('Create table') . "</a>\n";
if (support("view")) {
echo '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n";
}
if (support("routine")) {
echo "<h3>" . lang('Routines') . "</h3>\n";
$routines = routines();
if ($routines) {
echo "<table cellspacing='0'>\n";
echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td>&nbsp;</thead>\n";
odd('');
foreach ($routines as $row) {
echo '<tr' . odd() . '>';
echo '<th><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . h($row["ROUTINE_NAME"]) . '</a>';
echo '<td>' . h($row["ROUTINE_TYPE"]);
echo '<td>' . h($row["DTD_IDENTIFIER"]);
echo '<td><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a>";
}
echo "</table>\n";
if (!information_schema(DB)) {
echo "<p>" . ($jush == "sql" ? "<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("formChecked(this, /tables/)") . "> <input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /tables|views/)", 1) . ">\n"; // 1 - eventStop
$databases = (support("scheme") ? schemas() : get_databases());
if (count($databases) != 1 && $jush != "sqlite") {
$db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));
echo "<p>" . lang('Move to other database') . ": ";
echo ($databases ? html_select("target", $databases, $db) : '<input name="target" value="' . h($db) . '">');
echo " <input type='submit' name='move' value='" . lang('Move') . "' onclick='eventStop(event);'>";
echo (support("copy") ? " <input type='submit' name='copy' value='" . lang('Copy') . "' onclick='eventStop(event);'>" : "");
echo "\n";
}
echo "<input type='hidden' name='token' value='$token'>\n";
}
echo "</form>\n";
}
echo '<p><a href="' . h(ME) . 'create=">' . lang('Create table') . "</a>\n";
if (support("view")) {
echo '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n";
}
if (support("routine")) {
echo "<h3>" . lang('Routines') . "</h3>\n";
$routines = routines();
if ($routines) {
echo "<table cellspacing='0'>\n";
echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td>&nbsp;</thead>\n";
odd('');
foreach ($routines as $row) {
echo '<tr' . odd() . '>';
echo '<th><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . h($row["ROUTINE_NAME"]) . '</a>';
echo '<td>' . h($row["ROUTINE_TYPE"]);
echo '<td>' . h($row["DTD_IDENTIFIER"]);
echo '<td><a href="' . h(ME) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a>";
}
echo "</table>\n";
}
echo '<p><a href="' . h(ME) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . h(ME) . 'function=">' . lang('Create function') . "</a>\n";
}
if (support("sequence")) {
echo "<h3>" . lang('Sequences') . "</h3>\n";
$sequences = get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema()");
if ($sequences) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
odd('');
foreach ($sequences as $val) {
echo "<tr" . odd() . "><th><a href='" . h(ME) . "sequence=" . urlencode($val) . "'>" . h($val) . "</a>\n";
}
echo "</table>\n";
}
echo "<p><a href='" . h(ME) . "sequence='>" . lang('Create sequence') . "</a>\n";
}
if (support("type")) {
echo "<h3>" . lang('User types') . "</h3>\n";
$types = types();
if ($types) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
odd('');
foreach ($types as $val) {
echo "<tr" . odd() . "><th><a href='" . h(ME) . "type=" . urlencode($val) . "'>" . h($val) . "</a>\n";
}
echo "</table>\n";
}
echo "<p><a href='" . h(ME) . "type='>" . lang('Create type') . "</a>\n";
}
if (support("event")) {
echo "<h3>" . lang('Events') . "</h3>\n";
$rows = get_rows("SHOW EVENTS");
if ($rows) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "<td>" . lang('Schedule') . "<td>" . lang('Start') . "<td>" . lang('End') . "</thead>\n";
foreach ($rows as $row) {
echo "<tr>";
echo '<th><a href="' . h(ME) . 'event=' . urlencode($row["Name"]) . '">' . h($row["Name"]) . "</a>";
echo "<td>" . ($row["Execute at"] ? lang('At given time') . "<td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "<td>$row[Starts]");
echo "<td>$row[Ends]";
}
echo "</table>\n";
}
echo '<p><a href="' . h(ME) . 'event=">' . lang('Create event') . "</a>\n";
}
if ($tables_list) {
echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=db');</script>\n";
}
echo '<p><a href="' . h(ME) . 'procedure=">' . lang('Create procedure') . '</a> <a href="' . h(ME) . 'function=">' . lang('Create function') . "</a>\n";
}
if (support("sequence")) {
echo "<h3>" . lang('Sequences') . "</h3>\n";
$sequences = get_vals("SELECT sequence_name FROM information_schema.sequences WHERE sequence_schema = current_schema()");
if ($sequences) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "</thead>\n";
odd('');
foreach ($sequences as $val) {
echo "<tr" . odd() . "><th><a href='" . h(ME) . "sequence=" . urlencode($val) . "'>" . h($val) . "</a>\n";
}
echo "</table>\n";
}
echo "<p><a href='" . h(ME) . "sequence='>" . lang('Create sequence') . "</a>\n";
}
if (support("event")) {
echo "<h3>" . lang('Events') . "</h3>\n";
$result = $connection->query("SHOW EVENTS");
if ($result && $result->num_rows) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Name') . "<td>" . lang('Schedule') . "<td>" . lang('Start') . "<td>" . lang('End') . "</thead>\n";
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo '<th><a href="' . h(ME) . 'event=' . urlencode($row["Name"]) . '">' . h($row["Name"]) . "</a>";
echo "<td>" . ($row["Execute at"] ? lang('At given time') . "<td>" . $row["Execute at"] : lang('Every') . " " . $row["Interval value"] . " " . $row["Interval field"] . "<td>$row[Starts]");
echo "<td>$row[Ends]";
}
echo "</table>\n";
}
echo '<p><a href="' . h(ME) . 'event=">' . lang('Create event') . "</a>\n";
}
page_footer();
$table_status = table_status();
if ($table_status) {
echo "<script type='text/javascript'>\n";
foreach ($table_status as $row) {
$id = addcslashes($row["Name"], "\\'/");
echo "setHtml('Comment-$id', '" . nbsp($row["Comment"]) . "');\n";
if (!eregi("view", $row["Engine"])) {
foreach (array("Engine", "Collation") as $key) {
echo "setHtml('$key-$id', '" . nbsp($row[$key]) . "');\n";
}
foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) {
if ($row[$key] != "") {
$val = number_format($row[$key], 0, '.', lang(','));
echo "setHtml('$key-$id', '" . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "');\n";
if (isset($sums[$key])) {
$sums[$key] += ($row["Engine"] != "InnoDB" || $key != "Data_free" ? $row[$key] : 0);
}
} elseif (array_key_exists($key, $row)) {
echo "setHtml('$key-$id');\n";
}
}
}
}
foreach ($sums as $key => $val) {
echo "setHtml('sum-$key', '" . number_format($val, 0, '.', lang(',')) . "');\n";
}
echo "</script>\n";
}
exit; // page_footer() already called
}

View File

@@ -5,10 +5,13 @@
* @author Jakub Vrana
*/
$drivers["mssql"] = "MS SQL";
$possible_drivers[] = "SQLSRV";
$possible_drivers[] = "MSSQL";
if (extension_loaded("sqlsrv") || extension_loaded("mssql")) {
$drivers["mssql"] = "MS SQL";
}
if (isset($_GET["mssql"])) {
$possible_drivers = array("SQLSRV", "MSSQL");
define("DRIVER", "mssql");
if (extension_loaded("sqlsrv")) {
class Min_DB {
@@ -89,7 +92,7 @@ if (isset($_GET["mssql"])) {
function Min_Result($result) {
$this->_result = $result;
// $this->num_rows = sqlsrv_num_rows($result); // available only in scrollable results
$this->num_rows = sqlsrv_has_rows($result); //! sqlsrv_num_rows($result)
}
function _convert($row) {
@@ -142,7 +145,7 @@ if (isset($_GET["mssql"])) {
if ($this->_link) {
$result = $this->query("SELECT SERVERPROPERTY('ProductLevel'), SERVERPROPERTY('Edition')");
$row = $result->fetch_row();
$this->server_info = $this->result("sp_server_info 2", 2) . " [$row[0]] $row[1]";
$this->server_info = $this->result("sp_server_info 2", 2)." [$row[0]] $row[1]";
} else {
$this->error = mssql_get_last_message();
}
@@ -261,7 +264,7 @@ if (isset($_GET["mssql"])) {
function db_collation($db, $collations) {
global $connection;
return $connection->result("SELECT collation_name FROM sys.databases WHERE name = " . q($db));
return $connection->result("SELECT collation_name FROM sys.databases WHERE name = " . $connection->quote($db));
}
function engines() {
@@ -274,7 +277,8 @@ if (isset($_GET["mssql"])) {
}
function tables_list() {
return get_key_vals("SELECT name, type_desc FROM sys.all_objects WHERE schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND type IN ('S', 'U', 'V') ORDER BY name");
global $connection;
return get_key_vals("SELECT name, type_desc FROM sys.all_objects WHERE schema_id = SCHEMA_ID(" . $connection->quote(get_schema()) . ") AND type IN ('S', 'U', 'V') ORDER BY name");
}
function count_tables($databases) {
@@ -282,14 +286,16 @@ if (isset($_GET["mssql"])) {
$return = array();
foreach ($databases as $db) {
$connection->select_db($db);
$return[$db] = $connection->result("SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES");
$return[$db] = $connection->result("SELECT COUNT(*) FROM information_schema.TABLES");
}
return $return;
}
function table_status($name = "") {
global $connection;
$return = array();
foreach (get_rows("SELECT name AS Name, type_desc AS Engine FROM sys.all_objects WHERE schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND type IN ('S', 'U', 'V')" . ($name != "" ? " AND name = " . q($name) : "")) as $row) {
$result = $connection->query("SELECT name AS Name, type_desc AS Engine FROM sys.all_objects WHERE schema_id = SCHEMA_ID(" . $connection->quote(get_schema()) . ") AND type IN ('S', 'U', 'V')" . ($name != "" ? " AND name = " . $connection->quote($name) : ""));
while ($row = $result->fetch_assoc()) {
if ($name != "") {
return $row;
}
@@ -298,29 +304,26 @@ if (isset($_GET["mssql"])) {
return $return;
}
function is_view($table_status) {
return $table_status["Engine"] == "VIEW";
}
function fk_support($table_status) {
return true;
}
function fields($table) {
global $connection;
$return = array();
foreach (get_rows("SELECT c.*, t.name type, d.definition [default]
$result = $connection->query("SELECT c.*, t.name type, d.definition [default]
FROM sys.all_columns c
JOIN sys.all_objects o ON c.object_id = o.object_id
JOIN sys.types t ON c.user_type_id = t.user_type_id
LEFT JOIN sys.default_constraints d ON c.default_object_id = d.parent_column_id
WHERE o.schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND o.type IN ('S', 'U', 'V') AND o.name = " . q($table)
) as $row) {
$type = $row["type"];
$length = (ereg("char|binary", $type) ? $row["max_length"] : ($type == "decimal" ? "$row[precision],$row[scale]" : ""));
WHERE o.schema_id = SCHEMA_ID(" . $connection->quote(get_schema()) . ") AND o.type IN ('S', 'U', 'V') AND o.name = " . $connection->quote($table)
);
while ($row = $result->fetch_assoc()) {
$length = $row["max_length"]; //! precision, scale
$return[$row["name"]] = array(
"field" => $row["name"],
"full_type" => $type . ($length ? "($length)" : ""),
"type" => $type,
"full_type" => $row["type"] . ($length ? "($length)" : ""),
"type" => $row["type"],
"length" => $length,
"default" => $row["default"],
"null" => $row["is_nullable"],
@@ -340,24 +343,22 @@ WHERE o.schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND o.type IN ('S', 'U',
}
$return = array();
// sp_statistics doesn't return information about primary key
foreach (get_rows("SELECT i.name, key_ordinal, is_unique, is_primary_key, c.name AS column_name
FROM sys.indexes i
INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id
INNER JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id
WHERE OBJECT_NAME(i.object_id) = " . q($table)
, $connection2) as $row) {
$return[$row["name"]]["type"] = ($row["is_primary_key"] ? "PRIMARY" : ($row["is_unique"] ? "UNIQUE" : "INDEX"));
$return[$row["name"]]["lengths"] = array();
$return[$row["name"]]["columns"][$row["key_ordinal"]] = $row["column_name"];
$result = $connection2->query("SELECT indexes.name, key_ordinal, is_unique, is_primary_key, columns.name AS column_name
FROM sys.indexes
INNER JOIN sys.index_columns ON indexes.object_id = index_columns.object_id AND indexes.index_id = index_columns.index_id
INNER JOIN sys.columns ON index_columns.object_id = columns.object_id AND index_columns.column_id = columns.column_id
WHERE OBJECT_NAME(indexes.object_id) = " . $connection2->quote($table)
);
if ($result) {
while ($row = $result->fetch_assoc()) {
$return[$row["name"]]["type"] = ($row["is_primary_key"] ? "PRIMARY" : ($row["is_unique"] ? "UNIQUE" : "INDEX"));
$return[$row["name"]]["lengths"] = array();
$return[$row["name"]]["columns"][$row["key_ordinal"]] = $row["column_name"];
}
}
return $return;
}
function view($name) {
global $connection;
return array("select" => preg_replace('~^(?:[^[]|\\[[^]]*])*\\s+AS\\s+~isU', '', $connection->result("SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = SCHEMA_NAME() AND TABLE_NAME = " . q($name))));
}
function collations() {
$return = array();
foreach (get_vals("SELECT name FROM fn_helpcollations()") as $collation) {
@@ -376,11 +377,12 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
}
function exact_value($val) {
return q($val);
global $connection;
return $connection->quote($val);
}
function create_database($db, $collation) {
return queries("CREATE DATABASE " . idf_escape($db) . (eregi('^[a-z0-9_]+$', $collation) ? " COLLATE $collation" : ""));
return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " COLLATE " . idf_escape($collation) : ""));
}
function drop_databases($databases) {
@@ -388,74 +390,15 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
}
function rename_database($name, $collation) {
if (eregi('^[a-z0-9_]+$', $collation)) {
queries("ALTER DATABASE " . idf_escape(DB) . " COLLATE $collation");
if ($collation) {
queries("ALTER DATABASE " . idf_escape(DB) . " COLLATE " . idf_escape($collation));
}
queries("ALTER DATABASE " . idf_escape(DB) . " MODIFY NAME = " . idf_escape($name));
return true; //! false negative "The database name 'test2' has been set."
}
function auto_increment() {
return " IDENTITY" . ($_POST["Auto_increment"] != "" ? "(" . (+$_POST["Auto_increment"]) . ",1)" : "") . " PRIMARY KEY";
}
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
$alter = array();
foreach ($fields as $field) {
$column = idf_escape($field[0]);
$val = $field[1];
if (!$val) {
$alter["DROP"][] = " COLUMN $column";
} else {
$val[1] = preg_replace("~( COLLATE )'(\\w+)'~", "\\1\\2", $val[1]);
if ($field[0] == "") {
$alter["ADD"][] = "\n " . implode("", $val) . ($table == "" ? substr($foreign[$val[0]], 16 + strlen($val[0])) : ""); // 16 - strlen(" FOREIGN KEY ()")
} else {
unset($val[6]); //! identity can't be removed
if ($column != $val[0]) {
queries("EXEC sp_rename " . q(table($table) . ".$column") . ", " . q(idf_unescape($val[0])) . ", 'COLUMN'");
}
$alter["ALTER COLUMN " . implode("", $val)][] = "";
}
}
}
if ($table == "") {
return queries("CREATE TABLE " . table($name) . " (" . implode(",", (array) $alter["ADD"]) . "\n)");
}
if ($table != $name) {
queries("EXEC sp_rename " . q(table($table)) . ", " . q($name));
}
if ($foreign) {
$alter[""] = $foreign;
}
foreach ($alter as $key => $val) {
if (!queries("ALTER TABLE " . idf_escape($name) . " $key" . implode(",", $val))) {
return false;
}
}
return true;
}
function alter_indexes($table, $alter) {
$index = array();
$drop = array();
foreach ($alter as $val) {
if ($val[2]) {
if ($val[0] == "PRIMARY") { //! sometimes used also for UNIQUE
$drop[] = $val[1];
} else {
$index[] = "$val[1] ON " . table($table);
}
} elseif (!queries(($val[0] != "PRIMARY"
? "CREATE" . ($val[0] != "INDEX" ? " UNIQUE" : "") . " INDEX " . idf_escape(uniqid($table . "_")) . " ON " . table($table)
: "ALTER TABLE " . table($table) . " ADD PRIMARY KEY"
) . " $val[1]")) {
return false;
}
}
return (!$index || queries("DROP INDEX " . implode(", ", $index)))
&& (!$drop || queries("ALTER TABLE " . table($table) . " DROP " . implode(", ", $drop)))
;
return " IDENTITY";
}
function begin() {
@@ -466,22 +409,6 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
return queries("INSERT INTO " . table($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES"));
}
function insert_update($table, $set, $primary) {
$update = array();
$where = array();
foreach ($set as $key => $val) {
$update[] = "$key = $val";
if (isset($primary[idf_unescape($key)])) {
$where[] = "$key = $val";
}
}
// can use only one query for all rows with different API
return queries("MERGE " . table($table) . " USING (VALUES(" . implode(", ", $set) . ")) AS source (c" . implode(", c", range(1, count($set))) . ") ON " . implode(" AND ", $where) //! source, c1 - possible conflict
. " WHEN MATCHED THEN UPDATE SET " . implode(", ", $update)
. " WHEN NOT MATCHED THEN INSERT (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ");" // ; is mandatory
);
}
function last_id() {
global $connection;
return $connection->result("SELECT SCOPE_IDENTITY()"); // @@IDENTITY can return trigger INSERT
@@ -495,8 +422,10 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
}
function foreign_keys($table) {
global $connection;
$result = $connection->query("EXEC sp_fkeys @fktable_name = " . $connection->quote($table));
$return = array();
foreach (get_rows("EXEC sp_fkeys @fktable_name = " . q($table)) as $row) {
while ($row = $result->fetch_assoc()) {
$foreign_key = &$return[$row["FK_NAME"]];
$foreign_key["table"] = $row["PKTABLE_NAME"];
$foreign_key["source"][] = $row["FKCOLUMN_NAME"];
@@ -522,30 +451,31 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
}
function trigger($name) {
$rows = get_rows("SELECT s.name [Trigger],
global $connection;
$result = $connection->query("SELECT s.name [Trigger],
CASE WHEN OBJECTPROPERTY(s.id, 'ExecIsInsertTrigger') = 1 THEN 'INSERT' WHEN OBJECTPROPERTY(s.id, 'ExecIsUpdateTrigger') = 1 THEN 'UPDATE' WHEN OBJECTPROPERTY(s.id, 'ExecIsDeleteTrigger') = 1 THEN 'DELETE' END [Event],
CASE WHEN OBJECTPROPERTY(s.id, 'ExecIsInsteadOfTrigger') = 1 THEN 'INSTEAD OF' ELSE 'AFTER' END [Timing],
c.text
FROM sysobjects s
JOIN syscomments c ON s.id = c.id
WHERE s.xtype = 'TR' AND s.name = " . q($name)
WHERE s.xtype = 'TR' AND s.name = " . $connection->quote($name)
); // triggers are not schema-scoped
$return = reset($rows);
if ($return) {
$return["Statement"] = preg_replace('~^.+\\s+AS\\s+~isU', '', $return["text"]); //! identifiers, comments
}
return $return;
$row = $result->fetch_assoc();
$row["Statement"] = preg_replace('~^.+\\s+AS\\s+~isU', '', $row["text"]); //! identifiers, comments
return $row;
}
function triggers($table) {
global $connection;
$return = array();
foreach (get_rows("SELECT sys1.name,
$result = $connection->query("SELECT sys1.name,
CASE WHEN OBJECTPROPERTY(sys1.id, 'ExecIsInsertTrigger') = 1 THEN 'INSERT' WHEN OBJECTPROPERTY(sys1.id, 'ExecIsUpdateTrigger') = 1 THEN 'UPDATE' WHEN OBJECTPROPERTY(sys1.id, 'ExecIsDeleteTrigger') = 1 THEN 'DELETE' END [Event],
CASE WHEN OBJECTPROPERTY(sys1.id, 'ExecIsInsteadOfTrigger') = 1 THEN 'INSTEAD OF' ELSE 'AFTER' END [Timing]
FROM sysobjects sys1
JOIN sysobjects sys2 ON sys1.parent_obj = sys2.id
WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)
) as $row) { // triggers are not schema-scoped
WHERE sys1.xtype = 'TR' AND sys2.name = " . $connection->quote($table)
); // triggers are not schema-scoped
while ($row = $result->fetch_assoc()) {
$return[$row["name"]] = array($row["Timing"], $row["Event"]);
}
return $return;
@@ -587,7 +517,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)
}
function support($feature) {
return ereg('^(scheme|trigger|view|drop_col)$', $feature); //! routine|
return ereg('^(scheme|trigger|drop_col)$', $feature); //! view|routine|
}
$jush = "mssql";
@@ -603,7 +533,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)
$structured_types[$key] = array_keys($val);
}
$unsigned = array();
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "");
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL");
$functions = array("len", "lower", "round", "upper");
$grouping = array("avg", "count", "count distinct", "max", "min", "sum");
$edit_functions = array(

View File

@@ -1,8 +1,12 @@
<?php
$drivers = array("server" => "MySQL") + $drivers;
$possible_drivers[] = "MySQLi";
$possible_drivers[] = "MySQL";
$possible_drivers[] = "PDO_MySQL";
if (extension_loaded("mysqli") || extension_loaded("mysql") || extension_loaded("pdo_mysql")) {
$drivers = array("server" => "MySQL") + $drivers;
}
if (!defined("DRIVER")) {
$possible_drivers = array("MySQLi", "MySQL", "PDO_MySQL");
define("DRIVER", "server"); // server - backwards compatibility
// MySQLi supports everything, MySQL doesn't support multiple result sets, PDO_MySQL doesn't support orgtable
if (extension_loaded("mysqli")) {
@@ -14,9 +18,8 @@ if (!defined("DRIVER")) {
}
function connect($server, $username, $password) {
mysqli_report(MYSQLI_REPORT_OFF); // stays between requests, not required since PHP 5.3.4
list($host, $port) = explode(":", $server, 2); // part after : is used for port or socket
$return = @$this->real_connect(
return @$this->real_connect(
($server != "" ? $host : ini_get("mysqli.default_host")),
("$server$username" != "" ? $username : ini_get("mysqli.default_user")),
("$server$username$password" != "" ? $password : ini_get("mysqli.default_pw")),
@@ -24,14 +27,6 @@ if (!defined("DRIVER")) {
(is_numeric($port) ? $port : ini_get("mysqli.default_port")),
(!is_numeric($port) ? $port : null)
);
if ($return) {
if (method_exists($this, 'set_charset')) {
$this->set_charset("utf8");
} else {
$this->query("SET NAMES utf8");
}
}
return $return;
}
function result($query, $field = 0) {
@@ -74,11 +69,6 @@ if (!defined("DRIVER")) {
);
if ($this->_link) {
$this->server_info = mysql_get_server_info($this->_link);
if (function_exists('mysql_set_charset')) {
mysql_set_charset("utf8", $this->_link);
} else {
$this->query("SET NAMES utf8");
}
} else {
$this->error = mysql_error();
}
@@ -150,7 +140,7 @@ if (!defined("DRIVER")) {
*/
function result($query, $field = 0) {
$result = $this->query($query);
if (!$result || !$result->num_rows) {
if (!$result) {
return false;
}
return mysql_result($result->_result, 0, $field);
@@ -160,7 +150,7 @@ if (!defined("DRIVER")) {
class Min_Result {
var
$num_rows, ///< @var int number of rows in the result
$_result, $_offset = 0 ///< @access private
$_result ///< @access private
;
/** Constructor
@@ -189,7 +179,7 @@ if (!defined("DRIVER")) {
* @return object properties: name, type, orgtable, orgname, charsetnr
*/
function fetch_field() {
$return = mysql_fetch_field($this->_result, $this->_offset++); // offset required under certain conditions
$return = mysql_fetch_field($this->_result);
$return->orgtable = $return->table;
$return->orgname = $return->name;
$return->charsetnr = ($return->blob ? 63 : 0);
@@ -208,8 +198,7 @@ if (!defined("DRIVER")) {
var $extension = "PDO_MySQL";
function connect($server, $username, $password) {
$this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password);
$this->query("SET NAMES utf8"); // charset in DSN is ignored
$this->dsn("mysql:host=" . str_replace(":", ";unix_socket=", preg_replace('~:([0-9])~', ';port=\\1', $server)), $username, $password);
return true;
}
@@ -250,7 +239,8 @@ if (!defined("DRIVER")) {
$connection = new Min_DB;
$credentials = $adminer->credentials();
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
$connection->query("SET sql_quote_show_create = 1");
$connection->query("SET SQL_QUOTE_SHOW_CREATE=1");
$connection->query("SET NAMES utf8");
return $connection;
}
return $connection->error;
@@ -261,16 +251,15 @@ if (!defined("DRIVER")) {
* @return array
*/
function get_databases($flush = true) {
global $connection;
// SHOW DATABASES can take a very long time so it is cached
$return = &get_session("dbs");
$return = &get_session("databases");
if (!isset($return)) {
if ($flush) {
restart_session();
ob_flush();
flush();
}
$return = get_vals($connection->server_info >= 5 ? "SELECT SCHEMA_NAME FROM information_schema.SCHEMATA" : "SHOW DATABASES"); // SHOW DATABASES can be disabled by skip_show_database
$return = get_vals("SHOW DATABASES");
}
return $return;
}
@@ -308,7 +297,7 @@ if (!defined("DRIVER")) {
$return = $match[1];
} elseif (preg_match('~ CHARACTER SET ([^ ]+)~', $create, $match)) {
// default collation
$return = $collations[$match[1]][-1];
$return = $collations[$match[1]][0];
}
return $return;
}
@@ -317,8 +306,10 @@ if (!defined("DRIVER")) {
* @return array
*/
function engines() {
global $connection;
$return = array();
foreach (get_rows("SHOW ENGINES") as $row) {
$result = $connection->query("SHOW ENGINES");
while ($row = $result->fetch_assoc()) {
if (ereg("YES|DEFAULT", $row["Support"])) {
$return[] = $row["Engine"];
}
@@ -359,13 +350,16 @@ if (!defined("DRIVER")) {
* @return array
*/
function table_status($name = "") {
global $connection;
$return = array();
foreach (get_rows("SHOW TABLE STATUS" . ($name != "" ? " LIKE " . q(addcslashes($name, "%_")) : "")) as $row) {
$result = $connection->query("SHOW TABLE STATUS" . ($name != "" ? " LIKE " . $connection->quote(addcslashes($name, "%_")) : ""));
while ($row = $result->fetch_assoc()) {
if ($row["Engine"] == "InnoDB") {
// ignore internal comment, unnecessary since MySQL 5.1.21
$row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]);
}
if (!isset($row["Rows"])) {
$row["Engine"] = "VIEW";
$row["Comment"] = "";
}
if ($name != "") {
@@ -376,14 +370,6 @@ if (!defined("DRIVER")) {
return $return;
}
/** Find out whether the identifier is view
* @param array
* @return bool
*/
function is_view($table_status) {
return !isset($table_status["Rows"]);
}
/** Check if table supports foreign keys
* @param array result of table_status
* @return bool
@@ -397,24 +383,28 @@ if (!defined("DRIVER")) {
* @return array array($name => array("field" => , "full_type" => , "type" => , "length" => , "unsigned" => , "default" => , "null" => , "auto_increment" => , "on_update" => , "collation" => , "privileges" => , "comment" => , "primary" => ))
*/
function fields($table) {
global $connection;
$return = array();
foreach (get_rows("SHOW FULL COLUMNS FROM " . table($table)) as $row) {
preg_match('~^([^( ]+)(?:\\((.+)\\))?( unsigned)?( zerofill)?$~', $row["Type"], $match);
$return[$row["Field"]] = array(
"field" => $row["Field"],
"full_type" => $row["Type"],
"type" => $match[1],
"length" => $match[2],
"unsigned" => ltrim($match[3] . $match[4]),
"default" => ($row["Default"] != "" || ereg("char", $match[1]) ? $row["Default"] : null),
"null" => ($row["Null"] == "YES"),
"auto_increment" => ($row["Extra"] == "auto_increment"),
"on_update" => (eregi('^on update (.+)', $row["Extra"], $match) ? $match[1] : ""), //! available since MySQL 5.1.23
"collation" => $row["Collation"],
"privileges" => array_flip(explode(",", $row["Privileges"])),
"comment" => $row["Comment"],
"primary" => ($row["Key"] == "PRI"),
);
$result = $connection->query("SHOW FULL COLUMNS FROM " . table($table));
if ($result) {
while ($row = $result->fetch_assoc()) {
preg_match('~^([^( ]+)(?:\\((.+)\\))?( unsigned)?( zerofill)?$~', $row["Type"], $match);
$return[$row["Field"]] = array(
"field" => $row["Field"],
"full_type" => $row["Type"],
"type" => $match[1],
"length" => $match[2],
"unsigned" => ltrim($match[3] . $match[4]),
"default" => ($row["Default"] != "" || ereg("char", $match[1]) ? $row["Default"] : null),
"null" => ($row["Null"] == "YES"),
"auto_increment" => ($row["Extra"] == "auto_increment"),
"on_update" => (eregi('^on update (.+)', $row["Extra"], $match) ? $match[1] : ""), //! available since MySQL 5.1.23
"collation" => $row["Collation"],
"privileges" => array_flip(explode(",", $row["Privileges"])),
"comment" => $row["Comment"],
"primary" => ($row["Key"] == "PRI"),
);
}
}
return $return;
}
@@ -430,10 +420,13 @@ if (!defined("DRIVER")) {
$connection2 = $connection;
}
$return = array();
foreach (get_rows("SHOW INDEX FROM " . table($table), $connection2) as $row) {
$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["Column_name"];
$return[$row["Key_name"]]["lengths"][] = $row["Sub_part"];
$result = $connection2->query("SHOW INDEX FROM " . table($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["Column_name"];
$return[$row["Key_name"]]["lengths"][] = $row["Sub_part"];
}
}
return $return;
}
@@ -478,17 +471,15 @@ if (!defined("DRIVER")) {
* @return array
*/
function collations() {
global $connection;
$return = array();
foreach (get_rows("SHOW COLLATION") as $row) {
if ($row["Default"]) {
$return[$row["Charset"]][-1] = $row["Collation"];
} else {
$return[$row["Charset"]][] = $row["Collation"];
}
$result = $connection->query("SHOW COLLATION");
while ($row = $result->fetch_assoc()) {
$return[$row["Charset"]][] = $row["Collation"];
}
ksort($return);
foreach ($return as $key => $val) {
asort($return[$key]);
sort($return[$key]);
}
return $return;
}
@@ -515,7 +506,8 @@ if (!defined("DRIVER")) {
* @return string
*/
function exact_value($val) {
return q($val) . " COLLATE utf8_bin";
global $connection;
return $connection->quote($val) . " COLLATE utf8_bin";
}
/** Create database
@@ -523,8 +515,9 @@ if (!defined("DRIVER")) {
* @return string
*/
function create_database($db, $collation) {
set_session("dbs", null);
return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " COLLATE " . q($collation) : ""));
global $connection;
set_session("databases", null);
return queries("CREATE DATABASE " . idf_escape($db) . ($collation ? " COLLATE " . $connection->quote($collation) : ""));
}
/** Drop databases
@@ -532,8 +525,8 @@ if (!defined("DRIVER")) {
* @return bool
*/
function drop_databases($databases) {
set_session("dbs", null);
return apply_queries("DROP DATABASE", $databases, 'idf_escape');
set_session("databases", null);
return apply_queries("DROP DATABASE", $db, 'idf_escape');
}
/** Rename database from DB
@@ -542,18 +535,23 @@ if (!defined("DRIVER")) {
* @return bool
*/
function rename_database($name, $collation) {
global $connection;
$return = false;
if (create_database($name, $collation)) {
//! move triggers
$rename = array();
foreach (tables_list() as $table => $type) {
$rename[] = table($table) . " TO " . idf_escape($name) . "." . table($table);
$return = true; // table list may by empty
foreach (tables_list() as $table) {
if (!queries("RENAME TABLE " . table($table) . " TO " . idf_escape($name) . "." . table($table))) {
$return = false;
break;
}
}
if (!$rename || queries("RENAME TABLE " . implode(", ", $rename))) {
if ($return) {
queries("DROP DATABASE " . idf_escape(DB));
return true;
//! saved to history of removed database
}
}
return false;
return $return;
}
/** Generate modifier for auto increment column
@@ -589,6 +587,7 @@ if (!defined("DRIVER")) {
* @return bool
*/
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
global $connection;
$alter = array();
foreach ($fields as $field) {
$alter[] = ($field[1]
@@ -597,9 +596,9 @@ if (!defined("DRIVER")) {
);
}
$alter = array_merge($alter, $foreign);
$status = "COMMENT=" . q($comment)
. ($engine ? " ENGINE=" . q($engine) : "")
. ($collation ? " COLLATE " . q($collation) : "")
$status = "COMMENT=" . $connection->quote($comment)
. ($engine ? " ENGINE=" . $connection->quote($engine) : "")
. ($collation ? " COLLATE " . $connection->quote($collation) : "")
. ($auto_increment != "" ? " AUTO_INCREMENT=$auto_increment" : "")
. $partitioning
;
@@ -651,7 +650,6 @@ if (!defined("DRIVER")) {
/** Move tables to other schema
* @param array
* @param array
* @param string
* @return bool
*/
@@ -664,41 +662,14 @@ if (!defined("DRIVER")) {
//! move triggers
}
/** Copy tables to other schema
* @param array
* @param array
* @param string
* @return bool
*/
function copy_tables($tables, $views, $target) {
foreach ($tables as $table) {
$name = ($target == DB ? table("copy_$table") : idf_escape($target) . "." . table($table));
if (!queries("DROP TABLE IF EXISTS $name")
|| !queries("CREATE TABLE $name LIKE " . table($table))
|| !queries("INSERT INTO $name SELECT * FROM " . table($table))
) {
return false;
}
}
foreach ($views as $table) {
$name = ($target == DB ? table("copy_$table") : idf_escape($target) . "." . table($table));
$view = view($table);
if (!queries("DROP VIEW IF EXISTS $name")
|| !queries("CREATE VIEW $name AS $view[select]") //! USE to avoid db.table
) {
return false;
}
}
return true;
}
/** Get information about trigger
* @param string trigger name
* @return array array("Trigger" => , "Timing" => , "Event" => , "Statement" => )
*/
function trigger($name) {
$rows = get_rows("SHOW TRIGGERS WHERE `Trigger` = " . q($name));
return reset($rows);
global $connection;
$result = $connection->query("SHOW TRIGGERS WHERE `Trigger` = " . $connection->quote($name));
return $result->fetch_assoc();
}
/** Get defined triggers
@@ -706,8 +677,10 @@ if (!defined("DRIVER")) {
* @return array array($name => array($timing, $event))
*/
function triggers($table) {
global $connection;
$return = array();
foreach (get_rows("SHOW TRIGGERS LIKE " . q(addcslashes($table, "%_"))) as $row) {
$result = $connection->query("SHOW TRIGGERS LIKE " . $connection->quote(addcslashes($table, "%_")));
while ($row = $result->fetch_assoc()) {
$return[$row["Trigger"]] = array($row["Timing"], $row["Event"]);
}
return $return;
@@ -731,8 +704,8 @@ if (!defined("DRIVER")) {
*/
function routine($name, $type) {
global $connection, $enum_length, $inout, $types;
$aliases = array("bool", "boolean", "integer", "double precision", "real", "dec", "numeric", "fixed", "national char", "national varchar");
$type_pattern = "((" . implode("|", array_merge(array_keys($types), $aliases)) . ")(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";
$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 = "((" . implode("|", array_keys($types + $aliases)) . ")(?:\\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 = $connection->result("SHOW CREATE $type " . idf_escape($name), 2);
preg_match("~\\(((?:$pattern\\s*,?)*)\\)" . ($type == "FUNCTION" ? "\\s*RETURNS\\s+$type_pattern" : "") . "\\s*(.*)~is", $create, $match);
@@ -740,9 +713,10 @@ if (!defined("DRIVER")) {
preg_match_all("~$pattern\\s*,?~is", $match[1], $matches, PREG_SET_ORDER);
foreach ($matches as $param) {
$name = str_replace("``", "`", $param[2]) . $param[3];
$data_type = strtolower($param[5]);
$fields[] = array(
"field" => $name,
"type" => strtolower($param[5]),
"type" => (isset($aliases[$data_type]) ? $aliases[$data_type] : $data_type),
"length" => preg_replace_callback("~$enum_length~s", 'normalize_enum', $param[6]),
"unsigned" => strtolower(preg_replace('~\\s+~', ' ', trim("$param[8] $param[7]"))),
"full_type" => $param[4],
@@ -761,7 +735,13 @@ if (!defined("DRIVER")) {
}
function routines() {
return get_rows("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . q(DB));
global $connection;
$return = array();
$result = $connection->query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . $connection->quote(DB));
while ($row = $result->fetch_assoc()) {
$return[] = $row;
}
return $return;
}
/** Begin transaction
@@ -780,20 +760,6 @@ if (!defined("DRIVER")) {
return queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")");
}
/** Insert or update data in the table
* @param string
* @param array
* @param array columns in keys
* @return bool
*/
function insert_update($table, $set, $primary) {
foreach ($set as $key => $val) {
$set[$key] = "$key = $val";
}
$update = implode(", ", $set);
return queries("INSERT INTO " . table($table) . " SET $update ON DUPLICATE KEY UPDATE $update");
}
/** Get last auto increment ID
* @return string
*/
@@ -811,13 +777,6 @@ if (!defined("DRIVER")) {
return $connection->query("EXPLAIN $query");
}
/** Get user defined types
* @return array
*/
function types() {
return array();
}
/** Get existing schemas
* @return array
*/
@@ -842,24 +801,11 @@ if (!defined("DRIVER")) {
/** Get SQL command to create table
* @param string
* @param bool
* @return string
*/
function create_sql($table, $auto_increment) {
function create_sql($table) {
global $connection;
$return = $connection->result("SHOW CREATE TABLE " . table($table), 1);
if (!$auto_increment) {
$return = preg_replace('~ AUTO_INCREMENT=\\d+~', '', $return); //! skip comments
}
return $return;
}
/** Get SQL command to truncate table
* @param string
* @return string
*/
function truncate_sql($table) {
return "TRUNCATE " . table($table);
return $connection->result("SHOW CREATE TABLE " . table($table), 1);
}
/** Get SQL command to change database
@@ -876,10 +822,14 @@ if (!defined("DRIVER")) {
* @return string
*/
function trigger_sql($table, $style) {
global $connection;
$result = $connection->query("SHOW TRIGGERS LIKE " . $connection->quote(addcslashes($table, "%_")));
$return = "";
foreach (get_rows("SHOW TRIGGERS LIKE " . q(addcslashes($table, "%_")), null, "-- ") as $row) {
$return .= "\n" . ($style == 'CREATE+ALTER' ? "DROP TRIGGER IF EXISTS " . idf_escape($row["Trigger"]) . ";;\n" : "")
. "CREATE TRIGGER " . idf_escape($row["Trigger"]) . " $row[Timing] $row[Event] ON " . table($row["Table"]) . " FOR EACH ROW\n$row[Statement];;\n";
if ($result->num_rows) {
while ($row = $result->fetch_assoc()) {
$return .= "\n" . ($style == 'CREATE+ALTER' ? "DROP TRIGGER IF EXISTS " . idf_escape($row["Trigger"]) . ";;\n" : "")
. "CREATE TRIGGER " . idf_escape($row["Trigger"]) . " $row[Timing] $row[Event] ON " . table($row["Table"]) . " FOR EACH ROW\n$row[Statement];;\n";
}
}
return $return;
}
@@ -899,12 +849,12 @@ if (!defined("DRIVER")) {
}
/** Check whether a feature is supported
* @param string "comment", "drop_col", "dump", "event", "partitioning", "routine", "scheme", "sequence", "status", "trigger", "type", "variables", "view", "copy"
* @param string
* @return bool
*/
function support($feature) {
global $connection;
return !ereg("scheme|sequence|type" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|view|routine|trigger" : "") : ""), $feature);
return !ereg("scheme|sequence" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|view|routine|trigger" : "") : ""), $feature);
}
$jush = "sql"; ///< @var string JUSH identifier
@@ -921,13 +871,12 @@ if (!defined("DRIVER")) {
$structured_types[$key] = array_keys($val);
}
$unsigned = array("unsigned", "zerofill", "unsigned zerofill"); ///< @var array number variants
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", ""); ///< @var array operators used in select
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL"); ///< @var array operators used in select
$functions = array("char_length", "date", "from_unixtime", "hex", "lower", "round", "sec_to_time", "time_to_sec", "upper"); ///< @var array functions used in select
$grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum"); ///< @var array grouping functions used in select
$edit_functions = array( ///< @var array of array("$type|$type2" => "$function/$function2") functions used in editing, [0] - edit and insert, [1] - edit only
array(
"char" => "md5/sha1/password/encrypt/uuid", //! JavaScript for disabling maxlength
"binary" => "md5/sha1/hex",
"date|time" => "now",
), array(
"int|float|double|decimal" => "+/-",

View File

@@ -1,8 +1,11 @@
<?php
$drivers["oracle"] = "Oracle";
$possible_drivers[] = "OCI8";
$possible_drivers[] = "PDO_OCI";
if (extension_loaded("oci8") || extension_loaded("pdo_oci")) {
$drivers["oracle"] = "Oracle";
}
if (isset($_GET["oracle"])) {
$possible_drivers = array("OCI8", "PDO_OCI");
define("DRIVER", "oracle");
if (extension_loaded("oci8")) {
class Min_DB {
@@ -17,7 +20,7 @@ if (isset($_GET["oracle"])) {
}
function connect($server, $username, $password) {
$this->_link = @oci_new_connect($username, $password, $server, "AL32UTF8");
$this->_link = @oci_new_connect($username, $password, $server); //! AL32UTF8
if ($this->_link) {
$this->server_info = oci_server_version($this->_link);
return true;
@@ -80,6 +83,7 @@ if (isset($_GET["oracle"])) {
function Min_Result($result) {
$this->_result = $result;
$this->num_rows = -1; // all results unbuffered
}
function _convert($row) {
@@ -119,12 +123,9 @@ if (isset($_GET["oracle"])) {
var $extension = "PDO_OCI";
function connect($server, $username, $password) {
$this->dsn("oci:dbname=//$server;charset=AL32UTF8", $username, $password);
return true;
}
function select_db($database) {
return true;
}
}
@@ -175,9 +176,8 @@ if (isset($_GET["oracle"])) {
}
function tables_list() {
return get_key_vals("SELECT table_name, 'table' FROM all_tables WHERE tablespace_name = " . q(DB) . "
UNION SELECT view_name, 'view' FROM user_views"
); //! views don't have schema
global $connection;
return get_key_vals("SELECT table_name FROM all_tables WHERE tablespace_name = " . $connection->quote(DB)); //! views
}
function count_tables($databases) {
@@ -185,11 +185,10 @@ UNION SELECT view_name, 'view' FROM user_views"
}
function table_status($name = "") {
global $connection;
$return = array();
$search = q($name);
foreach (get_rows('SELECT table_name "Name", \'table\' "Engine" FROM all_tables WHERE tablespace_name = ' . q(DB) . ($name != "" ? " AND table_name = $search" : "") . "
UNION SELECT view_name, 'view' FROM user_views" . ($name != "" ? " WHERE view_name = $search" : "")
) as $row) {
$result = $connection->query('SELECT table_name "Name" FROM all_tables' . ($name != "" ? ' WHERE table_name = ' . $connection->quote($name) : ''));
while ($row = $result->fetch_assoc()) {
if ($name != "") {
return $row;
}
@@ -198,35 +197,35 @@ UNION SELECT view_name, 'view' FROM user_views" . ($name != "" ? " WHERE view_na
return $return;
}
function is_view($table_status) {
return $table_status["Engine"] == "view";
}
function fk_support($table_status) {
return true;
}
function fields($table) {
global $connection;
$return = array();
foreach (get_rows("SELECT * FROM all_tab_columns WHERE table_name = " . q($table) . " ORDER BY column_id") as $row) {
$type = $row["DATA_TYPE"];
$length = "$row[DATA_PRECISION],$row[DATA_SCALE]";
if ($length == ",") {
$length = $row["DATA_LENGTH"];
} //! int
$return[$row["COLUMN_NAME"]] = array(
"field" => $row["COLUMN_NAME"],
"full_type" => $type . ($length ? "($length)" : ""),
"type" => strtolower($type),
"length" => $length,
"default" => $row["DATA_DEFAULT"],
"null" => ($row["NULLABLE"] == "Y"),
//! "auto_increment" => false,
//! "collation" => $row["CHARACTER_SET_NAME"],
"privileges" => array("insert" => 1, "select" => 1, "update" => 1),
//! "comment" => $row["Comment"],
//! "primary" => ($row["Key"] == "PRI"),
);
$result = $connection->query("SELECT * FROM all_tab_columns WHERE table_name = " . $connection->quote($table) . " ORDER BY column_id");
if ($result) {
while ($row = $result->fetch_assoc()) {
$type = $row["DATA_TYPE"];
$length = "$row[DATA_PRECISION],$row[DATA_SCALE]";
if ($length == ",") {
$length = $row["DATA_LENGTH"];
} //! int
$return[$row["COLUMN_NAME"]] = array(
"field" => $row["COLUMN_NAME"],
"full_type" => $type . ($length ? "($length)" : ""),
"type" => strtolower($type),
"length" => $length,
"default" => $row["DATA_DEFAULT"],
"null" => ($row["NULLABLE"] == "Y"),
//! "auto_increment" => false,
//! "collation" => $row["CHARACTER_SET_NAME"],
"privileges" => array("insert" => 1, "select" => 1, "update" => 1),
//! "comment" => $row["Comment"],
//! "primary" => ($row["Key"] == "PRI"),
);
}
}
return $return;
}
@@ -235,11 +234,6 @@ UNION SELECT view_name, 'view' FROM user_views" . ($name != "" ? " WHERE view_na
return array(); //!
}
function view($name) {
$rows = get_rows('SELECT text "select" FROM user_views WHERE view_name = ' . q($name));
return reset($rows);
}
function collations() {
return array(); //!
}
@@ -254,12 +248,12 @@ UNION SELECT view_name, 'view' FROM user_views" . ($name != "" ? " WHERE view_na
}
function exact_value($val) {
return q($val);
global $connection;
return $connection->quote($val);
}
function explain($connection, $query) {
$connection->query("EXPLAIN PLAN FOR $query");
return $connection->query("SELECT * FROM plan_table");
//!
}
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
@@ -324,17 +318,8 @@ UNION SELECT view_name, 'view' FROM user_views" . ($name != "" ? " WHERE view_na
return true;
}
function show_variables() {
return get_key_vals('SELECT name, display_value FROM v$parameter');
}
function show_status() {
$rows = get_rows('SELECT * FROM v$instance');
return reset($rows);
}
function support($feature) {
return ereg("view|drop_col|variables|status", $feature); //!
return ereg("drop_col", $feature); //!
}
$jush = "oracle";
@@ -350,7 +335,7 @@ UNION SELECT view_name, 'view' FROM user_views" . ($name != "" ? " WHERE view_na
$structured_types[$key] = array_keys($val);
}
$unsigned = array();
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "");
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL");
$functions = array("length", "lower", "round", "upper");
$grouping = array("avg", "count", "count distinct", "max", "min", "sum");
$edit_functions = array(

View File

@@ -1,8 +1,11 @@
<?php
$drivers["pgsql"] = "PostgreSQL";
$possible_drivers[] = "PgSQL";
$possible_drivers[] = "PDO_PgSQL";
if (extension_loaded("pgsql") || extension_loaded("pdo_pgsql")) {
$drivers["pgsql"] = "PostgreSQL";
}
if (isset($_GET["pgsql"])) {
$possible_drivers = array("PgSQL", "PDO_PgSQL");
define("DRIVER", "pgsql");
if (extension_loaded("pgsql")) {
class Min_DB {
@@ -19,11 +22,11 @@ if (isset($_GET["pgsql"])) {
function connect($server, $username, $password) {
set_error_handler(array($this, '_error'));
$this->_string = "host='" . str_replace(":", "' port='", addcslashes($server, "'\\")) . "' user='" . addcslashes($username, "'\\") . "' password='" . addcslashes($password, "'\\") . "'";
$this->_link = @pg_connect($this->_string . (DB != "" ? " dbname='" . addcslashes(DB, "'\\") . "'" : " dbname='template1'"), PGSQL_CONNECT_FORCE_NEW);
$this->_link = @pg_connect($this->_string . (DB != "" ? " dbname='" . addcslashes(DB, "'\\") . "'" : ""), PGSQL_CONNECT_FORCE_NEW);
if (!$this->_link && DB != "") {
// try to connect directly with database for performance
$this->_database = false;
$this->_link = @pg_connect("$this->_string dbname='template1'", PGSQL_CONNECT_FORCE_NEW);
$this->_link = @pg_connect($this->_string, PGSQL_CONNECT_FORCE_NEW);
}
restore_error_handler();
if ($this->_link) {
@@ -42,7 +45,7 @@ if (isset($_GET["pgsql"])) {
if ($database == DB) {
return $this->_database;
}
$return = @pg_connect("$this->_string dbname='" . addcslashes($database, "'\\") . "'", PGSQL_CONNECT_FORCE_NEW);
$return = @pg_connect($this->_connection . " dbname='" . addcslashes($database, "'\\") . "'", PGSQL_CONNECT_FORCE_NEW);
if ($return) {
$this->_link = $return;
}
@@ -50,7 +53,7 @@ if (isset($_GET["pgsql"])) {
}
function close() {
$this->_link = @pg_connect("$this->_string dbname='template1'");
$this->_link = @pg_connect($this->_string);
}
function query($query, $unbuffered = false) {
@@ -80,7 +83,7 @@ if (isset($_GET["pgsql"])) {
function result($query, $field = 0) {
$result = $this->query($query);
if (!$result || !$result->num_rows) {
if (!$result) {
return false;
}
return pg_fetch_result($result->_result, 0, $field);
@@ -187,6 +190,7 @@ if (isset($_GET["pgsql"])) {
}
function tables_list() {
global $connection;
return get_key_vals("SELECT table_name, table_type FROM information_schema.tables WHERE table_schema = current_schema() ORDER BY table_name");
}
@@ -195,47 +199,46 @@ if (isset($_GET["pgsql"])) {
}
function table_status($name = "") {
global $connection;
$return = array();
foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN '' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids AS \"Oid\"
FROM pg_class
$result = $connection->query("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN '' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", pg_catalog.obj_description(oid, 'pg_class') AS \"Comment\"
FROM pg_catalog.pg_class
WHERE relkind IN ('r','v')
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())"
. ($name != "" ? " AND relname = " . q($name) : "")
) as $row) { //! Index_length, Auto_increment
. ($name != "" ? " AND relname = " . $connection->quote($name) : "")
); //! Index_length, Auto_increment
while ($row = $result->fetch_assoc()) {
$return[$row["Name"]] = $row;
}
return ($name != "" ? $return[$name] : $return);
}
function is_view($table_status) {
return $table_status["Engine"] == "view";
}
function fk_support($table_status) {
return true;
}
function fields($table) {
global $connection;
$return = array();
foreach (get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, d.adsrc AS default, a.attnotnull, col_description(c.oid, a.attnum) AS comment
FROM pg_class c
JOIN pg_namespace n ON c.relnamespace = n.oid
JOIN pg_attribute a ON c.oid = a.attrelid
LEFT JOIN pg_attrdef d ON c.oid = d.adrelid AND a.attnum = d.adnum
WHERE c.relname = " . q($table) . "
AND n.nspname = current_schema()
AND NOT a.attisdropped
AND a.attnum > 0
ORDER BY a.attnum"
) as $row) {
//! collation, primary
ereg('(.*)(\\((.*)\\))?', $row["full_type"], $match);
list(, $row["type"], , $row["length"]) = $match;
$row["full_type"] = $row["type"] . ($row["length"] ? "($row[length])" : "");
$row["null"] = ($row["attnotnull"] == "f");
$row["auto_increment"] = eregi("^nextval\\(", $row["default"]);
$row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1);
$return[$row["field"]] = $row;
$table_oid = $connection->result("SELECT oid FROM pg_class WHERE relname = " . $connection->quote($table));
$result = $connection->query("SELECT *, col_description($table_oid, ordinal_position) AS comment FROM information_schema.columns WHERE table_name = " . $connection->quote($table) . " ORDER BY ordinal_position");
if ($result) {
while ($row = $result->fetch_assoc()) {
$length = $row["character_maximum_length"];
$return[$row["column_name"]] = array(
"field" => $row["column_name"],
"full_type" => $row["data_type"] . ($length ? "($length)" : ""),
"type" => $row["data_type"],
"length" => $length,
"default" => $row["column_default"],
"null" => ($row["is_nullable"] == "YES"),
"auto_increment" => eregi("^nextval\\(", $row["column_default"]),
"collation" => $row["collation_name"],
"privileges" => array("insert" => 1, "select" => 1, "update" => 1), //! is_updatable
"primary" => false, //!
"comment" => $row["comment"],
);
}
}
return $return;
}
@@ -246,9 +249,10 @@ ORDER BY a.attnum"
$connection2 = $connection;
}
$return = array();
$table_oid = $connection2->result("SELECT oid FROM pg_class WHERE relname = " . q($table));
$table_oid = $connection2->result("SELECT oid FROM pg_class WHERE relname = " . $connection2->quote($table));
$columns = get_key_vals("SELECT attnum, attname FROM pg_attribute WHERE attrelid = $table_oid AND attnum > 0", $connection2);
foreach (get_rows("SELECT relname, indisunique, indisprimary, indkey FROM pg_index i, pg_class ci WHERE i.indrelid = $table_oid AND ci.oid = i.indexrelid", $connection2) as $row) {
$result = $connection2->query("SELECT relname, indisunique, indisprimary, indkey FROM pg_index i, pg_class ci WHERE i.indrelid = $table_oid AND ci.oid = i.indexrelid");
while ($row = $result->fetch_assoc()) {
$return[$row["relname"]]["type"] = ($row["indisprimary"] == "t" ? "PRIMARY" : ($row["indisunique"] == "t" ? "UNIQUE" : "INDEX"));
$return[$row["relname"]]["columns"] = array();
foreach (explode(" ", $row["indkey"]) as $indkey) {
@@ -260,14 +264,15 @@ ORDER BY a.attnum"
}
function foreign_keys($table) {
global $connection;
$return = array();
foreach (get_rows("SELECT tc.constraint_name, kcu.column_name, rc.update_rule AS on_update, rc.delete_rule AS on_delete, ccu.table_name AS table, ccu.column_name AS ref
$result = $connection->query("SELECT tc.constraint_name, kcu.column_name, rc.update_rule AS on_update, rc.delete_rule AS on_delete, ccu.table_name AS table, ccu.column_name AS ref
FROM information_schema.table_constraints tc
LEFT JOIN information_schema.key_column_usage kcu USING (constraint_catalog, constraint_schema, constraint_name)
LEFT JOIN information_schema.referential_constraints rc USING (constraint_catalog, constraint_schema, constraint_name)
LEFT JOIN information_schema.constraint_column_usage ccu ON rc.unique_constraint_catalog = ccu.constraint_catalog AND rc.unique_constraint_schema = ccu.constraint_schema AND rc.unique_constraint_name = ccu.constraint_name
WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . q($table) //! there can be more unique_constraint_name
) as $row) {
WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . $connection->quote($table)); //! there can be more unique_constraint_name
while ($row = $result->fetch_assoc()) {
$foreign_key = &$return[$row["constraint_name"]];
if (!$foreign_key) {
$foreign_key = $row;
@@ -280,7 +285,7 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . q($table) //! t
function view($name) {
global $connection;
return array("select" => $connection->result("SELECT pg_get_viewdef(" . q($name) . ")"));
return array("select" => $connection->result("SELECT pg_get_viewdef(" . $connection->quote($name) . ")"));
}
function collations() {
@@ -302,7 +307,8 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . q($table) //! t
}
function exact_value($val) {
return q($val);
global $connection;
return $connection->quote($val);
}
function create_database($db, $collation) {
@@ -325,6 +331,7 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . q($table) //! t
}
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
global $connection;
$alter = array();
$queries = array();
foreach ($fields as $field) {
@@ -365,10 +372,10 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . q($table) //! t
$queries[] = "ALTER TABLE " . table($table) . " RENAME TO " . table($name);
}
if ($table != "" || $comment != "") {
$queries[] = "COMMENT ON TABLE " . table($name) . " IS " . q($comment);
$queries[] = "COMMENT ON TABLE " . table($name) . " IS " . $connection->quote($comment);
}
if ($auto_increment != "") {
//! $queries[] = "SELECT setval(pg_get_serial_sequence(" . q($name) . ", ), $auto_increment)";
//! $queries[] = "SELECT setval(pg_get_serial_sequence(" . $connection->quote($name) . ", ), $auto_increment)";
}
foreach ($queries as $query) {
if (!queries($query)) {
@@ -423,13 +430,16 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . q($table) //! t
}
function trigger($name) {
$rows = get_rows('SELECT trigger_name AS "Trigger", condition_timing AS "Timing", event_manipulation AS "Event", \'FOR EACH \' || action_orientation AS "Type", action_statement AS "Statement" FROM information_schema.triggers WHERE event_object_table = ' . q($_GET["trigger"]) . ' AND trigger_name = ' . q($name));
return reset($rows);
global $connection;
$result = $connection->query('SELECT trigger_name AS "Trigger", condition_timing AS "Timing", event_manipulation AS "Event", \'FOR EACH \' || action_orientation AS "Type", action_statement AS "Statement" FROM information_schema.triggers WHERE event_object_table = ' . $connection->quote($_GET["trigger"]) . ' AND trigger_name = ' . $connection->quote($name));
return $result->fetch_assoc();
}
function triggers($table) {
global $connection;
$return = array();
foreach (get_rows("SELECT * FROM information_schema.triggers WHERE event_object_table = " . q($table)) as $row) {
$result = $connection->query("SELECT * FROM information_schema.triggers WHERE event_object_table = " . $connection->quote($table));
while ($row = $result->fetch_assoc()) {
$return[$row["trigger_name"]] = array($row["condition_timing"], $row["event_manipulation"]);
}
return $return;
@@ -450,21 +460,6 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . q($table) //! t
return queries("INSERT INTO " . table($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES"));
}
function insert_update($table, $set, $primary) {
global $connection;
$update = array();
$where = array();
foreach ($set as $key => $val) {
$update[] = "$key = $val";
if (isset($primary[idf_unescape($key)])) {
$where[] = "$key = $val";
}
}
return ($where && queries("UPDATE " . table($table) . " SET " . implode(", ", $update) . " WHERE " . implode(" AND ", $where)) && $connection->affected_rows)
|| queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")")
;
}
function last_id() {
return 0; // there can be several sequences
}
@@ -473,15 +468,6 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . q($table) //! t
return $connection->query("EXPLAIN $query");
}
function types() {
return get_vals("SELECT typname
FROM pg_type
WHERE typnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())
AND typtype IN ('b','d','e')
AND typelem = 0"
);
}
function schemas() {
return get_vals("SELECT nspname FROM pg_namespace");
}
@@ -492,15 +478,8 @@ AND typelem = 0"
}
function set_schema($schema) {
global $connection, $types, $structured_types;
$return = $connection->query("SET search_path TO " . idf_escape($schema));
foreach (types() as $type) { //! get types from current_schemas('t')
if (!isset($types[$type])) {
$types[$type] = 0;
$structured_types[lang('User types')][] = $type;
}
}
return $return;
global $connection;
return $connection->query("SET search_path TO " . idf_escape($schema));
}
function use_sql($database) {
@@ -511,11 +490,8 @@ AND typelem = 0"
return get_key_vals("SHOW ALL");
}
function show_status() {
}
function support($feature) {
return ereg('^(comment|view|scheme|sequence|trigger|type|variables|drop_col)$', $feature); //! routine|
return ereg('^(comment|view|scheme|sequence|trigger|variables|drop_col)$', $feature); //! routine|
}
$jush = "pgsql";
@@ -528,12 +504,12 @@ AND typelem = 0"
lang('Binary') => array("bit" => 0, "bit varying" => 0, "bytea" => 0),
lang('Network') => array("cidr" => 43, "inet" => 43, "macaddr" => 17, "txid_snapshot" => 0),
lang('Geometry') => array("box" => 0, "circle" => 0, "line" => 0, "lseg" => 0, "path" => 0, "point" => 0, "polygon" => 0),
) as $key => $val) { //! can be retrieved from pg_type
) as $key => $val) {
$types += $val;
$structured_types[$key] = array_keys($val);
}
$unsigned = array();
$operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "");
$operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL");
$functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
$grouping = array("avg", "count", "count distinct", "max", "min", "sum");
$edit_functions = array(

View File

@@ -1,83 +1,18 @@
<?php
$drivers["sqlite"] = "SQLite 3";
$drivers["sqlite2"] = "SQLite 2";
$possible_drivers[] = "SQLite";
$possible_drivers[] = "SQLite3";
$possible_drivers[] = "PDO_SQLite";
if (extension_loaded("sqlite3") || extension_loaded("pdo_sqlite")) {
$drivers["sqlite"] = "SQLite 3";
}
if (extension_loaded("sqlite") || extension_loaded("pdo_sqlite")) {
$drivers["sqlite2"] = "SQLite 2";
}
if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
$possible_drivers = array((isset($_GET["sqlite"]) ? "SQLite3" : "SQLite"), "PDO_SQLite");
define("DRIVER", (isset($_GET["sqlite"]) ? "sqlite" : "sqlite2"));
if (extension_loaded(isset($_GET["sqlite"]) ? "sqlite3" : "sqlite")) {
if (isset($_GET["sqlite"])) {
class Min_SQLite {
var $extension = "SQLite3", $server_info, $affected_rows, $error, $_link;
function Min_SQLite($filename) {
$this->_link = new SQLite3($filename);
$version = $this->_link->version();
$this->server_info = $version["versionString"];
}
function query($query) {
$result = @$this->_link->query($query);
if (!$result) {
$this->error = $this->_link->lastErrorMsg();
return false;
} elseif ($result->numColumns()) {
return new Min_Result($result);
}
$this->affected_rows = $this->_link->changes();
return true;
}
function quote($string) {
return "'" . $this->_link->escapeString($string) . "'";
}
function store_result() {
return $this->_result;
}
function result($query, $field = 0) {
$result = $this->query($query);
if (!is_object($result)) {
return false;
}
$row = $result->_result->fetchArray();
return $row[$field];
}
}
class Min_Result {
var $_result, $_offset = 0, $num_rows;
function Min_Result($result) {
$this->_result = $result;
}
function fetch_assoc() {
return $this->_result->fetchArray(SQLITE3_ASSOC);
}
function fetch_row() {
return $this->_result->fetchArray(SQLITE3_NUM);
}
function fetch_field() {
$column = $this->_offset++;
$type = $this->_result->columnType($column);
return (object) array(
"name" => $this->_result->columnName($column),
"type" => $type,
"charsetnr" => ($type == SQLITE3_BLOB ? 63 : 0), // 63 - binary
);
}
function __desctruct() {
return $this->_result->finalize();
}
}
} else {
if (extension_loaded(isset($_GET["sqlite2"]) ? "sqlite" : "sqlite3")) {
if (isset($_GET["sqlite2"])) {
class Min_SQLite {
var $extension = "SQLite", $server_info, $affected_rows, $error, $_link;
@@ -104,10 +39,6 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
return "'" . sqlite_escape_string($string) . "'";
}
function store_result() {
return $this->_result;
}
function result($query, $field = 0) {
$result = $this->query($query);
if (!is_object($result)) {
@@ -160,6 +91,74 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
}
} else {
class Min_SQLite {
var $extension = "SQLite3", $server_info, $affected_rows, $error, $_link;
function Min_SQLite($filename) {
$this->_link = new SQLite3($filename);
$version = $this->_link->version();
$this->server_info = $version["versionString"];
}
function query($query) {
$result = @$this->_link->query($query);
if (!$result) {
$this->error = $this->_link->lastErrorMsg();
return false;
} elseif ($result->numColumns()) {
return new Min_Result($result);
}
$this->affected_rows = $this->_link->changes();
return true;
}
function quote($string) {
return "'" . $this->_link->escapeString($string) . "'";
}
function result($query, $field = 0) {
$result = $this->query($query);
if (!is_object($result)) {
return false;
}
$row = $result->_result->fetchArray();
return $row[$field];
}
}
class Min_Result {
var $_result, $_offset = 0, $num_rows;
function Min_Result($result) {
$this->_result = $result;
$this->num_rows = 1; //!
}
function fetch_assoc() {
return $this->_result->fetchArray(SQLITE3_ASSOC);
}
function fetch_row() {
return $this->_result->fetchArray(SQLITE3_NUM);
}
function fetch_field() {
$column = $this->_offset++;
$type = $this->_result->columnType($column);
return (object) array(
"name" => $this->_result->columnName($column),
"type" => $type,
"charsetnr" => ($type == SQLITE3_BLOB ? 63 : 0), // 63 - binary
);
}
function __desctruct() {
return $this->_result->finalize();
}
}
}
} elseif (extension_loaded("pdo_sqlite")) {
@@ -173,28 +172,30 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
}
if (class_exists("Min_SQLite")) {
class Min_DB extends Min_SQLite {
function Min_DB() {
$this->Min_SQLite(":memory:");
}
function select_db($filename) {
if (is_readable($filename) && $this->query("ATTACH " . $this->quote(ereg("(^[/\\]|:)", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) { // is_readable - SQLite 3
$this->Min_SQLite($filename);
return true;
}
return false;
}
function multi_query($query) {
return $this->_result = $this->query($query);
}
function next_result() {
return false;
class Min_DB extends Min_SQLite {
function Min_DB() {
$this->Min_SQLite(":memory:");
}
function select_db($filename) {
if (is_readable($filename) && $this->query("ATTACH " . $this->quote(ereg("(^[/\\]|:)", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) { // is_readable - SQLite 3
$this->Min_SQLite($filename);
return true;
}
return false;
}
function multi_query($query) {
return $this->_result = $this->query($query);
}
function store_result() {
return $this->_result;
}
function next_result() {
return false;
}
}
@@ -237,7 +238,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
}
function tables_list() {
return get_key_vals("SELECT name, type FROM sqlite_master WHERE type IN ('table', 'view') ORDER BY (name = 'sqlite_sequence'), name", 1);
return get_key_vals("SELECT name, type FROM sqlite_master WHERE type IN ('table', 'view')", 1);
}
function count_tables($databases) {
@@ -245,46 +246,52 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
}
function table_status($name = "") {
global $connection;
$return = array();
foreach (get_rows("SELECT name AS Name, type AS Engine FROM sqlite_master WHERE type IN ('table', 'view')" . ($name != "" ? " AND name = " . q($name) : "")) as $row) {
$result = $connection->query("SELECT name AS Name, type AS Engine FROM sqlite_master WHERE type IN ('table', 'view')" . ($name != "" ? " AND name = " . $connection->quote($name) : ""));
while ($row = $result->fetch_assoc()) {
$row["Auto_increment"] = "";
$return[$row["Name"]] = $row;
}
foreach (get_rows("SELECT * FROM sqlite_sequence", null, "") as $row) {
$return[$row["name"]]["Auto_increment"] = $row["seq"];
$result = $connection->query("SELECT * FROM sqlite_sequence");
if ($result) {
while ($row = $result->fetch_assoc()) {
$return[$row["name"]]["Auto_increment"] = $row["seq"];
}
}
return ($name != "" ? $return[$name] : $return);
}
function is_view($table_status) {
return $table_status["Engine"] == "view";
}
function fk_support($table_status) {
global $connection;
return !$connection->result("SELECT sqlite_compileoption_used('OMIT_FOREIGN_KEY')");
}
function fields($table) {
global $connection;
$return = array();
foreach (get_rows("PRAGMA table_info(" . table($table) . ")") as $row) {
$type = strtolower($row["type"]);
$default = $row["dflt_value"];
$return[$row["name"]] = array(
"field" => $row["name"],
"type" => (eregi("int", $type) ? "integer" : (eregi("char|clob|text", $type) ? "text" : (eregi("blob", $type) ? "blob" : (eregi("real|floa|doub", $type) ? "real" : "numeric")))),
"full_type" => $type,
"default" => (ereg("'(.*)'", $default, $match) ? str_replace("''", "'", $match[1]) : ($default == "NULL" ? null : $default)),
"null" => !$row["notnull"],
"auto_increment" => eregi('^integer$', $type) && $row["pk"], //! possible false positive
"privileges" => array("select" => 1, "insert" => 1, "update" => 1),
"primary" => $row["pk"],
);
$result = $connection->query("PRAGMA table_info(" . table($table) . ")");
if (is_object($result)) {
while ($row = $result->fetch_assoc()) {
$type = strtolower($row["type"]);
$return[$row["name"]] = array(
"field" => $row["name"],
"type" => (eregi("int", $type) ? "integer" : (eregi("char|clob|text", $type) ? "text" : (eregi("blob", $type) ? "blob" : (eregi("real|floa|doub", $type) ? "real" : "numeric")))),
"full_type" => $type,
"default" => $row["dflt_value"],
"null" => !$row["notnull"],
"auto_increment" => eregi('^integer$', $type) && $row["pk"], //! possible false positive
"collation" => null, //!
"privileges" => array("select" => 1, "insert" => 1, "update" => 1),
"primary" => $row["pk"],
);
}
}
return $return;
}
function indexes($table, $connection2 = null) {
global $connection;
$return = array();
$primary = array();
foreach (fields($table) as $field) {
@@ -295,33 +302,41 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
if ($primary) {
$return[""] = array("type" => "PRIMARY", "columns" => $primary, "lengths" => array());
}
foreach (get_rows("PRAGMA index_list(" . table($table) . ")") as $row) {
$return[$row["name"]]["type"] = ($row["unique"] ? "UNIQUE" : "INDEX");
$return[$row["name"]]["lengths"] = array();
foreach (get_rows("PRAGMA index_info(" . idf_escape($row["name"]) . ")") as $row1) {
$return[$row["name"]]["columns"][] = $row1["name"];
$result = $connection->query("PRAGMA index_list(" . table($table) . ")");
if (is_object($result)) {
while ($row = $result->fetch_assoc()) {
$return[$row["name"]]["type"] = ($row["unique"] ? "UNIQUE" : "INDEX");
$return[$row["name"]]["lengths"] = array();
$result1 = $connection->query("PRAGMA index_info(" . idf_escape($row["name"]) . ")");
while ($row1 = $result1->fetch_assoc()) {
$return[$row["name"]]["columns"][] = $row1["name"];
}
}
}
return $return;
}
function foreign_keys($table) {
global $connection;
$return = array();
foreach (get_rows("PRAGMA foreign_key_list(" . table($table) . ")") as $row) {
$foreign_key = &$return[$row["id"]];
//! idf_unescape in SQLite2
if (!$foreign_key) {
$foreign_key = $row;
$result = $connection->query("PRAGMA foreign_key_list(" . table($table) . ")");
if (is_object($result)) {
while ($row = $result->fetch_assoc()) {
$foreign_key = &$return[$row["id"]];
//! idf_unescape in SQLite2
if (!$foreign_key) {
$foreign_key = $row;
}
$foreign_key["source"][] = $row["from"];
$foreign_key["target"][] = $row["to"];
}
$foreign_key["source"][] = $row["from"];
$foreign_key["target"][] = $row["to"];
}
return $return;
}
function view($name) {
global $connection;
return array("select" => preg_replace('~^(?:[^`"[]+|`[^`]*`|"[^"]*")* AS\\s+~iU', '', $connection->result("SELECT sql FROM sqlite_master WHERE name = " . q($name)))); //! identifiers may be inside []
return array("select" => preg_replace('~^(?:[^`"[]+|`[^`]*`|"[^"]*")* AS\\s+~iU', '', $connection->result("SELECT sql FROM sqlite_master WHERE name = " . $connection->quote($name)))); //! identifiers may be inside []
}
function collations() {
@@ -338,29 +353,16 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
}
function exact_value($val) {
return q($val);
}
function check_sqlite_name($name) {
// avoid creating PHP files on unsecured servers
global $connection;
$extensions = "db|sdb|sqlite";
if (!preg_match("~^[^\\0]*\\.($extensions)\$~", $name)) {
$connection->error = lang('Please use one of the extensions %s.', str_replace("|", ", ", $extensions));
return false;
}
return true;
return $connection->quote($val);
}
function create_database($db, $collation) {
global $connection;
if (file_exists($db)) {
$connection->error = lang('File exists.');
return false;
}
if (!check_sqlite_name($db)) {
return false;
}
$link = new Min_SQLite($db); //! exception handler
$link->query('PRAGMA encoding = "UTF-8"');
$link->query('CREATE TABLE adminer (i)'); // otherwise creates empty file
@@ -382,9 +384,6 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
function rename_database($name, $collation) {
global $connection;
if (!check_sqlite_name($name)) {
return false;
}
$connection->Min_SQLite(":memory:");
$connection->error = lang('File exists.');
return @rename(DB, $name);
@@ -395,6 +394,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
}
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
global $connection;
$alter = array();
foreach ($fields as $field) {
if ($field[1]) {
@@ -415,14 +415,14 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
return false;
}
if ($auto_increment) {
queries("UPDATE sqlite_sequence SET seq = $auto_increment WHERE name = " . q($name)); // ignores error
queries("UPDATE sqlite_sequence SET seq = $auto_increment WHERE name = " . $connection->quote($name)); // ignores error
}
return true;
}
function alter_indexes($table, $alter) {
foreach ($alter as $val) {
if (!queries(($val[2] ? "DROP INDEX" : "CREATE" . ($val[0] != "INDEX" ? " UNIQUE" : "") . " INDEX " . idf_escape(uniqid($table . "_")) . " ON " . table($table)) . " $val[1]")) {
if (!queries(($val[2] ? "DROP INDEX" : "CREATE" . ($val[0] != "INDEX" ? " UNIQUE" : "") . " INDEX " . idf_escape(uniqid($table . "_")) . " ON " . table($table)) . " $val[1]")) { //! primary key must be created in CREATE TABLE
return false;
}
}
@@ -447,13 +447,15 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
function trigger($name) {
global $connection;
preg_match('~^CREATE\\s+TRIGGER\\s*(?:[^`"\\s]+|`[^`]*`|"[^"]*")+\\s*([a-z]+)\\s+([a-z]+)\\s+ON\\s*(?:[^`"\\s]+|`[^`]*`|"[^"]*")+\\s*(?:FOR\\s*EACH\\s*ROW\\s)?(.*)~is', $connection->result("SELECT sql FROM sqlite_master WHERE name = " . q($name)), $match);
preg_match('~^CREATE\\s+TRIGGER\\s*(?:[^`"\\s]+|`[^`]*`|"[^"]*")+\\s*([a-z]+)\\s+([a-z]+)\\s+ON\\s*(?:[^`"\\s]+|`[^`]*`|"[^"]*")+\\s*(?:FOR\\s*EACH\\s*ROW\\s)?(.*)~is', $connection->result("SELECT sql FROM sqlite_master WHERE name = " . $connection->quote($name)), $match);
return array("Timing" => strtoupper($match[1]), "Event" => strtoupper($match[2]), "Trigger" => $name, "Statement" => $match[3]);
}
function triggers($table) {
global $connection;
$return = array();
foreach (get_rows("SELECT * FROM sqlite_master WHERE type = 'trigger' AND tbl_name = " . q($table)) as $row) {
$result = $connection->query("SELECT * FROM sqlite_master WHERE type = 'trigger' AND tbl_name = " . $connection->quote($table));
while ($row = $result->fetch_assoc()) {
preg_match('~^CREATE\\s+TRIGGER\\s*(?:[^`"\\s]+|`[^`]*`|"[^"]*")+\\s*([a-z]+)\\s*([a-z]+)~i', $row["sql"], $match);
$return[$row["name"]] = array($match[1], $match[2]);
}
@@ -483,10 +485,6 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
return queries("INSERT INTO " . table($table) . ($set ? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")" : "DEFAULT VALUES"));
}
function insert_update($table, $set, $primary) {
return queries("REPLACE INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")");
}
function last_id() {
global $connection;
return $connection->result("SELECT LAST_INSERT_ROWID()");
@@ -496,10 +494,6 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
return $connection->query("EXPLAIN $query");
}
function types() {
return array();
}
function schemas() {
return array();
}
@@ -512,20 +506,19 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
return true;
}
function create_sql($table, $auto_increment) {
function create_sql($table) {
global $connection;
return $connection->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . q($table));
}
function truncate_sql($table) {
return "DELETE FROM " . table($table);
return $connection->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . $connection->quote($table));
}
function use_sql($database) {
global $connection;
return "ATTACH " . $connection->quote($database) . " AS " . idf_escape($database);
}
function trigger_sql($table, $style) {
return implode(get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND name = " . q($table)));
global $connection;
return implode(get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND name = " . $connection->quote($table)));
}
function show_variables() {
@@ -547,14 +540,14 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
}
function support($feature) {
return ereg('^(view|trigger|variables|status|dump)$', $feature);
return ereg('^(view|trigger|variables|status)$', $feature);
}
$jush = "sqlite";
$types = array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0);
$structured_types = array_keys($types);
$unsigned = array();
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", ""); // REGEXP can be user defined function
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // REGEXP can be user defined function
$functions = array("hex", "length", "lower", "round", "unixepoch", "upper");
$grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
$edit_functions = array(

View File

@@ -3,18 +3,17 @@ $TABLE = $_GET["dump"];
if ($_POST) {
$cookie = "";
foreach (array("output", "format", "db_style", "routines", "events", "table_style", "auto_increment", "triggers", "data_style") as $key) {
foreach (array("output", "format", "db_style", "table_style", "data_style") as $key) {
$cookie .= "&$key=" . urlencode($_POST[$key]);
}
cookie("adminer_export", substr($cookie, 1));
$ext = dump_headers(($TABLE != "" ? $TABLE : DB), (DB == "" || count((array) $_POST["tables"] + (array) $_POST["data"]) > 1));
$is_sql = ($_POST["format"] == "sql");
if ($is_sql) {
if ($_POST["format"] == "sql") {
echo "-- Adminer $VERSION " . $drivers[DRIVER] . " dump
" . ($jush != "sql" ? "" : "SET NAMES utf8;
SET foreign_key_checks = 0;
SET time_zone = " . q($connection->result("SELECT @@time_zone")) . ";
SET time_zone = " . $connection->quote($connection->result("SELECT @@time_zone")) . ";
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
");
@@ -30,13 +29,13 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
}
foreach ((array) $databases as $db) {
if ($connection->select_db($db)) {
if ($is_sql && ereg('CREATE', $style) && ($create = $connection->result("SHOW CREATE DATABASE " . idf_escape($db), 1))) {
if ($_POST["format"] == "sql" && ereg('CREATE', $style) && ($create = $connection->result("SHOW CREATE DATABASE " . idf_escape($db), 1))) {
if ($style == "DROP+CREATE") {
echo "DROP DATABASE IF EXISTS " . idf_escape($db) . ";\n";
}
echo ($style == "CREATE+ALTER" ? preg_replace('~^CREATE DATABASE ~', '\\0IF NOT EXISTS ', $create) : $create) . ";\n";
}
if ($is_sql) {
if ($_POST["format"] == "sql") {
if ($style) {
echo use_sql($db) . ";\n\n";
}
@@ -46,16 +45,20 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
$out = "";
if ($_POST["routines"]) {
foreach (array("FUNCTION", "PROCEDURE") as $routine) {
foreach (get_rows("SHOW $routine STATUS WHERE Db = " . q($db), null, "-- ") as $row) {
$result = $connection->query("SHOW $routine STATUS WHERE Db = " . $connection->quote($db));
while ($row = $result->fetch_assoc()) {
$out .= ($style != 'DROP+CREATE' ? "DROP $routine IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "")
. $connection->result("SHOW CREATE $routine " . idf_escape($row["Name"]), 2) . ";;\n\n";
}
}
}
if ($_POST["events"]) {
foreach (get_rows("SHOW EVENTS", null, "-- ") as $row) {
$out .= ($style != 'DROP+CREATE' ? "DROP EVENT IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "")
. $connection->result("SHOW CREATE EVENT " . idf_escape($row["Name"]), 3) . ";;\n\n";
$result = $connection->query("SHOW EVENTS");
if ($result) {
while ($row = $result->fetch_assoc()) {
$out .= ($style != 'DROP+CREATE' ? "DROP EVENT IF EXISTS " . idf_escape($row["Name"]) . ";;\n" : "")
. $connection->result("SHOW CREATE EVENT " . idf_escape($row["Name"]), 3) . ";;\n\n";
}
}
}
if ($out) {
@@ -69,36 +72,39 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
$table = (DB == "" || in_array($row["Name"], (array) $_POST["tables"]));
$data = (DB == "" || in_array($row["Name"], (array) $_POST["data"]));
if ($table || $data) {
if (!is_view($row)) {
if (isset($row["Engine"])) {
if ($ext == "tar") {
ob_start();
}
$adminer->dumpTable($row["Name"], ($table ? $_POST["table_style"] : ""));
dump_table($row["Name"], ($table ? $_POST["table_style"] : ""));
if ($data) {
$adminer->dumpData($row["Name"], $_POST["data_style"], "SELECT * FROM " . table($row["Name"]));
dump_data($row["Name"], $_POST["data_style"]);
}
if ($is_sql && $_POST["triggers"] && $table && ($triggers = trigger_sql($row["Name"], $_POST["table_style"]))) {
echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n";
if ($_POST["format"] == "sql" && $_POST["triggers"]) {
$triggers = trigger_sql($row["Name"], $_POST["table_style"]);
if ($triggers) {
echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n";
}
}
if ($ext == "tar") {
echo tar_file((DB != "" ? "" : "$db/") . "$row[Name].csv", ob_get_clean());
} elseif ($is_sql) {
} elseif ($_POST["format"] == "sql") {
echo "\n";
}
} elseif ($is_sql) {
} elseif ($_POST["format"] == "sql") {
$views[] = $row["Name"];
}
}
}
foreach ($views as $view) {
$adminer->dumpTable($view, $_POST["table_style"], true);
dump_table($view, $_POST["table_style"], true);
}
if ($ext == "tar") {
echo pack("x512");
}
}
if ($style == "CREATE+ALTER" && $is_sql) {
if ($style == "CREATE+ALTER" && $_POST["format"] == "sql") {
// drop old tables
$query = "SELECT TABLE_NAME, ENGINE, TABLE_COLLATION, TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE()";
echo "DELIMITER ;;
@@ -113,10 +119,11 @@ CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
FETCH tables INTO _table_name, _engine, _table_collation, _table_comment;
IF NOT done THEN
CASE _table_name";
foreach (get_rows($query) as $row) {
$comment = q($row["ENGINE"] == "InnoDB" ? preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["TABLE_COMMENT"]) : $row["TABLE_COMMENT"]);
$result = $connection->query($query);
while ($row = $result->fetch_assoc()) {
$comment = $connection->quote($row["ENGINE"] == "InnoDB" ? preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["TABLE_COMMENT"]) : $row["TABLE_COMMENT"]);
echo "
WHEN " . q($row["TABLE_NAME"]) . " THEN
WHEN " . $connection->quote($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") . ";";
@@ -134,14 +141,11 @@ CALL adminer_alter(@adminer_alter);
DROP PROCEDURE adminer_alter;
";
}
if (in_array("CREATE+ALTER", array($style, $_POST["table_style"])) && $is_sql) {
if (in_array("CREATE+ALTER", array($style, $_POST["table_style"])) && $_POST["format"] == "sql") {
echo "SELECT @adminer_alter;\n";
}
}
}
if ($is_sql) {
echo "-- " . $connection->result("SELECT NOW()") . "\n";
}
exit;
}
@@ -153,29 +157,24 @@ page_header(lang('Export'), "", ($_GET["export"] != "" ? array("table" => $_GET[
<?php
$db_style = array('', 'USE', 'DROP+CREATE', 'CREATE');
$table_style = array('', 'DROP+CREATE', 'CREATE');
$data_style = array('', 'TRUNCATE+INSERT', 'INSERT');
$data_style = array('', 'TRUNCATE+INSERT', 'INSERT', 'INSERT+UPDATE');
if ($jush == "sql") {
$db_style[] = 'CREATE+ALTER';
$table_style[] = 'CREATE+ALTER';
$data_style[] = 'INSERT+UPDATE';
}
parse_str($_COOKIE["adminer_export"], $row);
if (!$row) {
$row = array("output" => "text", "format" => "sql", "db_style" => (DB != "" ? "" : "CREATE"), "table_style" => "DROP+CREATE", "data_style" => "INSERT");
}
if (!isset($row["events"])) { // backwards compatibility
$row["routines"] = $row["events"] = ($_GET["dump"] == "");
$row["auto_increment"] = $row["triggers"] = $row["table_style"];
}
echo "<tr><th>" . lang('Output') . "<td>" . html_select("output", $adminer->dumpOutput(), $row["output"], 0) . "\n"; // 0 - radio
echo "<tr><th>" . lang('Format') . "<td>" . html_select("format", $adminer->dumpFormat(), $row["format"], 0) . "\n"; // 0 - radio
echo ($jush == "sqlite" ? "" : "<tr><th>" . lang('Database') . "<td>" . html_select('db_style', $db_style, $row["db_style"])
. (support("routine") ? checkbox("routines", 1, $row["routines"], lang('Routines')) : "")
. (support("event") ? checkbox("events", 1, $row["events"], lang('Events')) : "")
);
$checked = ($_GET["dump"] == "");
echo "<tr><th>" . lang('Output') . "<td>" . $adminer->dumpOutput(0, $row["output"]) . "\n";
echo "<tr><th>" . lang('Format') . "<td>" . $adminer->dumpFormat(0, $row["format"]) . "\n";
echo "<tr><th>" . lang('Database') . "<td>" . html_select('db_style', $db_style, $row["db_style"])
. (support("routine") ? checkbox("routines", 1, $checked, lang('Routines')) : "")
. (support("event") ? checkbox("events", 1, $checked, lang('Events')) : "")
;
echo "<tr><th>" . lang('Tables') . "<td>" . html_select('table_style', $table_style, $row["table_style"])
. checkbox("auto_increment", 1, $row["auto_increment"], lang('Auto Increment'))
. (support("trigger") ? checkbox("triggers", 1, $row["triggers"], lang('Triggers')) : "")
. (support("trigger") ? checkbox("triggers", 1, $row["table_style"], lang('Triggers')) : "")
;
echo "<tr><th>" . lang('Data') . "<td>" . html_select('data_style', $data_style, $row["data_style"]);
?>
@@ -198,7 +197,7 @@ if (DB != "") {
$prefix = ereg_replace("_.*", "", $name);
$checked = ($TABLE == "" || $TABLE == (substr($TABLE, -1) == "%" ? "$prefix%" : $name)); //! % may be part of table name
$print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "formUncheck('check-tables');");
if (is_view($row)) {
if (eregi("view", $row["Engine"])) {
$views .= "$print\n";
} else {
echo "$print<td align='right'><label>" . ($row["Engine"] == "InnoDB" && $row["Rows"] ? "~ " : "") . $row["Rows"] . checkbox("data[]", $name, $checked, "", "formUncheck('check-data');") . "</label>\n";

View File

@@ -16,7 +16,7 @@ if ($_POST && !$error && !isset($_GET["select"])) {
$location = ME . "select=" . urlencode($TABLE);
}
if (isset($_POST["delete"])) {
query_redirect("DELETE" . limit1("FROM " . table($TABLE), " WHERE $where"), $location, lang('Item has been deleted.'));
query_redirect("DELETE" . limit1("FROM " . table($TABLE), $where), $location, lang('Item has been deleted.'));
} else {
$set = array();
foreach ($fields as $name => $field) {
@@ -58,21 +58,24 @@ if ($_POST["save"]) {
}
$row = array();
if ($select) {
$rows = get_rows("SELECT" . limit(implode(", ", $select) . " FROM " . table($TABLE), " WHERE $where", (isset($_GET["select"]) ? 2 : 1)));
$row = (isset($_GET["select"]) && count($rows) != 1 ? null : reset($rows));
$result = $connection->query("SELECT" . limit(implode(", ", $select) . " FROM " . table($TABLE), " WHERE $where", (isset($_GET["select"]) ? 2 : 1)));
$row = $result->fetch_assoc();
if (isset($_GET["select"]) && $result->fetch_assoc()) {
$row = null;
}
}
}
?>
<form action="" method="post" enctype="multipart/form-data" id="form">
<form action="" method="post" enctype="multipart/form-data">
<?php
if ($fields) {
echo "<table cellspacing='0' onkeydown='return editingKeydown(event);'>\n";
echo "<table cellspacing='0'>\n";
foreach ($fields as $name => $field) {
echo "<tr><th>" . $adminer->fieldName($field);
$default = $_GET["set"][bracket_escape($name)];
$value = (isset($row)
? ($row[$name] != "" && ereg("enum|set", $field["type"]) ? +$row[$name] : $row[$name])
? ($row[$name] != "" && ereg("enum|set", $field["type"]) ? intval($row[$name]) : $row[$name])
: (!$update && $field["auto_increment"] ? "" : (isset($_GET["select"]) ? false : (isset($default) ? $default : $field["default"])))
);
if (!$_POST["save"] && is_string($value)) {
@@ -90,21 +93,21 @@ if ($fields) {
}
?>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="hidden" name="referer" value="<?php echo h(isset($_POST["referer"]) ? $_POST["referer"] : $_SERVER["HTTP_REFERER"]); ?>">
<input type="hidden" name="save" value="1">
<?php
if ($fields) {
echo "<input type='submit' value='" . lang('Save') . "'>\n";
if (!isset($_GET["select"])) {
echo '<input type="submit" name="insert" value="' . ($update ? lang('Save and continue edit') : lang('Save and insert next')) . "\">\n";
}
}
echo ($update ? "<input type='submit' name='delete' value='" . lang('Delete') . "' onclick=\"return confirm('" . lang('Are you sure?') . "');\">\n"
: ($_POST || !$fields ? "" : "<script type='text/javascript'>document.getElementById('form').getElementsByTagName('td')[1].firstChild.focus();</script>\n")
);
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') . "'>\n";
if (!isset($_GET["select"])) {
echo "<input type='submit' name='insert' value='" . ($update ? lang('Save and continue edit') : lang('Save and insert next')) . "'>\n";
}
}
if ($update) {
echo "<input type='submit' name='delete' value='" . lang('Delete') . "'$confirm>\n";
}
?>
<input type="hidden" name="referer" value="<?php echo h(isset($_POST["referer"]) ? $_POST["referer"] : $_SERVER["HTTP_REFERER"]); ?>">
<input type="hidden" name="save" value="1">
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form>

View File

@@ -8,19 +8,19 @@ if ($_POST && !$error) {
query_redirect("DROP EVENT " . idf_escape($EVENT), substr(ME, 0, -1), lang('Event has been dropped.'));
} elseif (in_array($_POST["INTERVAL_FIELD"], $intervals) && isset($statuses[$_POST["STATUS"]])) {
$schedule = "\nON SCHEDULE " . ($_POST["INTERVAL_VALUE"]
? "EVERY " . q($_POST["INTERVAL_VALUE"]) . " $_POST[INTERVAL_FIELD]"
. ($_POST["STARTS"] ? " STARTS " . q($_POST["STARTS"]) : "")
. ($_POST["ENDS"] ? " ENDS " . q($_POST["ENDS"]) : "") //! ALTER EVENT doesn't drop ENDS - MySQL bug #39173
: "AT " . q($_POST["STARTS"])
? "EVERY " . $connection->quote($_POST["INTERVAL_VALUE"]) . " $_POST[INTERVAL_FIELD]"
. ($_POST["STARTS"] ? " STARTS " . $connection->quote($_POST["STARTS"]) : "")
. ($_POST["ENDS"] ? " ENDS " . $connection->quote($_POST["ENDS"]) : "") //! ALTER EVENT doesn't drop ENDS - MySQL bug #39173
: "AT " . $connection->quote($_POST["STARTS"])
) . " ON COMPLETION" . ($_POST["ON_COMPLETION"] ? "" : " NOT") . " PRESERVE"
;
queries_redirect(substr(ME, 0, -1), ($EVENT != "" ? lang('Event has been altered.') : lang('Event has been created.')), queries(($EVENT != ""
query_redirect(($EVENT != ""
? "ALTER EVENT " . idf_escape($EVENT) . $schedule
. ($EVENT != $_POST["EVENT_NAME"] ? "\nRENAME TO " . idf_escape($_POST["EVENT_NAME"]) : "")
: "CREATE EVENT " . idf_escape($_POST["EVENT_NAME"]) . $schedule
) . "\n" . $statuses[$_POST["STATUS"]] . " COMMENT " . q($_POST["EVENT_COMMENT"])
. rtrim(" DO\n$_POST[EVENT_DEFINITION]", ";") . ";"
));
) . "\n" . $statuses[$_POST["STATUS"]] . " COMMENT " . $connection->quote($_POST["EVENT_COMMENT"])
. " DO\n$_POST[EVENT_DEFINITION]"
, substr(ME, 0, -1), ($EVENT != "" ? lang('Event has been altered.') : lang('Event has been created.')));
}
}
@@ -30,8 +30,8 @@ $row = array();
if ($_POST) {
$row = $_POST;
} elseif ($EVENT != "") {
$rows = get_rows("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = " . q(DB) . " AND EVENT_NAME = " . q($EVENT));
$row = reset($rows);
$result = $connection->query("SELECT * FROM information_schema.EVENTS WHERE EVENT_SCHEMA = " . $connection->quote(DB) . " AND EVENT_NAME = " . $connection->quote($EVENT));
$row = $result->fetch_assoc();
}
?>
@@ -47,7 +47,7 @@ if ($_POST) {
</table>
<p><?php textarea("EVENT_DEFINITION", $row["EVENT_DEFINITION"]); ?>
<p>
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($EVENT != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($EVENT != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
</form>

View File

@@ -1,14 +1,13 @@
<?php
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 365*24*60*60) . " GMT");
if ($_GET["file"] == "favicon.ico") {
header("Content-Type: image/x-icon");
echo base64_decode("compile_file('../adminer/static/favicon.ico', 'base64_encode');");
} elseif ($_GET["file"] == "default.css") {
header("Content-Type: text/css; charset=utf-8");
header("Content-Type: text/css");
?>compile_file('../adminer/static/default.css', 'minify_css');<?php
} elseif ($_GET["file"] == "functions.js") {
header("Content-Type: text/javascript; charset=utf-8");
header("Content-Type: text/javascript");
?>compile_file('../adminer/static/functions.js', 'JSMin::minify');compile_file('static/editing.js', 'JSMin::minify');<?php
} else {
header("Content-Type: image/gif");
@@ -18,7 +17,6 @@ if ($_GET["file"] == "favicon.ico") {
case "up.gif": echo base64_decode("compile_file('../adminer/static/up.gif', 'base64_encode');"); break;
case "down.gif": echo base64_decode("compile_file('../adminer/static/down.gif', 'base64_encode');"); break;
case "arrow.gif": echo base64_decode("compile_file('../adminer/static/arrow.gif', 'base64_encode');"); break;
case "loader.gif": echo base64_decode("compile_file('../adminer/static/loader.gif', 'base64_encode');"); break;
}
}
exit;

View File

@@ -60,8 +60,8 @@ foreach (table_status() as $name => $table_status) {
$j = 0;
foreach ($row["source"] as $key => $val) {
echo "<tr>";
echo "<td>" . html_select("source[" . (+$key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow(this);" : 1));
echo "<td>" . html_select("target[" . (+$key) . "]", $target, $row["target"][$key]);
echo "<td>" . html_select("source[" . intval($key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow(this);" : 1));
echo "<td>" . html_select("target[" . intval($key) . "]", $target, $row["target"][$key]);
$j++;
}
?>
@@ -73,6 +73,6 @@ foreach ($row["source"] as $key => $val) {
<input type="submit" value="<?php echo lang('Save'); ?>">
<noscript><p><input type="submit" name="add" value="<?php echo lang('Add column'); ?>"></noscript>
<?php } ?>
<?php if ($_GET["name"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
<?php if ($_GET["name"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form>

View File

@@ -14,7 +14,7 @@ class Adminer {
* @return array ($server, $username, $password)
*/
function credentials() {
return array(SERVER, $_GET["username"], get_session("pwds"));
return array(SERVER, $_GET["username"], get_session("passwords"));
}
/** Get key used for permanent login
@@ -32,37 +32,20 @@ class Adminer {
return DB;
}
/** Headers to send before HTML output
* @return null
*/
function headers() {
header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox 3.6.9
header("X-XSS-Protection: 0"); // prevents introducing XSS in IE8 by removing safe parts of the page
}
/** Print HTML code inside <head>
* @return bool true to link adminer.css if exists
*/
function head() {
return true;
}
/** Print login form
* @return null
*/
function loginForm() {
global $drivers;
global $drivers, $possible_drivers;
?>
<table cellspacing="0">
<tr><th><?php echo lang('System'); ?><td><?php echo html_select("driver", $drivers, DRIVER, "loginDriver(this);"); ?>
<tr><th><?php echo lang('System'); ?><td><?php echo (count($possible_drivers) > 3 ? html_select("driver", $drivers, DRIVER) : "<input type='hidden' name='driver' value='" . key($drivers) . "'>" . reset($drivers)); ?></tr>
<tr><th><?php echo lang('Server'); ?><td><input name="server" value="<?php echo h(SERVER); ?>">
<tr><th><?php echo lang('Username'); ?><td><input id="username" name="username" value="<?php echo h($_GET["username"]); ?>">
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="password">
</table>
<script type="text/javascript">
var username = document.getElementById('username');
username.focus();
username.form['driver'].onchange();
document.getElementById('username').focus();
</script>
<?php
echo "<p><input type='submit' value='" . lang('Login') . "'>\n";
@@ -103,7 +86,7 @@ username.form['driver'].onchange();
function selectLinks($tableStatus, $set = "") {
echo '<p class="tabs">';
$links = array("select" => lang('Select data'), "table" => lang('Show structure'));
if (is_view($tableStatus)) {
if (eregi("view", $tableStatus["Engine"])) {
$links["view"] = lang('Alter view');
} else {
$links["create"] = lang('Alter table');
@@ -112,19 +95,11 @@ username.form['driver'].onchange();
$links["edit"] = lang('New item');
}
foreach ($links as $key => $val) {
echo " <a href='" . h(ME) . "$key=" . urlencode($tableStatus["Name"]) . ($key == "edit" ? $set : "") . "'" . bold(isset($_GET[$key])) . ">$val</a>";
echo " <a href='" . h(ME) . "$key=" . urlencode($tableStatus["Name"]) . ($key == "edit" ? $set : "") . "'>" . bold($val, isset($_GET[$key])) . "</a>";
}
echo "\n";
}
/** Get foreign keys for table
* @param string
* @return array same format as foreign_keys()
*/
function foreignKeys($table) {
return foreign_keys($table);
}
/** Find backward keys for table
* @param string
* @param string
@@ -148,7 +123,7 @@ username.form['driver'].onchange();
*/
function selectQuery($query) {
global $jush;
return "<p><a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Last page') . "'>&gt;&gt;</a> <code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a></p>\n"; // </p> - required for IE9 inline edit
return "<p><code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
}
/** Description of a row in a table
@@ -175,9 +150,9 @@ username.form['driver'].onchange();
* @return string
*/
function selectVal($val, $link, $field) {
$return = ($val != "<i>NULL</i>" && ereg("char|binary", $field["type"]) && !ereg("var", $field["type"]) ? "<code>$val</code>" : $val);
if (ereg('blob|bytea|raw|file', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen(html_entity_decode($val, ENT_QUOTES)));
$return = ($val != "<i>NULL</i>" && $field["type"] == "char" ? "<code>$val</code>" : $val);
if (ereg('binary|blob|bytea', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen($val));
}
return ($link ? "<a href='$link'>$return</a>" : $return);
}
@@ -188,7 +163,7 @@ username.form['driver'].onchange();
* @return string
*/
function editVal($val, $field) {
return (ereg("binary", $field["type"]) ? reset(unpack("H*", $val)) : $val);
return $val;
}
/** Print columns box in select
@@ -238,7 +213,7 @@ username.form['driver'].onchange();
}
}
echo "<div><select name='where[$i][col]' onchange='selectAddRow(this);'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, null, true) . "</select>";
echo html_select("where[$i][op]", $this->operators, "=");
echo html_select("where[$i][op]", $this->operators);
echo "<input name='where[$i][val]'></div>\n";
echo "</div></fieldset>\n";
}
@@ -260,7 +235,7 @@ username.form['driver'].onchange();
}
}
echo "<div><select name='order[$i]' onchange='selectAddRow(this);'><option>" . optionlist($columns, null, true) . "</select>";
echo "<label><input type='checkbox' name='desc[$i]' value='1'>" . lang('descending') . "</label></div>\n"; // not checkbox() to allow selectAddRow()
echo checkbox("desc[$i]", 1, 0, lang('descending')) . "</div>\n";
echo "</div></fieldset>\n";
}
@@ -329,11 +304,11 @@ username.form['driver'].onchange();
* @return array expressions to join by AND
*/
function selectSearchProcess($fields, $indexes) {
global $jush;
global $connection;
$return = array();
foreach ($indexes as $i => $index) {
if ($index["type"] == "FULLTEXT" && $_GET["fulltext"][$i] != "") {
$return[] = "MATCH (" . implode(", ", array_map('idf_escape', $index["columns"])) . ") AGAINST (" . q($_GET["fulltext"][$i]) . (isset($_GET["boolean"][$i]) ? " IN BOOLEAN MODE" : "") . ")";
$return[] = "MATCH (" . implode(", ", array_map('idf_escape', $index["columns"])) . ") AGAINST (" . $connection->quote($_GET["fulltext"][$i]) . (isset($_GET["boolean"][$i]) ? " IN BOOLEAN MODE" : "") . ")";
}
}
foreach ((array) $_GET["where"] as $val) {
@@ -342,8 +317,6 @@ username.form['driver'].onchange();
if (ereg('IN$', $val["op"])) {
$in = process_length($val["val"]);
$cond .= " (" . ($in != "" ? $in : "NULL") . ")";
} elseif (!$val["op"]) {
$cond .= $val["val"]; // SQL injection
} elseif ($val["op"] == "LIKE %%") {
$cond = " LIKE " . $this->processInput($fields[$val["col"]], "%$val[val]%");
} elseif (!ereg('NULL$', $val["op"])) {
@@ -357,7 +330,7 @@ username.form['driver'].onchange();
foreach ($fields as $name => $field) {
if (is_numeric($val["val"]) || !ereg('int|float|double|decimal', $field["type"])) {
$name = idf_escape($name);
$cols[] = ($jush == "sql" && ereg('char|text|enum|set', $field["type"]) && !ereg('^utf8', $field["collation"]) ? "CONVERT($name USING utf8)" : $name);
$cols[] = (ereg('char|text|enum|set', $field["type"]) && !ereg('^utf8', $field["collation"]) ? "CONVERT($name USING utf8)" : $name);
}
}
$return[] = ($cols ? "(" . implode("$cond OR ", $cols) . "$cond)" : "0");
@@ -411,15 +384,14 @@ username.form['driver'].onchange();
*/
function messageQuery($query) {
global $jush;
static $count = 0;
restart_session();
$id = "sql-" . ($count++);
$history = &get_session("queries");
if (strlen($query) > 1e6) { // not DB - reset in drop database
$query = ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
}
$history[$_GET["db"]][] = $query; //! respect $_GET["ns"]
return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre><p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a></div>';
$id = "sql-" . count($_SESSION["messages"]);
$history = &get_session("history");
$history[$_GET["db"]][] = (strlen($query) > 1e6 // not DB - reset in drop database
? ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..." // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
: $query
); //! respect $_GET["ns"]
return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre class='jush-$jush'>" . shorten_utf8($query, 1000) . '</pre><p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a></div>';
}
/** Functions displayed in edit form
@@ -436,9 +408,6 @@ username.form['driver'].onchange();
$return .= "/$val";
}
}
if ($key && !ereg('set|blob|bytea|raw|file', $field["type"])) {
$return .= "/=";
}
}
}
return explode("/", $return);
@@ -453,9 +422,8 @@ username.form['driver'].onchange();
*/
function editInput($table, $field, $attrs, $value) {
if ($field["type"] == "enum") {
return (isset($_GET["select"]) ? "<label><input type='radio'$attrs value='-1' checked><i>" . lang('original') . "</i></label> " : "")
. ($field["null"] ? "<label><input type='radio'$attrs value=''" . (isset($value) || isset($_GET["select"]) ? "" : " checked") . "><i>NULL</i></label> " : "")
. enum_input("radio", $attrs, $field, $value, 0) // 0 - empty
return ($field["null"] ? "<label><input type='radio'$attrs value=''" . (isset($value) || isset($_GET["select"]) ? "" : " checked") . "><em>NULL</em></label> " : "")
. "<input type='radio'$attrs value='0'" . ($value === 0 ? " checked" : "") . ">"
;
}
return "";
@@ -468,11 +436,9 @@ username.form['driver'].onchange();
* @return string expression to use in a query
*/
function processInput($field, $value, $function = "") {
if ($function == "=") {
return $value; // SQL injection
}
global $connection;
$name = $field["field"];
$return = ($field["type"] == "bit" && ereg('^[0-9]+$', $value) ? $value : q($value));
$return = $connection->quote($value);
if (ereg('^(now|getdate|uuid)$', $function)) {
$return = "$function()";
} elseif (ereg('^current_(date|timestamp)$', $function)) {
@@ -480,22 +446,21 @@ username.form['driver'].onchange();
} elseif (ereg('^([+-]|\\|\\|)$', $function)) {
$return = idf_escape($name) . " $function $return";
} elseif (ereg('^[+-] interval$', $function)) {
$return = idf_escape($name) . " $function " . (preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+$~i", $value) ? $value : $return);
$return = idf_escape($name) . " $function " . (preg_match("~^([0-9]+|'[0-9.: -]') [A-Z_]+$~i", $value) ? $value : $return);
} elseif (ereg('^(addtime|subtime|concat)$', $function)) {
$return = "$function(" . idf_escape($name) . ", $return)";
} elseif (ereg('^(md5|sha1|password|encrypt|hex)$', $function)) {
} elseif (ereg('^(md5|sha1|password|encrypt)$', $function)) {
$return = "$function($return)";
}
if (ereg("binary", $field["type"])) {
$return = "unhex($return)";
}
return $return;
}
/** Returns export output options
* @return array
* @param bool generate select (otherwise radio)
* @param string
* @return string
*/
function dumpOutput() {
function dumpOutput($select, $value = "") {
$return = array('text' => lang('open'), 'file' => lang('save'));
if (function_exists('gzencode')) {
$return['gz'] = 'gzip';
@@ -504,215 +469,20 @@ username.form['driver'].onchange();
$return['bz2'] = 'bzip2';
}
// ZipArchive requires temporary file, ZIP can be created by gzcompress - see PEAR File_Archive
return $return;
return html_select("output", $return, $value, $select);
}
/** Returns export format options
* @return array
* @param bool generate select (otherwise radio)
* @param string
* @return string
*/
function dumpFormat() {
return array('sql' => 'SQL', 'csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV');
}
/** Export table structure
* @param string
* @param string
* @param bool
* @return null prints data
*/
function dumpTable($table, $style, $is_view = false) {
if ($_POST["format"] != "sql") {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark
if ($style) {
dump_csv(array_keys(fields($table)));
}
} elseif ($style) {
$create = create_sql($table, $_POST["auto_increment"]);
if ($create) {
if ($style == "DROP+CREATE") {
echo "DROP " . ($is_view ? "VIEW" : "TABLE") . " IF EXISTS " . table($table) . ";\n";
}
if ($is_view) {
// remove DEFINER with current user
$create = preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\\1)', logged_user()) . '`~', '\\1', $create); //! proper escaping of user
}
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) {
// create procedure which iterates over original columns and adds new and removes old
$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 = " . q($table) . " ORDER BY ORDINAL_POSITION";
echo "DELIMITER ;;
CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
DECLARE _column_name, _collation_name, after varchar(64) DEFAULT '';
DECLARE _column_type, _column_default text;
DECLARE _is_nullable char(3);
DECLARE _extra varchar(30);
DECLARE _column_comment varchar(255);
DECLARE done, set_after bool DEFAULT 0;
DECLARE add_columns text DEFAULT '";
$fields = array();
$after = "";
foreach (get_rows($query) as $row) {
$default = $row["COLUMN_DEFAULT"];
$row["default"] = (isset($default) ? q($default) : "NULL");
$row["after"] = q($after); //! rgt AFTER lft, lft AFTER id doesn't work
$row["alter"] = escape_string(idf_escape($row["COLUMN_NAME"])
. " $row[COLUMN_TYPE]"
. ($row["COLLATION_NAME"] ? " COLLATE $row[COLLATION_NAME]" : "")
. (isset($default) ? " DEFAULT " . ($default == "CURRENT_TIMESTAMP" ? $default : $row["default"]) : "")
. ($row["IS_NULLABLE"] == "YES" ? "" : " NOT NULL")
. ($row["EXTRA"] ? " $row[EXTRA]" : "")
. ($row["COLUMN_COMMENT"] ? " COMMENT " . q($row["COLUMN_COMMENT"]) : "")
. ($after ? " AFTER " . idf_escape($after) : " FIRST")
);
echo ", ADD $row[alter]";
$fields[] = $row;
$after = $row["COLUMN_NAME"];
}
echo "';
DECLARE columns CURSOR FOR $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";
foreach ($fields as $row) {
echo "
WHEN " . q($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 != " . q($row["COLUMN_TYPE"]) . " OR _extra != '$row[EXTRA]' OR _column_comment != " . q($row["COLUMN_COMMENT"]) . " OR after != $row[after] THEN
SET @alter_table = CONCAT(@alter_table, ', MODIFY $row[alter]');
END IF;"; //! don't replace in comment
}
echo "
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_command = CONCAT(alter_command, 'ALTER TABLE " . table($table) . "', SUBSTR(CONCAT(add_columns, @alter_table), 2), ';\\n');
END IF;
END;;
DELIMITER ;
CALL adminer_alter(@adminer_alter);
DROP PROCEDURE adminer_alter;
";
//! indexes
}
}
}
/** Export table data
* @param string
* @param string
* @param string
* @return null prints data
*/
function dumpData($table, $style, $query) {
global $connection, $jush;
$max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024
if ($style) {
if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") {
echo truncate_sql($table) . ";\n";
}
if ($_POST["format"] == "sql") {
$fields = fields($table);
}
$result = $connection->query($query, 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers
if ($result) {
$insert = "";
$buffer = "";
while ($row = $result->fetch_assoc()) {
if ($_POST["format"] != "sql") {
if ($style == "table") {
dump_csv(array_keys($row));
$style = "INSERT";
}
dump_csv($row);
} else {
if (!$insert) {
$insert = "INSERT INTO " . table($table) . " (" . implode(", ", array_map('idf_escape', array_keys($row))) . ") VALUES";
}
foreach ($row as $key => $val) {
$row[$key] = (isset($val) ? (ereg('int|float|double|decimal', $fields[$key]["type"]) ? $val : q($val)) : "NULL"); //! columns looking like functions
}
$s = implode(",\t", $row);
if ($style == "INSERT+UPDATE") {
$set = array();
foreach ($row as $key => $val) {
$set[] = idf_escape($key) . " = $val";
}
echo "$insert ($s) ON DUPLICATE KEY UPDATE " . implode(", ", $set) . ";\n";
} else {
$s = ($max_packet ? "\n" : " ") . "($s)";
if (!$buffer) {
$buffer = $insert . $s;
} elseif (strlen($buffer) + 2 + strlen($s) < $max_packet) { // 2 - separator and terminator length
$buffer .= ",$s";
} else {
$buffer .= ";\n";
echo $buffer;
$buffer = $insert . $s;
}
}
}
}
if ($_POST["format"] == "sql" && $style != "INSERT+UPDATE" && $buffer) {
$buffer .= ";\n";
echo $buffer;
}
} elseif ($_POST["format"] == "sql") {
echo "-- " . str_replace("\n", " ", $connection->error) . "\n";
}
}
}
/** Send headers for export
* @param string
* @param bool
* @return string extension
*/
function dumpHeaders($identifier, $multi_table = false) {
$output = $_POST["output"];
$ext = ($_POST["format"] == "sql" ? "sql" : ($multi_table ? "tar" : "csv")); // multiple CSV packed to TAR
header("Content-Type: " .
($output == "bz2" ? "application/x-bzip" :
($output == "gz" ? "application/x-gzip" :
($ext == "tar" ? "application/x-tar" :
($ext == "sql" || $output != "file" ? "text/plain" : "text/csv") . "; charset=utf-8"
))));
if ($output == "bz2") {
ob_start('bzcompress', 1e6);
}
if ($output == "gz") {
ob_start('gzencode', 1e6);
}
return $ext;
}
/** Print homepage
* @return bool whether to print default homepage
*/
function homepage() {
echo '<p>' . ($_GET["ns"] == "" ? '<a href="' . h(ME) . 'database=">' . lang('Alter database') . "</a>\n" : "");
if (support("scheme")) {
echo "<a href='" . h(ME) . "scheme='>" . ($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema')) . "</a>\n";
}
return true;
function dumpFormat($select, $value = "") {
return html_select("format", array('sql' => 'SQL', 'csv' => 'CSV,', 'csv;' => 'CSV;'), $value, $select);
}
/** Prints navigation after Adminer title
* @param string can be "auth" if there is no database connection, "db" if there is no database selected, "ns" with invalid schema
* @param string can be "auth" if there is no database connection or "db" if there is no database selected
* @return null
*/
function navigation($missing) {
@@ -726,12 +496,12 @@ DROP PROCEDURE adminer_alter;
<?php
if ($missing == "auth") {
$first = true;
foreach ((array) $_SESSION["pwds"] as $driver => $servers) {
foreach ((array) $_SESSION["passwords"] as $driver => $servers) {
foreach ($servers as $server => $usernames) {
foreach ($usernames as $username => $password) {
if (isset($password)) {
if ($first) {
echo "<p onclick='eventStop(event);'>\n";
echo "<p>\n";
$first = false;
}
echo "<a href='" . h(auth_url($driver, $server, $username)) . "'>($drivers[$driver]) " . h($username . ($server != "" ? "@$server" : "")) . "</a><br>\n";
@@ -744,23 +514,17 @@ DROP PROCEDURE adminer_alter;
?>
<form action="" method="post">
<p class="logout">
<?php
if (DB == "" || !$missing) {
echo "<a href='" . h(ME) . "sql='" . bold(isset($_GET["sql"])) . ">" . lang('SQL command') . "</a>\n";
if (support("dump")) {
echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Dump') . "</a>\n";
}
}
?>
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>" onclick="eventStop(event);">
<a href="<?php echo h(ME); ?>sql="><?php echo bold(lang('SQL command'), isset($_GET["sql"])); ?></a>
<a href="<?php echo h(ME); ?>dump=<?php echo urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]); ?>"><?php echo bold(lang('Dump'), isset($_GET["dump"])); ?></a>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>">
</p>
</form>
<form action="">
<p>
<?php hidden_fields_get(); ?>
<?php echo ($databases ? html_select("db", array("" => "(" . lang('database') . ")") + $databases, DB, "this.form.submit();") : '<input name="db" value="' . h(DB) . '">'); ?>
<input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?> onclick="eventStop(event);">
<input type="submit" value="<?php echo lang('Use'); ?>"<?php echo ($databases ? " class='hidden'" : ""); ?>>
<?php
if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
if (support("scheme")) {
@@ -769,8 +533,7 @@ DROP PROCEDURE adminer_alter;
set_schema($_GET["ns"]);
}
}
if ($_GET["ns"] !== "" && !$missing) {
echo '<p><a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create new table') . "</a>\n";
if ($_GET["ns"] !== "") {
$tables = tables_list();
if (!$tables) {
echo "<p class='message'>" . lang('No tables.') . "\n";
@@ -781,12 +544,13 @@ DROP PROCEDURE adminer_alter;
$links[] = preg_quote($table, '/');
}
echo "<script type='text/javascript'>\n";
echo "var jushLinks = { $jush: [ '" . js_escape(ME) . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
echo "var jushLinks = { $jush: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
echo "jushLinks.$val = jushLinks.$jush;\n";
}
echo "</script>\n";
}
echo '<p><a href="' . h(ME) . 'create=">' . bold(lang('Create new table'), $_GET["create"] === "") . "</a>\n";
}
}
echo (isset($_GET["sql"]) ? '<input type="hidden" name="sql" value="">'
@@ -802,11 +566,18 @@ DROP PROCEDURE adminer_alter;
* @return null
*/
function tablesPrint($tables) {
echo "<p id='tables'>\n";
echo "<ul id='tables'>\n";
$i = 1;
foreach ($tables as $table => $type) {
echo '<a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table) . ">" . lang('select') . "</a> ";
echo '<a href="' . h(ME) . 'table=' . urlencode($table) . '"' . bold($_GET["table"] == $table) . ">" . $this->tableName(array("Name" => $table)) . "</a><br>\n"; //! Adminer::tableName may work with full table status
echo "<li onmouseover=\"toggle('table-$i');\" onmouseout=\"toggle('table-$i');\"><a href='" . h(ME) . "table=" . urlencode($table) . "'>" . bold($this->tableName(array("Name" => $table)), $_GET["table"] == $table) . "</a>"; //! Adminer::tableName may work with full table status
echo "<span id='table-$i' class='hidden'>";
echo ' <a href="' . h(ME) . 'select=' . urlencode($table) . '">' . bold(lang('select'), $_GET["select"] == $table) . '</a>';
echo ' <a href="' . h(ME) . 'create=' . urlencode($table) . '">' . bold(lang('alter'), $_GET["create"] == $table) . '</a>';
echo ' <a href="' . h(ME) . 'edit=' . urlencode($table) . '">' . bold(lang('insert'), $_GET["edit"] == $table) . '</a>';
echo "</span>\n";
$i++;
}
echo "</ul>\n";
}
}

View File

@@ -1,6 +1,12 @@
<?php
$connection = '';
if (!$drivers) {
page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", $possible_drivers)), null);
page_footer("auth");
exit;
}
$token = $_SESSION["token"];
if (!$_SESSION["token"]) {
$_SESSION["token"] = rand(1, 1e6); // defense against cross-site request forgery
@@ -16,7 +22,7 @@ if ($_COOKIE["adminer_permanent"]) {
if (isset($_POST["server"])) {
session_regenerate_id(); // defense against session fixation
$_SESSION["pwds"][$_POST["driver"]][$_POST["server"]][$_POST["username"]] = $_POST["password"];
$_SESSION["passwords"][$_POST["driver"]][$_POST["server"]][$_POST["username"]] = $_POST["password"];
if ($_POST["permanent"]) {
$key = base64_encode($_POST["driver"]) . "-" . base64_encode($_POST["server"]) . "-" . base64_encode($_POST["username"]);
$private = $adminer->permanentLogin();
@@ -36,7 +42,7 @@ if (isset($_POST["server"])) {
page_footer("db");
exit;
} else {
foreach (array("pwds", "dbs", "queries") as $key) {
foreach (array("passwords", "databases", "history") as $key) {
set_session($key, null);
}
$key = base64_encode(DRIVER) . "-" . base64_encode(SERVER) . "-" . base64_encode($_GET["username"]);
@@ -46,13 +52,13 @@ if (isset($_POST["server"])) {
}
redirect(substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.'));
}
} elseif ($permanent && !$_SESSION["pwds"]) {
} elseif ($permanent && !$_SESSION["passwords"]) {
session_regenerate_id();
$private = $adminer->permanentLogin(); // try to decode even if not set
foreach ($permanent as $key => $val) {
list(, $cipher) = explode(":", $val);
list($driver, $server, $username) = array_map('base64_decode', explode("-", $key));
$_SESSION["pwds"][$driver][$server][$username] = decrypt_string(base64_decode($cipher), $private);
$_SESSION["passwords"][$driver][$server][$username] = decrypt_string($cipher, $private);
}
}
@@ -66,7 +72,7 @@ function auth_error($exception = null) {
if (($_COOKIE[$session_name] || $_GET[$session_name]) && !$token) {
$error = lang('Session expired, please login again.');
} else {
$password = &get_session("pwds");
$password = &get_session("passwords");
if (isset($password)) {
$error = h($exception ? $exception->getMessage() : (is_string($connection) ? $connection : lang('Invalid credentials.')));
$password = null;
@@ -74,7 +80,7 @@ function auth_error($exception = null) {
}
}
page_header(lang('Login'), $error, null);
echo "<form action='' method='post' onclick='eventStop(event);'>\n";
echo "<form action='' method='post'>\n";
$adminer->loginForm();
echo "<div>";
hidden_fields($_POST, array("driver", "server", "username", "password", "permanent")); // expired session
@@ -83,16 +89,10 @@ function auth_error($exception = null) {
page_footer("auth");
}
if (isset($_GET["username"])) {
if (!class_exists("Min_DB")) {
unset($_SESSION["pwds"][DRIVER]); //! remove also from adminer_permanent
page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", $possible_drivers)), false);
page_footer("auth");
exit;
}
if (isset($_GET["username"]) && class_exists("Min_DB")) { // doesn't exists with passing wrong driver
$connection = connect();
}
if (is_string($connection) || !$adminer->login($_GET["username"], get_session("pwds"))) {
if (is_string($connection) || !$adminer->login($_GET["username"], get_session("passwords"))) {
auth_error();
exit;
}

View File

@@ -21,16 +21,14 @@ if (isset($_GET["file"])) {
include "../adminer/include/functions.inc.php";
global $adminer, $connection, $drivers, $edit_functions, $enum_length, $error, $functions, $grouping, $HTTPS, $inout, $jush, $LANG, $langs, $on_actions, $structured_types, $token, $translations, $types, $unsigned, $VERSION; // allows including Adminer inside a function
if (!isset($_SERVER["REQUEST_URI"])) {
$_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"] . ($_SERVER["QUERY_STRING"] != "" ? "?$_SERVER[QUERY_STRING]" : ""); // IIS 5 compatibility
}
$HTTPS = $_SERVER["HTTPS"] && strcasecmp($_SERVER["HTTPS"], "off");
@ini_set("session.use_trans_sid", false); // protect links in export, @ - may be disabled
if (!defined("SID")) {
if (!ini_bool("session.auto_start")) {
session_name("adminer_sid"); // use specific session name to get own namespace
$params = array(0, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]), "", $HTTPS);
$params = array(0, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]), "", $_SERVER["HTTPS"] && strcasecmp($_SERVER["HTTPS"], "off"));
if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
$params[] = true; // HttpOnly
}
@@ -39,13 +37,25 @@ if (!defined("SID")) {
}
// disable magic quotes to be able to use database escaping function
remove_slashes(array(&$_GET, &$_POST, &$_COOKIE));
if (function_exists("set_magic_quotes_runtime")) { // removed in PHP 6
if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST, &$_COOKIE);
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)] = ($filter ? $v : stripslashes($v));
}
}
}
unset($process);
}
if (function_exists("set_magic_quotes_runtime")) {
set_magic_quotes_runtime(false);
}
@set_time_limit(0); // @ - can be disabled
@ini_set("zend.ze1_compatibility_mode", false); // @ - deprecated
@ini_set("precision", 20); // @ - can be disabled
include "../adminer/include/lang.inc.php";
include "../adminer/lang/$LANG.inc.php";
@@ -59,7 +69,7 @@ include "../adminer/drivers/mysql.inc.php"; // must be included as last driver
define("SERVER", $_GET[DRIVER]); // read from pgsql=localhost
define("DB", $_GET["db"]); // for the sake of speed and size
define("ME", preg_replace('~^[^?]*/([^?]*).*~', '\\1', $_SERVER["REQUEST_URI"]) . '?'
. (sid() ? SID . '&' : '')
. (SID && !$_COOKIE ? SID . '&' : '') // !$_COOKIE - don't pass SID with permanent login
. (SERVER !== null ? DRIVER . "=" . urlencode(SERVER) . '&' : '')
. (isset($_GET["username"]) ? "username=" . urlencode($_GET["username"]) . '&' : '')
. (DB != "" ? 'db=' . urlencode(DB) . '&' . (isset($_GET["ns"]) ? "ns=" . urlencode($_GET["ns"]) . "&" : "") : '')
@@ -72,6 +82,7 @@ include "../adminer/include/xxtea.inc.php";
include "../adminer/include/auth.inc.php";
include "./include/connect.inc.php";
include "./include/editing.inc.php";
include "./include/export.inc.php";
session_cache_limiter(""); // to allow restarting session
if (!ini_bool("session.use_cookies") || @ini_set("session.use_cookies", false) !== false) { // @ - may be disabled
@@ -79,3 +90,4 @@ if (!ini_bool("session.use_cookies") || @ini_set("session.use_cookies", false) !
}
$on_actions = array("RESTRICT", "CASCADE", "SET NULL", "NO ACTION"); ///< @var array used in foreign_keys()
$confirm = " onclick=\"return confirm('" . lang('Are you sure?') . "');\""; ///< @var string

View File

@@ -1,11 +1,12 @@
<?php
function connect_error() {
global $connection, $token, $error, $drivers;
global $connection, $VERSION, $token, $error, $drivers;
$databases = array();
if (DB != "") {
page_header(lang('Database') . ": " . h(DB), lang('Invalid database.'), true);
} else {
if ($_POST["db"] && !$error) {
set_session("databases", null);
queries_redirect(substr(ME, 0, -1), lang('Databases have been dropped.'), drop_databases($_POST["db"]));
}
@@ -23,55 +24,44 @@ function connect_error() {
}
echo "<p>" . lang('%s version: %s through PHP extension %s', $drivers[DRIVER], "<b>$connection->server_info</b>", "<b>$connection->extension</b>") . "\n";
echo "<p>" . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
if ($_GET["refresh"]) {
set_session("dbs", null);
}
$databases = get_databases();
if ($databases) {
$scheme = support("scheme");
$collations = collations();
echo "<form action='' method='post'>\n";
echo "<table cellspacing='0' onclick='tableClick(event);'>\n";
echo "<thead><tr><td>&nbsp;<th>" . lang('Database') . "<td>" . lang('Collation') . "<td>" . lang('Tables') . "</thead>\n";
echo "<thead><tr><td><input type='hidden' name='token' value='$token'>&nbsp;<th>" . lang('Database') . "<td>" . lang('Collation') . "<td>" . lang('Tables') . "</thead>\n";
foreach ($databases as $db) {
$root = h(ME) . "db=" . urlencode($db);
echo "<tr" . odd() . "><td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"]));
echo "<th><a href='$root'>" . h($db) . "</a>";
echo "<td><a href='$root" . ($scheme ? "&amp;ns=" : "") . "&amp;database='>" . nbsp(db_collation($db, $collations)) . "</a>";
echo "<td><a href='$root&amp;database='>" . nbsp(db_collation($db, $collations)) . "</a>";
echo "<td align='right'><a href='$root&amp;schema=' id='tables-" . h($db) . "'>?</a>";
echo "\n";
}
echo "</table>\n";
echo "<p><input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm("formChecked(this, /db/)", 1) . ">\n"; // 1 - eventStop
echo "<input type='hidden' name='token' value='$token'>\n";
echo "<a href='" . h(ME) . "refresh=1' onclick='eventStop(event);'>" . lang('Refresh') . "</a>\n";
echo "<p><input type='submit' name='drop' value='" . lang('Drop') . "' onclick=\"return confirm('" . lang('Are you sure?') . " (' + formChecked(this, /db/) + ')');\">\n";
echo "</form>\n";
}
}
page_footer("db");
if ($databases) {
echo "<script type='text/javascript'>ajaxSetHtml('" . js_escape(ME) . "script=connect');</script>\n";
echo "<script type='text/javascript'>\n";
foreach (count_tables($databases) as $db => $val) {
echo "setHtml('tables-" . addcslashes($db, "\\'/") . "', '$val');\n";
}
echo "</script>\n";
}
if (isset($_GET["status"])) {
$_GET["variables"] = $_GET["status"];
}
if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["variables"]) || $_GET["script"] == "connect")) {
if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["variables"]))) {
if (DB != "") {
set_session("dbs", null);
set_session("databases", null);
}
connect_error(); // separate function to catch SQLite error
exit;
}
if (support("scheme") && DB != "" && $_GET["ns"] !== "") {
if (!isset($_GET["ns"])) {
redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema());
}
if (!set_schema($_GET["ns"])) {
page_header(lang('Schema') . ": " . h($_GET["ns"]), lang('Invalid schema.'), true);
page_footer("ns");
exit;
}
if (support("scheme") && DB != "" && $_GET["ns"] !== "" && (!isset($_GET["ns"]) || !set_schema($_GET["ns"]))) {
redirect(preg_replace('~ns=[^&]*&~', '', ME) . "ns=" . get_schema());
}

View File

@@ -7,37 +7,30 @@
* @return null
*/
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
global $LANG, $adminer, $connection, $drivers;
global $LANG, $VERSION, $adminer, $connection, $drivers;
header("Content-Type: text/html; charset=utf-8");
$adminer->headers();
header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin
$title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
$title_page = $title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name();
if (is_ajax()) {
header("X-AJAX-Title: " . rawurlencode($title_page));
} else {
?>
$protocol = ($_SERVER["HTTPS"] && strcasecmp($_SERVER["HTTPS"], "off") ? "https" : "http");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
<html lang="<?php echo $LANG; ?>">
<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_page; ?></title>
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico" id="favicon">
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css">
<?php if ($adminer->head() && file_exists("adminer.css")) { ?>
<title><?php echo $title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name(); ?></title>
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css<?php // Ondrej Valka, http://valka.info ?>">
<?php if (file_exists("adminer.css")) { ?>
<link rel="stylesheet" type="text/css" href="adminer.css">
<?php } ?>
<body class="<?php echo lang('ltr'); ?> nojs" onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>', '<?php echo js_escape($_GET["ns"]); ?>');" onkeydown="bodyKeydown(event);" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
<script type="text/javascript">
var areYouSure = '<?php echo lang('Resend POST data?'); ?>';
</script>
<body onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
<script type="text/javascript" src="../adminer/static/functions.js"></script>
<script type="text/javascript" src="static/editing.js"></script>
<div id="content">
<?php
}
if (isset($breadcrumb)) {
$link = substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1);
echo '<p id="breadcrumb"><a href="' . ($link ? h($link) : ".") . '">' . $drivers[DRIVER] . '</a> &raquo; ';
@@ -64,33 +57,28 @@ var areYouSure = '<?php echo lang('Resend POST data?'); ?>';
echo "$title\n";
}
}
echo "<span id='loader'></span>\n";
echo "<h2>$title_all</h2>\n";
restart_session();
$uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]);
$messages = $_SESSION["messages"][$uri];
if ($messages) {
echo "<div class='message'>" . implode("</div>\n<div class='message'>", $messages) . "</div>\n";
unset($_SESSION["messages"][$uri]);
if ($_SESSION["messages"]) {
echo "<div class='message'>" . implode("</div>\n<div class='message'>", $_SESSION["messages"]) . "</div>\n";
$_SESSION["messages"] = array();
}
$databases = &get_session("dbs");
$databases = &get_session("databases");
if (DB != "" && $databases && !in_array(DB, $databases, true)) {
$databases = null;
}
if ($error) {
echo "<div class='error'>$error</div>\n";
}
define("PAGE_HEADER", 1);
}
/** Print HTML footer
* @param string "auth", "db", "ns"
* @param string auth|db
* @return null
*/
function page_footer($missing = "") {
global $adminer;
if (!is_ajax()) {
?>
?>
</div>
<?php switch_lang(); ?>
@@ -98,5 +86,8 @@ function page_footer($missing = "") {
<?php $adminer->navigation($missing); ?>
</div>
<?php
}
// don't wait for code after footer
session_write_close();
ob_flush();
flush();
}

View File

@@ -2,78 +2,80 @@
/** Print select result
* @param Min_Result
* @param Min_DB connection to examine indexes
* @param string base link for <th> fields
* @return null
*/
function select($result, $connection2 = null, $href = "") {
$links = array(); // colno => orgtable - create links from these columns
$indexes = array(); // orgtable => array(column => colno) - primary keys
$columns = array(); // orgtable => array(column => ) - not selected columns in primary key
$blobs = array(); // colno => bool - display bytes for blobs
$types = array(); // colno => type - display char in <code>
odd(''); // reset odd for each result
for ($i=0; $row = $result->fetch_row(); $i++) {
if (!$i) {
echo "<table cellspacing='0' class='nowrap'>\n";
echo "<thead><tr>";
for ($j=0; $j < count($row); $j++) {
$field = $result->fetch_field();
$orgtable = $field->orgtable;
$orgname = $field->orgname;
if ($orgtable != "") {
if (!isset($indexes[$orgtable])) {
// find primary key in each table
$indexes[$orgtable] = array();
foreach (indexes($orgtable, $connection2) as $index) {
if ($index["type"] == "PRIMARY") {
$indexes[$orgtable] = array_flip($index["columns"]);
break;
function select($result, $connection2 = null) {
if (!$result->num_rows) {
echo "<p class='message'>" . lang('No rows.') . "\n";
} else {
echo "<table cellspacing='0' class='nowrap'>\n";
$links = array(); // colno => orgtable - create links from these columns
$indexes = array(); // orgtable => array(column => colno) - primary keys
$columns = array(); // orgtable => array(column => ) - not selected columns in primary key
$blobs = array(); // colno => bool - display bytes for blobs
$types = array(); // colno => type - display char in <code>
odd(''); // reset odd for each result
for ($i=0; $row = $result->fetch_row(); $i++) {
if (!$i) {
echo "<thead><tr>";
for ($j=0; $j < count($row); $j++) {
$field = $result->fetch_field();
$orgtable = $field->orgtable;
$orgname = $field->orgname;
if ($orgtable != "") {
if (!isset($indexes[$orgtable])) {
// find primary key in each table
$indexes[$orgtable] = array();
foreach (indexes($orgtable, $connection2) as $index) {
if ($index["type"] == "PRIMARY") {
$indexes[$orgtable] = array_flip($index["columns"]);
break;
}
}
$columns[$orgtable] = $indexes[$orgtable];
}
if (isset($columns[$orgtable][$orgname])) {
unset($columns[$orgtable][$orgname]);
$indexes[$orgtable][$orgname] = $j;
$links[$j] = $orgtable;
}
$columns[$orgtable] = $indexes[$orgtable];
}
if (isset($columns[$orgtable][$orgname])) {
unset($columns[$orgtable][$orgname]);
$indexes[$orgtable][$orgname] = $j;
$links[$j] = $orgtable;
if ($field->charsetnr == 63) { // 63 - binary
$blobs[$j] = true;
}
$types[$j] = $field->type;
echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . h($field->name);
}
if ($field->charsetnr == 63) { // 63 - binary
$blobs[$j] = true;
}
$types[$j] = $field->type;
$name = h($field->name);
echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . ($href ? "<a href='$href" . strtolower($name) . "' target='_blank' rel='noreferrer'>$name</a>" : $name);
echo "</thead>\n";
}
echo "</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($val)) { // strlen - SQLite can return int
$val = "&nbsp;"; // some content to print a border
echo "<tr" . odd() . ">";
foreach ($row as $key => $val) {
if (!isset($val)) {
$val = "<i>NULL</i>";
} else {
$val = h($val);
if ($types[$key] == 254) { // 254 - char
$val = "<code>$val</code>";
if ($blobs[$key] && !is_utf8($val)) {
$val = "<i>" . lang('%d byte(s)', strlen($val)) . "</i>"; //! link to download
} elseif (!strlen($val)) { // strlen - SQLite can return int
$val = "&nbsp;"; // some content to print a border
} else {
$val = h($val);
if ($types[$key] == 254) { // 254 - char
$val = "<code>$val</code>";
}
}
if (isset($links[$key]) && !$columns[$links[$key]]) {
$link = "edit=" . urlencode($links[$key]);
foreach ($indexes[$links[$key]] as $col => $j) {
$link .= "&where" . urlencode("[" . bracket_escape($col) . "]") . "=" . urlencode($row[$j]);
}
$val = "<a href='" . h(ME . $link) . "'>$val</a>";
}
}
if (isset($links[$key]) && !$columns[$links[$key]]) {
$link = "edit=" . urlencode($links[$key]);
foreach ($indexes[$links[$key]] as $col => $j) {
$link .= "&where" . urlencode("[" . bracket_escape($col) . "]") . "=" . urlencode($row[$j]);
}
$val = "<a href='" . h(ME . $link) . "'>$val</a>";
}
echo "<td>$val";
}
echo "<td>$val";
}
echo "</table>\n";
}
echo ($i ? "</table>" : "<p class='message'>" . lang('No rows.')) . "\n";
}
/** Get referencable tables with single column primary key except self
@@ -98,34 +100,6 @@ function referencable_primary($self) {
return $return;
}
/** Print SQL <textarea> tag
* @param string
* @param int
* @param int
* @param string
* @return null
*/
function textarea($name, $value, $rows = 10, $cols = 80) {
echo "<textarea name='$name' rows='$rows' cols='$cols' class='sqlarea' spellcheck='false' wrap='off' onkeydown='return textareaKeydown(this, event);'>"; // spellcheck, wrap - not valid before HTML5
if (is_array($value)) {
foreach ($value as $val) { // not implode() to save memory
echo h($val) . "\n\n\n";
}
} else {
echo h($value);
}
echo "</textarea>";
}
/** Format time difference
* @param array ($sec, $sec)
* @param array ($sec, $sec)
* @return string HTML code
*/
function format_time($start, $end) {
return " <span class='time'>(" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . ")</span>";
}
/** Print table columns for type edit
* @param string
* @param array
@@ -134,10 +108,10 @@ function format_time($start, $end) {
* @return null
*/
function edit_type($key, $field, $collations, $foreign_keys = array()) {
global $structured_types, $types, $unsigned, $on_actions;
global $structured_types, $unsigned, $inout, $on_actions;
?>
<td><select name="<?php echo $key; ?>[type]" class="type" onfocus="lastType = selectValue(this);" onchange="editingTypeChange(this);"><?php echo optionlist((!$field["type"] || isset($types[$field["type"]]) ? array() : array($field["type"])) + $structured_types + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select>
<td><input name="<?php echo $key; ?>[length]" value="<?php echo h($field["length"]); ?>" size="3" onfocus="editingLengthFocus(this);"><td class="options"><?php
<td><select name="<?php echo $key; ?>[type]" class="type" onfocus="lastType = selectValue(this);" onchange="editingTypeChange(this);"><?php echo optionlist($structured_types + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select>
<td><input name="<?php echo $key; ?>[length]" value="<?php echo h($field["length"]); ?>" size="3" onfocus="editingLengthFocus(this);"><td><?php
echo "<select name='$key" . "[collation]'" . (ereg('(char|text|enum|set)$', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
echo ($unsigned ? "<select name='$key" . "[unsigned]'" . (!$field["type"] || ereg('(int|float|double|decimal)$', $field["type"]) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
echo ($foreign_keys ? "<select name='$key" . "[on_delete]'" . (ereg("`", $field["type"]) ? "" : " class='hidden'") . "><option value=''>(" . lang('ON DELETE') . ")" . optionlist($on_actions, $field["on_delete"]) . "</select> " : " "); // space for IE
@@ -158,11 +132,11 @@ function process_length($length) {
* @return string
*/
function process_type($field, $collate = "COLLATE") {
global $unsigned;
global $connection, $unsigned;
return " $field[type]"
. ($field["length"] != "" ? "(" . process_length($field["length"]) . ")" : "")
. ($field["length"] != "" && !ereg('^date|time$', $field["type"]) ? "(" . process_length($field["length"]) . ")" : "")
. (ereg('int|float|double|decimal', $field["type"]) && in_array($field["unsigned"], $unsigned) ? " $field[unsigned]" : "")
. (ereg('char|text|enum|set', $field["type"]) && $field["collation"] ? " $collate " . q($field["collation"]) : "")
. (ereg('char|text|enum|set', $field["type"]) && $field["collation"] ? " $collate " . $connection->quote($field["collation"]) : "")
;
}
@@ -172,13 +146,14 @@ function process_type($field, $collate = "COLLATE") {
* @return array array("field", "type", "NULL", "DEFAULT", "ON UPDATE", "COMMENT", "AUTO_INCREMENT")
*/
function process_field($field, $type_field) {
global $connection;
return array(
idf_escape($field["field"]),
process_type($type_field),
($field["null"] ? " NULL" : " NOT NULL"), // NULL for timestamp
(isset($field["default"]) ? " DEFAULT " . ($field["type"] == "timestamp" && eregi("^CURRENT_TIMESTAMP$", $field["default"]) ? $field["default"] : q($field["default"])) : ""),
(isset($field["default"]) ? " DEFAULT " . ($field["type"] == "timestamp" && eregi("^CURRENT_TIMESTAMP$", $field["default"]) ? $field["default"] : $connection->quote($field["default"])) : ""),
($field["on_update"] ? " ON UPDATE $field[on_update]" : ""),
(support("comment") && $field["comment"] != "" ? " COMMENT " . q($field["comment"]) : ""),
(support("comment") && $field["comment"] != "" ? " COMMENT " . $connection->quote($field["comment"]) : ""),
($field["auto_increment"] ? auto_increment() : null),
);
}
@@ -231,7 +206,6 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
<?php } ?>
<td><?php echo "<input type='image' name='add[" . (support("move_col") ? 0 : count($fields)) . "]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script>
</thead>
<tbody onkeydown="return editingKeydown(event);">
<?php
foreach ($fields as $i => $field) {
$i++;
@@ -244,7 +218,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei
<?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?>
<?php if ($type == "TABLE") { ?>
<td><?php echo checkbox("fields[$i][null]", 1, $field["null"]); ?>
<td><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?> onclick="var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.onchange(); }">
<td><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?>>
<td class="hidden"><?php echo checkbox("fields[$i][has_default]", 1, $field["has_default"]); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" onchange="this.previousSibling.checked = true;">
<?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . "><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' maxlength='255'>" : ""); ?>
<?php } ?>
@@ -315,7 +289,7 @@ function normalize_enum($match) {
* @param array
* @param string
* @param string
* @return bool
* @return
*/
function grant($grant, $privileges, $columns, $on) {
if (!$privileges) {
@@ -348,22 +322,8 @@ function drop_create($drop, $create, $location, $message_drop, $message_alter, $
$dropped = $name != "" && ($_POST["dropped"] || queries($drop));
$created = queries($create);
if (!queries_redirect($location, ($name != "" ? $message_alter : $message_create), $created) && $dropped) {
redirect(null, $message_drop);
restart_session();
$_SESSION["messages"][] = $message_drop;
}
return $dropped;
}
/** Get string to add a file in TAR
* @param string
* @param string
* @return string
*/
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);
}

View File

@@ -0,0 +1,174 @@
<?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);
}
function dump_table($table, $style, $is_view = false) {
global $connection;
if ($_POST["format"] != "sql") {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark
if ($style) {
dump_csv(array_keys(fields($table)));
}
} elseif ($style) {
$create = create_sql($table);
if ($create) {
if ($style == "DROP+CREATE") {
echo "DROP " . ($is_view ? "VIEW" : "TABLE") . " IF EXISTS " . idf_escape($table) . ";\n";
}
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) {
// create procedure which iterates over original columns and adds new and removes old
$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 = " . $connection->quote($table) . " ORDER BY ORDINAL_POSITION";
echo "DELIMITER ;;
CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
DECLARE _column_name, _collation_name, after varchar(64) DEFAULT '';
DECLARE _column_type, _column_default text;
DECLARE _is_nullable char(3);
DECLARE _extra varchar(30);
DECLARE _column_comment varchar(255);
DECLARE done, set_after bool DEFAULT 0;
DECLARE add_columns text DEFAULT '";
$fields = array();
$result = $connection->query($query);
$after = "";
while ($row = $result->fetch_assoc()) {
$default = $row["COLUMN_DEFAULT"];
$row["default"] = (isset($default) ? $connection->quote($default) : "NULL");
$row["after"] = $connection->quote($after); //! rgt AFTER lft, lft AFTER id doesn't work
$row["alter"] = escape_string(idf_escape($row["COLUMN_NAME"])
. " $row[COLUMN_TYPE]"
. ($row["COLLATION_NAME"] ? " COLLATE $row[COLLATION_NAME]" : "")
. (isset($default) ? " DEFAULT " . ($default == "CURRENT_TIMESTAMP" ? $default : $row["default"]) : "")
. ($row["IS_NULLABLE"] == "YES" ? "" : " NOT NULL")
. ($row["EXTRA"] ? " $row[EXTRA]" : "")
. ($row["COLUMN_COMMENT"] ? " COMMENT " . $connection->quote($row["COLUMN_COMMENT"]) : "")
. ($after ? " AFTER " . idf_escape($after) : " FIRST")
);
echo ", ADD $row[alter]";
$fields[] = $row;
$after = $row["COLUMN_NAME"];
}
echo "';
DECLARE columns CURSOR FOR $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";
foreach ($fields as $row) {
echo "
WHEN " . $connection->quote($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 != " . $connection->quote($row["COLUMN_TYPE"]) . " OR _extra != '$row[EXTRA]' OR _column_comment != " . $connection->quote($row["COLUMN_COMMENT"]) . " OR after != $row[after] THEN
SET @alter_table = CONCAT(@alter_table, ', MODIFY $row[alter]');
END IF;"; //! don't replace in comment
}
echo "
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_command = CONCAT(alter_command, 'ALTER TABLE " . idf_escape($table) . "', SUBSTR(CONCAT(add_columns, @alter_table), 2), ';\\n');
END IF;
END;;
DELIMITER ;
CALL adminer_alter(@adminer_alter);
DROP PROCEDURE adminer_alter;
";
//! indexes
}
}
}
function dump_data($table, $style, $select = "") {
global $connection, $jush;
$max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024
if ($style) {
if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") {
echo "TRUNCATE " . idf_escape($table) . ";\n";
}
$fields = fields($table);
$result = $connection->query(($select ? $select : "SELECT * FROM " . idf_escape($table)), 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers, microtime
if ($result) {
$insert = "";
$buffer = "";
while ($row = $result->fetch_assoc()) {
if ($_POST["format"] != "sql") {
dump_csv($row);
} else {
if (!$insert) {
$insert = "INSERT INTO " . idf_escape($table) . " (" . implode(", ", array_map('idf_escape', array_keys($row))) . ") VALUES";
}
foreach ($row as $key => $val) {
$row[$key] = (isset($val) ? (ereg('int|float|double|decimal', $fields[$key]["type"]) ? $val : $connection->quote($val)) : "NULL"); //! columns looking like functions
}
$s = implode(",\t", $row);
if ($style == "INSERT+UPDATE") {
$set = array();
foreach ($row as $key => $val) {
$set[] = idf_escape($key) . " = $val";
}
echo "$insert ($s) ON DUPLICATE KEY UPDATE " . implode(", ", $set) . ";\n";
} else {
$s = ($max_packet ? "\n" : " ") . "($s)";
if (!$buffer) {
$buffer = $insert . $s;
} elseif (strlen($buffer) + 2 + strlen($s) < $max_packet) { // 2 - separator and terminator length
$buffer .= ",$s";
} else {
$buffer .= ";\n";
echo $buffer;
$buffer = $insert . $s;
}
}
}
}
if ($_POST["format"] == "sql" && $style != "INSERT+UPDATE" && $buffer) {
$buffer .= ";\n";
echo $buffer;
}
}
}
}
function dump_headers($identifier, $multi_table = false) {
$filename = ($identifier != "" ? friendly_url($identifier) : "adminer");
$output = $_POST["output"];
$ext = ($_POST["format"] == "sql" ? "sql" : ($multi_table ? "tar" : "csv")); // multiple CSV packed to TAR
header("Content-Type: " .
($output == "bz2" ? "application/x-bzip" :
($output == "gz" ? "application/x-gzip" :
($ext == "tar" ? "application/x-tar" :
($ext == "sql" || $output != "file" ? "text/plain" : "text/csv") . "; charset=utf-8"
))));
if ($output != "text") {
header("Content-Disposition: attachment; filename=$filename.$ext" . ($output != "file" && !ereg('[^0-9a-z]', $output) ? ".$output" : ""));
}
session_write_close();
if ($_POST["output"] == "bz2") {
ob_start('bzcompress', 1e6);
}
if ($_POST["output"] == "gz") {
ob_start('gzencode', 1e6);
}
return $ext;
}

View File

@@ -22,27 +22,8 @@ function idf_unescape($idf) {
* @return string
*/
function escape_string($val) {
return substr(q($val), 1, -1);
}
/** Disable magic_quotes_gpc
* @param array e.g. (&$_GET, &$_POST, &$_COOKIE)
* @return null modified in place
*/
function remove_slashes($process) {
if (get_magic_quotes_gpc()) {
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)] = ($filter ? $v : stripslashes($v));
}
}
}
}
global $connection;
return substr($connection->quote($val), 1, -1);
}
/** Escape or unescape string to use inside form []
@@ -91,7 +72,7 @@ function nl_br($string) {
function checkbox($name, $value, $checked, $label = "", $onclick = "") {
static $id = 0;
$id++;
$return = "<input type='checkbox'" . ($name ? " name='$name' value='" . h($value) . "'" : " class='jsonly'") . ($checked ? " checked" : "") . ($onclick ? " onclick=\"$onclick\"" : "") . " id='checkbox-$id'>";
$return = "<input type='checkbox'" . ($name ? " name='$name' value='" . h($value) . "'" : "") . ($checked ? " checked" : "") . ($onclick ? " onclick=\"$onclick\"" : "") . " id='checkbox-$id'>";
return ($label != "" ? "<label for='checkbox-$id'>$return" . h($label) . "</label>" : $return);
}
@@ -104,12 +85,10 @@ function checkbox($name, $value, $checked, $label = "", $onclick = "") {
function optionlist($options, $selected = null, $use_keys = false) {
$return = "";
foreach ($options as $k => $v) {
$opts = array($k => $v);
if (is_array($v)) {
$return .= '<optgroup label="' . h($k) . '">';
$opts = $v;
}
foreach ($opts as $key => $val) {
foreach ((is_array($v) ? $v : array($k => $v)) as $key => $val) {
$return .= '<option' . ($use_keys || is_string($key) ? ' value="' . h($key) . '"' : '') . (($use_keys || is_string($key) ? (string) $key : $val) === $selected ? ' selected' : '') . '>' . h($val);
}
if (is_array($v)) {
@@ -137,22 +116,20 @@ function html_select($name, $options, $value = "", $onchange = true) {
return $return;
}
/** Get onclick confirmation
* @param string JavaScript expression
* @param bool stop event propagation
* @return string
/** Print SQL <textarea> tag
* @param string
* @param int
* @param int
* @param string
* @return null
*/
function confirm($count = "", $stop = false) {
return " onclick=\"" . ($stop ? "eventStop(event); " : "") . "return confirm('" . lang('Are you sure?') . ($count ? " (' + $count + ')" : "") . "');\"";
function textarea($name, $value, $rows = 10, $cols = 80) {
echo "<textarea name='$name' rows='$rows' cols='$cols' style='width: 98%;' spellcheck='false'>" . h($value) . "</textarea>"; // spellcheck - not valid before HTML5
}
/** Escape string for JavaScript apostrophes
* @param string
* @return string
*/
function js_escape($string) {
return addcslashes($string, "\r\n'\\/"); // slash for <script>
}
// other functions
/** Get INI boolean value
* @param string
@@ -163,26 +140,6 @@ function ini_bool($ini) {
return (eregi('^(on|true|yes)$', $val) || (int) $val); // boolean values set by php_value are strings
}
/** Check if SID is neccessary
* @return bool
*/
function sid() {
static $return;
if (!isset($return)) { // restart_session() defines SID
$return = (SID && !($_COOKIE && ini_bool("session.use_cookies"))); // $_COOKIE - don't pass SID with permanent login
}
return $return;
}
/** Shortcut for $connection->quote($string)
* @param string
* @return string
*/
function q($string) {
global $connection;
return $connection->quote($string);
}
/** Get list of values from database
* @param string
* @param mixed
@@ -212,31 +169,8 @@ function get_key_vals($query, $connection2 = null) {
}
$return = array();
$result = $connection2->query($query);
if (is_object($result)) {
while ($row = $result->fetch_row()) {
$return[$row[0]] = $row[1];
}
}
return $return;
}
/** Get all rows of result
* @param string
* @return array associative
*/
function get_rows($query, $connection2 = null, $error = "<p class='error'>") {
global $connection;
if (!is_object($connection2)) {
$connection2 = $connection;
}
$return = array();
$result = $connection2->query($query);
if (is_object($result)) { // can return true
while ($row = $result->fetch_assoc()) {
$return[] = $row;
}
} elseif (!$result && $connection->error && $error && defined("PAGE_HEADER")) {
echo $error . error() . "\n";
while ($row = $result->fetch_row()) {
$return[$row[0]] = $row[1];
}
return $return;
}
@@ -273,11 +207,10 @@ function unique_array($row, $indexes) {
* @return string
*/
function where($where) {
global $jush;
$return = array();
foreach ((array) $where["where"] as $key => $val) {
$return[] = idf_escape(bracket_escape($key, 1)) // 1 - back
. (ereg('\\.', $val) || $jush == "mssql" ? " LIKE " . exact_value(addcslashes($val, "%_")) : " = " . exact_value($val)) // LIKE because of floats, but slow with ints, in MS SQL because of text
. (ereg('\\.', $val) ? " LIKE " . exact_value(addcslashes($val, "%_")) : " = " . exact_value($val)) // LIKE because of floats, but slow with ints
; //! enum and set
}
foreach ((array) $where["null"] as $key) {
@@ -292,7 +225,6 @@ function where($where) {
*/
function where_check($val) {
parse_str($val, $check);
remove_slashes(array(&$check));
return where($check);
}
@@ -304,7 +236,7 @@ function where_check($val) {
* @return string
*/
function where_link($i, $column, $value, $operator = "=") {
return "&where%5B$i%5D%5Bcol%5D=" . urlencode($column) . "&where%5B$i%5D%5Bop%5D=" . urlencode((isset($value) ? $operator : "IS NULL")) . "&where%5B$i%5D%5Bval%5D=" . urlencode($value);
return "&where%5B$i%5D%5Bcol%5D=" . urlencode($column) . "&where%5B$i%5D%5Bop%5D=" . urlencode($operator) . "&where%5B$i%5D%5Bval%5D=" . urlencode($value);
}
/** Set cookie valid for 1 month
@@ -313,14 +245,13 @@ function where_link($i, $column, $value, $operator = "=") {
* @return bool
*/
function cookie($name, $value) {
global $HTTPS;
$params = array(
$name,
(ereg("\n", $value) ? "" : $value), // HTTP Response Splitting protection in PHP < 5.1.2
time() + 2592000, // 2592000 - 30 days
preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]),
"",
$HTTPS
$_SERVER["HTTPS"] && strcasecmp($_SERVER["HTTPS"], "off")
);
if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
$params[] = true; // HttpOnly
@@ -364,20 +295,13 @@ function auth_url($driver, $server, $username) {
global $drivers;
preg_match('~([^?]*)\\??(.*)~', remove_from_uri(implode("|", array_keys($drivers)) . "|username|" . session_name()), $match);
return "$match[1]?"
. (sid() ? SID . "&" : "")
. (SID && !$_COOKIE ? SID . "&" : "")
. ($driver != "server" || $server != "" ? urlencode($driver) . "=" . urlencode($server) . "&" : "")
. "username=" . urlencode($username)
. ($match[2] ? "&$match[2]" : "")
;
}
/** Find whether it is an AJAX request
* @return bool
*/
function is_ajax() {
return ($_SERVER["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest");
}
/** Send Location header and exit
* @param string null to only set a message
* @param string
@@ -386,13 +310,10 @@ function is_ajax() {
function redirect($location, $message = null) {
if (isset($message)) {
restart_session();
$_SESSION["messages"][preg_replace('~^[^?]*~', '', (isset($location) ? $location : $_SERVER["REQUEST_URI"]))][] = $message;
$_SESSION["messages"][] = $message;
}
if (isset($location)) {
if ($location == "") {
$location = ".";
}
header((is_ajax() ? "X-AJAX-Redirect" : "Location") . ": $location");
header("Location: " . ($location != "" ? $location : "."));
exit;
}
}
@@ -413,7 +334,7 @@ function query_redirect($query, $location, $message, $redirect = true, $execute
}
$sql = "";
if ($query) {
$sql = $adminer->messageQuery("$query;");
$sql = $adminer->messageQuery($query);
}
if ($failed) {
$error = error() . $sql;
@@ -426,7 +347,7 @@ function query_redirect($query, $location, $message, $redirect = true, $execute
}
/** Execute and remember query
* @param string null to return remembered queries, end with ';' to use DELIMITER
* @param string null to return remembered queries
* @return Min_Result
*/
function queries($query = null) {
@@ -436,7 +357,7 @@ function queries($query = null) {
// return executed queries without parameter
return implode(";\n", $queries);
}
$queries[] = (ereg(';$', $query) ? "DELIMITER ;;\n$query;\nDELIMITER " : $query);
$queries[] = $query;
return $connection->query($query);
}
@@ -459,7 +380,6 @@ function apply_queries($query, $tables, $escape = 'table') {
* @param string
* @param string
* @param bool
* @return bool
*/
function queries_redirect($location, $message, $redirect) {
return query_redirect(queries(), $location, $message, $redirect, false, !$redirect);
@@ -491,18 +411,10 @@ function get_file($key, $decompress = false) {
if (!$file || $file["error"]) {
return $file["error"];
}
$return = file_get_contents($decompress && ereg('\\.gz$', $file["name"]) ? "compress.zlib://$file[tmp_name]"
return file_get_contents($decompress && ereg('\\.gz$', $file["name"]) ? "compress.zlib://$file[tmp_name]"
: ($decompress && ereg('\\.bz2$', $file["name"]) ? "compress.bzip2://$file[tmp_name]"
: $file["tmp_name"]
)); //! may not be reachable because of open_basedir
if ($decompress) {
if (function_exists("iconv") && ereg("^\xFE\xFF|^\xFF\xFE", $return, $regs)) {
$return = iconv("utf-16", "utf-8", $return);
} else { // not ternary operator to save memory
$return = ereg_replace("^\xEF\xBB\xBF", "", $return); // UTF-8 BOM
}
}
return $return;
}
/** Determine upload error
@@ -526,25 +438,6 @@ function odd($return = ' class="odd"') {
return ($i++ % 2 ? $return : '');
}
/** Print one row in JSON object
* @param string or "" to close the object
* @param string
* @return null
*/
function json_row($key, $val = null) {
static $first = true;
if ($first) {
echo "{";
}
if ($key != "") {
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\"\\") . '": ' . (isset($val) ? '"' . addcslashes($val, "\r\n\"\\") . '"' : 'undefined');
$first = false;
} else {
echo "\n}\n";
$first = true;
}
}
/** Check whether the string is in UTF-8
* @param string
* @return bool
@@ -554,16 +447,6 @@ function is_utf8($val) {
return (preg_match('~~u', $val) && !preg_match('~[\\0-\\x8\\xB\\xC\\xE-\\x1F]~', $val));
}
/** Create repeat pattern for preg
* @param string
* @param int
* @return string
*/
function repeat_pattern($pattern, $length) {
// fix for Compilation failed: number too big in {} quantifier
return str_repeat("$pattern{0,65535}", $length / 65535) . "$pattern{0," . ($length % 65535) . "}"; // can create {0,0} which is OK
}
/** Shorten UTF-8 string
* @param string
* @param int
@@ -571,10 +454,10 @@ function repeat_pattern($pattern, $length) {
* @return string escaped string with appended ...
*/
function shorten_utf8($string, $length = 80, $suffix = "") {
if (!preg_match("(^(" . repeat_pattern("[\t\r\n -\x{FFFF}]", $length) . ")($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow
preg_match("(^(" . repeat_pattern("[\t\r\n -~]", $length) . ")($)?)", $string, $match);
if (!preg_match("(^([\t\r\n -\x{FFFF}]{0,$length})($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow
preg_match("(^([\t\r\n -~]{0,$length})($)?)", $string, $match);
}
return h($match[1]) . $suffix . (isset($match[2]) ? "" : "<i>...</i>");
return h($match[1]) . $suffix . (isset($match[2]) ? "" : "<em>...</em>");
}
/** Generate friendly URL
@@ -607,7 +490,7 @@ function hidden_fields($process, $ignore = array()) {
* @return null
*/
function hidden_fields_get() {
echo (sid() ? '<input type="hidden" name="' . session_name() . '" value="' . h(session_id()) . '">' : '');
echo (SID && !$_COOKIE ? '<input type="hidden" name="' . session_name() . '" value="' . h(session_id()) . '">' : '');
echo (SERVER !== null ? '<input type="hidden" name="' . DRIVER . '" value="' . h(SERVER) . '">' : "");
echo '<input type="hidden" name="username" value="' . h($_GET["username"]) . '">';
}
@@ -617,9 +500,8 @@ function hidden_fields_get() {
* @return array array($col => array())
*/
function column_foreign_keys($table) {
global $adminer;
$return = array();
foreach ($adminer->foreignKeys($table) as $foreign_key) {
foreach (foreign_keys($table) as $foreign_key) {
foreach ($foreign_key["source"] as $val) {
$return[$val][] = $foreign_key;
}
@@ -632,19 +514,15 @@ function column_foreign_keys($table) {
* @param string
* @param array
* @param mixed int|string|array
* @param string
* @return null
*/
function enum_input($type, $attrs, $field, $value, $empty = null) {
global $adminer;
function enum_input($type, $name, $field, $value) {
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
$return = (isset($empty) ? "<label><input type='$type'$attrs value='$empty'" . ((is_array($value) ? in_array($empty, $value) : $value === 0) ? " checked" : "") . "><i>" . lang('empty') . "</i></label>" : "");
foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val));
$checked = (is_int($value) ? $value == $i+1 : (is_array($value) ? in_array($i+1, $value) : $value === $val));
$return .= " <label><input type='$type'$attrs value='" . ($i+1) . "'" . ($checked ? ' checked' : '') . '>' . h($adminer->editVal($val, $field)) . '</label>';
echo " <label><input type='$type' name='$name' value='" . ($i+1) . "'" . ($checked ? ' checked' : '') . '>' . h($val) . '</label>';
}
return $return;
}
/** Print edit input field
@@ -657,14 +535,11 @@ function input($field, $value, $function) {
global $types, $adminer, $jush;
$name = h(bracket_escape($field["field"]));
echo "<td class='function'>";
$reset = ($jush == "mssql" && $field["auto_increment"]);
if ($reset && !$_POST["save"]) {
$function = null;
}
$functions = (isset($_GET["select"]) || $reset ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
$attrs = " name='fields[$name]'";
$functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
if ($field["type"] == "enum") {
echo nbsp($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
echo nbsp($functions[""]) . "<td>" . ($functions["orig"] ? "<label><input type='radio' name='fields[$name]' value='-1' checked><em>$functions[orig]</em></label> " : "");
echo $adminer->editInput($_GET["edit"], $field, " name='fields[$name]'", $value);
enum_input("radio", "fields[$name]", $field, $value);
} else {
$first = 0;
foreach ($functions as $key => $val) {
@@ -673,9 +548,9 @@ function input($field, $value, $function) {
}
$first++;
}
$onchange = ($first ? " onchange=\"var f = this.form['function[" . js_escape($name) . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : "");
$attrs .= $onchange;
echo (count($functions) > 1 ? html_select("function[$name]", $functions, !isset($function) || in_array($function, $functions) || isset($functions[$function]) ? $function : "", "functionChange(this);") : nbsp(reset($functions))) . '<td>';
$onchange = ($first ? " onchange=\"var f = this.form['function[" . addcslashes($name, "\r\n'\\") . "]']; if ($first > f.selectedIndex) f.selectedIndex = $first;\"" : "");
$attrs = " name='fields[$name]'$onchange";
echo (count($functions) > 1 ? html_select("function[$name]", $functions, !isset($function) || in_array($function, $functions) ? $function : "") : nbsp(reset($functions))) . '<td>';
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
if ($input != "") {
echo $input;
@@ -684,16 +559,16 @@ function input($field, $value, $function) {
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='" . (1 << $i) . "'" . ($checked ? ' checked' : '') . "$onchange>" . h($adminer->editVal($val, $field)) . '</label>';
echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . (1 << $i) . "'" . ($checked ? ' checked' : '') . "$onchange>" . h($val) . '</label>';
}
} elseif (ereg('blob|bytea|raw|file', $field["type"]) && ini_bool("file_uploads")) {
} elseif (ereg('binary|blob|bytea', $field["type"]) && ini_bool("file_uploads")) {
echo "<input type='file' name='fields-$name'$onchange>";
} elseif (ereg('text|lob', $field["type"])) {
} elseif (ereg('text|blob', $field["type"])) {
echo "<textarea " . ($jush != "sqlite" || ereg("\n", $value) ? "cols='50' rows='12'" : "cols='30' rows='1' style='height: 1.2em;'") . "$attrs>" . h($value) . '</textarea>'; // 1.2em - line-height
} else {
// int(3) is only a display hint
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^(\\d+)(,(\\d+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $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 value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . (ereg('char|binary', $field["type"]) && $maxlength > 20 ? " size='40'" : "") . "$attrs>";
$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 value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . (ereg('char', $field["type"]) && $field["length"] > 20 ? " size='40'" : "") . "$attrs>";
}
}
}
@@ -703,7 +578,7 @@ function input($field, $value, $function) {
* @return string
*/
function process_input($field) {
global $adminer;
global $connection, $adminer;
$idf = bracket_escape($field["field"]);
$function = $_POST["function"][$idf];
$value = $_POST["fields"][$idf];
@@ -714,7 +589,7 @@ function process_input($field) {
if ($value == "") {
return "NULL";
}
return +$value;
return intval($value);
}
if ($field["auto_increment"] && $value == "") {
return null;
@@ -728,12 +603,12 @@ function process_input($field) {
if ($field["type"] == "set") {
return array_sum((array) $value);
}
if (ereg('blob|bytea|raw|file', $field["type"]) && ini_bool("file_uploads")) {
if (ereg('binary|blob|bytea', $field["type"]) && ini_bool("file_uploads")) {
$file = get_file("fields-$idf");
if (!is_string($file)) {
return false; //! report errors
}
return q($file);
return $connection->quote($file);
}
return $adminer->processInput($field, $value, $function);
}
@@ -745,14 +620,12 @@ function process_input($field) {
*/
function search_tables() {
global $adminer, $connection;
$_GET["where"][0]["op"] = "LIKE %%";
$_GET["where"][0]["val"] = $_POST["query"];
$found = false;
foreach (table_status() as $table => $table_status) {
$name = $adminer->tableName($table_status);
if (isset($table_status["Engine"]) && $name != "" && (!$_POST["tables"] || in_array($table, $_POST["tables"]))) {
$result = $connection->query("SELECT" . limit("1 FROM " . table($table), " WHERE " . implode(" AND ", $adminer->selectSearchProcess(fields($table), array())), 1));
if ($result->fetch_row()) {
if ($result->num_rows) {
if (!$found) {
echo "<ul>\n";
$found = true;
@@ -764,33 +637,17 @@ function search_tables() {
echo ($found ? "</ul>" : "<p class='message'>" . lang('No tables.')) . "\n";
}
/** Send headers for export
* @param string
* @param bool
* @return string extension
*/
function dump_headers($identifier, $multi_table = false) {
global $adminer;
$return = $adminer->dumpHeaders($identifier, $multi_table);
$output = $_POST["output"];
if ($output != "text") {
header("Content-Disposition: attachment; filename=" . ($identifier != "" ? friendly_url($identifier) : "dump") . ".$return" . ($output != "file" && !ereg('[^0-9a-z]', $output) ? ".$output" : ""));
}
session_write_close();
return $return;
}
/** Print CSV row
* @param array
* @return null
*/
function dump_csv($row) {
foreach ($row as $key => $val) {
if (preg_match("~[\"\n,;\t]~", $val) || $val === "") {
if (preg_match("~[\"\n,;]~", $val) || $val === "") {
$row[$key] = '"' . str_replace('"', '""', $val) . '"';
}
}
echo implode(($_POST["format"] == "csv" ? "," : ($_POST["format"] == "tsv" ? "\t" : ";")), $row) . "\r\n";
echo implode(($_POST["format"] == "csv" ? "," : ";"), $row) . "\n";
}
/** Apply SQL function
@@ -837,7 +694,7 @@ function password_file() {
* @param string
* @return bool
*/
function is_mail($email) {
function is_email($email) {
$atom = '[-a-z0-9!#$%&\'*+/=?^_`{|}~]'; // characters of local-name
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component
$pattern = "$atom+(\\.$atom+)*@($domain?\\.)+$domain";
@@ -846,11 +703,11 @@ function is_mail($email) {
/** Check whether the string is URL address
* @param string
* @return string "http", "https" or ""
* @return bool
*/
function is_url($string) {
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component //! IDN
return (preg_match("~^(https?)://($domain?\\.)+$domain(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string, $match) ? strtolower($match[1]) : ""); //! restrict path, query and fragment characters
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component
return preg_match("~^https?://($domain?\\.)+$domain(:[0-9]+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string); //! restrict path, query and fragment characters
}
/** Print header for hidden fieldset (close by </div></fieldset>)
@@ -863,10 +720,11 @@ function print_fieldset($id, $legend, $visible = false) {
echo "<fieldset><legend><a href='#fieldset-$id' onclick=\"return !toggle('fieldset-$id');\">$legend</a></legend><div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
}
/** Return class='active' if $bold is true
/** Enclose $string to <b> if $bold is true
* @param string
* @param bool
* @return string
*/
function bold($bold) {
return ($bold ? " class='active'" : "");
function bold($string, $bold) {
return ($bold ? "<b>$string</b>" : $string);
}

View File

@@ -2,50 +2,26 @@
// not used in a single language version
$langs = array(
'en' => 'English', // Jakub Vrána - http://www.vrana.cz
'cs' => 'Čeština', // Jakub Vrána - http://www.vrana.cz
'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, Juraj Krivda - http://www.jstudio.cz
'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
'fr' => 'Français', // Francis Gagné, Aurélien Royer
'fr' => 'Français', // Francis Gagné
'it' => 'Italiano', // Alessandro Fiorotto, Paolo Asperti
'et' => 'Eesti', // Priit Kallas
'hu' => 'Magyar', // Borsos Szilárd (Borsosfi) - http://www.borsosfi.hu, info@borsosfi.hu
'pl' => 'Polski', // Radosław Kowalewski - http://srsbiz.pl/
'ca' => 'Català', // Joan Llosas
'pt' => 'Português', // Gian Live - gian@live.com
'sl' => 'Slovenski', // Matej Ferlan - www.itdinamik.com, matej.ferlan@itdinamik.com
'tr' => 'Türkçe', // Bilgehan Korkmaz - turktron.com
'ru' => 'Русский язык', // Maksim Izmaylov
'zh' => '简体中文', // Mr. Lodar
'zh-tw' => '繁體中文', // http://tzangms.com
'ja' => '日本語', // Hitoshi Ozawa - http://sourceforge.jp/projects/oss-ja-jpn/releases/
'ta' => 'த‌மிழ்', // G. Sampath Kumar, Chennai, India, sampathkumar11@gmail.com
'ar' => 'العربية', // Y.M Amine - Algeria - nbr7@live.fr
);
/** Get current language
* @return string
*/
function get_lang() {
global $LANG;
return $LANG;
}
/** Translate string
* @param string
* @param int
* @return string
*/
function lang($idf, $number = null) {
global $LANG, $translations;
$translation = $translations[$idf];
if (is_array($translation) && $translation) {
$pos = ($number == 1 || (!$number && $LANG == 'fr') ? 0 // French treat zero as singular
: ($LANG == 'sl' && (!$number || $number > 2) ? 1 : 0) // Slovenian use different forms for 1, 2, 3-4, other
+ ((!$number || $number >= 5) && ereg('cs|sk|ru|sl|pl', $LANG) ? 2 : 1) // Slavic languages use different forms for 1, 2-4, other
);
$pos = ($number == 1 ? 0 : ((!$number || $number >= 5) && ereg('cs|sk|ru', $LANG) ? 2 : 1)); // Slavic languages use different form for 2, 3, 4
$translation = $translation[$pos];
}
$args = func_get_args();
@@ -57,7 +33,7 @@ function switch_lang() {
global $LANG, $langs;
echo "<form action=''>\n<div id='lang'>";
hidden_fields($_GET, array('lang'));
echo lang('Language') . ": " . html_select("lang", $langs, $LANG, "var loc = location.search.replace(/[?&]lang=[^&]*/, ''); location.search = loc + (loc ? '&' : '') + 'lang=' + this.value;");
echo lang('Language') . ": " . html_select("lang", $langs, $LANG, "this.form.submit();");
echo " <input type='submit' value='" . lang('Use') . "' class='hidden'>\n";
echo "</div>\n</form>\n";
}

View File

@@ -1,7 +1,7 @@
<?php
// PDO can be used in several database drivers
if (extension_loaded('pdo')) {
/*abstract*/ class Min_PDO extends PDO {
/*abstract */class Min_PDO extends PDO {
var $_result, $server_info, $affected_rows, $error;
function __construct() {
@@ -79,4 +79,5 @@ if (extension_loaded('pdo')) {
}
}
$possible_drivers = array();
$drivers = array();

View File

@@ -1,2 +1,2 @@
<?php
$VERSION = "3.2.1";
$VERSION = "3.0.0-dev";

View File

@@ -1,15 +1,14 @@
<?php
/** Adminer - Compact database management
* @link http://www.adminer.org/
* @author Jakub Vrana, http://www.vrana.cz/
* @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
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
include "./include/bootstrap.inc.php";
$enum_length = "'(?:''|[^'\\\\]|\\\\.)*+'";
$enum_length = '\'(?:\'\'|[^\'\\\\]|\\\\.)*\'|"(?:""|[^"\\\\]|\\\\.)*"';
$inout = array("IN", "OUT", "INOUT");
if (isset($_GET["select"]) && ($_POST["edit"] || $_POST["clone"]) && !$_POST["save"]) {
@@ -55,8 +54,6 @@ if (isset($_GET["download"])) {
include "./procedure.inc.php";
} elseif (isset($_GET["sequence"])) {
include "./sequence.inc.php";
} elseif (isset($_GET["type"])) {
include "./type.inc.php";
} elseif (isset($_GET["trigger"])) {
include "./trigger.inc.php";
} elseif (isset($_GET["user"])) {
@@ -67,8 +64,6 @@ if (isset($_GET["download"])) {
include "./select.inc.php";
} elseif (isset($_GET["variables"])) {
include "./variables.inc.php";
} elseif (isset($_GET["script"])) {
include "./script.inc.php";
} else {
include "./db.inc.php";
}

View File

@@ -2,14 +2,10 @@
$TABLE = $_GET["indexes"];
$index_types = array("PRIMARY", "UNIQUE", "INDEX");
$table_status = table_status($TABLE);
if (eregi("MyISAM|M?aria", $table_status["Engine"])) {
if (ereg("MyISAM|Maria", $table_status["Engine"])) {
$index_types[] = "FULLTEXT";
}
$indexes = indexes($TABLE);
if ($jush == "sqlite") { // doesn't support primary key
unset($index_types[0]);
unset($indexes[""]);
}
if ($_POST && !$error && !$_POST["add"]) {
$alter = array();
foreach ($_POST["indexes"] as $index) {
@@ -21,7 +17,7 @@ if ($_POST && !$error && !$_POST["add"]) {
foreach ($index["columns"] as $key => $column) {
if ($column != "") {
$length = $index["lengths"][$key];
$set[] = idf_escape($column) . ($length ? "(" . (+$length) . ")" : "");
$set[] = idf_escape($column) . ($length ? "(" . intval($length) . ")" : "");
$columns[] = $column;
$lengths[] = ($length ? $length : null);
}
@@ -76,25 +72,24 @@ if ($_POST) {
?>
<form action="" method="post">
<table cellspacing="0" class="nowrap">
<table cellspacing="0">
<thead><tr><th><?php echo lang('Index Type'); ?><th><?php echo lang('Column (length)'); ?></thead>
<?php
$j = 1;
$j = 0;
foreach ($row["indexes"] as $index) {
echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow(this);" : 1)) . "<td>";
echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) - 1 ? "indexesAddRow(this);" : 1)) . "<td>\n";
ksort($index["columns"]);
$i = 1;
foreach ($index["columns"] as $key => $column) {
foreach ($index["columns"] as $i => $column) {
echo "<span>" . html_select("indexes[$j][columns][$i]", array(-1 => "") + $fields, $column, ($i == count($index["columns"]) ? "indexesAddColumn(this);" : 1));
echo "<input name='indexes[$j][lengths][$i]' size='2' value='" . h($index["lengths"][$key]) . "'> </span>"; //! hide for non-MySQL drivers, add ASC|DESC
$i++;
echo "<input name='indexes[$j][lengths][$i]' size='2' value='" . h($index["lengths"][$i]) . "'> </span>\n"; //! hide for non-MySQL drivers, add ASC|DESC
}
echo "\n";
$j++;
}
?>
</table>
<p>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<noscript><p><input type="submit" name="add" value="<?php echo lang('Add next'); ?>"></noscript>
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form>

View File

@@ -1,267 +0,0 @@
<?php
$translations = array(
'Login' => 'تسجيل الدخول',
'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' => 'الطول',
'Auto Increment' => 'تزايد تلقائي',
'Options' => 'خيارات',
'Save' => 'حفظ',
'Drop' => 'حذف',
'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.' => 'تم تعديل العنصر.',
'Edit' => 'تعديل',
'Insert' => 'إنشاء',
'Save and insert next' => 'جفظ و إنشاء التالي',
'Delete' => 'مسح',
'Database' => 'قاعدة بيانات',
'Routines' => 'الروتينات',
'Indexes have been altered.' => 'تم تعديل المؤشر.',
'Indexes' => 'المؤشرات',
'Alter indexes' => 'تعديل المؤشرات',
'Add next' => 'إضافة التالي',
'Language' => 'اللغة',
'Select' => 'إختيار',
'New item' => 'عنصر جديد',
'Search' => 'بحث',
'Sort' => 'ترتيب',
'descending' => 'تنازلي',
'Limit' => 'حد',
'No rows.' => 'لا توجد نتائج.',
'Action' => 'حركة',
'edit' => 'تعديل',
'Page' => 'صفحة',
'Query executed OK, %d row(s) affected.' => 'تم تنفسذ الإستعلام, %d عدد الأسطر المعدلة.',
'Error in query' => 'هناك خطأ في الإستعلام',
'Execute' => 'تنفيذ',
'Table' => 'جدول',
'Foreign keys' => 'مفاتيح أجنبية',
'Triggers' => 'الزنادات',
'View' => 'عرض',
'Unable to select the table' => 'من غير الممكن إختيار الجدول',
'Invalid CSRF token. Send the form again.' => 'CSRF Token خاطئ. من فضلك أعد إرسال الإستمارة.',
'Comment' => 'تعليق',
'Default values' => 'القيمة الإفتراضية',
'%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 extension' => 'إمتداد غير موجود',
'None of the supported PHP extensions (%s) are available.' => 'إمتدادات php المدعومة غير موجودة.',
'Session support 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) have been killed.' => 'عدد الإجراءات التي تم إيقافها %d.',
'Kill' => 'إيقاف',
'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' => 'الحدث',
'%d row(s)' => '%d أسطر',
'Remove' => 'مسح',
'Are you sure?' => 'هل أنت متأكد؟',
'Privileges' => 'الإمتيازات',
'Create user' => 'إنشاء مستخدم',
'User has been dropped.' => 'تم حذف المستخدم.',
'User has been altered.' => 'تم تعديل المستخدم.',
'User has been created.' => 'تم إنشاء المستخدم.',
'Hashed' => 'تلبيد',
'Column' => 'عمود',
'Routine' => 'روتين',
'Grant' => 'Grant',
'Revoke' => 'Revoke',
'%s version: %s through PHP extension %s' => 'النسخة %s : %s عن طريق إمتداد ال PHP %s',
'Logged as: %s' => 'تم تسجيل الدخول بإسم %s',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'معلومات POST كبيرة جدا. قم بتقليص حجم المعلومات أو قم بزيادة قيمة %s في خيارات ال PHP.',
'Move up' => 'نقل للأعلى',
'Move down' => 'نقل للأسفل',
'Export' => 'تصدير',
'Tables' => 'جداول',
'Data' => 'معلومات',
'Output' => 'إخراج',
'open' => 'فتح',
'save' => 'حفظ',
'Format' => 'الصيغة',
'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' => 'في وقت محدد',
'Save and continue edit' => 'إحفظ و واصل التعديل',
'original' => 'الأصلي',
'Tables have been truncated.' => 'تم قطع الجداول.',
'Tables have been moved.' => 'تم نقل الجداول.',
'Tables have been dropped.' => 'تم حذف الجداول.',
'Tables and views' => 'الجداول و العروض',
'Engine' => 'المحرك',
'Collation' => 'ترتيب',
'Data Length' => 'طول المعطيات.',
'Index Length' => 'طول المؤشر.',
'Data Free' => 'المساحة الحرة',
'Rows' => 'الأسطر',
',' => ',',
'Analyze' => 'تحليل',
'Optimize' => 'تحسين',
'Check' => 'فحص',
'Repair' => 'إصلاح',
'Truncate' => 'قطع',
'Move to other database' => 'نقل إلى قاعدة بيانات أخرى',
'Move' => 'نقل',
'%d item(s) have been affected.' => 'عدد العناصر المعدلة هو %d.',
'whole result' => 'نتيجة كاملة',
'Clone' => 'نسخ',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'لقد تجاوزت العدد الأقصى للحقول. يرجى الرفع من %s و %s.',
'Partition by' => 'مقسم بواسطة',
'Partitions' => 'التقسيمات',
'Partition name' => 'إسم التقسيم',
'Values' => 'القيم',
'%d row(s) have been imported.' => 'عدد الأسطر المستوردة هو %d.',
'anywhere' => 'في اي مكان',
'Import' => 'إستيراد',
'Stop on error' => 'أوقف في حالة حدوث خطأ',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$5/$3/$1',
'[yyyy]-mm-dd' => 'jj/mm/[aaaa]',
'History' => 'تاريخ',
'Variables' => 'متغيرات',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'أعمدة المصدر و الهدف يجب أن تكون بنفس النوع, يجب أن يكون هناك مؤشر في أعمدة الهدف و البيانات المرجعية يجب ان تكون موجودة.',
'Relations' => 'علاقات',
'Run file' => 'نفذ الملف',
'Clear' => 'مسح',
'Maximum allowed file size is %sB.' => 'حجم الملف الأقصى هو %sB.',
'Numbers' => 'أعداد',
'Date and time' => 'التاريخ و الوقت',
'Strings' => 'سلاسل',
'Binary' => 'ثنائية',
'Lists' => 'قوائم',
'Editor' => 'المحرر',
'E-mail' => 'البريد الإلكتروني',
'From' => 'من',
'Subject' => 'الموضوع',
'Send' => 'إرسال',
'%d e-mail(s) have been sent.' => 'تم إرسال %d رسالة.',
'Webserver file %s' => 'ملف %s من خادم الويب',
'File does not exist.' => 'الملف غير موجود.',
'%d in total' => '%d في المجموع',
'Permanent login' => 'تسجيل دخول دائم',
'Databases have been dropped.' => 'تم حذف قواعد البيانات.',
'Database has been dropped.' => 'تم حذف قاعدة البيانات.',
'Search data in tables' => 'بحث في الجداول',
'schema' => 'المخطط',
'Schema' => 'المخطط',
'Alter schema' => 'تعديل المخطط',
'Create schema' => 'إنشاء مخطط',
'Schema has been dropped.' => 'تم حذف المخطط.',
'Schema has been created.' => 'تم إنشاء المخطط.',
'Schema has been altered.' => 'تم تعديل المخطط.',
'Sequences' => 'السلاسل',
'Create sequence' => 'إنشاء سلسلة',
'Alter sequence' => 'تعديل سلسلة',
'Sequence has been dropped.' => 'تم حذف السلسلة.',
'Sequence has been created.' => 'تم إنشاء السلسلة.',
'Sequence has been altered.' => 'تم تعديل السلسلة.',
'User types' => 'نوع المستخدم',
'Create type' => 'إنشاء نوع',
'Alter type' => 'تعديل نوع',
'Type has been dropped.' => 'تم حذف النوع.',
'Type has been created.' => 'تم إنشاء النوع.',
'Double click on a value to modify it.' => 'أنقر نقرا مزدوجا على قيمة لتعديلها.',
'Use edit link to modify this value.' => 'إستعمل الرابط "تعديل" لتعديل هذه القيمة.',
'last' => 'الأخيرة',
'From server' => 'من الخادم',
'System' => 'النظام',
'Select data' => 'عرض البيانات',
'Show structure' => 'عرض التركيبة',
'empty' => 'فارغ',
'Network' => 'شبكة',
'Geometry' => 'هندسة',
'File exists.' => 'الملف موجود.',
'Attachments' => 'ملفات مرفقة.',
'Item%s has been inserted.' => 'تم إدراج العنصر.',
'now' => 'الآن',
'%d query(s) executed OK.' => array('تم تنفيذ الإستعلام %d بنجاح.', 'تم تنفيذ الإستعلامات %d بنجاح.'),
'Show only errors' => 'إعرض الأخطاء فقط',
'Last page' => 'الصفحة السابقة',
'Refresh' => 'تحديث',
'Invalid schema.' => 'مخطط خاطئ.',
'Please use one of the extensions %s.' => 'من فضلك إستعمل إحدى الغمتدادات: %s.',
'ltr' => 'rtl',
);

View File

@@ -1,267 +0,0 @@
<?php
$translations = array(
'Login' => 'Inicia la sessió',
'Logout successful.' => 'Desconnexió correcta.',
'Invalid credentials.' => 'Credencials invàlids.',
'Server' => 'Servidor',
'Username' => 'Nom d\'usuari',
'Password' => 'Contrasenya',
'Select database' => 'Selecciona base de dades',
'Invalid database.' => 'Base de dades invàlida.',
'Create new database' => 'Crea una nova base de dades',
'Table has been dropped.' => 'S\'ha suprimit la taula.',
'Table has been altered.' => 'S\'ha modificat la taula.',
'Table has been created.' => 'S\'ha creat la taula.',
'Alter table' => 'Modifica la taula',
'Create table' => 'Crea una taula',
'Table name' => 'Nom de la taula',
'engine' => 'motor',
'collation' => 'compaginació',
'Column name' => 'Nom de la columna',
'Type' => 'Tipus',
'Length' => 'Llargada',
'Auto Increment' => 'Increment automàtic',
'Options' => 'Opcions',
'Save' => 'Desa',
'Drop' => 'Suprimeix',
'Database has been dropped.' => 'S\'ha suprimit la base de dades.',
'Database has been created.' => 'S\'ha creat la base de dades.',
'Database has been renamed.' => 'S\'ha canviat el nom de la base de dades.',
'Database has been altered.' => 'S\'ha modificat la base de dades.',
'Alter database' => 'Modifica la base de dades',
'Create database' => 'Crea una base de dades',
'SQL command' => 'Ordre SQL',
'Dump' => 'Exporta',
'Logout' => 'Desconnecta',
'database' => 'base de dades',
'Use' => 'Utilitza',
'No tables.' => 'No hi ha cap taula.',
'select' => 'registres',
'Create new table' => 'Crea una nova taula',
'Item has been deleted.' => 'S\'ha suprmit l\'element.',
'Item has been updated.' => 'S\'ha actualitzat l\'element.',
'Item%s has been inserted.' => 'S\'ha insertat l\'element%s.',
'Edit' => 'Edita',
'Insert' => 'Insereix',
'Save and insert next' => 'Desa i insereix el següent',
'Delete' => 'Suprimeix',
'Database' => 'Base de dades',
'Routines' => 'Rutines',
'Indexes have been altered.' => 'S\'han modificat els índexs.',
'Indexes' => 'Índexs',
'Alter indexes' => 'Modifica els índexs',
'Add next' => 'Afegeix el següent',
'Language' => 'Idioma',
'Select' => 'Selecciona',
'New item' => 'Nou element',
'Search' => 'Cerca',
'Sort' => 'Ordena',
'descending' => 'descendent',
'Limit' => 'Límit',
'No rows.' => 'No hi ha cap fila.',
'Action' => 'Acció',
'edit' => 'edita',
'Page' => 'Plana',
'Query executed OK, %d row(s) affected.' => array('Consulta executada correctament, %d fila modificada.', 'Consulta executada correctament, %d files modificades.'),
'Error in query' => 'Error en la consulta',
'Execute' => 'Executa',
'Table' => 'Taula',
'Foreign keys' => 'Claus foranes',
'Triggers' => 'Activadors',
'View' => 'Vista',
'Unable to select the table' => 'Impossible seleccionar la taula',
'Invalid CSRF token. Send the form again.' => 'Token CSRF invàlid. Torna a enviar el formulari.',
'Comment' => 'Comentari',
'Default values' => 'Valors per defecte',
'%d byte(s)' => array('%d byte', '%d bytes'),
'No commands to execute.' => 'Cap comanda per executar.',
'Unable to upload a file.' => 'Impossible adjuntar el fitxer.',
'File upload' => 'Adjunta un fitxer',
'File uploads are disabled.' => 'L\'ddjunció de fitxers està desactivada.',
'Routine has been called, %d row(s) affected.' => array('S\'ha cridat la rutina, %d fila modificada.', 'S\'ha cridat la rutina, %d files modificades.'),
'Call' => 'Crida',
'No extension' => 'Cap extensió',
'None of the supported PHP extensions (%s) are available.' => 'No hi ha cap de les extensions PHP soporatades (%s) disponible.',
'Session support must be enabled.' => 'Cal que estigui permès l\'us de sessions.',
'Session expired, please login again.' => 'La sessió ha expirat, torna a iniciar-ne una.',
'Text length' => 'Longitud del text',
'Foreign key has been dropped.' => 'S\'ha suprimit la clau forana.',
'Foreign key has been altered.' => 'S\'ha modificat la clau forana.',
'Foreign key has been created.' => 'S\'ha creat la clau forana.',
'Foreign key' => 'Clau forana',
'Target table' => 'Taula de destí',
'Change' => 'Canvi',
'Source' => 'Font',
'Target' => 'Destí',
'Add column' => 'Afegeix una columna',
'Alter' => 'Modifica',
'Add foreign key' => 'Afegeix una clau forana',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => 'Tipus d\'índex',
'Column (length)' => 'Columna (longitud)',
'View has been dropped.' => 'S\'ha suprimit la vista.',
'View has been altered.' => 'S\'ha modificat la vista.',
'View has been created.' => 'S\'ha creat la vista.',
'Alter view' => 'Modifica la vista',
'Create view' => 'Crea una vista',
'Name' => 'Nom',
'Process list' => 'Llista de processos',
'%d process(es) have been killed.' => array('S\'ha aturat %d procés.', 'S\'han aturat %d processos.'),
'Kill' => 'Atura',
'Parameter name' => 'Nom del paràmetre',
'Database schema' => 'Esquema de la base de dades',
'Create procedure' => 'Crea un procediment',
'Create function' => 'Crea una funció',
'Routine has been dropped.' => 'S\'ha suprimit la rutina.',
'Routine has been altered.' => 'S\'ha modificat la rutina.',
'Routine has been created.' => 'S\'ha creat la rutina.',
'Alter function' => 'Modifica la funció',
'Alter procedure' => 'Modifica el procediment',
'Return type' => 'Tipus retornat',
'Add trigger' => 'Afegeix un activador',
'Trigger has been dropped.' => 'S\'ha suprimit l\'activador.',
'Trigger has been altered.' => 'S\'ha modificat l\'activador.',
'Trigger has been created.' => 'S\'ha creat l\'activador.',
'Alter trigger' => 'Modifica l\'activador',
'Create trigger' => 'Crea un activador',
'Time' => 'Temps',
'Event' => 'Event',
'%s version: %s through PHP extension %s' => 'Versió %s: %s amb l\'extensió de PHP %s',
'%d row(s)' => array('%d fila', '%d files'),
'Remove' => 'Suprimeix',
'Are you sure?' => 'Estàs segur?',
'Privileges' => 'Privilegis',
'Create user' => 'Crea un usuari',
'User has been dropped.' => 'S\'ha suprimit l\'usuari.',
'User has been altered.' => 'S\'ha modificat l\'usuari.',
'User has been created.' => 'S\'ha creat l\'usuari.',
'Hashed' => 'Hashed',
'Column' => 'Columna',
'Routine' => 'Rutina',
'Grant' => 'Grant',
'Revoke' => 'Revoke',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Les dades POST són massa grans. Redueix les dades o incrementa la directiva de configuració %s.',
'Logged as: %s' => 'Connectat com: %s',
'Move up' => 'Mou a dalt',
'Move down' => 'Mou a baix',
'Functions' => 'Funcions',
'Aggregation' => 'Agregació',
'Export' => 'Exporta',
'Output' => 'Sortida',
'open' => 'obre',
'save' => 'desa',
'Format' => 'Format',
'Tables' => 'Taules',
'Data' => 'Data',
'Event has been dropped.' => 'S\'ha suprimit l\'event.',
'Event has been altered.' => 'S\'ha modificat l\'event.',
'Event has been created.' => 'S\'ha creat l\'event.',
'Alter event' => 'Modifica l\'event',
'Create event' => 'Crea un event',
'At given time' => 'A un moment donat',
'Every' => 'Cada',
'Events' => 'Events',
'Schedule' => 'Horari',
'Start' => 'Comença',
'End' => 'Acaba',
'Status' => 'Estat',
'On completion preserve' => 'Conservar en completar',
'Tables and views' => 'Taules i vistes',
'Data Length' => 'Longitud de les dades',
'Index Length' => 'L\'ongitud de l\'índex',
'Data Free' => 'Espai lliure',
'Collation' => 'Compaginació',
'Analyze' => 'Analitza',
'Optimize' => 'Optimitza',
'Check' => 'Verifica',
'Repair' => 'Repara',
'Truncate' => 'Escapça',
'Tables have been truncated.' => 'S\'han escapçat les taules.',
'Rows' => 'Files',
',' => ',',
'Tables have been moved.' => 'S\'han desplaçat les taules.',
'Move to other database' => 'Desplaça a una altra base de dades',
'Move' => 'Desplaça',
'Engine' => 'Motor',
'Save and continue edit' => 'Desa i segueix editant',
'original' => 'original',
'%d item(s) have been affected.' => array('S\'ha modificat %d element.', 'S\'han modificat %d elements.'),
'whole result' => 'tots els resultats',
'Tables have been dropped.' => 'S\'han suprimit les taules.',
'Clone' => 'Clona',
'Partition by' => 'Fes particions segons',
'Partitions' => 'Particions',
'Partition name' => 'Nom de la partició',
'Values' => 'Valors',
'%d row(s) have been imported.' => array('S\'ha importat %d fila.', 'S\'han importat %d files.'),
'Import' => 'Importa',
'Show structure' => 'Mostra l\'estructura',
'Select data' => 'Selecciona dades',
'Stop on error' => 'Atura en trobar un error',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'S\'ha assolit el nombre màxim de camps. Incrementa %s i %s.',
'anywhere' => 'a qualsevol lloc',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$5/$3/$1',
'[yyyy]-mm-dd' => 'dd/mm/[aaaa]',
'History' => 'Història',
'Variables' => 'Variables',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Les columnes origen i destí han de ser del mateix tipus, la columna destí ha d\'estar indexada i les dades referenciades han d\'existir.',
'E-mail' => 'Correu electrònic',
'From' => 'De',
'Subject' => 'Assumpte',
'Send' => 'Envia',
'%d e-mail(s) have been sent.' => array('S\'ha enviat %d correu electrònic.', 'S\'han enviat %d correus electrònics.'),
'Run file' => 'Executa el fitxer',
'Numbers' => 'Nombres',
'Date and time' => 'Data i hora',
'Strings' => 'Cadenes',
'Binary' => 'Binari',
'Lists' => 'Llistes',
'Relations' => 'Relacions',
'Maximum allowed file size is %sB.' => 'La mida màxima permesa del fitxer és de %sB.',
'Clear' => 'Suprimeix',
'Editor' => 'Editor',
'Webserver file %s' => 'Fitxer %s del servidor web',
'File does not exist.' => 'El fitxer no existeix.',
'Permanent login' => 'Sessió permanent',
'%d in total' => '%d en total',
'Attachments' => 'Adjuncions',
'System' => 'Sistema',
'last' => 'darrera',
'Network' => 'Xarxa',
'Geometry' => 'Geometria',
'Databases have been dropped.' => 'S\'han suprimit les bases de dades.',
'File exists.' => 'El fitxer ja existeix.',
'Double click on a value to modify it.' => 'Fes un doble clic a un valor per modificar-lo.',
'Use edit link to modify this value.' => 'Utilitza l\'enllaç d\'edició per modificar aquest valor.',
'Alter schema' => 'Modifica l\'esquema',
'Create schema' => 'Crea un esquema',
'Schema has been dropped.' => 'S\'ha suprimit l\'esquema.',
'Schema has been created.' => 'S\'ha creat l\'esquema.',
'Schema has been altered.' => 'S\'ha modificat l\'esquema.',
'schema' => 'esquema',
'Schema' => 'Esquema',
'Sequences' => 'Seqüències',
'Create sequence' => 'Crea una seqüència',
'Sequence has been dropped.' => 'S\'ha suprimit la seqüència.',
'Sequence has been created.' => 'S\'ha creat la seqüència.',
'Sequence has been altered.' => 'S\'ha modificat la seqüència.',
'Alter sequence' => 'Modifica la seqüència',
'User types' => 'Tipus de l\'usuari',
'Create type' => 'Crea un tipus',
'Type has been dropped.' => 'S\'ha suprimit el tipus.',
'Type has been created.' => 'S\'ha creat el tipus.',
'Alter type' => 'Modifica el tipus',
'Search data in tables' => 'Cerca dades en les taules',
'From server' => 'En el servidor',
'empty' => 'buit',
'now' => 'ara',
'%d query(s) executed OK.' => array('%d consulta executada correctament.', '%d consultes executades correctament.'),
'Show only errors' => 'Mostra només els errors',
'Last page' => 'Darrera plana',
'Refresh' => 'Refresca',
'Invalid schema.' => 'Esquema invàlid.',
'Please use one of the extensions %s.' => 'Si us plau, utilitza una de les extensions %s.',
'ltr' => 'ltr',
);

View File

@@ -1,28 +1,136 @@
<?php
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Systém',
'Login' => 'Přihlásit se',
'Logout successful.' => 'Odhlášení proběhlo v pořádku.',
'Invalid credentials.' => 'Neplatné přihlašovací údaje.',
'Server' => 'Server',
'Username' => 'Uživatel',
'Password' => 'Heslo',
'Permanent login' => 'Trvalé přihlášení',
'Login' => 'Přihlásit se',
'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',
'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',
'Logged as: %s' => 'Přihlášen jako: %s',
'Logout successful.' => 'Odhlášení proběhlo v pořádku.',
'Invalid credentials.' => 'Neplatné přihlašovací údaje.',
'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%s has been inserted.' => 'Položka%s 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 have 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' => 'Seřadit',
'descending' => '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' => 'Výchozí hodnoty',
'%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 extension' => 'Žádná extenze',
'None of the supported PHP extensions (%s) are available.' => 'Není dostupná žádná z podporovaných PHP extenzí (%s).',
'Session support 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) have been killed.' => array('Byl ukončen %d proces.', 'Byly ukončeny %d procesy.', 'Bylo ukončeno %d procesů.'),
'Kill' => 'Ukončit',
'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',
'%s version: %s through PHP extension %s' => 'Verze %s: %s přes PHP extenzi %s',
'Refresh' => 'Obnovit',
// text direction - 'ltr' or 'rtl'
'ltr' => 'ltr',
'%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
'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.',
@@ -33,99 +141,19 @@ $translations = array(
'Routine' => 'Procedura',
'Grant' => 'Povolit',
'Revoke' => 'Zakázat',
'Process list' => 'Seznam procesů',
'%d process(es) have been killed.' => array('Byl ukončen %d proces.', 'Byly ukončeny %d procesy.', 'Bylo ukončeno %d procesů.'),
'Kill' => 'Ukončit',
'Variables' => 'Proměnné',
'Status' => 'Stav',
'SQL command' => 'SQL příkaz',
'%d query(s) executed OK.' => array('%d příkaz proběhl v pořádku.', '%d příkazy proběhly v pořádku.', '%d příkazů proběhlo v pořádku.'),
'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ů.'),
'No commands to execute.' => 'Žádné příkazy k vykonání.',
'Error in query' => 'Chyba v dotazu',
'Execute' => 'Provést',
'Stop on error' => 'Zastavit při chybě',
'Show only errors' => 'Zobrazit pouze chyby',
// sprintf() format for time of the command
'%.3f s' => '%.3f s',
'History' => 'Historie',
'Clear' => 'Vyčistit',
'Edit all' => 'Upravit vše',
'File upload' => 'Nahrání souboru',
'From server' => 'Ze serveru',
'Webserver file %s' => 'Soubor %s na webovém serveru',
'Run file' => 'Spustit soubor',
'File does not exist.' => 'Soubor neexistuje.',
'File uploads are disabled.' => 'Nahrávání souborů není povoleno.',
'Unable to upload a file.' => 'Nepodařilo se nahrát soubor.',
'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Příliš velká POST data. Zmenšete data nebo zvyšte hodnotu konfigurační direktivy %s.',
'Logged as: %s' => 'Přihlášen jako: %s',
'Move up' => 'Přesunout nahoru',
'Move down' => 'Přesunout dolů',
'Functions' => 'Funkce',
'Aggregation' => 'Agregace',
'Export' => 'Export',
'Dump' => 'Export',
'Output' => 'Výstup',
'open' => 'otevřít',
'save' => 'uložit',
'Format' => 'Formát',
'Tables' => 'Tabulky',
'Data' => 'Data',
'Database' => 'Databáze',
'database' => 'databáze',
'Use' => 'Vybrat',
'Select database' => 'Vybrat databázi',
'Invalid database.' => 'Nesprávná databáze.',
'Create new database' => 'Vytvořit novou databázi',
'Database has been dropped.' => 'Databáze byla odstraněna.',
'Databases have been dropped.' => 'Databáze byly odstraněny.',
'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',
'Database schema' => 'Schéma databáze',
// link to current database schema layout
'Permanent link' => 'Trvalý odkaz',
// thousands separator - must contain single byte
',' => ' ',
'Engine' => 'Úložiště',
'Collation' => 'Porovnávání',
'Data Length' => 'Velikost dat',
'Index Length' => 'Velikost indexů',
'Data Free' => 'Volné místo',
'Rows' => 'Řádků',
'%d in total' => '%d celkem',
'Analyze' => 'Analyzovat',
'Optimize' => 'Optimalizovat',
'Check' => 'Zkontrolovat',
'Repair' => 'Opravit',
'Truncate' => 'Vyprázdnit',
'Tables have been truncated.' => 'Tabulky byly vyprázdněny.',
'Move to other database' => 'Přesunout do jiné databáze',
'Move' => 'Přesunout',
'Tables have been moved.' => 'Tabulky byly přesunuty.',
'Copy' => 'Zkopírovat',
'Tables have been copied.' => 'Tabulky byly zkopírovány.',
'Routines' => 'Procedury a funkce',
'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',
'Parameter name' => 'Název parametru',
'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',
'Events' => 'Události',
'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.',
@@ -133,167 +161,82 @@ $translations = array(
'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' => 'Tabulky',
'Tables and views' => 'Tabulky a pohledy',
'Table' => 'Tabulka',
'No tables.' => 'Žádné tabulky.',
'Alter table' => 'Pozměnit tabulku',
'Create table' => 'Vytvořit tabulku',
'Create new table' => 'Vytvořit novou tabulku',
'Table has been dropped.' => 'Tabulka byla odstraněna.',
'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' => 'Vyprázdnit',
'Tables have been truncated.' => 'Tabulky byly vyprázdně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',
'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.',
'Table has been altered.' => 'Tabulka byla změněna.',
'Table has been created.' => 'Tabulka byla vytvořena.',
'Table name' => 'Název tabulky',
'Show structure' => 'Zobrazit strukturu',
'engine' => 'úložiště',
'collation' => 'porovnávání',
'Column name' => 'Název sloupce',
'Type' => 'Typ',
'Length' => 'Délka',
'Auto Increment' => 'Auto Increment',
'Options' => 'Volby',
'Comment' => 'Komentář',
'Default values' => 'Výchozí hodnoty',
'Drop' => 'Odstranit',
'Are you sure?' => 'Opravdu?',
'Move up' => 'Přesunout nahoru',
'Move down' => 'Přesunout dolů',
'Remove' => 'Odebrat',
'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.',
'Clone' => 'Klonovat',
'Partition by' => 'Rozdělit podle',
'Partitions' => 'Oddíly',
'Partition name' => 'Název oddílu',
'Values' => 'Hodnoty',
'View' => 'Pohled',
'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',
'Indexes' => 'Indexy',
'Indexes have been altered.' => 'Indexy byly změněny.',
'Alter indexes' => 'Pozměnit indexy',
'Add next' => 'Přidat další',
'Index Type' => 'Typ indexu',
'Column (length)' => 'Sloupec (délka)',
'Foreign keys' => 'Cizí klíče',
'Foreign key' => 'Cizí klíč',
'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.',
'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ě',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Zdrojové a cílové sloupce musí mít stejný datový typ, nad cílovými sloupci musí být definován index a odkazovaná data musí existovat.',
'Triggers' => 'Triggery',
'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',
'Name' => 'Název',
'select' => 'vypsat',
'Select' => 'Vypsat',
'Select data' => 'Vypsat data',
'Functions' => 'Funkce',
'Aggregation' => 'Agregace',
'Search' => 'Vyhledat',
'anywhere' => 'kdekoliv',
'Search data in tables' => 'Vyhledat data v tabulkách',
'Sort' => 'Seřadit',
'descending' => 'sestupně',
'Limit' => 'Limit',
'Text length' => 'Délka textů',
'Action' => 'Akce',
'Unable to select the table' => 'Nepodařilo se vypsat tabulku',
'No rows.' => 'Žádné řádky.',
'%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
'Page' => 'Stránka',
'last' => 'poslední',
'Last page' => 'Poslední stránka',
'whole result' => 'celý výsledek',
'%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtů'),
'Import' => 'Import',
'%d row(s) have been imported.' => array('Byl importován %d záznam.', 'Byly importovány %d záznamy.', 'Bylo importováno %d záznamů.'),
// in-place editing in select
'Double click on a value to modify it.' => 'Dvojklikněte na políčko, které chcete změnit.',
'Use edit link to modify this value.' => 'Ke změně této hodnoty použijte odkaz upravit.',
// %s can contain auto-increment value
'Item%s has been inserted.' => 'Položka%s byla vložena.',
'Item has been deleted.' => 'Položka byla smazána.',
'Item has been updated.' => 'Položka byla aktualizována.',
'%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ů.'),
'New item' => 'Nová položka',
'original' => 'původní',
// label for value '' in enum data type
'empty' => 'prázdné',
'edit' => 'upravit',
'Edit' => 'Upravit',
'Insert' => 'Vložit',
'Save' => 'Uložit',
'Save and continue edit' => 'Uložit a pokračovat v editaci',
'Save and insert next' => 'Uložit a vložit další',
'Clone' => 'Klonovat',
'Delete' => 'Smazat',
'CSV Import' => 'Import CSV',
'Import' => 'Import',
'Show structure' => 'Zobrazit strukturu',
'Select data' => 'Vypsat data',
'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',
'$1-$3-$5' => '$6.$4.$1',
'[yyyy]-mm-dd' => 'd.m.[rrrr]',
'History' => 'Historie',
'Variables' => 'Proměnné',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Zdrojové a cílové sloupce musí mít stejný datový typ, nad cílovými sloupci musí být definován index a odkazovaná data musí existovat.',
'E-mail' => 'E-mail',
'From' => 'Odesílatel',
'Subject' => 'Předmět',
'Attachments' => 'Přílohy',
'Send' => 'Odeslat',
'%d e-mail(s) have been sent.' => array('Byl odeslán %d e-mail.', 'Byly odeslány %d e-maily.', 'Bylo odesláno %d e-mailů.'),
// data type descriptions
'Run file' => 'Spustit soubor',
'Numbers' => 'Čísla',
'Date and time' => 'Datum a čas',
'Strings' => 'Řetězce',
'Binary' => 'Binární',
'Lists' => 'Seznamy',
'Relations' => 'Vztahy',
'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.',
'Clear' => 'Vyčistit',
'Editor' => 'Editor',
'Webserver file %s' => 'Soubor %s na webovém serveru',
'File does not exist.' => 'Soubor neexistuje.',
'Permanent login' => 'Trvalé přihlášení',
'%d in total' => '%d celkem',
'Attachments' => 'Přílohy',
'System' => 'Systém',
'last' => 'poslední',
'Network' => 'Síť',
'Geometry' => 'Geometrie',
'Relations' => 'Vztahy',
// reload confirmation in AJAX
'Resend POST data?' => 'Znovu odeslat POST data?',
'Editor' => 'Editor',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => '$6.$4.$1',
// hint for date format - use language equivalents for day, month and year shortcuts
'[yyyy]-mm-dd' => 'd.m.[rrrr]',
// hint for time format - use language equivalents for hour, minute and second shortcuts
'HH:MM:SS' => 'HH:MM:SS',
'now' => 'teď',
// general SQLite error in create, drop or rename database
'Databases have been dropped.' => 'Databáze byly odstraněny.',
'File exists.' => 'Soubor existuje.',
'Please use one of the extensions %s.' => 'Prosím použijte jednu z koncovek %s.',
// PostgreSQL and MS SQL schema support
'Double click on a value to modify it.' => 'Dvojklikněte na políčko, které chcete změnit.',
'Increase text length to modify this value.' => 'Ke změně této hodnoty zvyšte délku textů.',
'Use edit link to modify this value.' => 'Ke změně této hodnoty použijte odkaz upravit.',
'Alter schema' => 'Pozměnit schéma',
'Create schema' => 'Vytvořit schéma',
'Schema has been dropped.' => 'Schéma bylo odstraněno.',
@@ -301,20 +244,11 @@ $translations = array(
'Schema has been altered.' => 'Schéma bylo změněno.',
'schema' => 'schéma',
'Schema' => 'Schéma',
'Invalid schema.' => 'Nesprávné schéma.',
// PostgreSQL sequences support
'Sequences' => 'Sekvence',
'Create sequence' => 'Vytvořit sekvenci',
'Sequence has been dropped.' => 'Sekvence byla odstraněna.',
'Sequence has been created.' => 'Sekvence byla vytvořena.',
'Sequence has been altered.' => 'Sekvence byla změněna.',
'Alter sequence' => 'Pozměnit sekvenci',
// PostgreSQL user types support
'User types' => 'Uživatelské typy',
'Create type' => 'Vytvořit typ',
'Type has been dropped.' => 'Typ byl odstraněn.',
'Type has been created.' => 'Typ byl vytvořen.',
'Alter type' => 'Pozměnit typ',
'Search data in tables' => 'Vyhledat data v tabulkách',
);

View File

@@ -40,7 +40,7 @@ $translations = array(
'Create new table' => 'Neue Tabelle',
'Item has been deleted.' => 'Datensatz gelöscht.',
'Item has been updated.' => 'Datensatz geändert.',
'Item%s has been inserted.' => 'Datensatz%s hinzugefügt.',
'Item has been inserted.' => 'Datensatz hinzugefügt.',
'Edit' => 'Ändern',
'Insert' => 'Hinzufügen',
'Save and insert next' => 'Speichern und nächsten hinzufügen',
@@ -173,7 +173,7 @@ $translations = array(
'Data Free' => 'Freier Bereich',
'Collation' => 'Collation',
'Analyze' => 'Analysieren',
'Optimize' => 'Optimieren',
'Optimize' => 'Optimisieren',
'Check' => 'Prüfen',
'Repair' => 'Reparieren',
'Truncate' => 'Entleeren (truncate)',
@@ -187,7 +187,7 @@ $translations = array(
'Save and continue edit' => 'Speichern und weiter bearbeiten',
'original' => 'Original',
'Tables have been dropped.' => 'Tabellen wurden entfernt (drop).',
'%d item(s) have been affected.' => '%d Artikel betroffen.',
'%d item(s) have been affected.' => array('%d Artikel betroffen.', '%d Artikel betroffen.'),
'whole result' => 'Gesamtergebnis',
'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.',
@@ -197,8 +197,9 @@ $translations = array(
'Values' => 'Werte',
'%d row(s) have been imported.' => array('%d Datensatz importiert.', '%d Datensätze wurden importiert.'),
'anywhere' => 'beliebig',
'CSV Import' => 'Importiere CSV',
'Import' => 'Importieren',
'Stop on error' => 'Bei Fehler anhalten',
'Stop on error' => 'Bei Fehler anhaltan',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$6.$4.$1',
'[yyyy]-mm-dd' => 't.m.[jjjj]',
@@ -224,44 +225,4 @@ $translations = array(
'File does not exist.' => 'Datei existiert nicht.',
'%d in total' => '%d insgesamt',
'Permanent login' => 'Passwort speichern',
'Databases have been dropped.' => 'Datenbanken entfernt.',
'Search data in tables' => 'Suche in Tabellen',
'schema' => 'Schema',
'Schema' => 'Schema',
'Alter schema' => 'Schema ändern',
'Create schema' => 'Neues Schema',
'Schema has been dropped.' => 'Schema wurde gelöscht.',
'Schema has been created.' => 'Neues Schema erstellt.',
'Schema has been altered.' => 'Schema geändert.',
'Sequences' => 'Sequenz',
'Create sequence' => 'Neue Sequenz',
'Alter sequence' => 'Sequenz ändern',
'Sequence has been dropped.' => 'Sequenz gelöscht.',
'Sequence has been created.' => 'Neue Sequenz erstellt.',
'Sequence has been altered.' => 'Sequenz geändert.',
'User types' => 'Benutzer-definierte Typen',
'Create type' => 'Typ erstellen',
'Alter type' => 'Typ ändern',
'Type has been dropped.' => 'Typ gelöscht.',
'Type has been created.' => 'Typ erstellt.',
'Double click on a value to modify it.' => 'Doppelklick zum Bearbeiten des Wertes.',
'Use edit link to modify this value.' => 'Benutzen Sie den Link zum editieren dieses Wertes.',
'last' => 'letzte',
'From server' => 'Auf Server',
'System' => 'Datenbank System',
'Select data' => 'Daten auswählen',
'Show structure' => 'Struktur anzeigen',
'empty' => 'leer',
'Network' => 'Netzwerk',
'Geometry' => 'Geometrie',
'File exists.' => 'Datei existiert schon.',
'Attachments' => 'Anhänge',
'%d query(s) executed OK.' => array('SQL-Query erfolgreich ausgeführt.', '%d SQL-Queries erfolgreich ausgeführt.'),
'Show only errors' => 'Nur Fehler anzeigen',
'Last page' => 'Letzte Seite',
'Refresh' => 'Aktualisieren',
'Invalid schema.' => 'Schema nicht gültig.',
'Please use one of the extensions %s.' => 'Bitte einen der Dateitypen %s benutzen.',
'now' => 'jetzt',
'ltr' => 'ltr',
);

View File

@@ -9,5 +9,4 @@ $translations = array(
'%d row(s) have been imported.' => array('%d row has been imported.', '%d rows have been imported.'),
'%d e-mail(s) have been sent.' => array('%d e-mail has been sent.', '%d e-mails have been sent.'),
'%d in total' => '%d in total',
'%d query(s) executed OK.' => array('%d query executed OK.', '%d queries executed OK.'),
);

View File

@@ -2,25 +2,25 @@
$translations = array(
'Login' => 'Login',
'Logout successful.' => 'Salida exitosa.',
'Invalid credentials.' => 'Identificacion inválida.',
'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' => 'Ingrese nueva base de datos',
'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' => 'Modifique estructura',
'Create table' => 'Cree tabla',
'Table name' => 'Nombre de la tabla',
'Alter table' => 'Modificar Estructura',
'Create table' => 'Crear tabla',
'Table name' => 'Nombre de tabla',
'engine' => 'motor',
'collation' => 'colación',
'Column name' => 'Nombre de columna',
'Type' => 'Tipo',
'Length' => 'Longitud',
'Auto Increment' => 'Incremento automático',
'Auto Increment' => 'Auto increment',
'Options' => 'Opciones',
'Save' => 'Guardar',
'Drop' => 'Eliminar',
@@ -40,7 +40,7 @@ $translations = array(
'Create new table' => 'Nueva tabla',
'Item has been deleted.' => 'Registro eliminado.',
'Item has been updated.' => 'Registro modificado.',
'Item%s has been inserted.' => 'Registro%s insertado.',
'Item has been inserted.' => 'Registro insertado.',
'Edit' => 'Modificar',
'Insert' => 'Agregar',
'Save and insert next' => 'Guardar e insertar otro',
@@ -69,13 +69,13 @@ $translations = array(
'Foreign keys' => 'Claves foráneas',
'Triggers' => 'Triggers',
'View' => 'Vistas',
'Unable to select the table' => 'No es posible seleccionar la tabla',
'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' => 'Valores predeterminados',
'%d byte(s)' => array('%d byte', '%d bytes'),
'No commands to execute.' => 'No hay comando para ejecutar.',
'Unable to upload a file.' => 'No es posible importar archivo.',
'Unable to upload a file.' => 'No posible importar archivo.',
'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.'),
@@ -83,13 +83,13 @@ $translations = array(
'No extension' => 'No hay extension',
'None of the supported PHP extensions (%s) are available.' => 'Ninguna de las extensiones PHP soportadas (%s) está disponible.',
'Session support must be enabled.' => 'Deben estar habilitadas las sesiones.',
'Session expired, please login again.' => 'Sesión expirada, por favor ingrese su clave de nuevo.',
'Session expired, please login again.' => 'Sesión expirada, favor loguéese de nuevo.',
'Text length' => 'Longitud de texto',
'Foreign key has been dropped.' => 'Clave externa eliminada.',
'Foreign key has been altered.' => 'Clave externa modificada.',
'Foreign key has been created.' => 'Clave externa creada.',
'Foreign key' => 'Clave externa',
'Target table' => 'Tabla de destino',
'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',
@@ -109,7 +109,7 @@ $translations = array(
'Process list' => 'Lista de procesos',
'%d process(es) have been killed.' => array('%d proceso detenido.', '%d procesos detenidos.'),
'Kill' => 'Detener',
'Parameter name' => 'Nombre de Parámetro',
'Parameter name' => 'Nombre de Parametro',
'Database schema' => 'Esquema de base de datos',
'Create procedure' => 'Crear procedimiento',
'Create function' => 'Crear función',
@@ -118,7 +118,7 @@ $translations = array(
'Routine has been created.' => 'Procedimiento creado.',
'Alter function' => 'Modificar Función',
'Alter procedure' => 'Modificar procedimiento',
'Return type' => 'Tipo de valor de regreso',
'Return type' => 'Tipo de valor retornado',
'Add trigger' => 'Agregar trigger',
'Trigger has been dropped.' => 'Trigger eliminado.',
'Trigger has been altered.' => 'Trigger modificado.',
@@ -162,7 +162,7 @@ $translations = array(
'At given time' => 'A hora determinada',
'Every' => 'Cada',
'Events' => 'Eventos',
'Schedule' => 'Agenda',
'Schedule' => 'Agendamiento',
'Start' => 'Inicio',
'End' => 'Fin',
'Status' => 'Estado',
@@ -190,13 +190,14 @@ $translations = array(
'%d item(s) have been affected.' => array('%d ítem 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. Por favor aumente %s y %s.',
'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) have been imported.' => array('%d registro importado.', '%d registros importados.'),
'anywhere' => 'donde sea',
'CSV Import' => 'Importar CSV',
'Import' => 'Importar',
'Stop on error' => 'Parar en caso de error',
'%.3f s' => '%.3f s',
@@ -224,44 +225,4 @@ $translations = array(
'File does not exist.' => 'Archivo no existe.',
'%d in total' => '%d en total',
'Permanent login' => 'Guardar contraseña',
'Databases have been dropped.' => 'Bases de datos eliminadas.',
'Search data in tables' => 'Buscar datos en tablas',
'schema' => 'esquema',
'Schema' => 'Esquema',
'Alter schema' => 'Modificar esquema',
'Create schema' => 'Crear esquema',
'Schema has been dropped.' => 'Esquema eliminado.',
'Schema has been created.' => 'Esquema creado.',
'Schema has been altered.' => 'Esquema modificado.',
'Sequences' => 'Secuencias',
'Create sequence' => 'Crear secuencias',
'Alter sequence' => 'Modificar secuencia',
'Sequence has been dropped.' => 'Secuencia eliminada.',
'Sequence has been created.' => 'Secuencia creada.',
'Sequence has been altered.' => 'Secuencia modificada.',
'User types' => 'Tipos definido por el usuario',
'Create type' => 'Crear tipo',
'Alter type' => 'Modificar tipo',
'Type has been dropped.' => 'Tipo eliminado.',
'Type has been created.' => 'Tipo creado.',
'Double click on a value to modify it.' => 'Doble-clic sobre el valor para editarlo.',
'Use edit link to modify this value.' => 'Utilice el enlace de modificar para realizar los cambios.',
'last' => 'último',
'From server' => 'Desde servidor',
'System' => 'Motor de base de datos',
'Select data' => 'Seleccionar datos',
'Show structure' => 'Mostrar estructura',
'empty' => 'ningúno',
'Network' => 'Red',
'Geometry' => 'Geometría',
'File exists.' => 'Archivo ya existe.',
'Attachments' => 'Adjuntos',
'%d query(s) executed OK.' => array('%d sentencia sql ejecutada correctamente.', '%d sentencias sql ejecutadas correctamente.'),
'Show only errors' => 'Mostrar solamente errores',
'Last page' => 'Ultima página',
'Refresh' => 'Refrescar',
'Invalid schema.' => 'Esquema inválido.',
'Please use one of the extensions %s.' => 'Por favor use una de las extensiones %s.',
'now' => 'ahora',
'ltr' => 'ltr',
);

View File

@@ -40,7 +40,7 @@ $translations = array(
'Create new table' => 'Loo uus tabel',
'Item has been deleted.' => 'Kustutamine õnnestus.',
'Item has been updated.' => 'Uuendamine õnnestus.',
'Item%s has been inserted.' => 'Kirje%s on edukalt lisatud.',
'Item has been inserted.' => 'Lisamine õnnestus.',
'Edit' => 'Muuda',
'Insert' => 'Sisesta',
'Save and insert next' => 'Salvesta ja lisa järgmine',
@@ -62,7 +62,7 @@ $translations = array(
'Action' => 'Tegevus',
'edit' => 'muuda',
'Page' => 'Lehekülg',
'Query executed OK, %d row(s) affected.' => 'Päring õnnestus, mõjutatatud ridu: %d.',
'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' => 'Päringus esines viga',
'Execute' => 'Käivita',
'Table' => 'Tabel',
@@ -78,7 +78,7 @@ $translations = array(
'Unable to upload a file.' => 'Faili üleslaadimine pole võimalik.',
'File upload' => 'Faili üleslaadimine',
'File uploads are disabled.' => 'Failide üleslaadimine on keelatud.',
'Routine has been called, %d row(s) affected.' => 'Protseduur täideti edukalt, mõjutatud ridu: %d.',
'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 extension' => 'Ei leitud laiendust',
'None of the supported PHP extensions (%s) are available.' => 'Serveris pole ühtegi toetatud PHP laiendustest (%s).',
@@ -127,7 +127,7 @@ $translations = array(
'Create trigger' => 'Loo uus päästik (TRIGGER)',
'Time' => 'Aeg',
'Event' => 'Sündmus',
'%d row(s)' => '%d rida',
'%d row(s)' => array('%d rida', '%d rida'),
'Remove' => 'Eemalda',
'Are you sure?' => 'Kas oled kindel?',
'Privileges' => 'Õigused',
@@ -187,7 +187,7 @@ $translations = array(
'Truncate' => 'Tühjenda',
'Move to other database' => 'Liiguta teise andmebaasi',
'Move' => 'Liiguta',
'%d item(s) have been affected.' => 'Mõjutatud kirjeid: %d.',
'%d item(s) have been affected.' => array('Mõjutatud kirjeid: %d.', 'Mõjutatud kirjeid: %d.'),
'whole result' => 'Täielikud tulemused',
'Clone' => 'Kloon',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Maksimaalne väljade arv ületatud. Palun suurendage %s ja %s.',
@@ -195,8 +195,9 @@ $translations = array(
'Partitions' => 'Partitsioonid',
'Partition name' => 'Partitsiooni nimi',
'Values' => 'Väärtused',
'%d row(s) have been imported.' => 'Imporditi %d rida.',
'%d row(s) have been imported.' => array('Imporditi %d rida.', 'Imporditi %d rida.'),
'anywhere' => 'vahet pole',
'CSV Import' => 'Impordi CSV',
'Import' => 'Impordi',
'Stop on error' => 'Peatuda vea esinemisel',
'%.3f s' => '%.3f s',
@@ -219,49 +220,9 @@ $translations = array(
'From' => 'Kellelt',
'Subject' => 'Pealkiri',
'Send' => 'Saada',
'%d e-mail(s) have been sent.' => 'Saadetud kirju: %d.',
'%d e-mail(s) have been sent.' => array('Saadetud kirju: %d.', 'Saadetud kirju: %d.'),
'Webserver file %s' => 'Fail serveris: %s',
'File does not exist.' => 'Faili ei leitud.',
'%d in total' => 'Kokku: %d',
'Permanent login' => 'Jäta mind meelde',
'Databases have been dropped.' => 'Andmebaasid on edukalt kustutatud.',
'Search data in tables' => 'Otsi kogu andmebaasist',
'schema' => 'struktuur',
'Schema' => 'Struktuur',
'Alter schema' => 'Muuda struktuuri',
'Create schema' => 'Loo struktuur',
'Schema has been dropped.' => 'Struktuur on edukalt kustutatud.',
'Schema has been created.' => 'Struktuur on edukalt loodud.',
'Schema has been altered.' => 'Struktuur on edukalt muudetud.',
'Sequences' => 'Jadad (sequences)',
'Create sequence' => 'Loo jada',
'Alter sequence' => 'Muuda jada',
'Sequence has been dropped.' => 'Jada on edukalt kustutatud.',
'Sequence has been created.' => 'Jada on edukalt loodud.',
'Sequence has been altered.' => 'Jada on edukalt muudetud.',
'User types' => 'Kasutajatüübid',
'Create type' => 'Loo tüüp',
'Alter type' => 'Muuda tüüpi',
'Type has been dropped.' => 'Tüüp on edukalt kustutatud.',
'Type has been created.' => 'Tüüp on edukalt loodud.',
'Double click on a value to modify it.' => 'Väärtuse muutmiseks topelt-kliki sellel.',
'Use edit link to modify this value.' => 'Väärtuse muutmiseks kasuta muutmislinki.',
'last' => 'viimane',
'From server' => 'Serverist',
'System' => 'Andmebaasimootor',
'Select data' => 'Vaata andmeid',
'Show structure' => 'Näita struktuuri',
'empty' => 'tühi',
'Network' => 'Võrk (network)',
'Geometry' => 'Geomeetria',
'File exists.' => 'Fail juba eksisteerib.',
'Attachments' => 'Manused',
'%d query(s) executed OK.' => array('%d päring edukalt käivitatud.', '%d päringut edukalt käivitatud.'),
'Show only errors' => 'Kuva vaid veateateid',
'Last page' => 'Viimane lehekülg',
'Refresh' => 'Uuenda',
'Invalid schema.' => 'Sobimatu skeema.',
'Please use one of the extensions %s.' => 'Palun kasuta üht laiendustest %s.',
'now' => 'nüüd',
'ltr' => 'ltr',
);

View File

@@ -1,32 +1,33 @@
<?php
$translations = array(
'Login' => 'Authentification',
'Logout successful.' => 'Au revoir !',
'Logout successful.' => 'Aurevoir!',
'Invalid credentials.' => 'Authentification échouée.',
'Server' => 'Serveur',
'Username' => 'Utilisateur',
'Password' => 'Mot de passe',
'Select database' => 'Sélectionner la base de données',
'Invalid database.' => 'Base de données invalide.',
'Create new database' => 'Créer une base de données',
'Table has been dropped.' => 'La table a été effacée.',
'Table has been altered.' => 'La table a été modifiée.',
'Table has been created.' => 'La table a été créée.',
'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' => 'interclassement',
'collation' => 'collation',
'Column name' => 'Nom de la colonne',
'Type' => 'Type',
'Length' => 'Longueur',
'Length' => 'Longeur',
'Auto Increment' => 'Auto increment',
'Options' => 'Options',
'Save' => 'Sauvegarder',
'Drop' => 'Supprimer',
'Database has been created.' => 'La base de données a été créée.',
'Database has been renamed.' => 'La base de données a été renommée.',
'Database has been altered.' => 'La base de données a été modifiée.',
'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',
@@ -34,11 +35,12 @@ $translations = array(
'Logout' => 'Déconnexion',
'database' => 'base de données',
'Use' => 'Utiliser',
'No tables.' => 'Aucune table.',
'No tables.' => 'Aucunes tables.',
'select' => 'select',
'Create new table' => 'Créer une nouvelle table',
'Item has been deleted.' => 'L\'élément a été supprimé.',
'Item has been updated.' => 'L\'élément a été modifié.',
'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',
@@ -49,22 +51,22 @@ $translations = array(
'Indexes' => 'Index',
'Alter indexes' => 'Modifier les index',
'Add next' => 'Ajouter le prochain',
'Language' => 'Langue',
'Language' => 'Langues',
'Select' => 'Select',
'New item' => 'Nouvel élément',
'Search' => 'Rechercher',
'Sort' => 'Trier',
'Sort' => 'Ordonner',
'descending' => 'décroissant',
'Limit' => 'Limite',
'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 avec succès, %d ligne modifiée.', 'Requête exécutée avec succès, %d lignes modifiées.'),
'Query executed OK, %d row(s) affected.' => array('Requête exécutée, %d ligne affectée.', '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és étrangères',
'Foreign keys' => 'Clé éxterne',
'Triggers' => 'Triggers',
'View' => 'Vue',
'Unable to select the table' => 'Impossible de sélectionner la table',
@@ -75,81 +77,81 @@ $translations = array(
'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.' => 'L\'importation de fichier est désactivée.',
'Routine has been called, %d row(s) affected.' => array('La routine a été exécutée, %d ligne modifiée.', 'La routine a été exécutée, %d lignes modifiées.'),
'File uploads are disabled.' => 'Importation 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 extension' => 'Extension introuvable',
'None of the supported PHP extensions (%s) are available.' => 'Aucune des extensions PHP supportées (%s) n\'est disponible.',
'Session support must be enabled.' => 'Veuillez activer les sessions.',
'Session expired, please login again.' => 'Session expirée, veuillez vous authentifier à nouveau.',
'Text length' => 'Longueur du texte',
'Foreign key has been dropped.' => 'La clé étrangère a été effacée.',
'Foreign key has been altered.' => 'La clé étrangère a été modifiée.',
'Foreign key has been created.' => 'La clé étrangère a été créée.',
'Foreign key' => 'Clé étrangère',
'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é étrangère',
'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.' => 'La vue a été effacée.',
'View has been altered.' => 'La vue a été modifiée.',
'View has been created.' => 'La vue a été créée.',
'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 des processus',
'%d process(es) have been killed.' => array('%d processus a été arrêté.', '%d processus ont été arrêtés.'),
'Process list' => 'Liste de processus',
'%d process(es) have been killed.' => array('%d processus arrêté.', '%d processus arrêtés.'),
'Kill' => 'Arrêter',
'Parameter name' => 'Nom du paramètre',
'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.' => 'La routine a été supprimée.',
'Routine has been altered.' => 'La routine a été modifiée.',
'Routine has been created.' => 'La routine a été créée.',
'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' => 'Modifier la fonction',
'Alter procedure' => 'Modifier la procédure',
'Return type' => 'Type de retour',
'Add trigger' => 'Ajouter un trigger',
'Trigger has been dropped.' => 'Le trigger a été supprimé.',
'Trigger has been altered.' => 'Le trigger a été modifié.',
'Trigger has been created.' => 'Le trigger a été créé.',
'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'),
'Remove' => 'Effacer',
'Are you sure?' => 'Êtes-vous certain ?',
'Privileges' => 'Privilèges',
'Are you sure?' => 'Êtes-vous certain?',
'Privileges' => 'Privilège',
'Create user' => 'Créer un utilisateur',
'User has been dropped.' => 'L\'utilisateur a été effacé.',
'User has been altered.' => 'L\'utilisateur a été modifié.',
'User has been created.' => 'L\'utilisateur a été créé.',
'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',
'%s version: %s through PHP extension %s' => 'Version de %s : %s via l\'extension PHP %s',
'Logged as: %s' => 'Authentifié en tant que : %s',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Données POST trop grandes. Réduisez la taille des données ou augmentez la valeur de %s dans la configuration de PHP.',
'%s version: %s through PHP extension %s' => 'Version de %s: %s utilisant l\'extension %s',
'Logged as: %s' => 'Authentifié en tant que %s',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Donnée POST trop grande . Réduire la taille des données ou modifier le %s 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ées',
'Data' => 'Donnée',
'Output' => 'Sortie',
'open' => 'ouvrir',
'save' => 'sauvegarder',
'Format' => 'Format',
'Format' => 'Formatter',
'Functions' => 'Fonctions',
'Aggregation' => 'Agrégation',
'Event has been dropped.' => 'L\'évènement a été supprimé.',
@@ -160,9 +162,9 @@ $translations = array(
'Start' => 'Démarrer',
'End' => 'Terminer',
'Every' => 'Chaque',
'Status' => 'Statut',
'Status' => 'Status',
'On completion preserve' => 'Conserver quand complété',
'Events' => 'Évènements',
'Events' => 'Évènement',
'Schedule' => 'Horaire',
'At given time' => 'À un moment précis',
'Save and continue edit' => 'Sauvegarder et continuer l\'édition',
@@ -172,41 +174,42 @@ $translations = array(
'Tables have been dropped.' => 'Les tables ont été effacées.',
'Tables and views' => 'Tables et vues',
'Engine' => 'Moteur',
'Collation' => 'Interclassement',
'Data Length' => 'Longueur des données',
'Index Length' => 'Longueur de l\'index',
'Data Free' => 'Espace inutilisé',
'Rows' => 'Lignes',
'Collation' => 'Collation',
'Data Length' => 'Longeur des données',
'Index Length' => 'Longeur de l\'index',
'Data Free' => 'Vide',
'Rows' => 'Rangés',
',' => ',',
'Analyze' => 'Analyser',
'Optimize' => 'Optimiser',
'Optimize' => 'Opitimiser',
'Check' => 'Vérifier',
'Repair' => 'Réparer',
'Truncate' => 'Tronquer',
'Move to other database' => 'Déplacer vers une autre base de données',
'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 a été modifié.', '%d éléments ont été modifiés.'),
'%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',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Le nombre maximum de champs est dépassé. Veuillez augmenter %s et %s.',
'Partition by' => 'Partitionner par',
'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) have been imported.' => array('%d ligne a été importée.','%d lignes ont été importées.'),
'%d row(s) have been imported.' => array('%d ligne a été importé.','%d lignes ont été importé.'),
'anywhere' => 'n\'importe où',
'CSV Import' => 'Importation CVS',
'Import' => 'Importer',
'Stop on error' => 'Arrêter en cas d\'erreur',
'Stop on error' => 'Arrêt sur erreur',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$5/$3/$1',
'[yyyy]-mm-dd' => 'jj/mm/[aaaa]',
'History' => 'Historique',
'Variables' => 'Variables',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Les colonnes de source et de destination doivent être du même type, il doit y avoir un index sur les colonnes de destination et les données référencées doivent exister.',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Les colonnes selectionnées et les colonnes de destination doivent être du même type, il doit y avoir un index sur les colonnes de destination et les données de référence doivent exister.',
'Relations' => 'Relations',
'Run file' => 'Exécuter le fichier',
'Run file' => 'Executer le fichier',
'Clear' => 'Effacer',
'Maximum allowed file size is %sB.' => 'La taille maximale des fichiers est de %sB.',
'Maximum allowed file size is %sB.' => 'Taille maximale des fichiers est de %sB.',
'Numbers' => 'Nombres',
'Date and time' => 'Date et heure',
'Strings' => 'Chaînes',
@@ -218,50 +221,8 @@ $translations = array(
'Subject' => 'Sujet',
'Send' => 'Envoyer',
'%d e-mail(s) have been sent.' => array('%d message a été envoyé.', '%d messages ont été envoyés.'),
'Webserver file %s' => 'Fichier %s du serveur Web',
'Webserver file %s' => '%s fichier du serveur Web',
'File does not exist.' => 'Le fichier est introuvable.',
'%d in total' => '%d au total',
'Permanent login' => 'Authentification permanente',
'Databases have been dropped.' => 'Les bases de données ont été supprimées.',
'Database has been dropped.' => 'La base de données a été supprimée.',
'Search data in tables' => 'Rechercher dans les tables',
'schema' => 'schéma',
'Schema' => 'Schéma',
'Alter schema' => 'Modifier le schéma',
'Create schema' => 'Créer un schéma',
'Schema has been dropped.' => 'Le schéma a été supprimé.',
'Schema has been created.' => 'Le schéma a été créé.',
'Schema has been altered.' => 'Le schéma a été modifié.',
'Sequences' => 'Séquences',
'Create sequence' => 'Créer une séquence',
'Alter sequence' => 'Modifier la séquence',
'Sequence has been dropped.' => 'La séquence a été supprimée.',
'Sequence has been created.' => 'La séquence a été créée.',
'Sequence has been altered.' => 'La séquence a été modifiée.',
'User types' => 'Types utilisateur',
'Create type' => 'Créer un type',
'Alter type' => 'Modifier le type',
'Type has been dropped.' => 'Le type a été supprimé.',
'Type has been created.' => 'Le type a été créé.',
'Double click on a value to modify it.' => 'Double-cliquez sur une valeur pour la modifier.',
'Use edit link to modify this value.' => 'Utilisez le lien "modifier" pour modifier cette valeur.',
'last' => 'dernière',
'From server' => 'Depuis le serveur',
'System' => 'Système',
'Select data' => 'Afficher les données',
'Show structure' => 'Afficher la structure',
'empty' => 'vide',
'Network' => 'Réseau',
'Geometry' => 'Géométrie',
'File exists.' => 'Le fichier existe.',
'Attachments' => 'Pièces jointes',
'Item%s has been inserted.' => 'L\'élément%s a été inséré.',
'now' => 'maintenant',
'%d query(s) executed OK.' => array('%d requête exécutée avec succès.', '%d requêtes exécutées avec succès.'),
'Show only errors' => 'Montrer seulement les erreurs',
'Last page' => 'Dernière page',
'Refresh' => 'Rafraîchir',
'Invalid schema.' => 'Schéma invalide.',
'Please use one of the extensions %s.' => 'Veuillez utiliser l\'une des extensions %s.',
'ltr' => 'ltr',
);

View File

@@ -1,267 +0,0 @@
<?php
$translations = array(
'Login' => 'Belépés',
'Logout successful.' => 'Sikeres kilépés.',
'Invalid credentials.' => 'Érvénytelen adatok.',
'Server' => 'Szerver',
'Username' => 'Felhasználó',
'Password' => 'Jelszó',
'Select database' => 'Adatbázis kiválasztása',
'Invalid database.' => 'Érvénytelen adatbázis.',
'Create new database' => 'Új adatbázis',
'Table has been dropped.' => 'A tábla eldobva.',
'Table has been altered.' => 'A tábla módosult.',
'Table has been created.' => 'A tábla létrejött.',
'Alter table' => 'Tábla módosítása',
'Create table' => 'Tábla létrehozása',
'Table name' => 'Tábla név',
'engine' => 'motor',
'collation' => 'egybevetés',
'Column name' => 'Oszlop neve',
'Type' => 'Típus',
'Length' => 'Hossz',
'Auto Increment' => 'Automatikus növelés',
'Options' => 'Opciók',
'Save' => 'Mentés',
'Drop' => 'Eldob',
'Database has been dropped.' => 'Az adatbázis eldobva.',
'Database has been created.' => 'Az adatbázis létrejött.',
'Database has been renamed.' => 'Az adadtbázis átnevezve.',
'Database has been altered.' => 'Az adatbázis módosult.',
'Alter database' => 'Adatbázis módosítása',
'Create database' => 'Adatbázis létrehozása',
'SQL command' => 'SQL parancs',
'Dump' => 'Exportálás',
'Logout' => 'Kilépés',
'database' => 'adatbázis',
'Use' => 'Használ',
'No tables.' => 'Nincs tábla.',
'select' => 'kiválaszt',
'Create new table' => 'Új tábla',
'Item has been deleted.' => 'A tétel törölve.',
'Item has been updated.' => 'A tétel frissítve.',
'Item%s has been inserted.' => '%s tétel beszúrva.',
'Edit' => 'Szerkeszt',
'Insert' => 'Beszúr',
'Save and insert next' => 'Mentés és újat beszúr',
'Delete' => 'Törlés',
'Database' => 'Adatbázis',
'Routines' => 'Rutinok',
'Indexes have been altered.' => 'Az indexek megváltoztak.',
'Indexes' => 'Indexek',
'Alter indexes' => 'Index módosítása',
'Add next' => 'Következő hozzáadása',
'Language' => 'Nyelv',
'Select' => 'Kiválaszt',
'New item' => 'Új tétel',
'Search' => 'Keresés',
'Sort' => 'Sorba rendezés',
'descending' => 'csökkenő',
'Limit' => 'korlát',
'No rows.' => 'Nincs megjeleníthető eredmény.',
'Action' => 'Művelet',
'edit' => 'szerkeszt',
'Page' => 'oldal',
'Query executed OK, %d row(s) affected.' => array('Lekérdezés sikeresen végrehajtva, %d sor érintett.', 'Lekérdezés sikeresen végrehajtva, %d sor érintett.', 'Lekérdezés sikeresen végrehajtva, %d sor érintett.'),
'Error in query' => 'Hiba a lekérdezésben',
'Execute' => 'Végrehajt',
'Table' => 'Tábla',
'Foreign keys' => 'Idegen kulcs',
'Triggers' => 'Trigger',
'View' => 'Nézet',
'Unable to select the table' => 'Nem tudom kiválasztani a táblát',
'Invalid CSRF token. Send the form again.' => 'Érvénytelen CSRF azonosító. Küldd újra az űrlapot.',
'Comment' => 'Megjegyzés',
'Default values' => 'Alapértelmezett értékek',
'%d byte(s)' => array('%d bájt', '%d bájt', '%d bájt'),
'No commands to execute.' => 'Nincs végrehajtható parancs.',
'Unable to upload a file.' => 'Nem tudom feltölteni a fájlt.',
'File upload' => 'Fájl feltöltése',
'File uploads are disabled.' => 'A fájl feltöltés le van tiltva.',
'Routine has been called, %d row(s) affected.' => array('Rutin meghívva, %d sor érintett.', 'Rutin meghívva, %d sor érintett.', 'Rutin meghívva, %d sor érintett.'),
'Call' => 'Meghív',
'No extension' => 'Nincs kiterjesztés',
'None of the supported PHP extensions (%s) are available.' => 'Nincs egy elérhető támogatott PHP kiterjesztés (%s) sem.',
'Session support must be enabled.' => 'A munkameneteknek (session) engedélyezve kell lennie.',
'Session expired, please login again.' => 'Munkamenet lejárt, jelentkezz be újra.',
'Text length' => 'Szöveg hossz',
'Foreign key has been dropped.' => 'Idegen kulcs eldobva.',
'Foreign key has been altered.' => 'Idegen kulcs módosult.',
'Foreign key has been created.' => 'Idegen kulcs létrejött.',
'Foreign key' => 'Idegen kulcs',
'Target table' => 'Cél tábla',
'Change' => 'Változtat',
'Source' => 'Forrás',
'Target' => 'Cél',
'Add column' => 'Oszlop hozzáadása',
'Alter' => 'Módosítás',
'Add foreign key' => 'Idegen kulcs hozzadása',
'ON DELETE' => 'törléskor',
'ON UPDATE' => 'frissítéskor',
'Index Type' => 'Index típusa',
'Column (length)' => 'Oszop (méret)',
'View has been dropped.' => 'A nézet eldobva.',
'View has been altered.' => 'A nézet módosult.',
'View has been created.' => 'A nézet létrejött.',
'Alter view' => 'Nézet módosítása',
'Create view' => 'Nézet létrehozása',
'Name' => 'Név',
'Process list' => 'Folyamatok',
'%d process(es) have been killed.' => array('%d folyamat leállítva.', '%d folyamat leállítva.', '%d folyamat leállítva.'),
'Kill' => 'Leállít',
'Parameter name' => 'Paraméter neve',
'Database schema' => 'Adatbázis séma',
'Create procedure' => 'Eljárás létrehozása',
'Create function' => 'Funkció létrehozása',
'Routine has been dropped.' => 'A rutin eldobva.',
'Routine has been altered.' => 'A rutin módosult.',
'Routine has been created.' => 'A rutin létrejött.',
'Alter function' => 'Funkció módosítása',
'Alter procedure' => 'Eljárás módosítása',
'Return type' => 'Visszatérési érték',
'Add trigger' => 'Trigger hozzáadása',
'Trigger has been dropped.' => 'A trigger eldobva.',
'Trigger has been altered.' => 'A trigger módosult.',
'Trigger has been created.' => 'A trigger létrejött.',
'Alter trigger' => 'Trigger módosítása',
'Create trigger' => 'Trigger létrehozása',
'Time' => 'Idő',
'Event' => 'Esemény',
'%s version: %s through PHP extension %s' => '%s verzió: %s, PHP: %s',
'%d row(s)' => array('%d sor', '%d sor', '%d sor'),
'Remove' => 'Eltávolítás',
'Are you sure?' => 'Biztos benne?',
'Privileges' => 'Privilégiumok',
'Create user' => 'Felhasználó hozzáadása',
'User has been dropped.' => 'A felhasználó eldobva.',
'User has been altered.' => 'A felhasználó módosult.',
'User has been created.' => 'A felhasználó létrejött.',
'Hashed' => 'Hashed',
'Column' => 'Oszlop',
'Routine' => 'Rutin',
'Grant' => 'Engedélyezés',
'Revoke' => 'Visszavonás',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Túl sok a POST adat! Csökkentsd az adat méretét, vagy növeld a %s beállítást.',
'Logged as: %s' => 'Belépve: %s',
'Move up' => 'Felfelé',
'Move down' => 'Lefelé',
'Functions' => 'Funkciók',
'Aggregation' => 'Aggregálás',
'Export' => 'Export',
'Output' => 'Kimenet',
'open' => 'megnyit',
'save' => 'ment',
'Format' => 'Formátum',
'Tables' => 'Táblák',
'Data' => 'Adat',
'Event has been dropped.' => 'Az esemény eldobva.',
'Event has been altered.' => 'Az esemény módosult.',
'Event has been created.' => 'Az esemény létrejött.',
'Alter event' => 'Esemény módosítása',
'Create event' => 'Esemény létrehozása',
'At given time' => 'Megadott időben',
'Every' => 'Minden',
'Events' => 'Esemény',
'Schedule' => 'Ütemzés',
'Start' => 'Kezd',
'End' => 'Vége',
'Status' => 'Állapot',
'On completion preserve' => 'Befejezéskor megőrzi',
'Tables and views' => 'Táblák és nézetek',
'Data Length' => 'Méret',
'Index Length' => 'Index hossz',
'Data Free' => 'Adat szabad',
'Collation' => 'Egybevetés',
'Analyze' => 'Elemzés',
'Optimize' => 'Optimalizál',
'Check' => 'Ellenőrzés',
'Repair' => 'Javít',
'Truncate' => 'Felszabadít',
'Tables have been truncated.' => 'A tábla felszabadítva.',
'Rows' => 'Oszlop',
',' => ' ',
'Tables have been moved.' => 'Táblák áthelyezve.',
'Move to other database' => 'Áthelyezés másik adatbázisba',
'Move' => 'Áthelyez',
'Engine' => 'Motor',
'Save and continue edit' => 'Mentés és szerkesztés folytatása',
'original' => 'eredeti',
'%d item(s) have been affected.' => array('%d tétel érintett.', '%d tétel érintett.', '%d tétel érintett.'),
'whole result' => 'összes eredményt mutatása',
'Tables have been dropped.' => 'Táblák eldobva.',
'Clone' => 'Klónoz',
'Partition by' => 'Particionálás ezzel',
'Partitions' => 'Particiók',
'Partition name' => 'Partició neve',
'Values' => 'Értékek',
'%d row(s) have been imported.' => array('%d sor importálva.', '%d sor importálva.', '%d sor importálva.'),
'Import' => 'Importálás',
'Show structure' => 'Struktúra',
'Select data' => 'Tartalom',
'Stop on error' => 'Hiba esetén megáll',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'A maximális mezőszámot elérted. Növeld meg ezeket: %s, %s.',
'anywhere' => 'bárhol',
'%.3f s' => '%.3f másodperc',
'$1-$3-$5' => '$6.$4.$1',
'[yyyy]-mm-dd' => '[yyyy].m.d',
'History' => 'Történet',
'Variables' => 'Változók',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'A forrás és cél oszlopoknak azonos típusúak legyenek, a cél oszlopok indexeltek legyenek, és a hivatkozott adatnak léteznie kell.',
'E-mail' => 'E-mail',
'From' => 'Feladó',
'Subject' => 'Tárgy',
'Send' => 'Küldés',
'%d e-mail(s) have been sent.' => array('%d e-mail elküldve.', '%d e-mail elküldve.', '%d e-mail elküldve.'),
'Run file' => 'Fájl futtatása',
'Numbers' => 'Szám',
'Date and time' => 'Dátum és idő',
'Strings' => 'Szöveg',
'Binary' => 'Bináris',
'Lists' => 'Lista',
'Relations' => 'Reláció',
'Maximum allowed file size is %sB.' => 'A maximális fájlméret %s B.',
'Clear' => 'Törlés',
'Editor' => 'Szerkesztő',
'Webserver file %s' => 'Webszerver fájl %s',
'File does not exist.' => 'A fájl nem létezik.',
'Permanent login' => 'Emlékezz rám',
'%d in total' => 'összesen %d',
'Attachments' => 'Csatolmány',
'System' => 'Adatbázis',
'last' => 'utoljára',
'Network' => 'Hálózat',
'Geometry' => 'Geometria',
'Databases have been dropped.' => 'Adatbázis eldobva.',
'File exists.' => 'A fájl létezik.',
'Double click on a value to modify it.' => 'Kattints kétszer az értékre a szerkesztéshez.',
'Use edit link to modify this value.' => 'Használd a szerkesztés hivatkozást ezen érték módosításához.',
'Alter schema' => 'Séma módosítása',
'Create schema' => 'Séma létrehozása',
'Schema has been dropped.' => 'Séma eldobva.',
'Schema has been created.' => 'Séma létrejött.',
'Schema has been altered.' => 'Séma módosult.',
'schema' => 'séma',
'Schema' => 'Séma',
'Sequences' => 'Sorozatok',
'Create sequence' => 'Sorozat létrehozása',
'Sequence has been dropped.' => 'Sorozat eldobva.',
'Sequence has been created.' => 'Sorozat létrejött.',
'Sequence has been altered.' => 'Sorozat módosult.',
'Alter sequence' => 'Sorozat módosítása',
'User types' => 'Felhasználói típus',
'Create type' => 'Típus létrehozása',
'Type has been dropped.' => 'Típus eldobva.',
'Type has been created.' => 'Típus létrehozva.',
'Alter type' => 'Típus módosítása',
'Search data in tables' => 'Keresés a táblákban',
'From server' => 'Szerverről',
'empty' => 'üres',
'now' => 'most',
'%d query(s) executed OK.' => '%d sikeres lekérdezés.',
'Show only errors' => 'Csak a hibák mutatása',
'Last page' => 'Utolsó oldal',
'Refresh' => 'Frissítés',
'Invalid schema.' => 'Érvénytelen séma.',
'Please use one of the extensions %s.' => 'Használja a(z) %s kiterjesztést.',
'ltr' => 'ltr',
);

View File

@@ -40,7 +40,7 @@ $translations = array(
'Create new table' => 'Crea nuova tabella',
'Item has been deleted.' => 'Elemento eliminato.',
'Item has been updated.' => 'Elemento aggiornato.',
'Item%s has been inserted.' => 'Elemento%s inserito.',
'Item has been inserted.' => 'Elemento inserito.',
'Edit' => 'Modifica',
'Insert' => 'Inserisci',
'Save and insert next' => 'Salva e inserisci un altro',
@@ -187,7 +187,7 @@ $translations = array(
'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.'),
'%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',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Troppi campi. Per favore aumentare %s e %s.',
@@ -195,8 +195,9 @@ $translations = array(
'Partitions' => 'Partizioni',
'Partition name' => 'Nome partizione',
'Values' => 'Valori',
'%d row(s) have been imported.' => array('%d riga importata.', '%d righe importate.'),
'%d row(s) have been imported.' => array('%d riga importata.','%d righe importate.'),
'anywhere' => 'ovunque',
'CSV Import' => 'Importa da CSV',
'Import' => 'Importa',
'Stop on error' => 'Stop su errore',
'%.3f s' => '%.3f s',
@@ -219,49 +220,9 @@ $translations = array(
'From' => 'Da',
'Subject' => 'Oggetto',
'Send' => 'Invia',
'%d e-mail(s) have been sent.' => array('%d e-mail inviata.', '%d e-mail inviate.'),
'%d e-mail(s) have been sent.' => array('%d e-mail inviata.','%d e-mail inviate.'),
'Webserver file %s' => 'Webserver file %s',
'File does not exist.' => 'Il file non esiste.',
'%d in total' => '%d in totale',
'Permanent login' => 'Login permanente',
'Databases have been dropped.' => 'Database eliminati.',
'Search data in tables' => 'Cerca nelle tabelle',
'schema' => 'schema',
'Schema' => 'Schema',
'Alter schema' => 'Modifica schema',
'Create schema' => 'Crea schema',
'Schema has been dropped.' => 'Schema eliminato.',
'Schema has been created.' => 'Schema creato.',
'Schema has been altered.' => 'Schema modificato.',
'Sequences' => 'Sequenza',
'Create sequence' => 'Crea sequenza',
'Alter sequence' => 'Modifica sequenza',
'Sequence has been dropped.' => 'Sequenza eliminata.',
'Sequence has been created.' => 'Sequenza creata.',
'Sequence has been altered.' => 'Sequenza modificata.',
'User types' => 'Tipi definiti dall\'utente',
'Create type' => 'Crea tipo definito dall\'utente',
'Alter type' => 'Modifica tipo definito dall\'utente',
'Type has been dropped.' => 'Tipo definito dall\'utente eliminato.',
'Type has been created.' => 'Tipo definito dall\'utente creato.',
'Double click on a value to modify it.' => 'Fai doppio click su un valore per modificarlo.',
'Use edit link to modify this value.' => 'Usa il link modifica per modificare questo valore.',
'last' => 'ultima',
'From server' => 'Dal server',
'System' => 'Sistema',
'Select data' => 'Visualizza dati',
'Show structure' => 'Visualizza struttura',
'empty' => 'vuoto',
'Network' => 'Rete',
'Geometry' => 'Geometria',
'File exists.' => 'Il file esiste già.',
'Attachments' => 'Allegati',
'%d query(s) executed OK.' => array('%d query eseguita con successo.', '%d query eseguite con successo.'),
'Show only errors' => 'Mostra solo gli errori',
'Last page' => 'Ultima pagina',
'Refresh' => 'Aggiorna',
'Invalid schema.' => 'Schema non valido.',
'Please use one of the extensions %s.' => 'Usa una delle estensioni %s.',
'now' => 'adesso',
'ltr' => 'ltr',
);

View File

@@ -35,11 +35,12 @@ $translations = array(
'Logout' => 'ログアウト',
'database' => 'データベース',
'Use' => '使用',
'No tables.' => 'テーブルがありません。',
'No tables.' => 'テーブルがありません没有表。',
'select' => '選択',
'Create new table' => 'テーブルを作成',
'Item has been deleted.' => '項目を削除しました',
'Item has been updated.' => '項目を更新しました',
'Item has been inserted.' => '項目を挿入しました',
'Edit' => '編集',
'Insert' => '挿入',
'Save and insert next' => '保存/追加',
@@ -72,6 +73,7 @@ $translations = array(
'Invalid CSRF token. Send the form again.' => '不正なCSRFトークン。再送信してください',
'Comment' => 'コメント',
'Default values' => '規定値',
'Show column comments' => '列コメントを表示',
'%d byte(s)' => '%d バイト',
'No commands to execute.' => '実行するコマンドがありません',
'Unable to upload a file.' => 'ファイルをアップロードできません',
@@ -109,7 +111,7 @@ $translations = array(
'%d process(es) have been killed.' => '%d プロセスを強制終了しました',
'Kill' => '強制終了',
'Parameter name' => '参数名',
'Database schema' => '構造',
'Database schema' => '数据?概要',
'Create procedure' => 'プロシージャの作成',
'Create function' => '関数の作成',
'Routine has been dropped.' => 'ルーチンを作成',
@@ -128,7 +130,7 @@ $translations = array(
'Event' => 'イベント',
'%s version: %s through PHP extension %s' => '%sバージョン%s、 PHP拡張機能 %s',
'%d row(s)' => '%d 行',
'Remove' => '除',
'Remove' => '除',
'Are you sure?' => '実行しますか?',
'Privileges' => '権限',
'Create user' => 'ユーザを作成',
@@ -181,7 +183,7 @@ $translations = array(
'Check' => 'チェック',
'Repair' => '修復',
'Truncate' => 'Truncate',
'Move to other database' => '別のデータベースへ移動',
'Move to other database' => '別のデータベースへ移動?',
'Move' => '移動',
'Save and continue edit' => '保存して継続',
'original' => '元',
@@ -197,6 +199,7 @@ $translations = array(
'%d row(s) have been imported.' => '%d 行をインポートしました',
'Show structure' => '構造',
'anywhere' => '任意',
'CSV Import' => 'CSV インポート',
'Import' => 'インポート',
'Stop on error' => 'エラーの場合は停止',
'Select data' => 'データ',
@@ -225,43 +228,4 @@ $translations = array(
'File does not exist.' => 'ファイルは存在しません',
'%d in total' => '合計 %d',
'Permanent login' => '永続的にログイン',
'Databases have been dropped.' => 'データベースを削除しました',
'Search data in tables' => 'データを検索する',
'schema' => 'スキーマ',
'Schema' => 'スキーマ',
'Alter schema' => 'スキーマ変更',
'Create schema' => 'スキーマ追加',
'Schema has been dropped.' => 'スキーマを削除しました',
'Schema has been created.' => 'スキーマを追加しました',
'Schema has been altered.' => 'スキーマを変更しました',
'Sequences' => 'シーケンス',
'Create sequence' => 'シーケンス作成',
'Alter sequence' => 'シーケンス変更',
'Sequence has been dropped.' => 'シーケンスを削除しました',
'Sequence has been created.' => 'シーケンスを追加しました',
'Sequence has been altered.' => 'シーケンスを変更しました',
'User types' => 'ユーザー定義型',
'Create type' => 'ユーザー定義型作成',
'Alter type' => 'ユーザー定義型変更',
'Type has been dropped.' => 'ユーザー定義型を削除しました',
'Type has been created.' => 'ユーザー定義型を追加しました',
'Double click on a value to modify it.' => 'ダブルクリックして編集',
'Use edit link to modify this value.' => 'リンクを編集する',
'last' => '最終',
'From server' => 'サーバーから実行',
'System' => 'データベース種類',
'empty' => '空',
'Network' => 'ネットワーク型',
'Geometry' => 'ジオメトリ型',
'File exists.' => 'ファイルが既に存在します',
'Attachments' => '添付ファイル',
'Item%s has been inserted.' => '%s項目を挿入しました',
'now' => '現在の日時',
'%d query(s) executed OK.' => '%d クエリーを実行しました',
'Show only errors' => 'エラーのみ表示',
'Last page' => '最後のページ',
'Refresh' => 'リフレッシュ',
'Invalid schema.' => '無効なスキーマ',
'Please use one of the extensions %s.' => 'いずれかの拡張機能を使ってください %s',
'ltr' => 'ltr',
);

View File

@@ -24,7 +24,6 @@ $translations = array(
'Options' => 'Opties',
'Save' => 'Opslaan',
'Drop' => 'Verwijderen',
'Databases have been dropped.' => 'Databases verwijderd.',
'Database has been dropped.' => 'Database verwijderd.',
'Database has been created.' => 'Database aangemaakt.',
'Database has been renamed.' => 'Database hernoemd.',
@@ -41,7 +40,7 @@ $translations = array(
'Create new table' => 'Nieuwe tabel',
'Item has been deleted.' => 'Item verwijderd.',
'Item has been updated.' => 'Item aangepast.',
'Item%s has been inserted.' => 'Item%s toegevoegd.',
'Item has been inserted.' => 'Item toegevoegd.',
'Edit' => 'Bewerk',
'Insert' => 'Toevoegen',
'Save and insert next' => 'Opslaan, daarna toevoegen',
@@ -198,6 +197,7 @@ $translations = array(
'Values' => 'Waarden',
'%d row(s) have been imported.' => array('%d rij werd geïmporteerd.', '%d rijen werden geïmporteerd.'),
'anywhere' => 'overal',
'CSV Import' => 'CSV Import',
'Import' => 'Importeren',
'Stop on error' => 'Stoppen bij fout',
'%.3f s' => '%.3f s',
@@ -225,43 +225,4 @@ $translations = array(
'File does not exist.' => 'Bestand niet gevonden.',
'%d in total' => '%d in totaal',
'Permanent login' => 'Blijf aangemeld',
'Search data in tables' => 'Zoeken in database',
'schema' => 'schema',
'Schema' => 'Schema',
'Alter schema' => 'Schema wijzigen',
'Create schema' => 'Schema maken',
'Schema has been dropped.' => 'Schema verwijderd.',
'Schema has been created.' => 'Schema aangemaakt.',
'Schema has been altered.' => 'Schema gewijzigd.',
'Sequences' => 'Sequences',
'Create sequence' => 'Sequence maken',
'Alter sequence' => 'Sequence wijzigen',
'Sequence has been dropped.' => 'Sequence verwijderd.',
'Sequence has been created.' => 'Sequence aangemaakt.',
'Sequence has been altered.' => 'Sequence gewijzigd.',
'User types' => 'Gebruikersgedefiniëerde types',
'Create type' => 'Type maken',
'Alter type' => 'Type wijzigen',
'Type has been dropped.' => 'Type verwijderd.',
'Type has been created.' => 'Type aangemaakt.',
'Double click on a value to modify it.' => 'Dubbelklik op een waarde om deze te bewerken.',
'Use edit link to modify this value.' => 'Gebruik de link "bewerk" om deze waarde te wijzigen.',
'last' => 'laatste',
'From server' => 'Van server',
'System' => 'Databasesysteem',
'Select data' => 'Gegevens selecteren',
'Show structure' => 'Toon structuur',
'empty' => 'leeg',
'Network' => 'Netwerk',
'Geometry' => 'Geometrie',
'File exists.' => 'Bestand bestaat reeds.',
'Attachments' => 'Bijlagen',
'%d query(s) executed OK.' => array('%d query succesvol uitgevoerd.', '%d querys succesvol uitgevoerd'),
'Show only errors' => 'Enkel fouten tonen',
'Last page' => 'Laatste pagina',
'Refresh' => 'Vernieuwen',
'Invalid schema.' => 'Ongeldig schema.',
'Please use one of the extensions %s.' => 'Gebruik 1 van volgende extensies: %s.',
'now' => 'nu',
'ltr' => 'ltr',
);

View File

@@ -1,314 +0,0 @@
<?php
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Rodzaj bazy',
'Server' => 'Serwer',
'Username' => 'Użytkownik',
'Password' => 'Hasło',
'Permanent login' => 'Zapamiętaj sesję',
'Login' => 'Zaloguj się',
'Logout' => 'Wyloguj',
'Logged as: %s' => 'Zalogowany jako: %s',
'Logout successful.' => 'Wylogowano pomyślnie.',
'Invalid credentials.' => 'Nieprawidłowe dane logowania.',
'Language' => 'Język',
'Invalid CSRF token. Send the form again.' => 'Nieprawidłowy token CSRF. Spróbuj wysłać formularz ponownie.',
'No extension' => 'Brak rozszerzenia',
'None of the supported PHP extensions (%s) are available.' => 'Żadne z rozszerzeń PHP umożliwiających połączenie się z bazą danych (%s) nie jest dostępne.',
'Session support must be enabled.' => 'Wymagana jest obsługa sesji w PHP.',
'Session expired, please login again.' => 'Sesja wygasła, zaloguj się ponownie.',
'%s version: %s through PHP extension %s' => 'Wersja %s: %s za pomocą %s',
'Refresh' => 'Odśwież',
// text direction
'ltr' => 'ltr',
'Privileges' => 'Uprawnienia użytkowników',
'Create user' => 'Dodaj użytkownika',
'User has been dropped.' => 'Użytkownik został usunięty.',
'User has been altered.' => 'Użytkownik został zmieniony.',
'User has been created.' => 'Użytkownik został dodany.',
'Hashed' => 'Zahashowane',
'Column' => 'Kolumna',
'Routine' => 'Procedura',
'Grant' => 'Uprawnienia',
'Revoke' => 'Usuń uprawnienia',
'Process list' => 'Lista procesów',
'%d process(es) have been killed.' => array('Przerwano %d wątek.', 'Przerwano %d wątki.', 'Przerwano %d wątków.'),
'Kill' => 'Przerwij wykonywanie',
'Variables' => 'Zmienne',
'Status' => 'Status',
'SQL command' => 'Zapytanie SQL',
'%d query(s) executed OK.' => array('Pomyślnie wykonano %d zapytanie.', 'Pomyślnie wykonano %d zapytania.', 'Pomyślnie wykonano %d zapytań.'),
'Query executed OK, %d row(s) affected.' => array('Zapytanie wykonane pomyślnie, zmieniono %d rekord.', 'Zapytanie wykonane pomyślnie, zmieniono %d rekordy.', 'Zapytanie wykonane pomyślnie, zmieniono %d rekordów.'),
'No commands to execute.' => 'Nic do wykonania.',
'Error in query' => 'Błąd w zapytaniu',
'Execute' => 'Wykonaj',
'Stop on error' => 'Zatrzymaj w przypadku błędu',
'Show only errors' => 'Pokaż tylko błędy',
// sprintf() format for time of the command
'%.3f s' => '%.3f s',
'History' => 'Historia',
'Clear' => 'Wyczyść',
'File upload' => 'Wgranie pliku',
'From server' => 'Z serwera',
'Webserver file %s' => 'Plik %s na serwerze',
'Run file' => 'Uruchom z pliku',
'File does not exist.' => 'Plik nie istnieje.',
'File uploads are disabled.' => 'Wgrywanie plików jest wyłączone.',
'Unable to upload a file.' => 'Wgranie pliku było niemożliwe.',
'Maximum allowed file size is %sB.' => 'Maksymalna wielkość pliku to %sB.',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Przesłano zbyt dużo danych. Zmniejsz objętość danych lub zwiększ zmienną konfiguracyjną %s.',
'Export' => 'Eksport',
'Dump' => 'Eksport',
'Output' => 'Rezultat',
'open' => 'otwórz',
'save' => 'zapisz',
'Format' => 'Format',
'Data' => 'Dane',
'Database' => 'Baza danych',
'database' => 'baza danych',
'Use' => 'Wybierz',
'Select database' => 'Wybierz bazę danych',
'Invalid database.' => 'Nie znaleziono bazy danych.',
'Create new database' => 'Utwórz nową bazę danych',
'Database has been dropped.' => 'Baza danych została usunięta.',
'Databases have been dropped.' => 'Bazy danych zostały usunięte.',
'Database has been created.' => 'Baza danych została utworzona.',
'Database has been renamed.' => 'Nazwa bazy danych została zmieniona.',
'Database has been altered.' => 'Baza danych została zmieniona.',
'Alter database' => 'Zmień bazę danych',
'Create database' => 'Utwórz bazę danych',
'Database schema' => 'Schemat bazy danych',
// link to current database schema layout
'Permanent link' => 'Trwały link',
// thousands separator - must contain single byte
',' => ' ',
'Engine' => 'Składowanie',
'Collation' => 'Porównywanie znaków',
'Data Length' => 'Rozmiar danych',
'Index Length' => 'Rozmiar indeksów',
'Data Free' => 'Wolne miejsce',
'Rows' => 'Liczba rekordów',
'%d in total' => '%d w sumie',
'Analyze' => 'Analizuj',
'Optimize' => 'Optymalizuj',
'Check' => 'Sprawdź',
'Repair' => 'Napraw',
'Truncate' => 'Opróżnij',
'Tables have been truncated.' => 'Tabele zostały opróżnione.',
'Move to other database' => 'Przenieś do innej bazy danych',
'Move' => 'Przenieś',
'Tables have been moved.' => 'Tabele zostały przeniesione.',
'Copy' => 'Kopiuj',
'Tables have been copied.' => 'Tabele zostały skopiowane.',
'Routines' => 'Procedury i funkcje',
'Routine has been called, %d row(s) affected.' => array('Procedura została uruchomiona, zmieniono %d rekord.', 'Procedura została uruchomiona, zmieniono %d rekordy.', 'Procedura została uruchomiona, zmieniono %d rekordów.'),
'Call' => 'Uruchom',
'Parameter name' => 'Nazwa parametru',
'Create procedure' => 'Utwórz procedurę',
'Create function' => 'Utwórz funkcję',
'Routine has been dropped.' => 'Procedura została usunięta.',
'Routine has been altered.' => 'Procedura została zmieniona.',
'Routine has been created.' => 'Procedura została utworzona.',
'Alter function' => 'Zmień funkcję',
'Alter procedure' => 'Zmień procedurę',
'Return type' => 'Zwracany typ',
'Events' => 'Wydarzenia',
'Event has been dropped.' => 'Wydarzenie zostało usunięte.',
'Event has been altered.' => 'Wydarzenie zostało zmienione.',
'Event has been created.' => 'Wydarzenie zostało utworzone.',
'Alter event' => 'Zmień wydarzenie',
'Create event' => 'Utwórz wydarzenie',
'At given time' => 'O danym czasie',
'Every' => 'Wykonuj co',
'Schedule' => 'Harmonogram',
'Start' => 'Początek',
'End' => 'Koniec',
'On completion preserve' => 'Nie kasuj wydarzenia po przeterminowaniu',
'Tables' => 'Tabele',
'Tables and views' => 'Tabele i perspektywy',
'Table' => 'Tabela',
'No tables.' => 'Brak tabel.',
'Alter table' => 'Zmień tabelę',
'Create table' => 'Utwórz tabelę',
'Create new table' => 'Utwórz nową tabelę',
'Table has been dropped.' => 'Tabela została usunięta.',
'Tables have been dropped.' => 'Tabele zostały usunięte.',
'Table has been altered.' => 'Tabela została zmieniona.',
'Table has been created.' => 'Tabela została utworzona.',
'Table name' => 'Nazwa tabeli',
'Show structure' => 'Struktura tabeli',
'engine' => 'składowanie',
'collation' => 'porównywanie znaków',
'Column name' => 'Nazwa kolumny',
'Type' => 'Typ',
'Length' => 'Długość',
'Auto Increment' => 'Auto Increment',
'Options' => 'Opcje',
'Comment' => 'Komentarz',
'Default values' => 'Wartości domyślne',
'Drop' => 'Usuń',
'Are you sure?' => 'Czy jesteś pewien?',
'Move up' => 'Przesuń w górę',
'Move down' => 'Przesuń w dół',
'Remove' => 'Usuń',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Przekroczono maksymalną liczbę pól. Zwiększ %s i %s.',
'Partition by' => 'Partycjonowanie',
'Partitions' => 'Partycje',
'Partition name' => 'Nazwa partycji',
'Values' => 'Wartości',
'View' => 'Perspektywa',
'View has been dropped.' => 'Perspektywa została usunięta.',
'View has been altered.' => 'Perspektywa została zmieniona.',
'View has been created.' => 'Perspektywa została utworzona.',
'Alter view' => 'Zmień perspektywę',
'Create view' => 'Utwórz perspektywę',
'Indexes' => 'Indeksy',
'Indexes have been altered.' => 'Indeksy zostały zmienione.',
'Alter indexes' => 'Zmień indeksy',
'Add next' => 'Dodaj następny',
'Index Type' => 'Typ indeksu',
'Column (length)' => 'Kolumna (długość)',
'Foreign keys' => 'Klucze obce',
'Foreign key' => 'Klucz obcy',
'Foreign key has been dropped.' => 'Klucz obcy został usunięty.',
'Foreign key has been altered.' => 'Klucz obcy został zmieniony.',
'Foreign key has been created.' => 'Klucz obcy został utworzony.',
'Target table' => 'Tabela docelowa',
'Change' => 'Zmień',
'Source' => 'Źródło',
'Target' => 'Cel',
'Add column' => 'Dodaj kolumnę',
'Alter' => 'Zmień',
'Add foreign key' => 'Dodaj klucz obcy',
'ON DELETE' => 'W przypadku usunięcia',
'ON UPDATE' => 'W przypadku zmiany',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Źródłowa i docelowa kolumna muszą być tego samego typu, powinien istnieć indeks na docelowej kolumnie oraz muszą istnieć dane referencyjne.',
'Triggers' => 'Wyzwalacze',
'Add trigger' => 'Dodaj wyzwalacz',
'Trigger has been dropped.' => 'Wyzwalacz został usunięty.',
'Trigger has been altered.' => 'Wyzwalacz został zmieniony.',
'Trigger has been created.' => 'Wyzwalacz został utworzony.',
'Alter trigger' => 'Zmień wyzwalacz',
'Create trigger' => 'Utwórz wyzwalacz',
'Time' => 'Czas',
'Event' => 'Wydarzenie',
'Name' => 'Nazwa',
'select' => 'przeglądaj',
'Select' => 'pokaż',
'Select data' => 'Pokaż dane',
'Functions' => 'Funkcje',
'Aggregation' => 'Agregacje',
'Search' => 'Szukaj',
'anywhere' => 'gdziekolwiek',
'Search data in tables' => 'Wyszukaj we wszystkich tabelach',
'Sort' => 'Sortuj',
'descending' => 'malejąco',
'Limit' => 'Limit',
'Text length' => 'Długość tekstu',
'Action' => 'Czynność',
'Unable to select the table' => 'Nie udało się pobrać danych z tabeli',
'No rows.' => 'Brak rekordów.',
'%d row(s)' => array('%d rekord', '%d rekordy', '%d rekordów'),
'Page' => 'Strona',
'last' => 'ostatni',
'Last page' => 'Ostatnia strona',
'whole result' => 'wybierz wszystkie',
'%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtów'),
'Import' => 'Import',
'%d row(s) have been imported.' => array('%d rekord został zaimportowany.', '%d rekordy zostały zaimportowane.', '%d rekordów zostało zaimportowanych.'),
// in-place editing in select
'Double click on a value to modify it.' => 'Kliknij podwójnie wartość, aby ją edytować.',
'Use edit link to modify this value.' => 'Użyj linku edycji aby zmienić tę wartość.',
// %s can contain auto-increment value
'Item%s has been inserted.' => 'Rekord%s został dodany.',
'Item has been deleted.' => 'Rekord został usunięty.',
'Item has been updated.' => 'Rekord został zaktualizowany.',
'%d item(s) have been affected.' => array('Zmieniono %d rekord.', 'Zmieniono %d rekordy.', 'Zmieniono %d rekordów.'),
'New item' => 'Nowy rekord',
'original' => 'bez zmian',
// label for value '' in enum data type
'empty' => 'puste',
'edit' => 'edytuj',
'Edit' => 'Edytuj',
'Insert' => 'Dodaj',
'Save' => 'Zapisz zmiany',
'Save and continue edit' => 'Zapisz i kontynuuj edycję',
'Save and insert next' => 'Zapisz i dodaj następny',
'Clone' => 'Duplikuj',
'Delete' => 'Usuń',
'E-mail' => 'E-mail',
'From' => 'Nadawca',
'Subject' => 'Temat',
'Attachments' => 'Załączniki',
'Send' => 'Wyślij',
'%d e-mail(s) have been sent.' => array('Wysłano %d e-mail.', 'Wysłano %d e-maile.', 'Wysłano %d e-maili.'),
// data type descriptions
'Numbers' => 'Numeryczne',
'Date and time' => 'Data i czas',
'Strings' => 'Tekstowe',
'Binary' => 'Binarne',
'Lists' => 'Listy',
'Network' => 'Sieć',
'Geometry' => 'Geometria',
'Relations' => 'Relacje',
'Editor' => 'Edytor',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => '$6.$4.$1',
// hint for date format - use language equivalents for day, month and year shortcuts
'[yyyy]-mm-dd' => 'd.m.[rrrr]',
'now' => 'teraz',
// general SQLite error in create, drop or rename database
'File exists.' => 'Plik już istnieje.',
'Please use one of the extensions %s.' => 'Proszę użyć jednego z rozszerzeń: %s.',
// PostgreSQL and MS SQL schema support
'Alter schema' => 'Zmień schemat',
'Create schema' => 'Utwórz schemat',
'Schema has been dropped.' => 'Schemat został usunięty.',
'Schema has been created.' => 'Schemat został utworzony.',
'Schema has been altered.' => 'Schemat został zmieniony.',
'schema' => 'schemat',
'Schema' => 'Schemat',
'Invalid schema.' => 'Nieprawidłowy schemat.',
// PostgreSQL sequences support
'Sequences' => 'Sekwencje',
'Create sequence' => 'Utwórz sekwencję',
'Sequence has been dropped.' => 'Sekwencja została usunięta.',
'Sequence has been created.' => 'Sekwencja została utworzona.',
'Sequence has been altered.' => 'Sekwencja została zmieniona.',
'Alter sequence' => 'Zmień sekwencję',
// PostgreSQL user types support
'User types' => 'Typy użytkownika',
'Create type' => 'Utwórz typ',
'Type has been dropped.' => 'Typ został usunięty.',
'Type has been created.' => 'Typ został utworzony.',
'Alter type' => 'Zmień typ',
);

View File

@@ -1,267 +0,0 @@
<?php
$translations = array(
'Login' => 'Entrar',
'Logout successful.' => 'Saida bem sucedida.',
'Invalid credentials.' => 'Identificação inválida.',
'Server' => 'Servidor',
'Username' => 'Usuario',
'Password' => 'Senha',
'Select database' => 'Selecionar Base de dados',
'Invalid database.' => 'Base de dados inválida.',
'Create new database' => 'Criar nova base de dados',
'Table has been dropped.' => 'Tabela eliminada.',
'Table has been altered.' => 'Tabela modificada.',
'Table has been created.' => 'Tabela criada.',
'Alter table' => 'Modificar estrutura',
'Create table' => 'Criar tabela',
'Table name' => 'Nome da tabela',
'engine' => 'motor',
'collation' => 'collation',
'Column name' => 'Nome da coluna',
'Type' => 'Tipo',
'Length' => 'Tamanho',
'Auto Increment' => 'Incremento Automático',
'Options' => 'Opções',
'Save' => 'Salvar',
'Drop' => 'Remover',
'Database has been dropped.' => 'Base de dados eliminada.',
'Database has been created.' => 'Base de dados criada.',
'Database has been renamed.' => 'Base de dados renomeada.',
'Database has been altered.' => 'Base de dados modificada.',
'Alter database' => 'Modificar Base de dados',
'Create database' => 'Criar Base de dados',
'SQL command' => 'Comando SQL',
'Dump' => 'Exportar',
'Logout' => 'Sair',
'database' => 'base de dados',
'Use' => 'Usar',
'No tables.' => 'Não existem tabelas.',
'select' => 'registros',
'Create new table' => 'Nova tabela',
'Item has been deleted.' => 'Registro eliminado.',
'Item has been updated.' => 'Registro modificado.',
'Item%s has been inserted.' => 'Registro%s inserido.',
'Edit' => 'Modificar',
'Insert' => 'Inserir',
'Save and insert next' => 'Salvar e inserir outro',
'Delete' => 'Apagar',
'Database' => 'Base de dados',
'Routines' => 'Procedimentos',
'Indexes have been altered.' => 'Indices modificados.',
'Indexes' => 'Indices',
'Alter indexes' => 'Modificar indices',
'Add next' => 'Adicionar proximo',
'Language' => 'Idioma',
'Select' => 'Selecionar',
'New item' => 'Novo Registro',
'Search' => 'Procurar',
'Sort' => 'Ordenar',
'descending' => 'decrescente',
'Limit' => 'Limite',
'No rows.' => 'Não existem registros.',
'Action' => 'Ação',
'edit' => 'modificar',
'Page' => 'Página',
'Query executed OK, %d row(s) affected.' => array('Consulta executada, %d registro afetados.', 'Consulta executada, %d registros afetados.'),
'Error in query' => 'Erro na consulta',
'Execute' => 'Executar',
'Table' => 'Tabela',
'Foreign keys' => 'Chaves foráneas',
'Triggers' => 'Triggers',
'View' => 'Visualizar',
'Unable to select the table' => 'Não é possivel selecionar a Tabela',
'Invalid CSRF token. Send the form again.' => 'Token CSRF inválido. Enviar o formulario novamente.',
'Comment' => 'Comentario',
'Default values' => 'Valores predeterminados',
'%d byte(s)' => array('%d byte', '%d bytes'),
'No commands to execute.' => 'Nenhum comando para executar.',
'Unable to upload a file.' => 'Não é possivel enviar o arquivo.',
'File upload' => 'Importar arquivo',
'File uploads are disabled.' => 'Importação de arquivos desablilitado.',
'Routine has been called, %d row(s) affected.' => array('Consulta executada, %d registro afetado.', 'Consulta executada, %d registros afetados.'),
'Call' => 'Chamar',
'No extension' => 'Não ha extension',
'None of the supported PHP extensions (%s) are available.' => 'Nenhuma das extensões PHP soportadas (%s) está disponivel.',
'Session support must be enabled.' => 'Devem estar habilitadas as sessões.',
'Session expired, please login again.' => 'Sessão expirada, por favor entre sua Chave de novo.',
'Text length' => 'Tamanho de texto',
'Foreign key has been dropped.' => 'Chave externa eliminada.',
'Foreign key has been altered.' => 'Chave externa modificada.',
'Foreign key has been created.' => 'Chave externa criada.',
'Foreign key' => 'Chave externa',
'Target table' => 'Tabela de destino',
'Change' => 'Modificar',
'Source' => 'Origem',
'Target' => 'Destino',
'Add column' => 'Adicionar coluna',
'Alter' => 'Modificar',
'Add foreign key' => 'Adicionar Chave foránea',
'ON DELETE' => 'ON DELETE',
'ON UPDATE' => 'ON UPDATE',
'Index Type' => 'Tipo de índice',
'Column (length)' => 'coluna (tamanho)',
'View has been dropped.' => 'Vista eliminada.',
'View has been altered.' => 'Vista modificada.',
'View has been created.' => 'Vista criada.',
'Alter view' => 'Modificar vista',
'Create view' => 'Criar vista',
'Name' => 'Nome',
'Process list' => 'Lista de processos',
'%d process(es) have been killed.' => array('%d processo terminado.', '%d processos terminados.'),
'Kill' => 'Parar',
'Parameter name' => 'Nome de Parametro',
'Database schema' => 'Esquema de Base de dados',
'Create procedure' => 'Criar procedimento',
'Create function' => 'Criar função',
'Routine has been dropped.' => 'Procedimento eliminado.',
'Routine has been altered.' => 'Procedimento modificado.',
'Routine has been created.' => 'Procedimento criado.',
'Alter function' => 'Modificar Função',
'Alter procedure' => 'Modificar procedimiento',
'Return type' => 'Tipo de valor de regreso',
'Add trigger' => 'Adicionar trigger',
'Trigger has been dropped.' => 'Trigger eliminado.',
'Trigger has been altered.' => 'Trigger modificado.',
'Trigger has been created.' => 'Trigger criado.',
'Alter trigger' => 'Modificar Trigger',
'Create trigger' => 'Adicionar Trigger',
'Time' => 'Tempo',
'Event' => 'Evento',
'%s version: %s through PHP extension %s' => 'Versão %s: %s através da extensão PHP %s',
'%d row(s)' => array('%d registro', '%d registros'),
'Remove' => 'Remover',
'Are you sure?' => 'Está seguro?',
'Privileges' => 'Privilegios',
'Create user' => 'Criar Usuario',
'User has been dropped.' => 'Usuario eliminado.',
'User has been altered.' => 'Usuario modificado.',
'User has been created.' => 'Usuario criado.',
'Hashed' => 'Hash',
'Column' => 'Coluna',
'Routine' => 'Rotina',
'Grant' => 'Conceder',
'Revoke' => 'Impedir',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'POST data demasiado grande. Reduza o tamanho ou aumente a diretiva de configuração %s.',
'Logged as: %s' => 'Logado como: %s',
'Move up' => 'Mover acima',
'Move down' => 'Mover abaixo',
'Functions' => 'Funções',
'Aggregation' => 'Adições',
'Export' => 'Exportar',
'Output' => 'Saida',
'open' => 'mostrar',
'save' => 'salvas',
'Format' => 'Formato',
'Tables' => 'Tabelas',
'Data' => 'Dados',
'Event has been dropped.' => 'Evento eliminado.',
'Event has been altered.' => 'Evento modificado.',
'Event has been created.' => 'Evento criado.',
'Alter event' => 'Modificar Evento',
'Create event' => 'Criar Evento',
'At given time' => 'A hora determinada',
'Every' => 'Cada',
'Events' => 'Eventos',
'Schedule' => 'Agenda',
'Start' => 'Inicio',
'End' => 'Fim',
'Status' => 'Estado',
'On completion preserve' => 'Ao completar preservar',
'Tables and views' => 'Tabelas e vistas',
'Data Length' => 'Tamanho de dados',
'Index Length' => 'Tamanho de índice',
'Data Free' => 'Espaço Livre',
'Collation' => 'Colação',
'Analyze' => 'Analizar',
'Optimize' => 'Otimizar',
'Check' => 'Verificar',
'Repair' => 'Reparar',
'Truncate' => 'Truncar',
'Tables have been truncated.' => 'Tabelas truncadas (truncate).',
'Rows' => 'Registros',
',' => ' ',
'Tables have been moved.' => 'As Tabelas foram movidas.',
'Move to other database' => 'Mover outra Base de dados',
'Move' => 'Mover',
'Engine' => 'Motor',
'Save and continue edit' => 'Salvar e continuar editando',
'original' => 'original',
'Tables have been dropped.' => 'Tabelas eliminadas.',
'%d item(s) have been affected.' => array('%d ítem afetado.', '%d itens afetados.'),
'whole result' => 'resultado completo',
'Clone' => 'Clonar',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Cantida máxima de campos permitidos excedidos. Por favor aumente %s y %s.',
'Partition by' => 'Particionar por',
'Partitions' => 'Partições',
'Partition name' => 'Nome da Partição',
'Values' => 'Valores',
'%d row(s) have been imported.' => array('%d registro importado.', '%d registros importados.'),
'anywhere' => 'qualquer local',
'Import' => 'Importar',
'Stop on error' => 'Parar em caso de erro',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$5/$3/$1',
'[yyyy]-mm-dd' => 'dd/mm/[aaaa]',
'History' => 'Historico',
'Variables' => 'Variaveis',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'As colunas de origen e destino devem ser do mesmo tipo, deve existir um índice entre as colunas de destino e o registro referenciado deve existir.',
'Relations' => 'Relações',
'Run file' => 'Executar Arquivo',
'Clear' => 'Limpar',
'Maximum allowed file size is %sB.' => 'Tamanho máximo do arquivo é %sB.',
'Numbers' => 'Números',
'Date and time' => 'Data e hora',
'Strings' => 'Cadena',
'Binary' => 'Binario',
'Lists' => 'Listas',
'Editor' => 'Editor',
'E-mail' => 'E-mail',
'From' => 'De',
'Subject' => 'Assunto',
'Send' => 'Enviar',
'%d e-mail(s) have been sent.' => array('%d email enviado.', '%d emails enviados.'),
'Webserver file %s' => 'Arquivo do servidor web %s',
'File does not exist.' => 'Arquivo não existe.',
'%d in total' => '%d no total',
'Permanent login' => 'Salvar Senha',
'Databases have been dropped.' => 'Bases de dados eliminadas.',
'Search data in tables' => 'Buscar dados nas Tabelas',
'schema' => 'esquema',
'Schema' => 'Esquema',
'Alter schema' => 'Modificar esquema',
'Create schema' => 'Criar esquema',
'Schema has been dropped.' => 'Esquema eliminado.',
'Schema has been created.' => 'Esquema criado.',
'Schema has been altered.' => 'Esquema modificado.',
'Sequences' => 'Sequencias',
'Create sequence' => 'Criar sequencias',
'Alter sequence' => 'Modificar sequencia',
'Sequence has been dropped.' => 'Sequencia eliminada.',
'Sequence has been created.' => 'Sequencia criada.',
'Sequence has been altered.' => 'Sequencia modificada.',
'User types' => 'Tipos definido pelo usuario',
'Create type' => 'Criar tipo',
'Alter type' => 'Modificar tipo',
'Type has been dropped.' => 'Tipo eliminado.',
'Type has been created.' => 'Tipo criado.',
'Double click on a value to modify it.' => 'Doble-clic sobre o valor para edita-lo.',
'Use edit link to modify this value.' => 'Utilize o link modificar para alterar.',
'last' => 'último',
'From server' => 'Desde servidor',
'System' => 'Motor de Base de dados',
'Select data' => 'Selecionar dados',
'Show structure' => 'Mostrar estrutura',
'empty' => 'vazio',
'Network' => 'Rede',
'Geometry' => 'Geometría',
'File exists.' => 'Arquivo ja existe.',
'Attachments' => 'Anexos',
'%d query(s) executed OK.' => array('%d consulta sql executada corretamente.', '%d consulta sql executadas corretamente.'),
'Show only errors' => 'Mostrar somente erros',
'Last page' => 'Ultima página',
'Refresh' => 'Atualizar',
'Invalid schema.' => 'Esquema inválido.',
'Please use one of the extensions %s.' => 'Por favor use uma das extensões %s.',
'now' => 'agora',
'ltr' => 'ltr',
);

View File

@@ -40,7 +40,7 @@ $translations = array(
'Create new table' => 'Создать новую таблицу',
'Item has been deleted.' => 'Запись удалена.',
'Item has been updated.' => 'Запись обновлена.',
'Item%s has been inserted.' => 'Запись%s была вставлена.',
'Item has been inserted.' => 'Запись вставлена.',
'Edit' => 'Редактировать',
'Insert' => 'Вставить',
'Save and insert next' => 'Сохранить и вставить еще',
@@ -147,7 +147,7 @@ $translations = array(
'Move down' => 'Переместить вниз',
'Functions' => 'Функции',
'Aggregation' => 'Агрегация',
'Export' => 'Экспорт',
'Export' => 'Експорт',
'Output' => 'Выходные данные',
'open' => 'открыть',
'save' => 'сохранить',
@@ -195,6 +195,7 @@ $translations = array(
'Partition name' => 'Название раздела',
'Values' => 'Параметры',
'%d row(s) have been imported.' => array('Импортирована %d строка.', 'Импортировано %d строки.', 'Импортировано %d строк.'),
'CSV Import' => 'Импорт CSV',
'Import' => 'Импорт',
'Stop on error' => 'Остановить при ошибке',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Достигнуто максимальное значение количества доступных полей. Увеличьте %s и %s.',
@@ -224,44 +225,4 @@ $translations = array(
'File does not exist.' => 'Такого файла не существует.',
'%d in total' => 'Всего %d',
'Permanent login' => 'Оставаться в системе',
'Databases have been dropped.' => 'Базы данных удалены.',
'Search data in tables' => 'Поиск в таблицах',
'schema' => 'схема',
'Schema' => 'Схема',
'Alter schema' => 'Изменить схему',
'Create schema' => 'Новая схема',
'Schema has been dropped.' => 'Схема удалена.',
'Schema has been created.' => 'Создана новая схема.',
'Schema has been altered.' => 'Схема изменена.',
'Sequences' => '«Последовательности»',
'Create sequence' => 'Создать «последовательность»',
'Alter sequence' => 'Изменить «последовательность»',
'Sequence has been dropped.' => '«Последовательность» удалена.',
'Sequence has been created.' => 'Создана новая «последовательность».',
'Sequence has been altered.' => '«Последовательность» изменена.',
'User types' => 'Типы пользователей',
'Create type' => 'Создать тип',
'Alter type' => 'Изменить тип',
'Type has been dropped.' => 'Тип удален.',
'Type has been created.' => 'Создан новый тип.',
'Double click on a value to modify it.' => 'Кликни два раза по значению, чтобы его изменить.',
'Use edit link to modify this value.' => 'Изменить это значение можно с помощью ссылки «изменить».',
'last' => 'последняя',
'From server' => 'С сервера',
'System' => 'Движок',
'Select data' => 'Выбрать',
'Show structure' => 'Показать структуру',
'empty' => 'пусто',
'Network' => 'Сеть',
'Geometry' => 'Геометрия',
'File exists.' => 'Файл уже существует.',
'Attachments' => 'Прикрепленные файлы',
'%d query(s) executed OK.' => array('%d запрос выполнен успешно.', '%d запроса выполнено успешно.', '%d запросов выполнено успешно.'),
'Show only errors' => 'Только ошибки',
'Last page' => 'Последняя страница',
'Refresh' => 'Обновить',
'Invalid schema.' => 'Неправильная схема.',
'Please use one of the extensions %s.' => 'Используйте одно из этих расширений %s.',
'now' => 'сейчас',
'ltr' => 'ltr',
);

View File

@@ -24,7 +24,6 @@ $translations = array(
'Options' => 'Voľby',
'Save' => 'Uložiť',
'Drop' => 'Odstrániť',
'Databases have been dropped.' => 'Databázy boli odstránené.',
'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á.',
@@ -41,7 +40,7 @@ $translations = array(
'Create new table' => 'Vytvoriť novú tabuľku',
'Item has been deleted.' => 'Položka bola vymazaná.',
'Item has been updated.' => 'Položka bola aktualizovaná.',
'Item%s has been inserted.' => 'Položka%s bola vložená.',
'Item has been inserted.' => 'Položka bola vložená.',
'Edit' => 'Upraviť',
'Insert' => 'Vložiť',
'Save and insert next' => 'Uložiť a vložiť ďalší',
@@ -170,9 +169,9 @@ $translations = array(
'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 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',
@@ -196,6 +195,7 @@ $translations = array(
'Partition name' => 'Názov oddielu',
'Values' => 'Hodnoty',
'%d row(s) have 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',
'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.',
@@ -225,43 +225,4 @@ $translations = array(
'File does not exist.' => 'Súbor neexistuje.',
'Permanent login' => 'Trvalé prihlásenie',
'%d in total' => '%d celkom',
'Search data in tables' => 'Vyhľadať dáta v tabuľkách',
'Alter schema' => 'Pozmeniť schému',
'Create schema' => 'Vytvoriť schému',
'Schema has been dropped.' => 'Schéma bola odstránená.',
'Schema has been created.' => 'Schéma bola vytvorená.',
'Schema has been altered.' => 'Schéma bola zmenená.',
'schema' => 'schéma',
'Schema' => 'Schéma',
'Sequences' => 'Sekvencia',
'Create sequence' => 'Vytvoriť sekvenciu',
'Sequence has been dropped.' => 'Sekvencia bola odstránená.',
'Sequence has been created.' => 'Sekvencia bola vytvorená.',
'Sequence has been altered.' => 'Sekvencia bola zmenená.',
'Alter sequence' => 'Pozmeniť sekvenciu',
'User types' => 'Užívateľské typy',
'Create type' => 'Vytvoriť typ',
'Type has been dropped.' => 'Typ bol odstránený.',
'Type has been created.' => 'Typ bol vytvorený.',
'Alter type' => 'Pozmeniť typ',
'Double click on a value to modify it.' => 'Dvojkliknite na políčko, ktoré chcete zmeniť.',
'Use edit link to modify this value.' => 'Pre zmenu tejto hodnoty použite odkaz upraviť.',
'last' => 'posledný',
'From server' => 'Zo serveru',
'System' => 'Systém',
'Show structure' => 'Zobraziť štruktúru',
'Select data' => 'Vypísať dáta',
'empty' => 'prázdne',
'Network' => 'Sieť',
'Geometry' => 'Geometria',
'File exists.' => 'Súbor existuje.',
'Attachments' => 'Prílohy',
'%d query(s) executed OK.' => array('Bol vykonaný %d dotaz.', 'Boli vykonané %d dotazy.', 'Bolo vykonaných %d dotazov.'),
'Show only errors' => 'Zobraziť iba chyby',
'Last page' => 'Posledná stránka',
'Refresh' => 'Obnoviť',
'Invalid schema.' => 'Neplatné schéma.',
'Please use one of the extensions %s.' => 'Prosím vyberte jednu z koncoviek %s.',
'now' => 'teraz',
'ltr' => 'ltr',
);

View File

@@ -1,311 +0,0 @@
<?php
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Sistem',
'Server' => 'Strežnik',
'Username' => 'Uporabniško ime',
'Password' => 'Geslo',
'Permanent login' => 'Trajna prijava',
'Login' => 'Prijavi se',
'Logout' => 'Odjavi se',
'Logged as: %s' => 'Prijavljen kot: %s',
'Logout successful.' => 'Prijava uspešna.',
'Invalid credentials.' => 'Neveljavne pravice.',
'Language' => 'Jezik',
'Invalid CSRF token. Send the form again.' => 'Neveljaven token CSRF. Pošljite formular še enkrat.',
'No extension' => 'Brez dodatkov',
'None of the supported PHP extensions (%s) are available.' => 'Noben od podprtih dodatkov za PHP (%s) ni na voljo.',
'Session support must be enabled.' => 'Podpora za seje mora biti omogočena.',
'Session expired, please login again.' => 'Seja je potekla. Prosimo, ponovno se prijavite.',
'%s version: %s through PHP extension %s' => 'Verzija %s: %s preko dodatka za PHP %s',
'Refresh' => 'Osveži',
// text direction
'ltr' => 'ltr',
'Privileges' => 'Pravice',
'Create user' => 'Ustvari uporabnika',
'User has been dropped.' => 'Uporabnik je odstranjen.',
'User has been altered.' => 'Uporabnik je spremenjen.',
'User has been created.' => 'Uporabnik je ustvarjen.',
'Hashed' => 'Zakodirano',
'Column' => 'Stolpec',
'Routine' => 'Postopek',
'Grant' => 'Dovoli',
'Revoke' => 'Odvzemi',
'Process list' => 'Seznam procesov',
'%d process(es) have been killed.' => array('Končan je %d proces.', 'Končana sta %d procesa.', 'Končani so %d procesi.', 'Končanih je %d procesov.'),
'Kill' => 'Končaj',
'Variables' => 'Spremenljivke',
'Status' => 'Stanje',
'SQL command' => 'Ukaz SQL',
'%d query(s) executed OK.' => array('Uspešno se je končala %d poizvedba.', 'Uspešno sta se končali %d poizvedbi.', 'Uspešno so se končale %d poizvedbe.', 'Uspešno se je končalo %d poizvedb.'),
'Query executed OK, %d row(s) affected.' => array('Poizvedba se je uspešno izvedla, spremenjena je %d vrstica.', 'Poizvedba se je uspešno izvedla, spremenjeni sta %d vrstici.', 'Poizvedba se je uspešno izvedla, spremenjene so %d vrstice.', 'Poizvedba se je uspešno izvedla, spremenjenih je %d vrstic.'),
'No commands to execute.' => 'Ni ukazov za izvedbo.',
'Error in query' => 'Napaka v poizvedbi',
'Execute' => 'Izvedi',
'Stop on error' => 'Ustavi ob napaki',
'Show only errors' => 'Pokaži samo napake',
// sprintf() format for time of the command
'%.3f s' => '%.3f s',
'History' => 'Zgodovina',
'Clear' => 'Počisti',
'File upload' => 'Naloži datoteko',
'From server' => 'z strežnika',
'Webserver file %s' => 'Datoteka na spletnem strežniku %s',
'Run file' => 'Zaženi datoteko',
'File does not exist.' => 'Datoteka ne obstaja.',
'File uploads are disabled.' => 'Nalaganje datotek je onemogočeno.',
'Unable to upload a file.' => 'Ne morem naložiti datoteke.',
'Maximum allowed file size is %sB.' => 'Največja velikost datoteke je %sB.',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Preveliko podatkov za POST. Zmanjšajte število podatkov ali povečajte nastavitev za %s.',
'Export' => 'Izvozi',
'Dump' => 'Izvozi',
'Output' => 'Izhod rezultata',
'open' => 'odpri',
'save' => 'shrani',
'Format' => 'Format',
'Data' => 'Podatki',
'Database' => 'Baza',
'database' => 'baza',
'Use' => 'Uporabi',
'Select database' => 'Izberi bazo',
'Invalid database.' => 'Neveljavna baza.',
'Create new database' => 'Ustvari novo bazo',
'Database has been dropped.' => 'Baza je zavržena.',
'Databases have been dropped.' => 'Baze so zavržene.',
'Database has been created.' => 'Baza je ustvarjena.',
'Database has been renamed.' => 'Baza je preimenovana.',
'Database has been altered.' => 'Baza je spremenjena.',
'Alter database' => 'Spremeni bazo',
'Create database' => 'Ustvari bazo',
'Database schema' => 'Shema baze',
// thousands separator - must contain single byte
',' => ' ',
'Engine' => 'Pogon',
'Collation' => 'Zbiranje',
'Data Length' => 'Velikost podatkov',
'Index Length' => 'Velikost indeksa',
'Data Free' => 'Podatkov prosto ',
'Rows' => 'Vrstic',
'%d in total' => 'Skupaj %d',
'Analyze' => 'Analiziraj',
'Optimize' => 'Optimiziraj',
'Check' => 'Preveri',
'Repair' => 'Popravi',
'Truncate' => 'Skrajšaj',
'Tables have been truncated.' => 'Tabele so skrajšane.',
'Move to other database' => 'Premakni v drugo bazo',
'Move' => 'Premakni',
'Tables have been moved.' => 'Tabele so premaknjene.',
'Copy' => 'Kopiraj',
'Tables have been copied.' => 'Tabele so kopirane.',
'Routines' => 'Postopki',
'Routine has been called, %d row(s) affected.' => array('Klican je bil postopek, spremenjena je %d vrstica.', 'Klican je bil postopek, spremenjeni sta %d vrstici.', 'Klican je bil postopek, spremenjene so %d vrstice.', 'Klican je bil postopek, spremenjenih je %d vrstic.'),
'Call' => 'Pokliči',
'Parameter name' => 'Ime parametra',
'Create procedure' => 'Ustvari postopek',
'Create function' => 'Ustvari funkcijo',
'Routine has been dropped.' => 'Postopek je zavržen.',
'Routine has been altered.' => 'Postopek je spremenjen.',
'Routine has been created.' => 'Postopek je ustvarjen.',
'Alter function' => 'Spremeni funkcijo',
'Alter procedure' => 'Spremeni postopek',
'Return type' => 'Vračalni tip',
'Events' => 'Dogodki',
'Event has been dropped.' => 'Dogodek je zavržen.',
'Event has been altered.' => 'Dogodek je spremenjen.',
'Event has been created.' => 'Dogodek je ustvarjen.',
'Alter event' => 'Spremeni dogodek',
'Create event' => 'Ustvari dogodek',
'At given time' => 'v danem času',
'Every' => 'vsake',
'Schedule' => 'Urnik',
'Start' => 'Začetek',
'End' => 'Konec',
'On completion preserve' => 'Po zaključku ohrani',
'Tables' => 'Tabele',
'Tables and views' => 'Tabele in pogledi',
'Table' => 'Tabela',
'No tables.' => 'Ni tabel.',
'Alter table' => 'Spremeni tabelo',
'Create table' => 'Ustvari tabelo',
'Create new table' => 'Ustvari novo tabelo',
'Table has been dropped.' => 'Tabela je zavržena.',
'Tables have been dropped.' => 'Tabele so zavržene.',
'Table has been altered.' => 'Tabela je spremenjena.',
'Table has been created.' => 'Tabela je ustvarjena.',
'Table name' => 'Ime tabele',
'Show structure' => 'Pokaži zgradbo',
'engine' => 'pogon',
'collation' => 'zbiranje',
'Column name' => 'Ime stolpca',
'Type' => 'Tip',
'Length' => 'Dolžina',
'Auto Increment' => 'Samodejno povečevanje',
'Options' => 'Možnosti',
'Comment' => 'Komentar',
'Default values' => 'Privzete vrednosti',
'Drop' => 'Zavrzi',
'Are you sure?' => 'Ste prepričani?',
'Move up' => 'Premakni gor',
'Move down' => 'Premakni dol',
'Remove' => 'Odstrani',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'Največje število dovoljenih polje je preseženo. Prosimo, povečajte %s in %s.',
'Partition by' => 'Porazdeli po',
'Partitions' => 'Porazdelitve',
'Partition name' => 'Ime porazdelitve',
'Values' => 'Vrednosti',
'View' => 'Pogledi',
'View has been dropped.' => 'Pogled je zavržen.',
'View has been altered.' => 'Pogled je spremenjen.',
'View has been created.' => 'Pogled je ustvarjen.',
'Alter view' => 'Spremeni pogled',
'Create view' => 'Ustvari pogled',
'Indexes' => 'Indeksi',
'Indexes have been altered.' => 'Indeksi so spremenjeni.',
'Alter indexes' => 'Spremeni indekse',
'Add next' => 'Dodaj naslednjega',
'Index Type' => 'Tip indeksa',
'Column (length)' => 'Stolpec (dolžina)',
'Foreign keys' => 'Tuji ključi',
'Foreign key' => 'Tuj ključ',
'Foreign key has been dropped.' => 'Tuj ključ je zavržen.',
'Foreign key has been altered.' => 'Tuj ključ je spremenjen.',
'Foreign key has been created.' => 'Tuj ključ je ustvarjen.',
'Target table' => 'Ciljna tabela',
'Change' => 'Spremeni',
'Source' => 'Izvor',
'Target' => 'Cilj',
'Add column' => 'Dodaj stolpec',
'Alter' => 'Spremeni',
'Add foreign key' => 'Dodaj tuj ključ',
'ON DELETE' => 'pri brisanju',
'ON UPDATE' => 'pri posodabljanju',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Izvorni in ciljni stolpec mora imeti isti podatkovni tip. Obstajati mora indeks na ciljnih stolpcih in obstajati morajo referenčni podatki.',
'Triggers' => 'Sprožilniki',
'Add trigger' => 'Dodaj sprožilnik',
'Trigger has been dropped.' => 'Sprožilnik je odstranjen.',
'Trigger has been altered.' => 'Sprožilnik je spremenjen.',
'Trigger has been created.' => 'Sprožilnik je ustvarjen.',
'Alter trigger' => 'Spremeni sprožilnik',
'Create trigger' => 'Ustvari sprožilnik',
'Time' => 'Čas',
'Event' => 'Dogodek',
'Name' => 'Naziv',
'select' => 'izberi',
'Select' => 'Izberi',
'Select data' => 'Izberi podatke',
'Functions' => 'Funkcije',
'Aggregation' => 'Združitev',
'Search' => 'Išči',
'anywhere' => 'kjerkoli',
'Search data in tables' => 'Išče podatke po tabelah',
'Sort' => 'Sortiraj',
'descending' => 'padajoče',
'Limit' => 'Limita',
'Text length' => 'Dolžina teksta',
'Action' => 'Dejanje',
'Unable to select the table' => 'Ne morem izbrati tabele',
'No rows.' => 'Ni vrstic.',
'%d row(s)' => array('%d vrstica', '%d vrstici', '%d vrstice', '%d vrstic'),
'Page' => 'Stran',
'last' => 'Zadnja',
'Last page' => 'Zadnja stran',
'whole result' => 'cel razultat',
'%d byte(s)' => array('%d bajt', '%d bajta', '%d bajti', '%d bajtov'),
'Import' => 'Uvozi',
'%d row(s) have been imported.' => array('Uvožena je %d vrstica.', 'Uvoženi sta %d vrstici.', 'Uvožene so %d vrstice.', 'Uvoženih je %d vrstic.'),
// in-place editing in select
'Double click on a value to modify it.' => 'Dvojni klik na vrednost za urejanje.',
'Use edit link to modify this value.' => 'Uporabite urejanje povezave za spreminjanje te vrednosti.',
// %s can contain auto-increment value
'Item%s has been inserted.' => 'Predmet%s je vstavljen.',
'Item has been deleted.' => 'Predmet je izbrisan.',
'Item has been updated.' => 'Predmet je posodobljen.',
'%d item(s) have been affected.' => array('Spremenjen je %d predmet.', 'Spremenjena sta %d predmeta.', 'Spremenjeni so %d predmeti.', 'Spremenjenih je %d predmetov.'),
'New item' => 'Nov predmet',
'original' => 'original',
// label for value '' in enum data type
'empty' => 'prazno',
'edit' => 'uredi',
'Edit' => 'Uredi',
'Insert' => 'Vstavi',
'Save' => 'Shrani',
'Save and continue edit' => 'Shrani in nadaljuj z urejanjem',
'Save and insert next' => 'Shrani in vstavi tekst',
'Clone' => 'Kloniraj',
'Delete' => 'Izbriši',
'E-mail' => 'E-mail',
'From' => 'Od',
'Subject' => 'Zadeva',
'Attachments' => 'Priponke',
'Send' => 'Pošlji',
'%d e-mail(s) have been sent.' => array('Poslan je %d e-mail.', 'Poslana sta %d e-maila.', 'Poslani so %d e-maili.', 'Poslanih je %d e-mailov.'),
// data type descriptions
'Numbers' => 'Števila',
'Date and time' => 'Datum in čas',
'Strings' => 'Nizi',
'Binary' => 'Binarni',
'Lists' => 'Seznami',
'Network' => 'Mrežni',
'Geometry' => 'Geometrčni',
'Relations' => 'Relacijski',
'Editor' => 'Urejevalnik',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => '$6.$4.$1',
// hint for date format - use language equivalents for day, month and year shortcuts
'[yyyy]-mm-dd' => 'd.m.[rrrr]',
'now' => 'zdaj',
// general SQLite error in create, drop or rename database
'File exists.' => 'Datoteka obstaja.',
'Please use one of the extensions %s.' => 'Prosim, uporabite enega od dodatkov %s.',
// PostgreSQL and MS SQL schema support
'Alter schema' => 'Spremeni shemo',
'Create schema' => 'Ustvari shemo',
'Schema has been dropped.' => 'Shema je zavržena.',
'Schema has been created.' => 'Shema je ustvarjena.',
'Schema has been altered.' => 'Shema je spremenjena.',
'schema' => 'shema',
'Schema' => 'Shema',
'Invalid schema.' => 'Neveljavna shema.',
// PostgreSQL sequences support
'Sequences' => 'Sekvence',
'Create sequence' => 'Ustvari sekvenco',
'Sequence has been dropped.' => 'Sekvenca je zavržena.',
'Sequence has been created.' => 'Sekvence je ustvarjena.',
'Sequence has been altered.' => 'Sekvence je spremenjena.',
'Alter sequence' => 'Spremni sekvenco',
// PostgreSQL user types support
'User types' => 'Uporabniški tipi',
'Create type' => 'Ustvari tip',
'Type has been dropped.' => 'Tip je zavržen.',
'Type has been created.' => 'Tip je ustvarjen.',
'Alter type' => 'Spremeni tip',
);

View File

@@ -1,267 +0,0 @@
<?php
$translations = array(
'Login' => 'நுழை',
'Logout successful.' => 'வெற்றிக‌ர‌மாய் வெளியேறியாயிற்று.',
'Invalid credentials.' => 'ச‌ரியான‌ விப‌ர‌ங்க‌ள் இல்லை.',
'Server' => 'வ‌ழ‌ங்கி (Server)',
'Username' => 'ப‌ய‌னாள‌ர் (User)',
'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' => 'நீளம்',
'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' => 'Dump',
'Logout' => 'வெளியேறு',
'database' => 'த‌க‌வ‌ல்த‌ள‌ம்',
'Use' => 'உப‌யோகி',
'No tables.' => 'அட்ட‌வ‌ணை இல்லை.',
'select' => 'தேர்வு செய்',
'Create new table' => 'புதிய‌ அட்ட‌வ‌ணையை உருவாக்கு',
'Item has been deleted.' => 'உருப்படி நீக்க‌ப்ப‌ட்ட‌து.',
'Item has been updated.' => 'உருப்ப‌டி புதுப்பிக்க‌ப்ப‌ட்ட‌து.',
'Edit' => 'தொகு',
'Insert' => 'புகுத்து',
'Save and insert next' => 'சேமித்த‌ப் பின் அடுத்த‌தை புகுத்து',
'Delete' => 'நீக்கு',
'Database' => 'த‌க‌வ‌ல்த‌ள‌ம்',
'Routines' => 'ரொட்டீன் ',
'Indexes have been altered.' => 'அக‌வ‌ரிசைக‌ள் (Indexes) மாற்ற‌ப்பட்ட‌து.',
'Indexes' => 'அக‌வ‌ரிசைக‌ள் (Index) ',
'Alter indexes' => 'அக‌வ‌ரிசையை (Index) மாற்று',
'Add next' => 'அடுத்த‌தை சேர்க்க‌வும்',
'Language' => 'மொழி',
'Select' => 'தேர்வு செய்',
'New item' => 'புதிய‌ உருப்ப‌டி',
'Search' => 'தேடு',
'Sort' => 'த‌ர‌ம் பிரி',
'descending' => 'இற‌ங்குமுக‌மான‌',
'Limit' => 'வ‌ர‌ம்பு',
'No rows.' => 'வ‌ரிசை இல்லை.',
'Action' => 'செய‌ல்',
'edit' => 'தொகு',
'Page' => 'ப‌க்க‌ம்',
'Query executed OK, %d row(s) affected.' => array('வின‌வ‌ல் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌து, %d வ‌ரிசை மாற்ற‌ப்ப‌ட்ட‌து.', 'வின‌வ‌ல் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌து, %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' => 'உள்ளிருக்கும் (Default) ம‌திப்புக‌ள் ',
'%d byte(s)' => array('%d பைட்', '%d பைட்டுக‌ள்'),
'No commands to execute.' => 'செய‌ல் ப‌டுத்த‌ எந்த‌ க‌ட்ட‌ளைக‌ளும் இல்லை.',
'Unable to upload a file.' => 'கோப்பை மேலேற்ற‌ம் (upload) செய்ய‌ இயல‌வில்லை.',
'File upload' => 'கோப்பை மேலேற்று (upload) ',
'File uploads are disabled.' => 'கோப்புக‌ள் மேலேற்றம் (upload)முட‌க்க‌ப்ப‌ட்டுள்ள‌ன‌.',
'Routine has been called, %d row(s) affected.' => array('ரொட்டீன்க‌ள் அழைக்க‌ப்பட்டுள்ள‌ன‌, %d வ‌ரிசை மாற்ற‌ம் அடைந்த‌து.', 'ரொட்டீன்க‌ள் அழைக்க‌ப்ப‌ட்டுள்ள‌ன‌, %d வ‌ரிசைக‌ள் மாற்றம் அடைந்துள்ள‌ன‌.'),
'Call' => 'அழை',
'None of the supported PHP extensions (%s) are available.' => 'PHP ஆத‌ர‌வு விரிவுக‌ள் (%s) இல்லை.',
'Session support 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' => 'அக‌வ‌ரிசை வ‌கை (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) have been killed.' => array('%d வேலை வ‌லுவில் நிறுத்த‌ப‌ட்ட‌து.', '%d வேலைக‌ள் வ‌லுவில் நிறுத்த‌ப‌ட்ட‌ன‌.'),
'Kill' => 'வ‌லுவில் நிறுத்து',
'Parameter name' => 'அள‌புரு (Parameter) பெய‌ர்',
'Database schema' => 'த‌க‌வ‌ல்த‌ள‌ அமைப்பு முறைக‌ள்',
'Create procedure' => 'செய்முறையை உருவாக்கு',
'Create function' => 'Function உருவாக்கு',
'Routine has been dropped.' => 'ரொட்டீன் நீக்க‌ப்ப‌ட்ட‌து.',
'Routine has been altered.' => 'ரொட்டீன் மாற்ற‌ப்ப‌ட்டது.',
'Routine has been created.' => 'ரொட்டீன் உருவாக்க‌ப்ப‌ட்ட‌து.',
'Alter function' => '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' => 'நிக‌ழ்ச்சி',
'%d row(s)' => array('%d வ‌ரிசை', '%d வ‌ரிசைக‌ள்'),
'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' => 'இர‌த்துச்செய்',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'மிக‌ அதிக‌மான‌ POST த‌க‌வ‌ல். த‌க‌வ‌லை குறைக்க‌வும் அல்ல‌து %s வ‌டிவ‌மைப்பை (configuration directive) மாற்ற‌வும்.',
'Logged as: %s' => 'ப‌ய‌னாளர்: %s',
'Move up' => 'மேலே ந‌க‌ர்த்து',
'Move down' => 'கீழே நக‌ர்த்து',
'Functions' => 'Functions',
'Aggregation' => 'திர‌ள்வு (Aggregation)',
'Export' => 'ஏற்றும‌தி',
'Output' => 'வெளியீடு',
'open' => 'திற‌',
'save' => 'சேமி',
'Format' => 'ஃபார்ம‌ட் (Format)',
'Tables' => 'அட்ட‌வ‌ணை',
'Data' => 'த‌க‌வ‌ல்',
'Event has been dropped.' => 'நிக‌ழ்ச்சி (Event) நீக்க‌ப்ப‌ட்ட‌து.',
'Event has been altered.' => 'நிக‌ழ்ச்சி (Event) மாற்றப்ப‌ட்ட‌து.',
'Event has been created.' => 'நிக‌ழ்ச்சி (Event) உருவாக்க‌‌ப்ப‌ட்ட‌து.',
'Alter event' => 'நிக‌ழ்ச்சியை (Event) மாற்று',
'Create event' => 'நிக‌ழ்ச்சியை (Event) உருவாக்கு',
'At given time' => 'குறித்த‌ நேர‌த்தில்',
'Every' => 'ஒவ்வொரு',
'Events' => 'நிக‌ழ்ச்சிக‌ள்',
'Schedule' => 'கால‌ அட்ட‌வ‌ணை',
'Start' => 'தொட‌ங்கு',
'End' => 'முடி (வு)',
'Status' => 'நிக‌ழ்நிலை (Status)',
'On completion preserve' => 'முடிந்த‌தின் பின் பாதுகாக்க‌வும்',
'Tables and views' => 'அட்ட‌வ‌ணைக‌ளும் பார்வைக‌ளும்',
'Data Length' => 'த‌க‌வ‌ல் நீள‌ம்',
'Index Length' => 'Index நீள‌ம்',
'Data Free' => 'Data Free',
'Collation' => 'கொலேச‌ன்',
'Analyze' => 'நுணுகி ஆராய‌வும்',
'Optimize' => 'உக‌ப்பாக்கு (Optimize)',
'Check' => 'ப‌ரிசோதி',
'Repair' => 'ப‌ழுது பார்',
'Truncate' => 'குறை (Truncate)',
'Tables have been truncated.' => 'அட்ட‌வ‌ணை குறைக்க‌ப்ப‌ட்ட‌து (truncated).',
'Rows' => 'வ‌ரிசைக‌ள்',
',' => ',',
'Tables have been moved.' => 'அட்ட‌வ‌ணை ந‌க‌ர்த்த‌ப்ப‌ட்ட‌து.',
'Move to other database' => 'ம‌ற்ற‌ த‌க‌வ‌ல் தள‌த்திற்க்கு ந‌க‌ர்த்து',
'Move' => 'ந‌க‌ர்த்து',
'Engine' => 'எஞ்சின் (Engine)',
'Save and continue edit' => 'சேமித்த‌ பிற‌கு தொகுப்ப‌தை தொட‌ர‌வும்',
'original' => 'அச‌ல்',
'Tables have been dropped.' => 'அட்ட‌வ‌ணை நீக்க‌ப்ப‌ட்ட‌து.',
'%d item(s) have been affected.' => array('%d உருப்ப‌டி மாற்ற‌ம‌டைந்தது.', '%d உருப்ப‌டிக‌ள் மாற்ற‌ம‌டைந்த‌ன‌.'),
'whole result' => 'முழுமையான‌ முடிவு',
'Clone' => 'ந‌க‌லி (Clone)',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'அனும‌திக்க‌ப்ப‌ட்ட‌ அதிக‌ப‌ட்ச‌ கோப்புக‌ளின் எண்ணிக்கை மீற‌ப்ப‌ட்ட‌து. த‌ய‌வு செய்து %s ம‌ற்றும் %s யை அதிக‌ரிக்க‌வும்.',
'Partition by' => 'பிரித்த‌து',
'Partitions' => 'பிரிவுக‌ள்',
'Partition name' => 'பிரிவின் பெய‌ர்',
'Values' => 'ம‌திப்புக‌ள்',
'%d row(s) have been imported.' => array('%d வ‌ரிசை இற‌க்கும‌தி (Import) செய்ய‌ப்ப‌ட்ட‌து.', '%d வ‌ரிசைக‌ள் இற‌க்கும‌தி (Import) செய்ய‌ப்ப‌ட்டன‌.'),
'Show structure' => 'க‌ட்ட‌மைப்பை காண்பிக்க‌வும்',
'Import' => 'இற‌க்கும‌தி (Import)',
'Stop on error' => 'பிழை ஏற்ப‌டின் நிற்க‌',
'Select data' => 'த‌க‌வ‌லை தேர்வு செய்',
'%.3f s' => '%.3f s',
'$1-$3-$5' => '$5/$3/$1',
'[yyyy]-mm-dd' => 'dd/mm/[yyyy]',
'History' => 'வ‌ர‌லாறு',
'Variables' => 'மாறிலிக‌ள் (Variables)',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'இல‌க்கு நெடுவ‌ரிசையில் அக‌வ‌ரிசை (Index) ம‌ற்றும் குறிக்க‌ப்ப‌ட்ட‌ த‌க‌வல் (Referenced DATA) க‌ண்டிப்பாக‌ இருத்த‌ல் வேண்டும். மூல‌ நெடுவ‌ரிசை ம‌ற்றும் இலக்கு நெடுவ‌ரிசையின் த‌க‌வ‌ல் வ‌டிவ‌ம் (DATA TYPE) ஒன்றாக‌ இருக்க‌ வேண்டும்.',
'Relations' => 'உற‌வுக‌ள் (Relations)',
'Run file' => 'கோப்பினை இய‌க்க‌வும்',
'Clear' => 'துடை (Clear)',
'Maximum allowed file size is %sB.' => 'கோப்பின் அதிக‌ப‌ட்ச‌ அள‌வு %sB.',
'Numbers' => 'எண்க‌ள்',
'Date and time' => 'தேதி ம‌ற்றும் நேர‌ம்',
'Strings' => 'ச‌ர‌ம் (String)',
'Binary' => 'பைன‌ரி',
'Lists' => 'ப‌ட்டிய‌ல்',
'Editor' => 'தொகுப்பாளர்',
'E-mail' => 'மின்ன‌ஞ்ச‌ல்',
'From' => 'அனுப்புனர்',
'Subject' => 'பொருள்',
'Send' => 'அனுப்பு',
'%d e-mail(s) have been sent.' => array('%d மின்ன‌ஞ்ச‌ல் அனுப்ப‌ப‌ட்ட‌து.', '%d மின்ன‌ஞ்ச‌ல்க‌ள் அனுப்ப‌ப்ப‌ட்ட‌ன‌.'),
'Webserver file %s' => 'வெப் ச‌ர்வ‌ர் கோப்பு %s',
'File does not exist.' => 'கோப்பு இல்லை.',
'%d in total' => 'மொத்தம் %d ',
'Permanent login' => 'நிர‌ந்த‌ர‌மாக‌ நுழைய‌வும்',
'Schema' => 'அமைப்புமுறை',
'Alter schema' => 'அமைப்புமுறையை மாற்று',
'Create schema' => 'அமைப்புமுறையை உருவாக்கு',
'Search data in tables' => 'த‌க‌வ‌லை அட்ட‌வ‌ணையில் தேடு',
'Sequences' => 'வ‌ரிசைமுறை',
'Create sequence' => 'வ‌ரிசைமுறையை உருவாக்கு',
'User types' => 'ப‌ய‌னாள‌ர் வ‌கைக‌ள்',
'Create type' => 'வ‌கையை உருவாக்கு',
'Item%s has been inserted.' => 'உருப்ப‌டி (Item) சேர்க்க‌ப்ப‌ட்ட‌து.',
'Schema has been dropped.' => 'அமைப்புமுறை நீக்க‌ப்ப‌ட்ட‌து.',
'Schema has been created.' => 'அமைப்புமுறை உருவாக்க‌ப்ப‌ட்ட‌து.',
'Schema has been altered.' => 'அமைப்புமுறை மாற்ற‌ப்ப‌ட்ட‌து.',
'Double click on a value to modify it.' => 'ம‌திப்பினை மாற்ற அத‌ன் மீது இருமுறை சொடுக்க‌வும் (Double click).',
'Use edit link to modify this value.' => 'இந்த‌ ம‌திப்பினை மாற்ற‌, தொகுப்பு இணைப்பினை உப‌யோகிக்க‌வும்.',
'last' => 'க‌டைசி',
'Sequence has been dropped.' => 'வ‌ரிசைமுறை நீக்க‌ப்ப‌ட்ட‌து.',
'Sequence has been created.' => 'வ‌ரிசைமுறை உருவாக்க‌ப்ப‌ட்ட‌து.',
'Sequence has been altered.' => 'வ‌ரிசைமுறை மாற்ற‌ப்ப‌ட்ட‌து.',
'Alter sequence' => 'வ‌ரிசைமுறையை மாற்று',
'From server' => 'செர்வ‌ரில் இருந்து',
'Type has been dropped.' => 'வ‌கை (type) நீக்க‌ப்ப‌ட்ட‌து.',
'Type has been created.' => 'வ‌கை (type) உருவாக்க‌ப்ப‌ட்ட‌து.',
'Alter type' => 'வ‌கையினை (type) மாற்று',
'System' => 'சிஸ்ட‌ம் (System)',
'anywhere' => 'எங்காயினும்',
'empty' => 'வெறுமை (empty)',
'schema' => 'அமைப்புமுறை',
'No extension' => 'விரிவு (extensஇஒன்) இல்லை ',
'Databases have been dropped.' => 'த‌க‌வ‌ல் த‌ள‌ங்க‌ள் நீக்க‌ப்ப‌ட்டன‌.',
'%s version: %s through PHP extension %s' => '%s ப‌திப்பு: %s through PHP extension %s',
'Network' => 'நெட்வொர்க்',
'Geometry' => 'வ‌டிவ‌விய‌ல் (Geometry)',
'File exists.' => 'கோப்பு உள்ள‌து.',
'Attachments' => 'இணைப்புக‌ள்',
'now' => 'இப்பொழுது',
'%d query(s) executed OK.' => array('%d வின‌வ‌ல் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌து.', '%d வின‌வ‌ல்க‌ள் செய‌ல்ப‌டுத்த‌ப்ப‌ட்ட‌ன‌.'),
'Show only errors' => 'பிழைக‌ளை ம‌ட்டும் காண்பிக்க‌வும்',
'Last page' => 'க‌டைசி ப‌க்க‌ம்',
'Refresh' => 'புதுப்பி (Refresh)',
'Invalid schema.' => 'அமைப்புமுறை ச‌ரியான‌த‌ல்ல‌ (Invalid Schema).',
'Please use one of the extensions %s.' => 'த‌ய‌வு செய்து ஒரு விரிவினை %s (extension) உப‌யோகிக்க‌வும்.',
'ltr' => 'ltr',
);

View File

@@ -1,311 +0,0 @@
<?php
$translations = array(
// label for database system selection (MySQL, SQLite, ...)
'System' => 'Sistem',
'Server' => 'Sunucu',
'Username' => 'Kullanıcı',
'Password' => 'Parola',
'Permanent login' => 'Kalıcı giriş',
'Login' => 'Giriş',
'Logout' => ıkış',
'Logged as: %s' => '%s olarak giriş yapıldı.',
'Logout successful.' => 'Başarıyla çıkıldı.',
'Invalid credentials.' => 'Geçersiz kimlik.',
'Language' => 'Dil',
'Invalid CSRF token. Send the form again.' => 'Geçersiz Cross-site request forgery (CSRF) jetonu. Forumu tekrar yolla.',
'No extension' => 'Uzantı yok',
'None of the supported PHP extensions (%s) are available.' => 'Desteklenen PHP uzantılarından (%s) hiçbiri mevcut değil.',
'Session support must be enabled.' => 'Oturum desteği etkin olmalıdır.',
'Session expired, please login again.' => 'Oturum süresi doldu, lütfen tekrar giriş yapın.',
'%s version: %s through PHP extension %s' => '%s sürüm: %s PHP uzantısı ile %s',
'Refresh' => 'Tazele',
// text direction
'ltr' => 'ltr',
'Privileges' => 'İzinler',
'Create user' => 'Kullanıcı yarat',
'User has been dropped.' => 'Kullanıcı düşürüldü.',
'User has been altered.' => 'Kullanıcı değiştirildi.',
'User has been created.' => 'Kullanıcı yaratıldı.',
'Hashed' => 'Harmanlandı.',
'Column' => 'Kolon',
'Routine' => 'Yordam',
'Grant' => 'İmtiyaz',
'Revoke' => 'Geri al',
'Process list' => 'İşlem listesi',
'%d process(es) have been killed.' => array('%d süreç öldürüldü.', '%d adet süreç öldürüldü.'),
'Kill' => 'Öldür',
'Variables' => 'Değişkenler',
'Status' => 'Durum',
'SQL command' => 'SQL komutu',
'%d query(s) executed OK.' => array('%d sorgunun işletilmesi tamamlandı.', '%d kadar sorgunun işletilmesi tamamlandı.'),
'Query executed OK, %d row(s) affected.' => array('Sorgu işletilmesi tamamlandı. %d sıra(row) etkilendi.', 'Sorgu işletilmesi tamamlandı. Bundan %d kadar sıra etkilendi.'),
'No commands to execute.' => 'İşletilmek için komut yok.',
'Error in query' => 'Sorguda hata',
'Execute' => 'İşlet',
'Stop on error' => 'Dur hata',
'Show only errors' => 'Sadece hataları göster.',
// sprintf() format for time of the command
'%.3f s' => '%.3f s',
'History' => 'Tarih',
'Clear' => 'Boşluk',
'File upload' => 'Dosya gönder',
'From server' => 'Sunucudan',
'Webserver file %s' => '%s web sunucusu dosyası',
'Run file' => 'Dosya çalıştır',
'File does not exist.' => 'Dosya mevcut değil.',
'File uploads are disabled.' => 'Dosya gönderimi etkin değil.',
'Unable to upload a file.' => 'Dosya gönderilemiyor.',
'Maximum allowed file size is %sB.' => 'Bir dosya için izin verilen dosya sınırı %sB.',
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Çok büyük POST verisi, veriyi azaltın ya da ayar yönergesini uygun olarak yapılandırın.',
'Export' => 'İhraç',
'Dump' => 'Döküm',
'Output' => ıktı',
'open' => 'aç',
'save' => 'kaydet',
'Format' => 'Biçim',
'Data' => 'Veri',
'Database' => 'Veritabanı',
'database' => 'veritabanı',
'Use' => 'Kullan',
'Select database' => 'Veritabanı seç',
'Invalid database.' => 'Geçersiz veritabanı.',
'Create new database' => 'Yeni veritabanı yarat',
'Database has been dropped.' => 'Veritabanı düşürüldü.',
'Databases have been dropped.' => 'Veritabanları düşüüldü.',
'Database has been created.' => 'Veritabanı yaratıldı.',
'Database has been renamed.' => 'Veritabanının ismi değiştirildi.',
'Database has been altered.' => 'Veritabanı değiştirildi.',
'Alter database' => 'Veritabanı değiştir',
'Create database' => 'Veritabanı yarat',
'Database schema' => 'Veritabanı şeması',
// thousands separator - must contain single byte
',' => ' ',
'Engine' => 'Motor',
'Collation' => 'Karşılaştırma',
'Data Length' => 'Veri uzunluğu',
'Index Length' => 'Dizin uzunluğu',
'Data Free' => 'Serbest veri',
'Rows' => 'Sıralar (Rows)',
'%d in total' => '%d toplamda',
'Analyze' => 'Çözümleme',
'Optimize' => 'En uygun hale getirme',
'Check' => 'Denetleme',
'Repair' => 'Tamir',
'Truncate' => 'Buda',
'Tables have been truncated.' => 'Tablolar budandı.',
'Move to other database' => 'Diğer veritabanına taşı',
'Move' => 'Taşı',
'Tables have been moved.' => 'Tablolar taşındı.',
'Copy' => 'Kopyala',
'Tables have been copied.' => 'Tablolar kopyalandı.',
'Routines' => 'Yordamlar',
'Routine has been called, %d row(s) affected.' => array('Yordam çağrıldı, %d sıra(row) etkilendi.', 'Yordam çağrıldı, %d sıralar(rows) etkilendi.'),
'Call' => 'Çağrı',
'Parameter name' => 'Parametre adı',
'Create procedure' => 'Yöntem yarat',
'Create function' => 'Fonksiyon yarat',
'Routine has been dropped.' => 'Yordam düşürüldü.',
'Routine has been altered.' => 'Yordam değiştirildi.',
'Routine has been created.' => 'Yordam yaratıldı.',
'Alter function' => 'Değiştirme fonksyionu',
'Alter procedure' => 'Değiştirme yöntemi',
'Return type' => 'Geri dönüş türü',
'Events' => 'Olaylar',
'Event has been dropped.' => 'Olay düşüdüldü.',
'Event has been altered.' => 'Olay değiştirildi.',
'Event has been created.' => 'Olay yaratıldı.',
'Alter event' => 'Değiştirme olayı',
'Create event' => 'Yaratma olayı',
'At given time' => 'Bir anda',
'Every' => 'Herzaman',
'Schedule' => 'Takvimli',
'Start' => 'Başla',
'End' => 'Son',
'On completion preserve' => 'Tamamlama koruması AÇIK',
'Tables' => 'Tablolar',
'Tables and views' => 'Tablolar ve görünümler',
'Table' => 'Tablo',
'No tables.' => 'Tablo yok.',
'Alter table' => 'Tablo değiştir',
'Create table' => 'Tablo yarat',
'Create new table' => 'Yeni tablo yarat',
'Table has been dropped.' => 'Tablo düşürüldü.',
'Tables have been dropped.' => 'Tablolar düşürüldü.',
'Table has been altered.' => 'Tablo değiştirildi.',
'Table has been created.' => 'Tablo yaratıldı.',
'Table name' => 'Tablo adı',
'Show structure' => 'Yapıyı göster',
'engine' => 'motor',
'collation' => 'karşılaştırma',
'Column name' => 'Kolon adı',
'Type' => 'Tür',
'Length' => 'Uzunluk',
'Auto Increment' => 'Otomatik yükselt',
'Options' => 'Seçenekler',
'Comment' => 'Yorum',
'Default values' => 'Varsayılan değerler',
'Drop' => 'Düşür',
'Are you sure?' => 'Emin misin?',
'Move up' => 'Yukarı taşı',
'Move down' => 'AŞağı taş',
'Remove' => 'Kaldır',
'Maximum number of allowed fields exceeded. Please increase %s and %s.' => 'kabul edilebilir alan sayısııldı. Lütfen %s ve %s düşürün.',
'Partition by' => 'Bölümü tarafından',
'Partitions' => 'Bölümler',
'Partition name' => 'BÖlüm adı',
'Values' => 'Değerler',
'View' => 'Görünüm',
'View has been dropped.' => 'Görünüm düşürüldü.',
'View has been altered.' => 'Görünüm değiştirildi.',
'View has been created.' => 'Görünüm yaratıldı.',
'Alter view' => 'Değişim görünüm',
'Create view' => 'Görünüm yarat',
'Indexes' => 'Dizinler',
'Indexes have been altered.' => 'Dizinler değiştirilidi.',
'Alter indexes' => 'Dizinleri değiştir',
'Add next' => 'Sonraya ekle',
'Index Type' => 'Dizin Türü',
'Column (length)' => 'Kolon (uzunluğu)',
'Foreign keys' => 'Dış anahtarlar',
'Foreign key' => 'Dış anahtar',
'Foreign key has been dropped.' => 'Dış anahtar düşürüldü.',
'Foreign key has been altered.' => 'Dış anahtar değiştir.',
'Foreign key has been created.' => 'Dış anahtar yarat.',
'Target table' => 'Hedef tablo',
'Change' => 'Değiş',
'Source' => 'Kaynak',
'Target' => 'Hedef',
'Add column' => 'Kolon eklde',
'Alter' => 'Değiştir',
'Add foreign key' => 'Dış anahtar ekle',
'ON DELETE' => 'Silinmek üzere',
'ON UPDATE' => 'Yükseltilmek üzere',
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Kaynak ve hedef kolonlar aynı veri türü olmak zorunda, hedef kolonda bir dizin ve başvurulan veri bulunmalı.',
'Triggers' => 'Tetikler',
'Add trigger' => 'Tetik ekle',
'Trigger has been dropped.' => 'Tetik düşürüldü.',
'Trigger has been altered.' => 'Tetik değiştirildi.',
'Trigger has been created.' => 'Tetik yaratıldı.',
'Alter trigger' => 'Tetik değiştir.',
'Create trigger' => 'Tetik yarat',
'Time' => 'Zaman',
'Event' => 'Olay',
'Name' => 'Ad',
'select' => 'seç',
'Select' => 'Seç',
'Select data' => 'Veri seç',
'Functions' => 'Fonksiyonlar',
'Aggregation' => 'Kümeleme',
'Search' => 'Arama',
'anywhere' => 'herhangi bir yer',
'Search data in tables' => 'Tablolarda veri ara.',
'Sort' => 'Sırala',
'descending' => 'azalan',
'Limit' => 'sınır',
'Text length' => 'Yazı uzunluğu',
'Action' => 'Eylem',
'Unable to select the table' => 'Tablo seçilemedi',
'No rows.' => 'Sıra yok.',
'%d row(s)' => array('%d sıra)', '%d kadar sıra'),
'Page' => 'Sayfa',
'last' => 'son',
'Last page' => 'Son sayfa',
'whole result' => 'tüm sonuç',
'%d byte(s)' => array('%d bayt', '%d kadar bayt'),
'Import' => 'İthal',
'%d row(s) have been imported.' => array('%d sıra ithal edildi.', '%d kadar sıra ithal edildi.'),
// in-place editing in select
'Double click on a value to modify it.' => 'Değerin üzerine çift tıklayın ve değiştirin.',
'Use edit link to modify this value.' => 'Değeri değiştirmek için düzenleme bağlantısını kullanın.',
// %s can contain auto-increment value
'Item%s has been inserted.' => 'Öğeler eklendi.',
'Item has been deleted.' => 'Öğe silindi.',
'Item has been updated.' => 'Öğe güncellendi.',
'%d item(s) have been affected.' => array('%d öğe etkilendi.', '%d kadar öğe etkilendi.'),
'New item' => 'Yeni öğe',
'original' => 'orijinal',
// label for value '' in enum data type
'empty' => 'boş',
'edit' => 'düzen',
'Edit' => 'Düzen',
'Insert' => 'Ekle',
'Save' => 'Kaydet',
'Save and continue edit' => 'Kaydet ve düzenlemeye devam et',
'Save and insert next' => 'Kaydet ve sonrakin ekle',
'Clone' => 'Klonla',
'Delete' => 'Sil',
'E-mail' => 'E-posta',
'From' => 'Gönderen',
'Subject' => 'Konu',
'Attachments' => 'Ekler',
'Send' => 'Gönder',
'%d e-mail(s) have been sent.' => array('%d e-posta dönderildi.', '%d kadar e-posta gönderildi.'),
// data type descriptions
'Numbers' => 'Sayılar',
'Date and time' => 'Tarih ve zaman',
'Strings' => 'Sözcükler',
'Binary' => 'İkili',
'Lists' => 'Listeler',
'Network' => 'Ağ',
'Geometry' => 'Geometri',
'Relations' => 'İlişkiler',
'Editor' => 'Düzenleyici',
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
'$1-$3-$5' => '$6.$4.$1',
// hint for date format - use language equivalents for day, month and year shortcuts
'[yyyy]-mm-dd' => 'd.m.[rrrr]',
'now' => 'şimdi',
// general SQLite error in create, drop or rename database
'File exists.' => 'Dosya mevcut.',
'Please use one of the extensions %s.' => '%s uzantılarından birini kullanın.',
// PostgreSQL and MS SQL schema support
'Alter schema' => 'Değişim şeması',
'Create schema' => 'Yaratım şeması',
'Schema has been dropped.' => 'Şema düşürüldü.',
'Schema has been created.' => 'Şema yaratıldı.',
'Schema has been altered.' => 'Şema değiştirildi.',
'schema' => 'şema',
'Schema' => 'Şema',
'Invalid schema.' => 'Geçersiz şema.',
// PostgreSQL sequences support
'Sequences' => 'Diziler',
'Create sequence' => 'Dizi yarat',
'Sequence has been dropped.' => 'Dizi düşürüldü.',
'Sequence has been created.' => 'Dizi yaratıldı.',
'Sequence has been altered.' => 'Dizi değiştirildi.',
'Alter sequence' => 'Dizi değiştir',
// PostgreSQL user types support
'User types' => 'Kullanıcı türleri',
'Create type' => 'Tür yarat',
'Type has been dropped.' => 'Tür düşürüldü.',
'Type has been created.' => 'Tür yaratıldı.',
'Alter type' => 'Tür değiştir',
);

View File

@@ -23,7 +23,7 @@ $translations = array(
'Options' => '選項',
'Save' => '儲存',
'Drop' => '丟棄',
'Database has been dropped.' => '資料庫已刪除。',
'Database has been dropped.' => '已丟棄資料庫。',
'Database has been created.' => '已建立資料庫。',
'Database has been renamed.' => '已重新命名資料庫。',
'Database has been altered.' => '已更改資料庫。',
@@ -38,7 +38,7 @@ $translations = array(
'select' => '選擇',
'Create new table' => '建立新資料表',
'Item has been updated.' => '已更新項目。',
'Item%s has been inserted.' => '已插入項目%s。',
'Item has been inserted.' => '已插入項目。',
'Edit' => '編輯',
'Insert' => '插入',
'Save and insert next' => '儲存並插入下一個',
@@ -195,6 +195,7 @@ $translations = array(
'Values' => '值',
'%d row(s) have been imported.' => '%d行已導入。',
'anywhere' => '任意位置',
'CSV Import' => '匯入 CSV',
'Import' => '匯入',
'Stop on error' => '出錯時停止',
'%.3f s' => '%.3f秒',
@@ -224,44 +225,4 @@ $translations = array(
'%d in total' => '總共 %d 個',
'Permanent login' => '永久登入',
'Table has been dropped.' => '已經刪除資料表。',
'Databases have been dropped.' => '資料庫已刪除。',
'Search data in tables' => '在資料庫搜尋',
'schema' => '資料表結構',
'Schema' => '資料表結構',
'Alter schema' => '更改資料表結構',
'Create schema' => '建立資料表結構',
'Schema has been dropped.' => '已刪除資料表結構。',
'Schema has been created.' => '已建立資料表結構。',
'Schema has been altered.' => '已更改資料表結構。',
'Sequences' => 'Sequences',
'Create sequence' => '建立 sequence',
'Alter sequence' => '更改 sequence',
'Sequence has been dropped.' => '已刪除 sequence。',
'Sequence has been created.' => '已建立 sequence。',
'Sequence has been altered.' => '已更改 sequence。',
'User types' => '使用者類型',
'Create type' => '建立類型',
'Alter type' => '更改類型',
'Type has been dropped.' => '已刪除類型。',
'Type has been created.' => '已建立類型。',
'Double click on a value to modify it.' => '雙擊以進行修改。',
'Use edit link to modify this value.' => '使用編輯連結來修改。',
'last' => '最後一頁',
'From server' => '從伺服器',
'System' => '資料庫系統',
'Select data' => '選擇資料',
'Show structure' => '秀出結構',
'empty' => '空值',
'Network' => '網路',
'Geometry' => '幾何',
'File exists.' => '檔案已存在。',
'Attachments' => '附件',
'%d query(s) executed OK.' => '已順利執行 %d 個查詢。',
'Show only errors' => '僅顯示錯誤訊息',
'Last page' => '最後一頁',
'Refresh' => '重新載入',
'Invalid schema.' => '無效的資料表結構。',
'Please use one of the extensions %s.' => '請使用下列其中一個 extension %s。',
'now' => '現在',
'ltr' => 'ltr',
);

View File

@@ -40,7 +40,7 @@ $translations = array(
'Create new table' => '创建新表',
'Item has been deleted.' => '已删除项目。',
'Item has been updated.' => '已更新项目。',
'Item%s has been inserted.' => '已插入项目%s。',
'Item has been inserted.' => '已插入项目。',
'Edit' => '编辑',
'Insert' => '插入',
'Save and insert next' => '保存并插入下一个',
@@ -62,7 +62,7 @@ $translations = array(
'Action' => '动作',
'edit' => '编辑',
'Page' => '页面',
'Query executed OK, %d row(s) affected.' => '执行查询OK%d 行受影响',
'Query executed OK, %d row(s) affected.' => '执行查询OK%d 行受影响',
'Error in query' => '查询出错',
'Execute' => '执行',
'Table' => '表',
@@ -78,7 +78,7 @@ $translations = array(
'Unable to upload a file.' => '不能上传文件。',
'File upload' => '文件上传',
'File uploads are disabled.' => '文件上传被禁用。',
'Routine has been called, %d row(s) affected.' => '子程序被调用,%d 行被影响',
'Routine has been called, %d row(s) affected.' => '子程序被调用,%d 行被影响',
'Call' => '调用',
'No extension' => '没有扩展',
'None of the supported PHP extensions (%s) are available.' => '没有支持的 PHP 扩展可用(%s。',
@@ -197,6 +197,7 @@ $translations = array(
'Values' => '值',
'%d row(s) have been imported.' => '%d 行已导入。',
'anywhere' => '任意位置',
'CSV Import' => 'CSV 导入',
'Import' => '导入',
'Stop on error' => '出错时停止',
'%.3f s' => '%.3f 秒',
@@ -221,47 +222,7 @@ $translations = array(
'Send' => '发送',
'%d e-mail(s) have been sent.' => '%d 封邮件已发送。',
'Webserver file %s' => 'Web服务器文件 %s',
'File does not exist.' => '文件不存在',
'File does not exist.' => '文件不存在',
'%d in total' => '共计 %d',
'Permanent login' => '保持登录',
'Databases have been dropped.' => '已丢弃数据库。',
'Search data in tables' => '在表中搜索数据',
'schema' => '模式',
'Schema' => '模式',
'Alter schema' => '更改模式',
'Create schema' => '创建模式',
'Schema has been dropped.' => '已丢弃模式。',
'Schema has been created.' => '已创建模式。',
'Schema has been altered.' => '已更改模式。',
'Sequences' => '序列',
'Create sequence' => '创建序列',
'Alter sequence' => '更改序列',
'Sequence has been dropped.' => '已丢弃序列。',
'Sequence has been created.' => '已创建序列。',
'Sequence has been altered.' => '已更改序列。',
'User types' => '用户类型',
'Create type' => '创建类型',
'Alter type' => '更改类型',
'Type has been dropped.' => '已丢弃类型。',
'Type has been created.' => '已创建类型。',
'Double click on a value to modify it.' => '在值上双击类修改它。',
'Use edit link to modify this value.' => '使用编辑链接来修改该值。',
'last' => '最后',
'From server' => '来自服务器',
'System' => '系统',
'Select data' => '选择数据',
'Show structure' => '显示结构',
'empty' => '空',
'Network' => '网络',
'Geometry' => '几何图形',
'File exists.' => '文件已存在。',
'Attachments' => '附件',
'%d query(s) executed OK.' => '%d 条查询已成功执行。',
'Show only errors' => '仅显示错误',
'Last page' => '末页',
'Refresh' => '刷新',
'Invalid schema.' => '非法模式。',
'Please use one of the extensions %s.' => '请使用这些扩展中的一个:%s。',
'now' => '现在',
'ltr' => 'ltr',
);

View File

@@ -1,32 +0,0 @@
<?php
function adminer_object() {
// required to run any plugin
include_once "../plugins/plugin.php";
// autoloader
foreach (glob("../plugins/*.php") as $filename) {
include_once $filename;
}
/* It is possible to combine customization and plugins:
class AdminerCustomization extends AdminerPlugin {
}
return new AdminerCustomization($plugins);
*/
return new AdminerPlugin(array(
// specify enabled plugins here
new AdminerDumpZip,
new AdminerDumpXml,
new AdminerEditCalendar("<script type='text/javascript' src='../externals/jquery-ui/jquery-1.4.4.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.core.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.widget.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.datepicker.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.mouse.js'></script>\n<script type='text/javascript' src='../externals/jquery-ui/ui/jquery.ui.slider.js'></script>\n<script type='text/javascript' src='../externals/jquery-timepicker/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' href='../externals/jquery-ui/themes/base/jquery.ui.all.css'>\n<style type='text/css'>\n.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }\n.ui-timepicker-div dl { text-align: left; }\n.ui-timepicker-div dl dt { height: 25px; }\n.ui-timepicker-div dl dd { margin: -25px 0 10px 65px; }\n.ui-timepicker-div td { font-size: 90%; }\n</style>\n", "../externals/jquery-ui/ui/i18n/jquery.ui.datepicker-%s.js"),
new AdminerTinymce("../externals/tinymce/jscripts/tiny_mce/tiny_mce_dev.js"),
new AdminerFileUpload(""),
new AdminerSlugify,
new AdminerTranslation,
new AdminerForeignSystem,
new AdminerEnumOption,
));
}
// include original Adminer or Adminer Editor (usually named adminer.php)
include "./index.php";

View File

@@ -14,7 +14,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"] && !$_POST["up"]
}
$dropped = drop_create(
"DROP $routine " . idf_escape($PROCEDURE),
"CREATE $routine " . idf_escape($_POST["name"]) . " (" . implode(", ", $set) . ")" . (isset($_GET["function"]) ? " RETURNS" . process_type($_POST["returns"], "CHARACTER SET") : "") . rtrim("\n$_POST[definition]", ";") . ";",
"CREATE $routine " . idf_escape($_POST["name"]) . " (" . implode(", ", $set) . ")" . (isset($_GET["function"]) ? " RETURNS" . process_type($_POST["returns"], "CHARACTER SET") : "") . "\n$_POST[definition]",
substr(ME, 0, -1),
lang('Routine has been dropped.'),
lang('Routine has been altered.'),
@@ -39,7 +39,6 @@ if ($_POST) {
?>
<form action="" method="post" id="form">
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64">
<table cellspacing="0" class="nowrap">
<?php
edit_fields($row["fields"], $collations, $routine);
@@ -51,8 +50,9 @@ if (isset($_GET["function"])) {
</table>
<p><?php textarea("definition", $row["definition"]); ?>
<p>
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($PROCEDURE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
<?php if ($dropped) { ?><input type="hidden" name="dropped" value="1"><?php } ?>
<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 h($row["name"]); ?>" maxlength="64">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($PROCEDURE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
</form>

View File

@@ -2,7 +2,7 @@
if ($_POST && !$error) {
$killed = 0;
foreach ((array) $_POST["kill"] as $val) {
if (queries("KILL " . (+$val))) {
if (queries("KILL " . ereg_replace("[^0-9]+", "", $val))) {
$killed++;
}
}
@@ -13,23 +13,18 @@ page_header(lang('Process list'), $error);
?>
<form action="" method="post">
<table cellspacing="0" onclick="tableClick(event);" class="nowrap">
<table cellspacing="0" onclick="tableClick(event);">
<?php
$i = -1;
foreach (get_rows("SHOW FULL PROCESSLIST") as $i => $row) {
$result = $connection->query("SHOW PROCESSLIST");
for ($i=0; $row = $result->fetch_assoc(); $i++) {
if (!$i) {
echo "<thead><tr lang='en'><th>&nbsp;<th>" . implode("<th>", array_keys($row)) . "</thead>\n";
}
echo "<tr" . odd() . "><td>" . checkbox("kill[]", $row["Id"], 0);
foreach ($row as $key => $val) {
echo "<td>" . ($key == "Info" && $val != "" ? "<code class='jush-$jush'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Edit') . '</a>' : nbsp($val));
}
echo "\n";
echo "<tr" . odd() . "><td>" . checkbox("kill[]", $row["Id"], 0) . "<td>" . implode("<td>", array_map('nbsp', $row)) . "\n";
}
?>
</table>
<p><?php echo ($i + 1) . "/" . lang('%d in total', $connection->result("SELECT @@max_connections")); ?>
<p>
<input type="submit" value="<?php echo lang('Kill'); ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Kill'); ?>">
</form>

View File

@@ -4,11 +4,10 @@ page_header(lang('Database schema'), "", array(), DB);
$table_pos = array();
$table_pos_js = array();
// saved in one cookie because there is a limit of 20 cookies per domain
$name = "adminer_schema";
preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~', ($_GET["schema"] ? $_GET["schema"] : $_COOKIE[($_COOKIE["$name-" . DB] ? "$name-" . DB : $name)]), $matches, PREG_SET_ORDER); // $_COOKIE["adminer_schema"] was used before 3.2.0 //! ':' in table name
preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~', $_COOKIE["adminer_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'" . js_escape($match[1]) . "': [ $match[2], $match[3] ]";
$table_pos_js[] = "\n\t'" . addcslashes($match[1], "\r\n'\\/") . "': [ $match[2], $match[3] ]";
}
$top = 0;
@@ -28,21 +27,23 @@ foreach (table_status() as $row) {
$schema[$row["Name"]]["fields"][$name] = $field;
}
$schema[$row["Name"]]["pos"] = ($table_pos[$row["Name"]] ? $table_pos[$row["Name"]] : array($top, 0));
foreach ($adminer->foreignKeys($row["Name"]) as $val) {
if (!$val["db"]) {
$left = $base_left;
if ($table_pos[$row["Name"]][1] || $table_pos[$val["table"]][1]) {
$left = min(floatval($table_pos[$row["Name"]][1]), floatval($table_pos[$val["table"]][1])) - 1;
} else {
$base_left -= .1;
if (fk_support($row)) {
foreach (foreign_keys($row["Name"]) as $val) {
if (!$val["db"]) {
$left = $base_left;
if ($table_pos[$row["Name"]][1] || $table_pos[$val["table"]][1]) {
$left = min(floatval($table_pos[$row["Name"]][1]), floatval($table_pos[$val["table"]][1])) - 1;
} else {
$base_left -= .1;
}
while ($lefts[(string) $left]) {
// find free $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;
}
while ($lefts[(string) $left]) {
// find free $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);
@@ -54,17 +55,15 @@ foreach (table_status() as $row) {
tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
em = document.getElementById('schema').offsetHeight / <?php echo $top; ?>;
document.onmousemove = schemaMousemove;
document.onmouseup = function (ev) {
schemaMouseup(ev, '<?php echo js_escape(DB); ?>');
};
document.onmouseup = schemaMouseup;
</script>
<?php
foreach ($schema as $name => $table) {
echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;' onmousedown='schemaMousedown(this, event);'>";
echo '<a href="' . h(ME) . 'table=' . urlencode($name) . '"><b>' . h($name) . "</b></a><br>\n";
echo '<a href="' . h(ME) . 'table=' . urlencode($name) . '"><strong>' . h($name) . "</strong></a><br>\n";
foreach ($table["fields"] as $field) {
$val = '<span' . type_class($field["type"]) . ' title="' . h($field["full_type"] . ($field["null"] ? " NULL" : '')) . '">' . h($field["field"]) . '</span>';
echo ($field["primary"] ? "<i>$val</i>" : $val) . "<br>\n";
echo ($field["primary"] ? "<em>$val</em>" : $val) . "<br>\n";
}
foreach ((array) $table["references"] as $target_name => $refs) {
foreach ($refs as $left => $ref) {
@@ -103,4 +102,3 @@ foreach ($schema as $name => $table) {
}
?>
</div>
<p><a href="<?php echo h($_SERVER["REQUEST_URI"]); ?>" id="schema-link"><?php echo lang('Permanent link'); ?></a>

View File

@@ -25,11 +25,11 @@ if ($_POST) {
<form action="" method="post">
<p><input name="name" value="<?php echo h($row["name"]); ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php
if ($_GET["ns"] != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n";
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
}
?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form>

View File

@@ -1,37 +0,0 @@
<?php
header("Content-Type: text/javascript; charset=utf-8");
if ($_GET["script"] == "db") {
$sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0);
foreach (table_status() as $row) {
$id = js_escape($row["Name"]);
json_row("Comment-$id", nbsp($row["Comment"]));
if (!is_view($row)) {
foreach (array("Engine", "Collation") as $key) {
json_row("$key-$id", nbsp($row[$key]));
}
foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) {
if ($row[$key] != "") {
$val = number_format($row[$key], 0, '.', lang(','));
json_row("$key-$id", ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? "~ $val" : $val));
if (isset($sums[$key])) {
$sums[$key] += ($row["Engine"] != "InnoDB" || $key != "Data_free" ? $row[$key] : 0);
}
} elseif (array_key_exists($key, $row)) {
json_row("$key-$id");
}
}
}
}
foreach ($sums as $key => $val) {
json_row("sum-$key", number_format($val, 0, '.', lang(',')));
}
json_row("");
} else { // connect
foreach (count_tables(get_databases()) as $db => $val) {
json_row("tables-" . js_escape($db), $val);
}
json_row("");
}
exit; // don't print footer

View File

@@ -4,9 +4,6 @@ $table_status = table_status($TABLE);
$indexes = indexes($TABLE);
$fields = fields($TABLE);
$foreign_keys = column_foreign_keys($TABLE);
if ($table_status["Oid"] == "t") {
$indexes[] = array("type" => "PRIMARY", "columns" => array("oid"));
}
$rights = array(); // privilege => 0
$columns = array(); // selectable columns
@@ -15,7 +12,7 @@ foreach ($fields as $key => $field) {
$name = $adminer->fieldName($field);
if (isset($field["privileges"]["select"]) && $name != "") {
$columns[$key] = html_entity_decode(strip_tags($name));
if (ereg('text|lob', $field["type"])) {
if (ereg('text|blob', $field["type"])) {
$text_length = $adminer->selectLengthProcess();
}
}
@@ -26,51 +23,45 @@ list($select, $group) = $adminer->selectColumnsProcess($columns, $indexes);
$where = $adminer->selectSearchProcess($fields, $indexes);
$order = $adminer->selectOrderProcess($fields, $indexes);
$limit = $adminer->selectLimitProcess();
$from = ($select ? implode(", ", $select) : ($table_status["Oid"] == "t" ? "oid, " : "") . "*") . "\nFROM " . table($TABLE);
$from = ($select ? implode(", ", $select) : "*") . "\nFROM " . table($TABLE);
$group_by = ($group && count($group) < count($select) ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : "");
if ($_GET["val"] && is_ajax()) {
header("Content-Type: text/plain; charset=utf-8");
foreach ($_GET["val"] as $unique_idf => $row) {
echo $connection->result("SELECT" . limit(idf_escape(key($row)) . " FROM " . table($TABLE), " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : "") . ($order ? " ORDER BY " . implode(", ", $order) : ""), 1));
}
exit;
}
if ($_POST && !$error) {
$where_check = "(" . implode(") OR (", array_map('where_check', (array) $_POST["check"])) . ")";
$primary = $unselected = null;
foreach ($indexes as $index) {
if ($index["type"] == "PRIMARY") {
$primary = array_flip($index["columns"]);
$unselected = ($select ? $primary : array());
break;
}
}
$primary = ($indexes["PRIMARY"] ? ($select ? array_flip($indexes["PRIMARY"]["columns"]) : array()) : null); // empty array means that all primary fields are selected
foreach ($select as $key => $val) {
$val = $_GET["columns"][$key];
if (!$val["fun"]) {
unset($unselected[$val["col"]]);
unset($primary[$val["col"]]);
}
}
if ($_POST["export"]) {
dump_headers($TABLE);
$adminer->dumpTable($TABLE, "");
if (!is_array($_POST["check"]) || $unselected === array()) {
dump_table($TABLE, "");
if ($_POST["format"] != "sql") { // Editor doesn't send format
$row = array_keys($fields);
if ($select) {
$row = array();
foreach ($select as $val) {
$row[] = (ereg('^`.*`$', $val) ? idf_unescape($val) : $val); //! columns looking like functions
}
}
dump_csv($row);
}
if (!is_array($_POST["check"]) || $primary === array()) {
$where2 = $where;
if (is_array($_POST["check"])) {
$where2[] = "($where_check)";
}
$query = "SELECT $from" . ($where2 ? "\nWHERE " . implode(" AND ", $where2) : "") . $group_by;
dump_data($TABLE, "INSERT", "SELECT $from" . ($where2 ? "\nWHERE " . implode(" AND ", $where2) : "") . $group_by);
} else {
$union = array();
foreach ($_POST["check"] as $val) {
// where is not unique so OR can't be used
$union[] = "(SELECT" . limit($from, "\nWHERE " . ($where ? implode(" AND ", $where) . " AND " : "") . where_check($val) . $group_by, 1) . ")";
}
$query = implode(" UNION ALL ", $union);
dump_data($TABLE, "INSERT", implode(" UNION ALL ", $union));
}
$adminer->dumpData($TABLE, "table", $query);
exit;
}
if (!$adminer->selectEmailProcess($where, $foreign_keys)) {
@@ -102,7 +93,7 @@ if ($_POST && !$error) {
$command = "INSERT";
$query = "INTO $query";
}
if ($_POST["all"] || ($unselected === array() && $_POST["check"]) || count($group) < count($select)) {
if ($_POST["all"] || ($primary === array() && $_POST["check"]) || count($group) < count($select)) {
$result = queries($command . " $query" . ($_POST["all"] ? ($where ? "\nWHERE " . implode(" AND ", $where) : "") : "\nWHERE $where_check"));
$affected = $connection->affected_rows;
} else {
@@ -128,11 +119,9 @@ if ($_POST && !$error) {
$set = array();
foreach ($row as $key => $val) {
$key = bracket_escape($key, 1); // 1 - back
$set[] = idf_escape($key) . " = " . (ereg('char|text', $fields[$key]["type"]) || $val != "" ? $adminer->processInput($fields[$key], $val) : "NULL");
$set[] = idf_escape($key) . " = " . $adminer->processInput($fields[$key], $val);
}
$query = table($TABLE) . " SET " . implode(", ", $set);
$where2 = " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : "");
$result = queries("UPDATE" . (count($group) < count($select) ? " $query$where2" : limit1($query, $where2))); // can change row on a different page without unique key
$result = queries("UPDATE" . limit1(table($TABLE) . " SET " . implode(", ", $set), " WHERE " . where_check($unique_idf) . ($where ? " AND " . implode(" AND ", $where) : ""))); // can change row on a different page without unique key
if (!$result) {
break;
}
@@ -141,13 +130,13 @@ if ($_POST && !$error) {
queries_redirect(remove_from_uri(), lang('%d item(s) have been affected.', $affected), $result);
}
} elseif (is_string($file = get_file("csv_file", true))) {
//! character set
$file = preg_replace("~^\xEF\xBB\xBF~", '', $file); //! character set
$result = true;
$cols = array_keys($fields);
preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~', $file, $matches);
$affected = count($matches[0]);
begin();
$separator = ($_POST["separator"] == "csv" ? "," : ($_POST["separator"] == "tsv" ? "\t" : ";"));
$separator = ($_POST["separator"] == "csv" ? "," : ";");
foreach ($matches[0] as $key => $val) {
preg_match_all("~((\"[^\"]*\")+|[^$separator]*)$separator~", $val . $separator, $matches2);
if (!$key && !array_diff($matches2[1], $cols)) { //! doesn't work with column names containing ",\n
@@ -155,11 +144,12 @@ if ($_POST && !$error) {
$cols = $matches2[1];
$affected--;
} else {
$set = array();
$set = "";
foreach ($matches2[1] as $i => $col) {
$set[idf_escape($cols[$i])] = ($col == "" && $fields[$cols[$i]]["null"] ? "NULL" : q(str_replace('""', '"', preg_replace('~^"|"$~', '', $col))));
$set .= ", " . idf_escape($cols[$i]) . " = " . ($col == "" && $fields[$cols[$i]]["null"] ? "NULL" : $connection->quote(str_replace('""', '"', preg_replace('~^"|"$~', '', $col))));
}
$result = insert_update($TABLE, $set, $primary);
$set = substr($set, 1);
$result = queries("INSERT INTO " . table($TABLE) . " SET$set ON DUPLICATE KEY UPDATE$set");
if (!$result) {
break;
}
@@ -169,7 +159,7 @@ if ($_POST && !$error) {
queries("COMMIT");
}
queries_redirect(remove_from_uri("page"), lang('%d row(s) have been imported.', $affected), $result);
queries("ROLLBACK"); // after queries_redirect() to not overwrite error
queries("ROLLBACK");
} else {
$error = upload_error($file);
}
@@ -213,10 +203,10 @@ if (!$columns) {
$page = $_GET["page"];
if ($page == "last") {
$found_rows = $connection->result("SELECT COUNT(*) FROM " . table($TABLE) . ($where ? " WHERE " . implode(" AND ", $where) : ""));
$page = floor(max(0, $found_rows - 1) / $limit);
$page = floor(($found_rows - 1) / $limit);
}
$query = "SELECT" . limit((+$limit && $group && count($group) < count($select) && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . $from, ($where ? "\nWHERE " . implode(" AND ", $where) : "") . $group_by, ($limit != "" ? +$limit : null), ($page ? $limit * $page : 0), "\n");
$query = "SELECT" . limit((intval($limit) && $group && count($group) < count($select) && $jush == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . $from, ($where ? "\nWHERE " . implode(" AND ", $where) : "") . $group_by, ($limit != "" ? intval($limit) : null), ($page ? $limit * $page : 0), "\n");
echo $adminer->selectQuery($query);
$result = $connection->query($query);
@@ -234,7 +224,7 @@ if (!$columns) {
}
// use count($rows) without LIMIT, COUNT(*) without grouping, FOUND_ROWS otherwise (slowest)
if ($_GET["page"] != "last") {
$found_rows = (+$limit && $group && count($group) < count($select)
$found_rows = (intval($limit) && $group && count($group) < count($select)
? ($jush == "sql" ? $connection->result(" SELECT FOUND_ROWS()") : $connection->result("SELECT COUNT(*) FROM ($query) x")) // space to allow mysql.trace_mode
: count($rows)
);
@@ -245,26 +235,23 @@ if (!$columns) {
} else {
$backward_keys = $adminer->backwardKeys($TABLE, $table_name);
echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);' onkeydown='return editingKeydown(event);'>\n";
echo "<thead><tr>" . (!$group && $select ? "" : "<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='" . h($_GET["modify"] ? remove_from_uri("modify") : $_SERVER["REQUEST_URI"] . "&modify=1") . "'>" . lang('edit') . "</a>");
echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
echo "<thead><tr><td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='" . h($_GET["modify"] ? remove_from_uri("modify") : $_SERVER["REQUEST_URI"] . "&modify=1") . "'>" . lang('edit') . "</a>";
$names = array();
$functions = array();
reset($select);
$rank = 1;
$order = 1;
foreach ($rows[0] as $key => $val) {
if ($table_status["Oid"] != "t" || $key != "oid") {
$val = $_GET["columns"][key($select)];
$field = $fields[$select ? $val["col"] : $key];
$name = ($field ? $adminer->fieldName($field, $rank) : "*");
if ($name != "") {
$rank++;
$names[$key] = $name;
$column = idf_escape($key);
echo '<th><a href="' . h(remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key) . ($order[0] == $column || $order[0] == $key || (!$order && $group[0] == $column) ? '&desc%5B0%5D=1' : '')) . '">' . apply_sql_function($val["fun"], $name) . "</a>"; // $order[0] == $key - COUNT(*) //! columns looking like functions
}
$functions[$key] = $val["fun"];
next($select);
$val = $_GET["columns"][key($select)];
$field = $fields[$select ? $val["col"] : $key];
$name = ($field ? $adminer->fieldName($field, $order) : "*");
if ($name != "") {
$order++;
$names[$key] = $name;
echo '<th><a href="' . h(remove_from_uri('(order|desc)[^=]*|page') . '&order%5B0%5D=' . urlencode($key) . ($_GET["order"][0] == $key && !$_GET["desc"][0] ? '&desc%5B0%5D=1' : '')) . '">' . apply_sql_function($val["fun"], $name) . "</a>"; //! columns looking like functions
}
$functions[$key] = $val["fun"];
next($select);
}
$lengths = array();
if ($_GET["modify"]) {
@@ -281,40 +268,37 @@ if (!$columns) {
foreach ($unique_array as $key => $val) {
$unique_idf .= "&" . (isset($val) ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key));
}
echo "<tr" . odd() . ">" . (!$group && $select ? "" : "<td>" . checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]), "", "this.form['all'].checked = false; formUncheck('all-page');") . (count($group) < count($select) || information_schema(DB) ? "" : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "'>" . lang('edit') . "</a>"));
echo "<tr" . odd() . "><td>" . checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]), "", "this.form['all'].checked = false; formUncheck('all-page');") . (count($select) != count($group) || information_schema(DB) ? '' : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "'>" . lang('edit') . "</a>");
foreach ($row as $key => $val) {
if (isset($names[$key])) {
$field = $fields[$key];
if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) {
$email_fields[$key] = (is_mail($val) ? $names[$key] : ""); //! filled e-mails can be contained on other pages
$email_fields[$key] = (is_email($val) ? $names[$key] : ""); //! filled e-mails can be contained on other pages
}
$link = "";
$val = $adminer->editVal($val, $field);
if (!isset($val)) {
$val = "<i>NULL</i>";
} else {
if (ereg('blob|bytea|raw|file', $field["type"]) && $val != "") {
if (ereg('binary|blob|bytea', $field["type"]) && $val != "") {
$link = h(ME . 'download=' . urlencode($TABLE) . '&field=' . urlencode($key) . $unique_idf);
}
if ($val === "") { // === - may be int
if ($val == "") {
$val = "&nbsp;";
} elseif ($text_length != "" && ereg('text|blob', $field["type"]) && is_utf8($val)) {
$val = shorten_utf8($val, max(0, +$text_length)); // usage of LEFT() would reduce traffic but complicate query - expected average speedup: .001 s VS .01 s on local network
$val = shorten_utf8($val, max(0, intval($text_length))); // usage of LEFT() would reduce traffic but complicate query - expected average speedup: .001 s VS .01 s on local network
} else {
$val = h($val);
}
if (!$link) { // link related items
foreach ((array) $foreign_keys[$key] as $foreign_key) {
if (count($foreign_keys[$key]) == 1 || end($foreign_key["source"]) == $key) {
$link = "";
if (count($foreign_keys[$key]) == 1 || count($foreign_key["source"]) == 1) {
foreach ($foreign_key["source"] as $i => $source) {
$link .= where_link($i, $foreign_key["target"][$i], $rows[$n][$source]);
}
$link = h(($foreign_key["db"] != "" ? preg_replace('~([?&]db=)[^&]+~', '\\1' . urlencode($foreign_key["db"]), ME) : ME) . 'select=' . urlencode($foreign_key["table"]) . $link); // InnoDB supports non-UNIQUE keys
if (count($foreign_key["source"]) == 1) {
break;
}
break;
}
}
}
@@ -327,36 +311,28 @@ if (!$columns) {
}
}
foreach ($unique_array as $k => $v) {
$link .= h(where_link($i++, $k, $v));
$link .= h(where_link($i++, $k, $v, (isset($v) ? "=" : "IS NULL")));
}
}
}
if (!$link) {
if (is_mail($val)) {
$link = "mailto:$val";
}
if ($protocol = is_url($row[$key])) {
$link = ($protocol == "http" && $HTTPS
? $row[$key] // HTTP links from HTTPS pages don't receive Referer automatically
: "$protocol://www.adminer.org/redirect/?url=" . urlencode($row[$key]) // intermediate page to hide Referer, may be changed to rel="noreferrer" in HTML5
);
}
if (!$link && is_email($val)) {
$link = "mailto:$val";
}
if (!$link && is_url($row[$key])) {
$link = "http://www.adminer.org/redirect/?url=" . urlencode($row[$key]); // intermediate page to hide Referer, may be changed to rel="noreferrer" in HTML5
}
$id = h("val[$unique_idf][" . bracket_escape($key) . "]");
$value = $_POST["val"][$unique_idf][bracket_escape($key)];
$h_value = h(isset($value) ? $value : $row[$key]);
$long = strpos($val, "<i>...</i>");
$editable = is_utf8($val) && $rows[$n][$key] == $row[$key] && !$functions[$key];
$text = ereg('text|lob', $field["type"]);
$long = strpos($val, "<em>...</em>");
$editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key];
$text = ereg('text|blob', $field["type"]);
echo (($_GET["modify"] && $editable) || isset($value)
? "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>")
: "<td id='$id' ondblclick=\"" . ($editable ? "selectDblClick(this, event" . ($long ? ", 2" : ($text ? ", 1" : "")) . ")" : "alert('" . h(lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)
: "<td id='$id' ondblclick=\"" . ($editable ? "selectDblClick(this, event" . ($text ? ", 1" : "") . ")" : "alert('" . ($long ? lang('Increase text length to modify this value.') : lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)
);
}
}
if ($backward_keys) {
echo "<td>";
}
$adminer->backwardKeysPrint($backward_keys, $rows[$n]);
echo "</tr>\n"; // close to allow white-space: pre
}
@@ -367,11 +343,11 @@ if (!$columns) {
if ($rows || $page) {
$exact_count = true;
if ($_GET["page"] != "last" && +$limit && count($group) >= count($select) && ($found_rows >= $limit || $page)) {
if ($_GET["page"] != "last" && intval($limit) && count($group) >= count($select) && ($found_rows >= $limit || $page)) {
$found_rows = $table_status["Rows"];
if (!isset($found_rows) || $where || ($table_status["Engine"] == "InnoDB" && $found_rows < max(1e4, 2 * ($page + 1) * $limit))) {
if (!isset($found_rows) || $where || 2 * $page * $limit > $found_rows || ($table_status["Engine"] == "InnoDB" && $found_rows < 1e4)) {
// slow with big tables
ob_flush(); //! doesn't work with AJAX
ob_flush();
flush();
$found_rows = $connection->result("SELECT COUNT(*) FROM " . table($TABLE) . ($where ? " WHERE " . implode(" AND ", $where) : ""));
} else {
@@ -379,11 +355,10 @@ if (!$columns) {
}
}
echo "<p class='pages'>";
if (+$limit && $found_rows > $limit) {
if (intval($limit) && $found_rows > $limit) {
// display first, previous 4, next 4 and last page
$max_page = floor(($found_rows - 1) / $limit);
echo '<a href="' . h(remove_from_uri("page")) . "\" onclick=\"pageClick(this.href, +prompt('" . lang('Page') . "', '" . ($page + 1) . "'), event); return false;\">" . lang('Page') . "</a>:";
echo pagination(0, $page) . ($page > 5 ? " ..." : "");
echo lang('Page') . ":" . pagination(0, $page) . ($page > 5 ? " ..." : "");
for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) {
echo pagination($i, $page);
}
@@ -394,7 +369,7 @@ if (!$columns) {
if (!information_schema(DB)) {
?>
<fieldset><legend><?php echo lang('Edit'); ?></legend><div>
<input type="submit" value="<?php echo lang('Save'); ?>" title="<?php echo lang('Double click on a value to modify it.'); ?>" class="jsonly">
<input type="submit" value="<?php echo lang('Save'); ?>" title="<?php echo lang('Double click on a value to modify it.'); ?>">
<input type="submit" name="edit" value="<?php echo lang('Edit'); ?>">
<input type="submit" name="clone" value="<?php echo lang('Clone'); ?>">
<input type="submit" name="delete" value="<?php echo lang('Delete'); ?>" onclick="return confirm('<?php echo lang('Are you sure?'); ?> (' + (this.form['all'].checked ? <?php echo $found_rows; ?> : formChecked(this, /check/)) + ')');">
@@ -402,17 +377,14 @@ if (!$columns) {
<?php
}
print_fieldset("export", lang('Export'));
$output = $adminer->dumpOutput();
echo ($output ? html_select("output", $output, $adminer_export["output"]) . " " : "");
echo html_select("format", $adminer->dumpFormat(), $adminer_export["format"]);
echo " <input type='submit' name='export' value='" . lang('Export') . "' onclick='eventStop(event);'>\n";
echo $adminer->dumpOutput(1, $adminer_export["output"]) . " " . $adminer->dumpFormat(1, $adminer_export["format"]); // 1 - select
echo " <input type='submit' name='export' value='" . lang('Export') . "'>\n";
echo "</div></fieldset>\n";
}
print_fieldset("import", lang('Import'), !$rows);
echo "<input type='file' name='csv_file'> ";
echo html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;", "tsv" => "TSV"), $adminer_export["format"], 1); // 1 - select
echo " <input type='submit' name='import' value='" . lang('Import') . "'>";
echo "<input type='hidden' name='token' value='$token'>\n";
print_fieldset("import", lang('CSV Import'), !$result->num_rows);
echo "<input type='hidden' name='token' value='$token'><input type='file' name='csv_file'> ";
echo html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;"), $adminer_export["format"], 1); // 1 - select
echo " <input type='submit' name='import' value='" . lang('Import') . "'>\n";
echo "</div></fieldset>\n";
$adminer->selectEmailPrint(array_filter($email_fields, 'strlen'), $columns);

View File

@@ -24,11 +24,11 @@ if ($_POST) {
<form action="" method="post">
<p><input name="name" value="<?php echo h($row["name"]); ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php
if ($SEQUENCE != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n";
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm>\n";
}
?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form>

View File

@@ -1,13 +1,6 @@
<?php
if (!$error && $_POST["export"]) {
dump_headers("sql");
$adminer->dumpTable("", "");
$adminer->dumpData("", "table", $_POST["query"]);
exit;
}
restart_session();
$history_all = &get_session("queries");
$history_all = &get_session("history");
$history = &$history_all[DB];
if (!$error && $_POST["clear"]) {
$history = array();
@@ -25,18 +18,15 @@ if (!$error && $_POST) {
: "compress.bzip2://adminer.sql.bz2"
)), "rb");
$query = ($fp ? fread($fp, 1e6) : false);
} elseif ($_FILES && $_FILES["sql_file"]["error"] != 4) { // 4 - UPLOAD_ERR_NO_FILE
} elseif ($_POST["file"]) {
$query = get_file("sql_file", true);
}
if (is_string($query)) { // get_file() returns error as number, fread() as false
if (function_exists('memory_get_usage')) {
@ini_set("memory_limit", 2 * strlen($query) + memory_get_usage() + 8e6); // @ - may be disabled, 2 - substr and trim, 8e6 - other variables
}
if ($query != "" && strlen($query) < 1e6) { // don't add big queries
$q = $query . (ereg(';$', $query) ? "" : ";"); //! doesn't work with DELIMITER |
if (!$history || end($history) != $q) { // no repeated queries
$history[] = $q;
}
if ($query != "" && strlen($query) < 1e6 && (!$history || end($history) != $query)) { // don't add repeated and big queries
$history[] = $query;
}
$space = "(\\s|/\\*.*\\*/|(#|-- )[^\n]*\n|--\n)";
if (!ini_bool("session.use_cookies")) {
@@ -49,19 +39,14 @@ if (!$error && $_POST) {
if (is_object($connection2) && DB != "") {
$connection2->select_db(DB);
}
$commands = 0;
$errors = array();
$parse = '[\'`"]' . ($jush == "pgsql" ? '|\\$[^$]*\\$' : ($jush == "mssql" || $jush == "sqlite" ? '|\\[' : '')) . '|/\\*|-- |#'; //! ` and # not everywhere
$total_start = explode(" ", microtime());
parse_str($_COOKIE["adminer_export"], $adminer_export);
$dump_format = $adminer->dumpFormat();
unset($dump_format["sql"]);
$queries = 0;
$errors = "";
while ($query != "") {
if (!$offset && $jush == "sql" && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
if (!$offset && preg_match('~^\\s*DELIMITER\\s+(.+)~i', $query, $match)) {
$delimiter = $match[1];
$query = substr($query, strlen($match[0]));
} else {
preg_match('(' . preg_quote($delimiter) . "|$parse|\$)", $query, $match, PREG_OFFSET_CAPTURE, $offset); // should always match
preg_match('(' . preg_quote($delimiter) . '|[\'`"]|/\\*|-- |#|$)', $query, $match, PREG_OFFSET_CAPTURE, $offset); // should always match
$found = $match[0][0];
$offset = $match[0][1] + strlen($found);
if (!$found && $fp && !feof($fp)) {
@@ -70,8 +55,54 @@ if (!$error && $_POST) {
if (!$found && rtrim($query) == "") {
break;
}
if ($found && $found != $delimiter) { // find matching quote or comment end
while (preg_match('(' . ($found == '/*' ? '\\*/' : ($found == '[' ? ']' : (ereg('^-- |^#', $found) ? "\n" : preg_quote($found) . "|\\\\."))) . '|$)s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES
if (!$found || $found == $delimiter) { // end of a query
$empty = false;
$q = substr($query, 0, $match[0][1]);
$queries++;
echo "<pre class='jush-$jush' id='sql-$queries'>" . shorten_utf8(trim($q), 1000) . "</pre>\n";
ob_flush();
flush(); // can take a long time - show the running query
$start = explode(" ", microtime()); // microtime(true) is available since PHP 5
//! don't allow changing of character_set_results, convert encoding of displayed query
if (!$connection->multi_query($q)) {
echo "<p class='error'>" . lang('Error in query') . ": " . error() . "\n";
$errors .= " <a href='#sql-$queries'>$queries</a>";
if ($_POST["error_stops"]) {
break;
}
} else {
if (is_object($connection2) && preg_match("~^$space*(USE)\\b~isU", $q)) {
$connection2->query($q);
}
do {
$result = $connection->store_result();
$end = explode(" ", microtime());
$time = " <span class='time'>(" . lang('%.3f s', max(0, $end[0] - $start[0] + $end[1] - $start[1])) . ")</span>";
if (is_object($result)) {
select($result, $connection2);
echo "<p>" . ($result->num_rows ? lang('%d row(s)', $result->num_rows) : "") . $time;
if ($connection2 && preg_match("~^($space|\\()*SELECT\\b~isU", $q)) {
$id = "explain-$queries";
echo ", <a href='#$id' onclick=\"return !toggle('$id');\">EXPLAIN</a>\n";
echo "<div id='$id' class='hidden'>\n";
select(explain($connection2, $q));
echo "</div>\n";
}
} else {
if (preg_match("~^$space*(CREATE|DROP|ALTER)$space+(DATABASE|SCHEMA)\\b~isU", $q)) {
restart_session();
set_session("databases", null); // clear cache
session_write_close();
}
echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n";
}
$start = $end;
} while ($connection->next_result());
}
$query = substr($query, $offset);
$offset = 0;
} else { // find matching quote or comment end
while (preg_match('~' . ($found == '/*' ? '\\*/' : (ereg('-- |#', $found) ? "\n" : "$found|\\\\.")) . '|$~s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES
$s = $match[0][0];
$offset = $match[0][1] + strlen($s);
if (!$s && $fp && !feof($fp)) {
@@ -80,83 +111,15 @@ if (!$error && $_POST) {
break;
}
}
} else { // end of a query
$empty = false;
$q = substr($query, 0, $match[0][1]);
$commands++;
$print = "<pre id='sql-$commands'><code class='jush-$jush'>" . shorten_utf8(trim($q), 1000) . "</code></pre>\n";
if (!$_POST["only_errors"]) {
echo $print;
ob_flush();
flush(); // can take a long time - show the running query
}
$start = explode(" ", microtime()); // microtime(true) is available since PHP 5
//! don't allow changing of character_set_results, convert encoding of displayed query
if ($connection->multi_query($q)) {
if (is_object($connection2) && preg_match("~^$space*(USE)\\b~isU", $q)) {
$connection2->query($q);
}
do {
$result = $connection->store_result();
$end = explode(" ", microtime());
$time = format_time($start, $end) . (strlen($q) < 1000 ? " <a href='" . h(ME) . "sql=" . urlencode(trim($q)) . "'>" . lang('Edit') . "</a>" : ""); // 1000 - maximum length of encoded URL in IE is 2083 characters
if (!is_object($result)) {
if (preg_match("~^$space*(CREATE|DROP|ALTER)$space+(DATABASE|SCHEMA)\\b~isU", $q)) {
restart_session();
set_session("dbs", null); // clear cache
session_write_close();
}
if (!$_POST["only_errors"]) {
echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $connection->affected_rows) . "$time\n";
}
} else {
if ($_POST["only_errors"]) {
echo $print;
$print = "";
}
select($result, $connection2);
echo "<form action='' method='post'>\n";
echo "<p>" . ($result->num_rows ? lang('%d row(s)', $result->num_rows) : "") . $time;
$id = "export-$commands";
$export = ", <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('Export') . "</a><span id='$id' class='hidden'>: "
. html_select("output", $adminer->dumpOutput(), $adminer_export["output"]) . " "
. html_select("format", $dump_format, $adminer_export["format"])
. "<input type='hidden' name='query' value='" . h($q) . "'>"
. " <input type='submit' name='export' value='" . lang('Export') . "' onclick='eventStop(event);'><input type='hidden' name='token' value='$token'></span>"
;
if ($connection2 && preg_match("~^($space|\\()*SELECT\\b~isU", $q) && ($explain = explain($connection2, $q))) {
$id = "explain-$commands";
echo ", <a href='#$id' onclick=\"return !toggle('$id');\">EXPLAIN</a>$export\n";
echo "<div id='$id' class='hidden'>\n";
select($explain, $connection2, ($jush == "sql" ? "http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/explain-output.html#" : ""));
echo "</div>\n";
} else {
echo "$export\n";
}
echo "</form>\n";
}
$start = $end;
} while ($connection->next_result());
} elseif ($connection->error) {
echo ($_POST["only_errors"] ? $print : "");
echo "<p class='error'>" . lang('Error in query') . ": " . error() . "\n";
$errors[] = " <a href='#sql-$commands'>$commands</a>";
if ($_POST["error_stops"]) {
break;
}
}
$query = substr($query, $offset);
$offset = 0;
}
}
}
}
if ($errors && $queries > 1) {
echo "<p class='error'>" . lang('Error in query') . ": $errors\n";
}
if ($empty) {
echo "<p class='message'>" . lang('No commands to execute.') . "\n";
} elseif ($_POST["only_errors"]) {
echo "<p class='message'>" . lang('%d query(s) executed OK.', $commands - count($errors)) . format_time($total_start, explode(" ", microtime())) . "\n";
} elseif ($errors && $commands > 1) {
echo "<p class='error'>" . lang('Error in query') . ": " . implode("", $errors) . "\n";
}
//! MS SQL - SET SHOWPLAN_ALL OFF
} else {
@@ -170,24 +133,26 @@ if (!$error && $_POST) {
$q = $_GET["sql"]; // overwrite $q from if ($_POST) to save memory
if ($_POST) {
$q = $_POST["query"];
} elseif ($_GET["history"] == "all") {
$q = $history;
} elseif ($_GET["history"] != "") {
$q = $history[$_GET["history"]];
}
textarea("query", $q, 20);
echo ($_POST ? "" : "<script type='text/javascript'>document.getElementsByTagName('textarea')[0].focus();</script>\n");
echo "<p>" . (ini_bool("file_uploads") ? lang('File upload') . ': <input type="file" name="sql_file"> (&lt; ' . ini_get("upload_max_filesize") . 'B)' : lang('File uploads are disabled.')); // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
?>
<p>
<input type="submit" value="<?php echo lang('Execute'); ?>" title="Ctrl+Enter">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<?php
echo checkbox("error_stops", 1, $_POST["error_stops"], lang('Stop on error')) . "\n";
echo checkbox("only_errors", 1, $_POST["only_errors"], lang('Show only errors')) . "\n";
<input type="submit" value="<?php echo lang('Execute'); ?>">
<?php echo checkbox("error_stops", 1, $_POST["error_stops"], lang('Stop on error')); ?>
print_fieldset("webfile", lang('From server'), $_POST["webfile"]);
<p>
<?php
if (!ini_bool("file_uploads")) {
echo lang('File uploads are disabled.');
} else { ?>
<?php echo lang('File upload'); ?>: <input type="file" name="sql_file">
<input type="submit" name="file" value="<?php echo lang('Run file'); ?>">
<?php } ?>
<p><?php
$compress = array();
foreach (array("gz" => "zlib", "bz2" => "bz2") as $key => $val) {
if (extension_loaded($val)) {
@@ -195,9 +160,9 @@ foreach (array("gz" => "zlib", "bz2" => "bz2") as $key => $val) {
}
}
echo lang('Webserver file %s', "<code>adminer.sql" . ($compress ? "[" . implode("|", $compress) . "]" : "") . "</code>");
echo ' <input type="submit" name="webfile" value="' . lang('Run file') . '">';
echo "</div></fieldset>\n";
?> <input type="submit" name="webfile" value="<?php echo lang('Run file'); ?>">
<?php
if ($history) {
print_fieldset("history", lang('History'), $_GET["history"] != "");
foreach ($history as $key => $val) {
@@ -205,7 +170,6 @@ if ($history) {
echo '<a href="' . h(ME . "sql=&history=$key") . '">' . lang('Edit') . "</a> <code class='jush-$jush'>" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace('~^(#|-- ).*~m', '', $val)))), 80, "</code>") . "<br>\n";
}
echo "<input type='submit' name='clear' value='" . lang('Clear') . "'>\n";
echo "<a href='" . h(ME . "sql=&history=all") . "'>" . lang('Edit all') . "</a>\n";
echo "</div></fieldset>\n";
}
?>

View File

@@ -1,4 +1,3 @@
/** @author Ondrej Valka, http://valka.info */
body { color: #000; background: #fff; font: 90%/1.25 Verdana, Arial, Helvetica, sans-serif; margin: 0; }
a { color: blue; }
a:visited { color: navy; }
@@ -19,8 +18,9 @@ td img { max-width: 200px; max-height: 200px; }
code { background: #eee; }
tr:hover td, tr:hover th { background: #ddf; }
pre { margin: 1em 0 0; }
ul { margin: 1em 0 0; }
.version { color: #777; font-size: 67%; }
.js .hidden, .nojs .jsonly { display: none; }
.js .hidden { display: none; }
.nowrap td, .nowrap th, td.nowrap { white-space: pre; }
.wrap td { white-space: normal; }
.error { color: red; background: #fee; }
@@ -37,30 +37,21 @@ pre { margin: 1em 0 0; }
.number { text-align: right; }
.datetime { text-align: right; }
.type { width: 15ex; width: auto\9; }
.options select { width: 20ex; width: auto\9; }
.active { font-weight: bold; }
.sqlarea { width: 98%; }
#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; }
#tables { padding: 0 0 0 1em; }
#tables li { list-style-type: none; }
#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; }
#loader { position: fixed; top: 0; left: 18em; }
#h1 { color: #777; text-decoration: none; font-style: italic; }
#version { font-size: 67%; color: red; }
#schema { margin-left: 60px; position: relative; }
#schema .table { border: 1px solid silver; padding: 0 2px; cursor: move; position: absolute; }
#schema .references { position: absolute; }
.rtl h2 { margin: 0 -18px 20px 0; }
.rtl p, .rtl table, .rtl .error, .rtl .message { margin: 1em 0 0 20px; }
.rtl #content { margin: 2em 21em 0 0; padding: 10px 0 20px 20px; }
.rtl #breadcrumb { left: auto; right: 21em; margin: 0 -18px 0 0; }
.rtl #lang, .rtl #menu { left: auto; right: 0; }
@media print {
#lang, #menu { display: none; }
#content { margin-left: 1em; }
#breadcrumb { left: 1em; }
.nowrap td, .nowrap th, td.nowrap { white-space: normal; }
}

View File

@@ -2,24 +2,28 @@
/** Load syntax highlighting
* @param string first three characters of database system version
* @param string 'http' or 'https' - used after compilation
*/
function bodyLoad(version) {
onpopstate(history); // copied from editor/static/editing.js
function bodyLoad(version, protocol) {
var jushRoot = '../externals/jush/';
var script = document.createElement('script');
script.src = jushRoot + 'jush.js';
script.onload = function () {
if (window.jush) { // IE runs in case of an error too
jush.create_links = ' target="_blank" rel="noreferrer"';
jush.urls.sql_sqlset = jush.urls.sql[0] = jush.urls.sqlset[0] = jush.urls.sqlstatus[0] = 'http://dev.mysql.com/doc/refman/' + version + '/en/$key';
var pgsql = 'http://www.postgresql.org/docs/' + version + '/static/';
jush.urls.pgsql_pgsqlset = jush.urls.pgsql[0] = pgsql + '$key';
jush.urls.pgsqlset[0] = pgsql + 'runtime-config-$key.html#GUC-$1';
jush.create_links = ' target="_blank"';
jush.urls.sql[0] = 'http://dev.mysql.com/doc/refman/' + version + '/en/$key';
jush.urls.sql_sqlset = jush.urls.sql[0];
jush.urls.sqlset[0] = jush.urls.sql[0];
jush.urls.sqlstatus[0] = jush.urls.sql[0];
jush.urls.pgsql[0] = 'http://www.postgresql.org/docs/' + version + '/static/$key';
jush.urls.pgsql_pgsqlset = jush.urls.pgsql[0];
jush.urls.pgsqlset[0] = 'http://www.postgresql.org/docs/' + version + '/static/runtime-config-$key.html#GUC-$1';
jush.style(jushRoot + 'jush.css');
if (window.jushLinks) {
jush.custom_links = jushLinks;
}
jush.highlight_tag('code', 0);
jush.highlight_tag('pre', 0);
jush.highlight_tag('code');
}
};
script.onreadystatechange = function () {
@@ -30,13 +34,20 @@ function bodyLoad(version) {
document.body.appendChild(script);
}
/** Get value of select
* @param HTMLSelectElement
* @return string
*/
function selectValue(select) {
return select.value || select.options[select.selectedIndex].text;
}
/** Get value of dynamically created form field
* @param HTMLFormElement
* @param string
* @return HTMLElement
*/
function formField(form, name) {
// required in IE < 8, form.elements[name] doesn't work
for (var i=0; i < form.length; i++) {
if (form[i].name == name) {
return form[i];
@@ -55,25 +66,16 @@ function typePassword(el, disable) {
}
}
function loginDriver(driver) {
var trs = driver.parentNode.parentNode.parentNode.rows;
for (var i=1; i < trs.length; i++) {
trs[i].className = (/sqlite/.test(driver.value) ? 'hidden' : '');
}
}
var added = '.', rowCount;
/** Check if val is equal to a-delimiter-b where delimiter is '_', '' or big letter
/** Escape string to use in regular expression
* @param string
* @param string
* @param string
* @return boolean
* @return string
*/
function delimiterEqual(val, a, b) {
return (val == a + '_' + b || val == a + b || val == a + b.charAt(0).toUpperCase() + b.substr(1));
function reEscape(s) {
return s.replace(/[\[\]\\^$*+?.(){|}]/, '\\$&');
}
/** Escape string to use as identifier
@@ -91,28 +93,33 @@ function editingNameChange(field) {
var name = field.name.substr(0, field.name.length - 7);
var type = formField(field.form, name + '[type]');
var opts = type.options;
var table = reEscape(field.value);
var column = '';
var match;
if ((match = /(.+)_(.+)/.exec(table)) || (match = /(.*[a-z])([A-Z].*)/.exec(table))) { // limited to single word columns
table = match[1];
column = match[2];
}
var plural = '(?:e?s)?';
var tabCol = table + plural + '_?' + column;
var re = new RegExp('(^' + idfEscape(table + plural) + '`' + idfEscape(column) + '$' // table_column
+ '|^' + idfEscape(tabCol) + '`' // table
+ '|^' + idfEscape(column + plural) + '`' + idfEscape(table) + '$' // column_table
+ ')|`' + idfEscape(tabCol) + '$' // column
, 'i');
var candidate; // don't select anything with ambiguous match (like column `id`)
var val = field.value;
for (var i = opts.length; i--; ) {
var match = /(.+)`(.+)/.exec(opts[i].value);
if (!match) { // common type
if (candidate && i == opts.length - 2 && val == opts[candidate].value.replace(/.+`/, '') && name == 'fields[1]') { // single target table, link to column, first field - probably `id`
return;
if (!/`/.test(opts[i].value)) { // common type
if (i == opts.length - 2 && candidate && !match[1] && name == 'fields[1]') { // single target table, link to column, first field - probably `id`
return false;
}
break;
}
var table = match[1];
var column = match[2];
var tables = [ table, table.replace(/s$/, ''), table.replace(/es$/, '') ];
for (var j=0; j < tables.length; j++) {
table = tables[j];
if (val == column || val == table || delimiterEqual(val, table, column) || delimiterEqual(val, column, table)) {
if (candidate) {
return;
}
candidate = i;
break;
if (match = re.exec(opts[i].value)) {
if (candidate) {
return false;
}
candidate = i;
}
}
if (candidate) {
@@ -131,7 +138,7 @@ function editingAddRow(button, allowed, focus) {
if (allowed && rowCount >= allowed) {
return false;
}
var match = /(\d+)(\.\d+)?/.exec(button.name);
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);
@@ -277,7 +284,6 @@ function partitionNameChange(el) {
* @param HTMLSelectElement
*/
function foreignAddRow(field) {
field.onchange = function () { };
var row = field.parentNode.parentNode.cloneNode(true);
var selects = row.getElementsByTagName('select');
for (var i=0; i < selects.length; i++) {
@@ -285,6 +291,7 @@ function foreignAddRow(field) {
selects[i].selectedIndex = 0;
}
field.parentNode.parentNode.parentNode.appendChild(row);
field.onchange = function () { };
}
@@ -293,7 +300,6 @@ function foreignAddRow(field) {
* @param HTMLSelectElement
*/
function indexesAddRow(field) {
field.onchange = function () { };
var row = field.parentNode.parentNode.cloneNode(true);
var spans = row.getElementsByTagName('span');
for (var i=0; i < spans.length - 1; i++) {
@@ -301,32 +307,29 @@ function indexesAddRow(field) {
}
var selects = row.getElementsByTagName('select');
for (var i=0; i < selects.length; i++) {
selects[i].name = selects[i].name.replace(/indexes\[\d+/, '$&1');
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\[\d+/, '$&1');
input.name = input.name.replace(/indexes\[[0-9]+/, '$&1');
input.value = '';
field.parentNode.parentNode.parentNode.appendChild(row);
field.onchange = function () { };
}
/** Add column for index
* @param HTMLSelectElement
*/
function indexesAddColumn(field) {
field.onchange = function () { };
var column = field.parentNode.cloneNode(true);
var select = column.getElementsByTagName('select')[0];
select.name = select.name.replace(/\]\[\d+/, '$&1');
select.name = select.name.replace(/\]\[[0-9]+/, '$&1');
select.selectedIndex = 0;
var input = column.getElementsByTagName('input')[0];
input.name = input.name.replace(/\]\[\d+/, '$&1');
input.name = input.name.replace(/\]\[[0-9]+/, '$&1');
input.value = '';
field.parentNode.parentNode.appendChild(column);
select = field.form[field.name.replace(/\].*/, '][type]')];
if (!select.selectedIndex) {
select.selectedIndex = 3;
}
field.onchange = function () { };
}
@@ -370,7 +373,7 @@ function schemaMousemove(ev) {
isTop = (div2.offsetTop + ref[0] * em > divs[i].offsetTop + top * em);
}
if (!lineSet[id]) {
var line = document.getElementById(divs[i].id.replace(/^....(.+)-\d+$/, 'refl$1'));
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 (isTop) {
@@ -391,9 +394,8 @@ function schemaMousemove(ev) {
/** Finish move
* @param MouseEvent
* @param string
*/
function schemaMouseup(ev, db) {
function schemaMouseup(ev) {
if (that !== undefined) {
ev = ev || event;
tablePos[that.firstChild.firstChild.firstChild.data] = [ (ev.clientY - y) / em, (ev.clientX - x) / em ];
@@ -402,9 +404,6 @@ function schemaMouseup(ev, db) {
for (var key in tablePos) {
s += '_' + key + ':' + Math.round(tablePos[key][0] * 10000) / 10000 + 'x' + Math.round(tablePos[key][1] * 10000) / 10000;
}
s = encodeURIComponent(s.substr(1));
var link = document.getElementById('schema-link');
link.href = link.href.replace(/[^=]+$/, '') + s;
cookie('adminer_schema-' + db + '=' + s, 30); //! special chars in db
cookie('adminer_schema=' + encodeURIComponent(s.substr(1)), 30, '; path="' + location.pathname + location.search + '"');
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

View File

@@ -1,5 +1,5 @@
// to hide elements displayed by JavaScript
document.body.className = document.body.className.replace(/(^|\s)nojs(\s|$)/, '$1js$2');
document.body.className = 'js';
/** Toggle visibility
* @param string
@@ -16,30 +16,22 @@ function toggle(id) {
* @param number
* @param string optional
*/
function cookie(assign, days) {
function cookie(assign, days, params) {
var date = new Date();
date.setDate(date.getDate() + days);
document.cookie = assign + '; expires=' + date;
document.cookie = assign + '; expires=' + date + (params || '');
}
/** Verify current Adminer version
* @param string 'http' or 'https'
*/
function verifyVersion() {
function verifyVersion(protocol) {
cookie('adminer_version=0', 1);
var script = document.createElement('script');
script.src = location.protocol + '//www.adminer.org/version.php';
script.src = protocol + '://www.adminer.org/version.php';
document.body.appendChild(script);
}
/** Get value of select
* @param HTMLSelectElement
* @return string
*/
function selectValue(select) {
var selected = select.options[select.selectedIndex];
return ((selected.attributes.value || {}).specified ? selected.value : selected.text);
}
/** Check all elements matching given name
* @param HTMLInputElement
* @param RegExp
@@ -102,33 +94,7 @@ function setHtml(id, html) {
if (html == undefined) {
el.parentNode.innerHTML = '&nbsp;';
} else {
el.innerHTML = html.replace(/<noscript>.*<\/noscript>/i, ''); // required for Google Chrome // hopes that there will be only one <noscript> on each line
}
}
}
/** Find node position
* @param Node
* @return number
*/
function nodePosition(el) {
var pos = 0;
while (el = el.previousSibling) {
pos++;
}
return pos;
}
/** Go to the specified page
* @param string
* @param string
* @param [MouseEvent]
*/
function pageClick(href, page, event) {
if (!isNaN(page) && page) {
href += (page != 1 ? '&page=' + (page - 1) : '');
if (!ajaxSend(href)) {
location.href = href;
el.innerHTML = html;
}
}
}
@@ -139,264 +105,20 @@ function pageClick(href, page, event) {
* @param HTMLSelectElement
*/
function selectAddRow(field) {
field.onchange = function () { };
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]\[\d+/, '$&1');
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]\[\d+/, '$&1');
inputs[0].name = inputs[0].name.replace(/[a-z]\[[0-9]+/, '$&1');
inputs[0].value = '';
inputs[0].className = '';
}
field.parentNode.parentNode.appendChild(row);
}
/** Handle Tab and Esc in textarea
* @param HTMLTextAreaElement
* @param KeyboardEvent
* @return boolean
*/
function textareaKeydown(target, event) {
if (!event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey) {
if (event.keyCode == 9) { // 9 - Tab
// inspired by http://pallieter.org/Projects/insertTab/
if (target.setSelectionRange) {
var start = target.selectionStart;
var scrolled = target.scrollTop;
target.value = target.value.substr(0, start) + '\t' + target.value.substr(target.selectionEnd);
target.setSelectionRange(start + 1, start + 1);
target.scrollTop = scrolled;
return false; //! still loses focus in Opera, can be solved by handling onblur
} else if (target.createTextRange) {
document.selection.createRange().text = '\t';
return false;
}
}
if (event.keyCode == 27) { // 27 - Esc
var els = target.form.elements;
for (var i=1; i < els.length; i++) {
if (els[i-1] == target) {
els[i].focus();
break;
}
}
return false;
}
}
return true;
}
/** Send form by Enter on <select>
* @param KeyboardEvent
* @return boolean
*/
function bodyKeydown(event) {
var target = event.target || event.srcElement;
if (event.ctrlKey && (event.keyCode == 13 || event.keyCode == 10) && !event.altKey && !event.metaKey && /select|textarea/i.test(target.tagName)) { // 13|10 - Enter, shiftKey allowed
target.blur();
if ((!target.form.onsubmit || target.form.onsubmit() !== false) && !ajaxForm(target.form)) {
target.form.submit();
}
return false;
}
}
/** Change focus by Ctrl+Up or Ctrl+Down
* @param KeyboardEvent
* @return boolean
*/
function editingKeydown(event) {
if ((event.keyCode == 40 || event.keyCode == 38) && event.ctrlKey && !event.altKey && !event.metaKey) { // 40 - Down, 38 - Up, shiftKey allowed
var target = event.target || event.srcElement;
var sibling = (event.keyCode == 40 ? 'nextSibling' : 'previousSibling');
var el = target.parentNode.parentNode[sibling];
if (el && (/^tr$/i.test(el.tagName) || (el = el[sibling])) && /^tr$/i.test(el.tagName) && (el = el.childNodes[nodePosition(target.parentNode)]) && (el = el.childNodes[nodePosition(target)])) {
el.focus();
}
return false;
}
return true;
}
/** Disable maxlength for functions
* @param HTMLSelectElement
*/
function functionChange(select) {
var input = select.form[select.name.replace(/^function/, 'fields')];
if (selectValue(select)) {
if (input.origMaxLength === undefined) {
input.origMaxLength = input.maxLength;
}
input.removeAttribute('maxlength');
} else if (input.origMaxLength >= 0) {
input.maxLength = input.origMaxLength;
}
}
/** Create AJAX request
* @param string
* @param function (XMLHttpRequest)
* @param [string]
* @return XMLHttpRequest or false in case of an error
*/
function ajax(url, callback, data) {
var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false));
if (xmlhttp) {
xmlhttp.open((data ? 'POST' : 'GET'), url);
if (data) {
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
}
xmlhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
callback(xmlhttp);
}
};
xmlhttp.send(data);
}
return xmlhttp;
}
/** Use setHtml(key, value) for JSON response
* @param string
* @return XMLHttpRequest or false in case of an error
*/
function ajaxSetHtml(url) {
return ajax(url, function (xmlhttp) {
if (xmlhttp.status) {
var data = eval('(' + xmlhttp.responseText + ')');
for (var key in data) {
setHtml(key, data[key]);
}
}
});
}
/** Replace favicon
* @param string
*/
function replaceFavicon(href) {
var favicon = document.getElementById('favicon');
favicon.href = href;
favicon.parentNode.appendChild(favicon); // to replace the icon in Firefox
}
var ajaxState = 0;
/** Safely load content to #content
* @param string
* @param [string]
* @param [boolean]
* @return XMLHttpRequest or false in case of an error
*/
function ajaxSend(url, data, popState) {
if (!history.pushState) {
return false;
}
var currentState = ++ajaxState;
onblur = function () {
replaceFavicon('../adminer/static/loader.gif');
};
setHtml('loader', '<img src="../adminer/static/loader.gif" alt="">');
return ajax(url, function (xmlhttp) {
if (currentState == ajaxState) {
var title = xmlhttp.getResponseHeader('X-AJAX-Title');
if (title) {
document.title = decodeURIComponent(title);
}
var redirect = xmlhttp.getResponseHeader('X-AJAX-Redirect');
if (redirect) {
return ajaxSend(redirect, '', popState);
}
onblur = function () { };
replaceFavicon('../adminer/static/favicon.ico');
if (!xmlhttp.status) {
setHtml('loader', '');
} else {
if (!popState) {
if (data || url != location.href) {
history.pushState(data, '', url);
}
scrollTo(0, 0);
}
setHtml('content', xmlhttp.responseText);
var content = document.getElementById('content');
var scripts = content.getElementsByTagName('script');
var length = scripts.length; // required to avoid infinite loop
for (var i=0; i < length; i++) {
var script = document.createElement('script');
script.text = scripts[i].text;
content.appendChild(script);
}
var as = document.getElementById('menu').getElementsByTagName('a');
var href = location.href.replace(/(&(sql=|dump=|(select|table)=[^&]*)).*/, '$1');
for (var i=0; i < as.length; i++) {
if (href == as[i].href) {
as[i].className = 'active';
} else if (as[i].className == 'active') {
as[i].className = '';
}
}
var dump = document.getElementById('dump');
if (dump) {
var match = /&(select|table)=([^&]+)/.exec(href);
dump.href = dump.href.replace(/[^=]+$/, '') + (match ? match[2] : '');
}
//! modify Change database hidden fields
if (window.jush) {
jush.highlight_tag('code', 0);
}
}
}
}, data);
}
/** Revive page from history
* @param PopStateEvent|history
*/
onpopstate = function (event) {
if (event.state ? confirm(areYouSure) : ajaxState) {
ajaxSend(location.href, event.state, 1); // 1 - disable pushState
}
}
/** Send form by AJAX GET
* @param HTMLFormElement
* @param [string]
* @return XMLHttpRequest or false in case of an error
*/
function ajaxForm(form, data) {
if (/&(database|scheme|create|view|sql|user|dump|call)=/.test(location.href) && !/\./.test(data)) { // . - type="image"
return false;
}
var params = [ ];
for (var i=0; i < form.elements.length; i++) {
var el = form.elements[i];
if (/file/i.test(el.type) && el.value) {
return false;
} else if (el.name && (!/checkbox|radio|submit|file/i.test(el.type) || el.checked)) {
params.push(encodeURIComponent(el.name) + '=' + encodeURIComponent(/select/i.test(el.tagName) ? selectValue(el) : el.value));
}
}
if (data) {
params.push(data);
}
if (form.method == 'post') {
return ajaxSend((/\?/.test(form.action) ? form.action : location.href), params.join('&')); // ? - always part of Adminer URL
}
return ajaxSend((form.action || location.href).replace(/\?.*/, '') + '?' + params.join('&'));
field.onchange = function () { };
}
@@ -404,14 +126,15 @@ function ajaxForm(form, data) {
/** Display edit field
* @param HTMLElement
* @param MouseEvent
* @param number display textarea instead of input, 2 - load long text
* @param boolean display textarea instead of input
*/
function selectDblClick(td, event, text) {
td.ondblclick = function () { };
var pos = event.rangeOffset;
var value = (td.firstChild.alt ? td.firstChild.alt : (td.textContent ? td.textContent : td.innerText));
var value = (td.firstChild.firstChild ? td.firstChild.firstChild.data : td.firstChild.data);
var input = document.createElement(text ? 'textarea' : 'input');
input.style.width = Math.max(td.clientWidth - 14, 20) + 'px'; // 14 = 2 * (td.border + td.padding + input.border)
input.name = td.id;
input.value = (value == '\u00A0' || td.getElementsByTagName('i').length ? '' : value); // &nbsp; or i - NULL
input.style.width = (td.clientWidth - 14) + 'px'; // 14 = 2 * (td.border + td.padding + input.border)
if (text) {
var rows = 1;
value.replace(/\n/g, function () {
@@ -419,12 +142,9 @@ function selectDblClick(td, event, text) {
});
input.rows = rows;
}
if (value == '\u00A0' || td.getElementsByTagName('i').length) { // &nbsp; or i - NULL
value = '';
}
if (document.selection) {
var range = document.selection.createRange();
range.moveToPoint(event.clientX, event.clientY);
range.moveToPoint(event.x, event.y);
var range2 = range.duplicate();
range2.moveToElementText(td);
range2.setEndPoint('EndToEnd', range);
@@ -433,62 +153,12 @@ function selectDblClick(td, event, text) {
td.innerHTML = '';
td.appendChild(input);
input.focus();
if (text == 2) { // long text
return ajax(location.href + '&' + encodeURIComponent(td.id) + '=', function (xmlhttp) {
if (xmlhttp.status) {
input.value = xmlhttp.responseText;
input.name = td.id;
}
});
}
input.value = value;
input.name = td.id;
input.selectionStart = pos;
input.selectionEnd = pos;
if (document.selection) {
var range = document.selection.createRange();
range.moveEnd('character', -input.value.length + pos);
range.moveStart('character', pos);
range.select();
}
}
/** Load link by AJAX
* @param MouseEvent
* @param string
* @param string
* @return bool
*/
function bodyClick(event, db, ns) {
if (event.button || event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) {
return;
}
if (event.getPreventDefault ? event.getPreventDefault() : event.returnValue === false) {
return false;
}
var el = event.target || event.srcElement;
if (/^a$/i.test(el.parentNode.tagName)) {
el = el.parentNode;
}
if (/^a$/i.test(el.tagName) && !/^:|#|&download=/i.test(el.getAttribute('href')) && /[&?]username=/.test(el.href)) {
var match = /&db=([^&]*)/.exec(el.href);
var match2 = /&ns=([^&]*)/.exec(el.href);
return !(db == (match ? match[1] : '') && ns == (match2 ? match2[1] : '') && ajaxSend(el.href));
}
if (/^input$/i.test(el.tagName) && /image|submit/.test(el.type)) {
return !ajaxForm(el.form, (el.name ? encodeURIComponent(el.name) + (el.type == 'image' ? '.x' : '') + '=1' : ''));
}
return true;
}
/** Stop event propagation
* @param Event
*/
function eventStop(event) {
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
td.ondblclick = function () { };
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

View File

@@ -6,12 +6,8 @@ if (!$fields) {
}
$table_status = ($fields ? table_status($TABLE) : array());
page_header(($fields && is_view($table_status) ? lang('View') : lang('Table')) . ": " . h($TABLE), $error);
page_header(($fields && $table_status["Engine"] == "VIEW" ? lang('View') : lang('Table')) . ": " . h($TABLE), $error);
$adminer->selectLinks($table_status);
$comment = $table_status["Comment"];
if ($comment != "") {
echo "<p>" . lang('Comment') . ": " . h($comment) . "\n";
}
if ($fields) {
echo "<table cellspacing='0'>\n";
@@ -24,7 +20,7 @@ if ($fields) {
}
echo "</table>\n";
if (!is_view($table_status)) {
if ($table_status["Engine"] != "VIEW") {
echo "<h3>" . lang('Indexes') . "</h3>\n";
$indexes = indexes($TABLE);
if ($indexes) {
@@ -48,11 +44,11 @@ if ($fields) {
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th>" . lang('Source') . "<td>" . lang('Target') . "<td>" . lang('ON DELETE') . "<td>" . lang('ON UPDATE') . ($jush != "sqlite" ? "<td>&nbsp;" : "") . "</thead>\n";
foreach ($foreign_keys as $name => $foreign_key) {
$link = ($foreign_key["db"] != "" ? "<b>" . h($foreign_key["db"]) . "</b>." : "") . h($foreign_key["table"]);
$link = ($foreign_key["db"] != "" ? "<strong>" . h($foreign_key["db"]) . "</strong>." : "") . h($foreign_key["table"]);
echo "<tr>";
echo "<th><i>" . implode("</i>, <i>", array_map('h', $foreign_key["source"])) . "</i>";
echo "<td><a href='" . h($foreign_key["db"] != "" ? preg_replace('~db=[^&]*~', "db=" . urlencode($foreign_key["db"]), ME) : ME) . "table=" . urlencode($foreign_key["table"]) . "'>$link</a>";
echo "(<i>" . implode("</i>, <i>", array_map('h', $foreign_key["target"])) . "</i>)";
echo "(<em>" . implode("</em>, <em>", array_map('h', $foreign_key["target"])) . "</em>)";
echo "<td>$foreign_key[on_delete]\n";
echo "<td>$foreign_key[on_update]\n";
if ($jush != "sqlite") {

View File

@@ -9,7 +9,7 @@ if ($_POST && !$error && in_array($_POST["Timing"], $trigger_options["Timing"])
$on = " ON " . table($TABLE);
$dropped = drop_create(
"DROP TRIGGER " . idf_escape($_GET["name"]) . ($jush == "pgsql" ? $on : ""),
"CREATE TRIGGER " . idf_escape($_POST["Trigger"]) . ($jush == "mssql" ? $on . $timing_event : $timing_event . $on) . rtrim(" $_POST[Type]\n$_POST[Statement]", ";") . ";",
"CREATE TRIGGER " . idf_escape($_POST["Trigger"]) . ($jush == "mssql" ? $on . $timing_event : $timing_event . $on) . " $_POST[Type]\n$_POST[Statement]",
ME . "table=" . urlencode($TABLE),
lang('Trigger has been dropped.'),
lang('Trigger has been altered.'),
@@ -30,15 +30,15 @@ if ($_POST) {
<form action="" method="post" id="form">
<table cellspacing="0">
<tr><th><?php echo lang('Time'); ?><td><?php echo html_select("Timing", $trigger_options["Timing"], $row["Timing"], "if (/^" . h(preg_quote($TABLE, "/")) . "_[ba][iud]$/.test(this.form['Trigger'].value)) this.form['Trigger'].value = '" . h(js_escape($TABLE)) . "_' + selectValue(this).charAt(0).toLowerCase() + selectValue(this.form['Event']).charAt(0).toLowerCase();"); ?>
<tr><th><?php echo lang('Time'); ?><td><?php echo html_select("Timing", $trigger_options["Timing"], $row["Timing"], "if (/^" . h(preg_quote($TABLE, "/")) . "_[ba][iud]$/.test(this.form['Trigger'].value)) this.form['Trigger'].value = '" . h(addcslashes($TABLE, "\r\n'\\")) . "_' + selectValue(this).charAt(0).toLowerCase() + selectValue(this.form['Event']).charAt(0).toLowerCase();"); ?>
<tr><th><?php echo lang('Event'); ?><td><?php echo html_select("Event", $trigger_event, $row["Event"], "this.form['Timing'].onchange();"); ?>
<tr><th><?php echo lang('Type'); ?><td><?php echo html_select("Type", $trigger_options["Type"], $row["Type"]); ?>
</table>
<p><?php echo lang('Name'); ?>: <input name="Trigger" value="<?php echo h($row["Trigger"]); ?>" maxlength="64">
<p><?php textarea("Statement", $row["Statement"]); ?>
<p>
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($_GET["name"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo confirm(); ?>><?php } ?>
<?php if ($dropped) { ?><input type="hidden" name="dropped" value="1"><?php } ?>
<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="Trigger" value="<?php echo h($row["Trigger"]); ?>" maxlength="64">
<input type="submit" value="<?php echo lang('Save'); ?>">
<?php if ($_GET["name"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"<?php echo $confirm; ?>><?php } ?>
</form>

View File

@@ -1,33 +0,0 @@
<?php
$TYPE = $_GET["type"];
if ($_POST && !$error) {
$link = substr(ME, 0, -1);
if ($_POST["drop"]) {
query_redirect("DROP TYPE " . idf_escape($TYPE), $link, lang('Type has been dropped.'));
} else {
query_redirect("CREATE TYPE " . idf_escape($_POST["name"]) . " $_POST[as]", $link, lang('Type has been created.'));
}
}
page_header($TYPE != "" ? lang('Alter type') . ": " . h($TYPE) : lang('Create type'), $error);
$row["as"] = "AS ";
if ($_POST) {
$row = $_POST;
}
?>
<form action="" method="post">
<p>
<?php
if ($TYPE != "") {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'" . confirm() . ">\n";
} else {
echo "<input name='name' value='" . h($row['name']) . "'>\n";
textarea("as", $row["as"]);
echo "<p><input type='submit' value='" . lang('Save') . "'>\n";
}
?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
</form>

View File

@@ -1,7 +1,8 @@
<?php
$USER = $_GET["user"];
$privileges = array("" => array("All privileges" => ""));
foreach (get_rows("SHOW PRIVILEGES") as $row) {
$result = $connection->query("SHOW PRIVILEGES");
while ($row = $result->fetch_assoc()) {
foreach (explode(",", ($row["Privilege"] == "Grant option" ? "" : $row["Context"])) as $context) {
$privileges[$context][$row["Privilege"]] = $row["Comment"];
}
@@ -26,7 +27,7 @@ if ($_POST) {
}
$grants = array();
$old_pass = "";
if (isset($_GET["host"]) && ($result = $connection->query("SHOW GRANTS FOR " . q($USER) . "@" . q($_GET["host"])))) { //! use information_schema for MySQL 5 - column names in column privileges are not escaped
if (isset($_GET["host"]) && ($result = $connection->query("SHOW GRANTS FOR " . $connection->quote($USER) . "@" . $connection->quote($_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) {
@@ -45,9 +46,9 @@ if (isset($_GET["host"]) && ($result = $connection->query("SHOW GRANTS FOR " . q
}
if ($_POST && !$error) {
$old_user = (isset($_GET["host"]) ? q($USER) . "@" . q($_GET["host"]) : "''");
$new_user = q($_POST["user"]) . "@" . q($_POST["host"]); // if $_GET["host"] is not set then $new_user is always different
$pass = q($_POST["pass"]);
$old_user = (isset($_GET["host"]) ? $connection->quote($USER) . "@" . $connection->quote($_GET["host"]) : "''");
$new_user = $connection->quote($_POST["user"]) . "@" . $connection->quote($_POST["host"]); // if $_GET["host"] is not set then $new_user is always different
$pass = $connection->quote($_POST["pass"]);
if ($_POST["drop"]) {
query_redirect("DROP USER $old_user", ME . "privileges=", lang('User has been dropped.'));
} else {
@@ -127,7 +128,7 @@ if ($_POST) {
<?php
//! MAX_* limits, REQUIRE
echo "<table cellspacing='0'>\n";
echo "<thead><tr><th colspan='2'><a href='http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/grant.html#priv_level' target='_blank' rel='noreferrer'>" . lang('Privileges') . "</a>";
echo "<thead><tr><th colspan='2'><a href='http://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/grant.html'>" . lang('Privileges') . "</a>";
$i = 0;
foreach ($grants as $object => $grant) {
echo '<th>' . ($object != "*.*" ? "<input name='objects[$i]' value='" . h($object) . "' size='10'>" : "<input type='hidden' name='objects[$i]' value='*.*' size='10'>*.*"); //! separate db, table, columns, PROCEDURE|FUNCTION, routine
@@ -162,7 +163,7 @@ foreach (array(
echo "</table>\n";
?>
<p>
<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 } ?>
<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 } ?>
</form>

View File

@@ -25,10 +25,10 @@ if ($_POST) {
?>
<form action="" method="post">
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64">
<p><?php textarea("select", $row["select"]); ?>
<p>
<?php if ($dropped) { // old view was dropped but new wasn't created ?><input type="hidden" name="dropped" value="1"><?php } ?>
<input type="submit" value="<?php echo lang('Save'); ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<?php if ($dropped) { // old view was dropped but new wasn't created ?><input type="hidden" name="dropped" value="1"><?php } ?>
<?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64">
<input type="submit" value="<?php echo lang('Save'); ?>">
</form>

View File

@@ -1,95 +1,17 @@
Adminer 3.2.1 (released 2011-03-23):
Ability to save expression in edit
Respect default database collation (bug #3191489)
Don't export triggers without table (bug #3193489)
Esc to focus next field in Tab textarea (thanks to David Grudl)
Send forms by Ctrl+Enter on <select>
Enum editor and textarea Ctrl+Enter working in IE
AJAX forms in Google Chrome
Parse UTF-16 and UTF-8 BOM in all text uploads
Display ; in history (thanks to Jan Cerny)
Use DELIMITER in history
Show databases even with skip_show_database in MySQL 5 (thanks to Radoslaw Kowalewski)
Disable maxlength with functions in edit
Better placement of AJAX icon
Table header in CSV export (Editor)
Time format hint (Editor)
Respect order after search (Editor)
Set MySQL time zone by PHP setting (Editor)
Allow own code in <head> (customization)
Polish translation
Adminer 3.2.0 (released 2011-02-24):
Get long texts and slow information by AJAX
Most links and forms by AJAX in browsers with support for history.pushState
Copy tables
Ability to search by expression in select
Export SQL command result (bug #3116854)
Focus first field with insert (bug #3126501)
Permanent link in schema
Display total time in show only errors mode in SQL command
History: edit all
MS SQL: auto primary and foreign key
SQLite: display 0
Create table default data type: int
Focus upper/lower fields by Ctrl+Up/Ctrl+Down
Hide credentials for SQLite
Utilize oids in PostgreSQL
Homepage customization
Use IN for search in numeric fields (Editor)
Use password input for _md5 and _sha1 fields (Editor)
Work without session.use_cookies (bug #3138640)
Fix saving schema to cookie in Opera
Portuguese, Slovenian and Turkish translation
Adminer 3.1.0 (released 2010-11-16):
TSV export and import
Customizable export
Option to show only errors in SQL command
Link to bookmark SQL command
Recognize $$ strings in SQL command (PostgreSQL)
Highlight and edit SQL command in processlist
Always display all drivers
Timestamp at the end of export
Link to refresh database cache (bug #3102451)
Support for virtual foreign keys
Disable XSS "protection" of IE8
Immunity against zend.ze1_compatibility_mode (bug #3089645)
Fix last page with empty result set
Arabic translation and RTL support
Dual licensing: Apache or GPL
Adminer 3.0.1 (released 2010-10-18):
Send the form by Ctrl+Enter in all textareas
Disable creating SQLite databases with extension other than db, sdb, sqlite
Ability to use Adminer in a frame through customization
Catalan translation
MS SQL 2005 compatibility
PostgreSQL: connect if the eponymous database does not exist
Adminer 3.0.0 (released 2010-10-15):
Adminer 3.0.0-dev:
Drivers for MS SQL, SQLite, PostgreSQL, Oracle
Allow concurrent logins on the same server
Allow permanent login without customization
In-place editation in select
Foreign key options in Table creation
Treat binary type as hex
Show number of tables in server overview
Operator LIKE %%
Remember export parameters in cookie
Allow semicolon as CSV separator
Schemas, sequences and types support (PostgreSQL)
Autofocus username in login form
Allow to insert Tab in SQL textareas and send the form by Ctrl+Enter
Disable spellchecking in SQL textareas
Display auto_increment value of inserted item
Allow disabling auto_increment value export
Prefill auto_increment column name
Ability to jump to any page in select by JavaScript
Display comment in table overview
Link last page above data in select
Link table names in SQL queries
Hungarian, Japanese and Tamil translation
Japanese translation
Defer table information in database overview to JavaScript (performance)
Big tables optimizations (performance)

View File

@@ -51,37 +51,29 @@ function put_file($match) {
if (basename($match[2]) != "lang.inc.php" || !$_SESSION["lang"]) {
$tokens = token_get_all($return); // to find out the last token
return "?>\n$return" . (in_array($tokens[count($tokens) - 1][0], array(T_CLOSE_TAG, T_INLINE_HTML), true) ? "<?php" : "");
} elseif (preg_match('~\\s*(\\$pos = .*;)~sU', $return, $match2)) {
} elseif (preg_match('~\\s*(\\$pos = .*)~', $return, $match2)) {
// single language lang() is used for plural
return "function get_lang() {
return '$_SESSION[lang]';
}
function lang(\$translation, \$number) {
" . str_replace('$LANG', "'$_SESSION[lang]'", $match2[1]) . '
return sprintf($translation[$pos], $number);
}
';
return "function lang(\$translation, \$number) {\n\t" . str_replace('$LANG', "'$_SESSION[lang]'", $match2[1]) . "\n\treturn sprintf(\$translation[\$pos], \$number);\n}\n";
} else {
echo "lang() not found\n";
}
}
function put_file_lang($match) {
global $lang_ids, $project, $langs;
global $lang_ids, $project;
if ($_SESSION["lang"]) {
return "";
}
$return = "";
foreach ($langs as $lang => $val) {
include dirname(__FILE__) . "/adminer/lang/$lang.inc.php"; // assign $translations
foreach (glob(dirname(__FILE__) . "/adminer/lang/*.inc.php") as $filename) {
include $filename; // assign $translations
$translation_ids = array_flip($lang_ids); // default translation
foreach ($translations as $key => $val) {
if (isset($val)) {
$translation_ids[$lang_ids[$key]] = $val;
}
}
$return .= "\tcase \"$lang\": \$translations = array(";
$return .= "\tcase \"" . basename($filename, '.inc.php') . '": $translations = array(';
foreach ($translation_ids as $val) {
$return .= (is_array($val) ? "array('" . implode("', '", array_map('add_apo_slashes', $val)) . "')" : "'" . add_apo_slashes($val) . "'") . ", ";
}
@@ -173,7 +165,7 @@ function php_shrink($input) {
}
function minify_css($file) {
return preg_replace('~\\s*([:;{},])\\s*~', '\\1', preg_replace('~/\\*.*\\*/~sU', '', $file));
return preg_replace('~\\s*([:;{},])\\s*~', '\\1', $file);
}
function compile_file($match) {
@@ -215,7 +207,6 @@ foreach (glob(dirname(__FILE__) . "/adminer/drivers/" . ($driver ? $driver : "*"
}
include dirname(__FILE__) . "/adminer/include/pdo.inc.php";
$features = array("view", "event", "privileges", "user", "processlist", "variables", "trigger", "scheme", "sequence", "dump");
foreach (array("adminer", "editor") as $project) {
$lang_ids = array(); // global variable simplifies usage in a callback function
$file = file_get_contents(dirname(__FILE__) . "/$project/index.php");
@@ -223,7 +214,7 @@ foreach (array("adminer", "editor") as $project) {
$connection = (object) array("server_info" => 5.1); // MySQL support is version specific
$_GET[$driver] = true; // to load the driver
include_once dirname(__FILE__) . "/adminer/drivers/$driver.inc.php";
foreach ($features as $feature) {
foreach (array("view", "event", "privileges", "user", "processlist", "variables", "trigger", "scheme", "sequence") as $feature) {
if (!support($feature)) {
$file = str_replace("} elseif (isset(\$_GET[\"$feature\"])) {\n\tinclude \"./$feature.inc.php\";\n", "", $file);
}
@@ -240,19 +231,8 @@ foreach (array("adminer", "editor") as $project) {
$file = preg_replace('(include "../adminer/drivers/(?!' . preg_quote($driver) . ').*\\s*)', '', $file);
}
$file = preg_replace_callback('~\\b(include|require) "([^"]*)";~', 'put_file', $file); // bootstrap.inc.php
if ($driver) {
foreach ($features as $feature) {
if (!support($feature)) {
$file = preg_replace("((\t*)" . preg_quote('if (support("' . $feature . '")') . ".*\n\\1\\})sU", '', $file);
}
}
if (count($drivers) == 1) {
$file = str_replace('<?php echo html_select("driver", $drivers, DRIVER); ?>', "<input type='hidden' name='driver' value='" . ($driver == "mysql" ? "server" : $driver) . "'>" . reset($drivers), $file);
}
}
$file = preg_replace_callback("~lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])~s", 'lang_ids', $file);
$file = preg_replace_callback('~\\b(include|require) "([^"]*\\$LANG.inc.php)";~', 'put_file_lang', $file);
$file = str_replace("\r", "", $file);
if ($_SESSION["lang"]) {
// single language version
$file = preg_replace_callback("~(<\\?php\\s*echo )?lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])(;\\s*\\?>)?~s", 'remove_lang', $file);
@@ -261,12 +241,10 @@ foreach (array("adminer", "editor") as $project) {
}
$file = str_replace('<script type="text/javascript" src="static/editing.js"></script>' . "\n", "", $file);
$file = preg_replace_callback("~compile_file\\('([^']+)', '([^']+)'\\);~", 'compile_file', $file); // integrate static files
$replace = 'h(preg_replace("~\\\\\\\\?.*~", "", ME)) . "?file=\\1&amp;version=' . $VERSION;
$file = preg_replace("~'\\.\\./adminer/static/(loader\\.gif|favicon\\.ico)~", "location.pathname+'?file=\\1&amp;version=$VERSION", $file);
$file = preg_replace('~\\.\\./adminer/static/(loader\\.gif)~', "'+location.pathname+'?file=\\1&amp;version=$VERSION", $file);
$replace = 'h(preg_replace("~\\\\\\\\?.*~", "", $_SERVER["REQUEST_URI"])) . "?file=\\1&amp;version=' . $VERSION;
$file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
$file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file);
$file = str_replace("'../externals/jush/'", "location.protocol + '//www.adminer.org/static/'", $file);
$file = str_replace("'../externals/jush/'", "protocol + '://www.adminer.org/static/'", $file);
$file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
$file = php_shrink($file);

View File

@@ -1,23 +1,14 @@
<?php
page_header(lang('Server'), "", false);
if ($adminer->homepage()) {
echo "<form action='' method='post'>\n";
echo "<p>" . lang('Search data in tables') . ": <input name='query' value='" . h($_POST["query"]) . "'> <input type='submit' value='" . lang('Search') . "'>\n";
if ($_POST["query"] != "") {
search_tables();
}
echo "<table cellspacing='0' class='nowrap' onclick='tableClick(event);'>\n";
echo '<thead><tr class="wrap"><td><input id="check-all" type="checkbox" onclick="formCheck(this, /^tables\[/);"><th>' . lang('Table') . '<td>' . lang('Rows') . "</thead>\n";
foreach (table_status() as $table => $row) {
$name = $adminer->tableName($row);
if (isset($row["Engine"]) && $name != "") {
echo '<tr' . odd() . '><td>' . checkbox("tables[]", $table, in_array($table, (array) $_POST["tables"], true), "", "formUncheck('check-all');");
echo '<th><a href="' . h(ME) . 'select=' . urlencode($table) . '">' . h($name) . '</a>';
$val = number_format($row["Rows"], 0, '.', lang(','));
echo "<td align='right'><a href='" . h(ME . "edit=") . urlencode($table) . "'>" . ($row["Engine"] == "InnoDB" && $val ? "~ $val" : $val) . "</a>";
}
}
echo "</table>\n";
echo "</form>\n";
?>
<form action=""><p>
<?php echo lang('Search data in tables'); ?>:
<?php hidden_fields_get(); ?>
<input name="where[0][val]" value="<?php echo h($_GET["where"][0]["val"]); ?>">
<input type="submit" value="<?php echo lang('Search'); ?>" />
</form>
<?php
if ($_GET["where"][0]["val"] != "") {
search_tables();
}

View File

@@ -29,11 +29,8 @@ function adminer_object() {
}
function fieldName($field, $order = 0) {
if ($order && ereg('_(md5|sha1)$', $field["field"])) {
return ""; // hide hashes in select
}
// only columns with comments will be displayed and only the first five in select
return ($order <= 5 ? h($field["comment"]) : "");
return ($order <= 5 && !ereg('_(md5|sha1)$', $field["field"]) ? h($field["comment"]) : "");
}
}

View File

@@ -10,7 +10,7 @@ class Adminer {
//! driver, ns
function credentials() {
return array(SERVER, $_GET["username"], get_session("pwds"));
return array(); // default INI settings
}
function permanentLogin() {
@@ -19,22 +19,13 @@ class Adminer {
function database() {
global $connection;
$databases = get_databases(false);
return (!$databases
$dbs = get_databases(false);
return (!$dbs
? $connection->result("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1)") // username without the database list
: $databases[(information_schema($databases[0]) ? 1 : 0)] // first available database
: $dbs[(information_schema($dbs[0]) ? 1 : 0)] // first available database
);
}
function headers() {
header("X-Frame-Options: deny");
header("X-XSS-Protection: 0");
}
function head() {
return true;
}
function loginForm() {
?>
<table cellspacing="0">
@@ -50,8 +41,6 @@ document.getElementById('username').focus();
}
function login($login, $password) {
global $connection;
$connection->query("SET time_zone = " . q(substr_replace(@date("O"), ":", -2, 0))); // date("P") available since PHP 5.1.3, @ - requires date.timezone since PHP 5.3.0
return true;
}
@@ -68,56 +57,58 @@ document.getElementById('username').focus();
if (isset($set)) {
echo '<p class="tabs"><a href="' . h(ME . 'edit=' . urlencode($TABLE) . $set) . '">' . lang('New item') . "</a>\n";
}
echo "<a href='" . h(remove_from_uri("page")) . "&amp;page=last' title='" . lang('Last page') . "'>&gt;&gt;</a>\n";
}
function foreignKeys($table) {
return foreign_keys($table);
}
function backwardKeys($table, $tableName) {
global $connection;
$return = array();
foreach (get_rows("SELECT TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME, REFERENCED_COLUMN_NAME
$result = $connection->query("SELECT TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME, REFERENCED_COLUMN_NAME
FROM information_schema.KEY_COLUMN_USAGE
WHERE TABLE_SCHEMA = " . q($this->database()) . "
AND REFERENCED_TABLE_SCHEMA = " . q($this->database()) . "
AND REFERENCED_TABLE_NAME = " . q($table) . "
ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$return[$row["TABLE_NAME"]]["keys"][$row["CONSTRAINT_NAME"]][$row["COLUMN_NAME"]] = $row["REFERENCED_COLUMN_NAME"];
}
foreach ($return as $key => $val) {
$name = $this->tableName(table_status($key));
if ($name != "") {
$search = preg_quote($tableName);
$separator = "(:|\\s*-)?\\s+";
$return[$key]["name"] = (preg_match("(^$search$separator(.+)|^(.+?)$separator$search\$)iu", $name, $match) ? $match[2] . $match[3] : $name);
} else {
unset($return[$key]);
WHERE TABLE_SCHEMA = " . $connection->quote($this->database()) . "
AND REFERENCED_TABLE_SCHEMA = " . $connection->quote($this->database()) . "
AND REFERENCED_TABLE_NAME = " . $connection->quote($table) . "
ORDER BY ORDINAL_POSITION");
if ($result) { //! requires MySQL 5
while ($row = $result->fetch_assoc()) {
$return[$row["TABLE_NAME"]]["keys"][$row["CONSTRAINT_NAME"]][$row["COLUMN_NAME"]] = $row["REFERENCED_COLUMN_NAME"];
}
foreach ($return as $key => $val) {
$name = $this->tableName(table_status($key));
if ($name != "") {
$search = preg_quote($tableName);
$separator = "(:|\\s*-)?\\s+";
$return[$key]["name"] = (preg_match("(^$search$separator(.+)|^(.+?)$separator$search\$)", $name, $match) ? $match[2] . $match[3] : $name);
} else {
unset($return[$key]);
}
}
}
return $return;
}
function backwardKeysPrint($backwardKeys, $row) {
foreach ($backwardKeys as $table => $backwardKey) {
foreach ($backwardKey["keys"] as $cols) {
$link = ME . 'select=' . urlencode($table);
$i = 0;
foreach ($cols as $column => $val) {
$link .= where_link($i++, $column, $row[$val]);
if ($backwardKeys) {
echo "<td>";
foreach ($backwardKeys as $table => $backwardKey) {
foreach ($backwardKey["keys"] as $cols) {
$link = ME . 'select=' . urlencode($table);
$i = 0;
foreach ($cols as $column => $val) {
$link .= where_link($i++, $column, $row[$val]);
}
echo "<a href='" . h($link) . "'>" . h($backwardKey["name"]) . "</a>";
$link = ME . 'edit=' . urlencode($table);
foreach ($cols as $column => $val) {
$link .= "&set" . urlencode("[" . bracket_escape($column) . "]") . "=" . urlencode($row[$val]);
}
echo "<a href='" . h($link) . "' title='" . lang('New item') . "'>+</a> ";
}
echo "<a href='" . h($link) . "'>" . h($backwardKey["name"]) . "</a>";
$link = ME . 'edit=' . urlencode($table);
foreach ($cols as $column => $val) {
$link .= "&set" . urlencode("[" . bracket_escape($column) . "]") . "=" . urlencode($row[$val]);
}
echo "<a href='" . h($link) . "' title='" . lang('New item') . "'>+</a> ";
}
}
}
function selectQuery($query) {
return "<!--\n" . str_replace("--", "--><!-- ", $query) . "\n-->\n";
return "<!--\n" . str_replace("--", "--><!--", $query) . "\n-->\n";
}
function rowDescription($table) {
@@ -146,7 +137,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
// uses constant number of queries to get the descriptions, join would be complex, multiple queries would be slow
$descriptions = $this->_values[$foreignKey["table"]];
if (!$descriptions) {
$descriptions = get_key_vals("SELECT $id, $name FROM " . table($foreignKey["table"]) . " WHERE $id IN (" . implode(", ", $ids) . ")");
$descriptions = get_key_vals("SELECT $id, $name FROM " . idf_escape($foreignKey["table"]) . " WHERE $id IN (" . implode(", ", $ids) . ")");
}
// use the descriptions
foreach ($rows as $n => $row) {
@@ -164,19 +155,19 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
function selectVal($val, $link, $field) {
$return = ($val == "<i>NULL</i>" ? "&nbsp;" : $val);
if (ereg('blob|bytea', $field["type"]) && !is_utf8($val)) {
if (ereg('binary|blob|bytea', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen($val));
if (ereg("^(GIF|\xFF\xD8\xFF|\x89\x50\x4E\x47\x0D\x0A\x1A\x0A)", $val)) { // GIF|JPG|PNG, getimagetype() works with filename
$return = "<img src='$link' alt='$return'>";
}
}
if (ereg("(tinyint|bit)\\(1\\)", $field["full_type"]) && $return != "&nbsp;") { // bool
if ($field["full_type"] == "tinyint(1)" && $return != "&nbsp;") { // bool
$return = '<img src="' . ($val ? "../adminer/static/plus.gif" : "../adminer/static/cross.gif") . '" alt="' . h($val) . '">';
}
if ($link) {
$return = "<a href='$link'>$return</a>";
}
if (!$link && !ereg("(tinyint|bit)\\(1\\)", $field["full_type"]) && ereg('int|float|double|decimal', $field["type"])) {
if (!$link && $field["full_type"] != "tinyint(1)" && ereg('int|float|double|decimal', $field["type"])) {
$return = "<div class='number'>$return</div>"; // Firefox doesn't support <colgroup>
} elseif (ereg('date', $field["type"])) {
$return = "<div class='datetime'>$return</div>";
@@ -186,9 +177,9 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
function editVal($val, $field) {
if (ereg('date|timestamp', $field["type"]) && isset($val)) {
return preg_replace('~^(\\d{2}(\\d+))-(0?(\\d+))-(0?(\\d+))~', lang('$1-$3-$5'), $val);
return preg_replace('~^([0-9]{2}([0-9]+))-(0?([0-9]+))-(0?([0-9]+))~', lang('$1-$3-$5'), $val);
}
return (ereg("binary", $field["type"]) ? reset(unpack("H*", $val)) : $val);
return $val;
}
function selectColumnsPrint($select, $columns) {
@@ -203,14 +194,13 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$keys[$val["col"]] = $key;
}
$i = 0;
$fields = fields($_GET["select"]);
foreach ($fields as $name => $field) {
foreach (fields($_GET["select"]) as $name => $field) {
if (ereg("enum", $field["type"])) { //! set - uses 1 << $i and FIND_IN_SET()
$desc = $columns[$name];
$key = $keys[$name];
$i--;
echo "<div>" . h($desc) . "<input type='hidden' name='where[$i][col]' value='" . h($name) . "'>:";
echo enum_input("checkbox", " name='where[$i][val][]'", $field, (array) $where[$key]["val"], ($field["null"] ? 0 : null));
enum_input("checkbox", "where[$i][val][]", $field, (array) $where[$key]["val"]); //! impossible to search for NULL
echo "</div>\n";
unset($columns[$name]);
}
@@ -218,9 +208,6 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
foreach ($columns as $name => $desc) {
$options = $this->_foreignKeyOptions($_GET["select"], $name);
if ($options) {
if ($fields[$name]["null"]) {
$options[0] = '(' . lang('empty') . ')';
}
$key = $keys[$name];
$i--;
echo "<div>" . h($desc) . "<input type='hidden' name='where[$i][col]' value='" . h($name) . "'><input type='hidden' name='where[$i][op]' value='='>: <select name='where[$i][val]'>" . optionlist($options, $where[$key]["val"], true) . "</select></div>\n";
@@ -229,7 +216,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
}
$i = 0;
foreach ($where as $val) {
if (($val["col"] == "" || $columns[$val["col"]]) && "$val[col]$val[val]" != "") {
if ($columns[$val["col"]] && "$val[col]$val[val]" != "") {
echo "<div><select name='where[$i][col]'><option value=''>(" . lang('anywhere') . ")" . optionlist($columns, $val["col"], true) . "</select>";
echo html_select("where[$i][op]", array(-1 => "") + $this->operators, $val["op"]);
echo "<input name='where[$i][val]' value='" . h($val["val"]) . "'></div>\n";
@@ -248,7 +235,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
foreach ($indexes as $key => $index) {
$order = array();
foreach ($index["columns"] as $val) {
$order[] = $columns[$val];
$order[] = $this->fieldName(array("field" => $val, "comment" => $columns[$val]));
}
if (count(array_filter($order, 'strlen')) > 1 && $key != "PRIMARY") {
$orders[$key] = implode(", ", $order);
@@ -256,15 +243,9 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
}
if ($orders) {
echo '<fieldset><legend>' . lang('Sort') . "</legend><div>";
echo "<select name='index_order'>" . optionlist(array("" => "") + $orders, ($_GET["order"][0] != "" ? "" : $_GET["index_order"]), true) . "</select>";
echo "<select name='index_order'>" . optionlist(array("" => "") + $orders, $_GET["index_order"], true) . "</select>";
echo "</div></fieldset>\n";
}
if ($_GET["order"]) {
echo "<div style='display: none;'>" . hidden_fields(array(
"order" => array(1 => reset($_GET["order"])),
"desc" => ($_GET["desc"] ? array(1 => 1) : array()),
)) . "</div>\n";
}
}
function selectLimitPrint($limit) {
@@ -284,12 +265,12 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
function selectEmailPrint($emailFields, $columns) {
if ($emailFields) {
print_fieldset("email", lang('E-mail'), $_POST["email_append"]);
echo '<fieldset><legend><a href="#fieldset-email" onclick="return !toggle(\'fieldset-email\');">' . lang('E-mail') . "</a></legend><div id='fieldset-email'" . ($_POST["email_append"] ? "" : " class='hidden'") . ">\n";
echo "<p>" . lang('From') . ": <input name='email_from' value='" . h($_POST ? $_POST["email_from"] : $_COOKIE["adminer_email"]) . "'>\n";
echo lang('Subject') . ": <input name='email_subject' value='" . h($_POST["email_subject"]) . "'>\n";
echo "<p><textarea name='email_message' rows='15' cols='75'>" . h($_POST["email_message"] . ($_POST["email_append"] ? '{$' . "$_POST[email_addition]}" : "")) . "</textarea><br>\n"; //! Ctrl+Enter for this.form.email
echo "<p><textarea name='email_message' rows='15' cols='75'>" . h($_POST["email_message"] . ($_POST["email_append"] ? '{$' . "$_POST[email_addition]}" : "")) . "</textarea><br>\n";
echo html_select("email_addition", $columns, $_POST["email_addition"]) . "<input type='submit' name='email_append' value='" . lang('Insert') . "'>\n"; //! JavaScript
echo "<p>" . lang('Attachments') . ": <input type='file' name='email_files[]' onchange=\"this.onchange = function () { }; var el = this.cloneNode(true); el.value = ''; this.parentNode.appendChild(el);\">";
echo "<p>" . lang('Attachments') . ": <input type='file' name='email_files[]' onchange=\"var el = this.cloneNode(true); el.value = ''; this.parentNode.appendChild(el); this.onchange = function () { };\">";
echo "<p>" . (count($emailFields) == 1 ? '<input type="hidden" name="email_field" value="' . h(key($emailFields)) . '">' : html_select("email_field", $emailFields));
echo "<input type='submit' name='email' value='" . lang('Send') . "' onclick=\"return this.form['delete'].onclick();\">\n";
echo "</div></fieldset>\n";
@@ -310,20 +291,12 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$conds = array();
foreach (($col != "" ? array($col => $fields[$col]) : $fields) as $name => $field) {
if ($col != "" || is_numeric($val) || !ereg('int|float|double|decimal', $field["type"])) {
$name = idf_escape($name);
if ($col != "" && $field["type"] == "enum") {
$conds[] = (in_array(0, $val) ? "$name IS NULL OR " : "") . "$name IN (" . implode(", ", array_map('intval', $val)) . ")";
$conds[] = idf_escape($name) . " IN (" . implode(", ", array_map('intval', $val)) . ")";
} else {
$text_type = ereg('char|text|enum|set', $field["type"]);
$value = $this->processInput($field, (!$op && $text_type && ereg('^[^%]+$', $val) ? "%$val%" : $val));
$conds[] = $name . ($value == "NULL" ? " IS" . ($op == ">=" ? " NOT" : "") . " $value"
: (in_array($op, $this->operators) || $op == "=" ? " $op $value"
: ($text_type ? " LIKE $value"
: " IN (" . str_replace(",", "', '", $value) . ")"
))); //! can issue "Illegal mix of collations" for columns in other character sets - solve by CONVERT($name using utf8)
if ($key < 0 && $val == "0") {
$conds[] = "$name IS NULL";
}
$value = $this->processInput($field, ($text_type && ereg('^[^%]+$', $val) ? "%$val%" : $val));
$conds[] = idf_escape($name) . ($value == "NULL" ? " IS" . ($op == ">=" ? " NOT" : "") : (in_array($op, $this->operators) ? " $op" : ($op != "=" && $text_type ? " LIKE" : " ="))) . " $value"; //! can issue "Illegal mix of collations" for columns in other character sets - solve by CONVERT($name using utf8)
}
}
}
@@ -334,13 +307,10 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
}
function selectOrderProcess($fields, $indexes) {
$index_order = $_GET["index_order"];
if ($index_order != "") {
unset($_GET["order"][1]);
}
if ($_GET["order"]) {
return array(idf_escape(reset($_GET["order"])) . ($_GET["desc"] ? " DESC" : ""));
return array(idf_escape($_GET["order"][0]) . (isset($_GET["desc"][0]) ? " DESC" : ""));
}
$index_order = $_GET["index_order"];
foreach (($index_order != "" ? array($indexes[$index_order]) : $indexes) as $index) {
if ($index_order != "" || $index["type"] == "INDEX") {
$desc = false;
@@ -369,6 +339,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
}
function selectEmailProcess($where, $foreignKeys) {
global $connection;
if ($_POST["email_append"]) {
return true;
}
@@ -379,11 +350,15 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$subject = $_POST["email_subject"];
$message = $_POST["email_message"];
preg_match_all('~\\{\\$([a-z0-9_]+)\\}~i', "$subject.$message", $matches); // allows {$name} in subject or message
$rows = get_rows("SELECT DISTINCT $field" . ($matches[1] ? ", " . implode(", ", array_map('idf_escape', array_unique($matches[1]))) : "") . " FROM " . table($_GET["select"])
$result = $connection->query("SELECT DISTINCT $field" . ($matches[1] ? ", " . implode(", ", array_map('idf_escape', array_unique($matches[1]))) : "") . " FROM " . idf_escape($_GET["select"])
. " WHERE $field IS NOT NULL AND $field != ''"
. ($where ? " AND " . implode(" AND ", $where) : "")
. ($_POST["all"] ? "" : " AND ((" . implode(") OR (", array_map('where_check', (array) $_POST["check"])) . "))")
);
$rows = array();
while ($row = $result->fetch_assoc()) {
$rows[] = $row;
}
$fields = fields($_GET["select"]);
foreach ($this->rowDescriptions($rows, $foreignKeys) as $row) {
$replace = array('{\\' => '{'); // allow literal {$name}
@@ -391,7 +366,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$replace['{$' . "$val}"] = $this->editVal($row[$val], $fields[$val]);
}
$email = $row[$_POST["email_field"]];
if (is_mail($email) && send_mail($email, strtr($subject, $replace), strtr($message, $replace), $_POST["email_from"], $_FILES["email_files"])) {
if (is_email($email) && send_email($email, strtr($subject, $replace), strtr($message, $replace), $_POST["email_from"], $_FILES["email_files"])) {
$sent++;
}
}
@@ -403,18 +378,14 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
}
function messageQuery($query) {
return "<!--\n" . str_replace("--", "--><!-- ", $query) . "\n-->";
return "<!--\n" . str_replace("--", "--><!--", $query) . "\n-->";
}
function editFunctions($field) {
$return = array();
if ($field["null"] && ereg('blob', $field["type"])) {
$return["NULL"] = lang('empty');
}
$return[""] = ($field["null"] || $field["auto_increment"] || ereg("(tinyint|bit)\\(1\\)", $field["full_type"]) ? "" : "*");
$return = array("" => ($field["null"] || $field["auto_increment"] || $field["full_type"] == "tinyint(1)" ? "" : "*"));
//! respect driver
if (ereg('date|time', $field["type"])) {
$return["now"] = lang('now');
$return[] = "now";
}
if (eregi('_(md5|sha1)$', $field["field"], $match)) {
$return[] = strtolower($match[1]);
@@ -424,87 +395,45 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
function editInput($table, $field, $attrs, $value) {
if ($field["type"] == "enum") {
return (isset($_GET["select"]) ? "<label><input type='radio'$attrs value='-1' checked><i>" . lang('original') . "</i></label> " : "")
. enum_input("radio", $attrs, $field, ($value || isset($_GET["select"]) ? $value : 0), ($field["null"] ? "" : null))
;
return ($field["null"] ? "<input type='radio'$attrs value=''" . ($value || isset($_GET["select"]) ? "" : " checked") . ">" : "");
}
$options = $this->_foreignKeyOptions($table, $field["field"]);
if ($options) {
return "<select$attrs>" . optionlist($options, $value, true) . "</select>";
}
if (ereg("(tinyint|bit)\\(1\\)", $field["full_type"])) { // bool
if ($field["full_type"] == "tinyint(1)") { // bool
return '<input type="checkbox" value="' . h($value ? $value : 1) . '"' . ($value ? ' checked' : '') . "$attrs>";
}
$hint = "";
if (ereg('time', $field["type"])) {
$hint = lang('HH:MM:SS');
}
if (ereg('date|timestamp', $field["type"])) {
$hint = lang('[yyyy]-mm-dd') . ($hint ? " [$hint]" : "");
}
if ($hint) {
return "<input value='" . h($value) . "'$attrs> ($hint)"; //! maxlength
}
if (eregi('_(md5|sha1)$', $field["field"])) {
return "<input type='password' value='" . h($value) . "'$attrs>";
return "<input value='" . h($value) . "'$attrs> (" . lang('[yyyy]-mm-dd') . ")"; //! maxlength
}
return '';
}
function processInput($field, $value, $function = "") {
global $connection;
if ($function == "now") {
return "$function()";
}
$return = $value;
if (ereg('date|timestamp', $field["type"]) && preg_match('(^' . str_replace('\\$1', '(?P<p1>\\d*)', preg_replace('~(\\\\\\$([2-6]))~', '(?P<p\\2>\\d{1,2})', preg_quote(lang('$1-$3-$5')))) . '(.*))', $value, $match)) {
if (ereg('date|timestamp', $field["type"]) && preg_match('(^' . str_replace('\\$1', '(?P<p1>[0-9]*)', preg_replace('~(\\\\\\$([2-6]))~', '(?P<p\\2>[0-9]{1,2})', preg_quote(lang('$1-$3-$5')))) . '(.*))', $value, $match)) {
$return = ($match["p1"] != "" ? $match["p1"] : ($match["p2"] != "" ? ($match["p2"] < 70 ? 20 : 19) . $match["p2"] : gmdate("Y"))) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match);
}
$return = ($field["type"] == "bit" && ereg('^[0-9]+$', $value) ? $return : q($return));
if (!ereg('char|text', $field["type"]) && !ereg("(tinyint|bit)\\(1\\)", $field["full_type"]) && $value == "") {
$return = $connection->quote($return);
if (!ereg('varchar|text', $field["type"]) && $field["full_type"] != "tinyint(1)" && $value == "") {
$return = "NULL";
} elseif (ereg('^(md5|sha1)$', $function)) {
$return = "$function($return)";
}
if (ereg("binary", $field["type"])) {
$return = "unhex($return)";
}
return $return;
}
function dumpOutput() {
return array();
function dumpOutput($select, $value = "") {
return "";
}
function dumpFormat() {
return array('csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV');
}
function dumpTable() {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark
}
function dumpData($table, $style, $query) {
global $connection;
$result = $connection->query($query, 1); // 1 - MYSQLI_USE_RESULT
if ($result) {
while ($row = $result->fetch_assoc()) {
if ($style == "table") {
dump_csv(array_keys($row));
$style = "INSERT";
}
dump_csv($row);
}
}
}
function dumpHeaders($identifier, $multi_table = false) {
$ext = "csv";
header("Content-Type: text/csv; charset=utf-8");
return $ext;
}
function homepage() {
return true;
function dumpFormat($select, $value = "") {
return html_select("format", array('csv' => 'CSV,', 'csv;' => 'CSV;'), $value, $select);
}
function navigation($missing) {
@@ -518,25 +447,25 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
<?php
if ($missing == "auth") {
$first = true;
foreach ((array) $_SESSION["pwds"]["server"][""] as $username => $password) {
foreach ((array) $_SESSION["passwords"]["server"][""] as $username => $password) {
if (isset($password)) {
if ($first) {
echo "<p onclick='eventStop(event);'>\n";
echo "<p>\n";
$first = false;
}
echo "<a href='" . h(auth_url("server", "", $username)) . "'>" . ($username != "" ? h($username) : "<i>" . lang('empty') . "</i>") . "</a><br>\n";
echo "<a href='" . h(auth_url("server", "", $username)) . "'>" . h($username) . "</a><br>\n";
}
}
} else {
?>
<form action="" method="post">
<p class="logout">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>" onclick="eventStop(event);">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>">
</p>
</form>
<?php
if ($missing != "db" && $missing != "ns") {
if ($missing != "db") {
$table_status = table_status();
if (!$table_status) {
echo "<p class='message'>" . lang('No tables.') . "\n";
@@ -552,12 +481,13 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
foreach ($tables as $row) {
$name = $this->tableName($row);
if (isset($row["Engine"]) && $name != "") { // ignore views and tables without name
echo "<a href='" . h(ME) . 'select=' . urlencode($row["Name"]) . "'" . bold($_GET["select"] == $row["Name"]) . ">$name</a><br>\n";
echo "<a href='" . h(ME) . 'select=' . urlencode($row["Name"]) . "'>" . bold($name, $_GET["select"] == $row["Name"]) . "</a><br>\n";
}
}
}
function _foreignKeyOptions($table, $column) {
global $connection;
$foreignKeys = column_foreign_keys($table);
foreach ((array) $foreignKeys[$column] as $foreignKey) {
if (count($foreignKey["source"]) == 1) {
@@ -567,7 +497,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$return = &$this->_values[$foreignKey["table"]];
if (!isset($return)) {
$table_status = table_status($foreignKey["table"]);
$return = ($table_status["Rows"] > 1000 ? array() : array("" => "") + get_key_vals("SELECT $id, $name FROM " . table($foreignKey["table"]) . " ORDER BY 2"));
$return = ($table_status["Rows"] > 1000 ? array() : array("" => "") + get_key_vals("SELECT $id, $name FROM " . idf_escape($foreignKey["table"]) . " ORDER BY 2"));
}
return $return;
}

View File

@@ -14,9 +14,9 @@ function email_header($header) {
* @param string
* @param string
* @param array
* @return bool
* @return
*/
function send_mail($email, $subject, $message, $from = "", $files = array("error" => array())) {
function send_email($email, $subject, $message, $from = "", $files = array()) {
$eol = (strncasecmp(PHP_OS, "win", 3) ? "\n" : "\r\n"); // PHP_EOL available since PHP 4.3.10 and 5.0.2
$message = str_replace("\n", $eol, wordwrap(str_replace("\r", "", "$message\n")));
$boundary = uniqid("boundary");

View File

@@ -0,0 +1,23 @@
<?php
function dump_table($table) {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark
}
function dump_data($table, $style, $select = "") {
global $connection;
$result = $connection->query(($select ? $select : "SELECT * FROM " . idf_escape($table)), 1); // 1 - MYSQLI_USE_RESULT
if ($result) {
while ($row = $result->fetch_assoc()) {
dump_csv($row);
}
}
}
function dump_headers($identifier) {
$filename = ($identifier != "" ? friendly_url($identifier) : "dump");
$ext = "csv";
header("Content-Type: text/csv; charset=utf-8");
header("Content-Disposition: attachment; filename=$filename.$ext");
session_write_close();
return $ext;
}

View File

@@ -1,10 +1,9 @@
<?php
/** Adminer Editor - Compact database editor
* @link http://www.adminer.org/
* @author Jakub Vrana, http://www.vrana.cz/
* @author Jakub Vrana, http://php.vrana.cz/
* @copyright 2009 Jakub Vrana
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
include "../adminer/include/bootstrap.inc.php";

View File

@@ -1,5 +1,4 @@
// Editor specific functions
function bodyLoad(version) {
onpopstate(history);
}

1
externals/jquery-ui vendored

Submodule externals/jquery-ui deleted from c44818fcca

2
externals/jush vendored

1
externals/tinymce vendored

Submodule externals/tinymce deleted from 00968708de

View File

@@ -27,8 +27,7 @@ foreach (array_merge(
foreach (glob(dirname(__FILE__) . "/adminer/lang/" . ($_SESSION["lang"] ? $_SESSION["lang"] : "*") . ".inc.php") as $filename) {
$messages = $messages_all;
$file = file_get_contents($filename);
$file = str_replace("\r", "", $file);
preg_match_all("~^(\\s*(?:// [^'].*\\s+)?)(?:// )?(('(?:[^\\\\']+|\\\\.)*') => .*[^,\n]),?~m", $file, $matches, PREG_SET_ORDER);
preg_match_all("~^(\\s*)(?:// )?(('(?:[^\\\\']+|\\\\.)*') => .*[^,\n]),?~m", $file, $matches, PREG_SET_ORDER);
$s = "";
foreach ($matches as $match) {
if (isset($messages[$match[3]])) {
@@ -40,17 +39,12 @@ foreach (glob(dirname(__FILE__) . "/adminer/lang/" . ($_SESSION["lang"] ? $_SESS
$s .= "$match[1]// $match[2],\n";
}
}
if ($messages) {
if (basename($filename) != "en.inc.php") {
$s .= "\n";
}
foreach ($messages as $idf => $val) {
// add new messages
if ($val == "," && strpos($idf, "%d")) {
$s .= "\t$idf => array(),\n";
} elseif (basename($filename) != "en.inc.php") {
$s .= "\t$idf => null,\n";
}
foreach($messages as $idf => $val) {
// add new messages
if ($val == "," && strpos($idf, "%d")) {
$s .= "\t$idf => array(),\n";
} elseif (basename($filename) != "en.inc.php") {
$s .= "\t$idf => null,\n";
}
}
$s = "<?php\n\$translations = array(\n$s);\n";

View File

@@ -1,54 +0,0 @@
<?php
/** Dump to XML format in structure <database name=""><table name=""><column name="">value
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerDumpXml {
function dumpFormat() {
return array('xml' => 'XML');
}
function dumpTable($table, $style, $is_view = false) {
if ($_POST["format"] == "xml") {
return true;
}
}
function _database() {
echo "</database>\n";
}
function dumpData($table, $style, $query) {
static $database = false;
if ($_POST["format"] == "xml") {
if (!$database) {
$database = true;
echo "<database name='" . h(DB) . "'>\n";
register_shutdown_function(array($this, '_database'));
}
$connection = connection();
$result = $connection->query($query, 1);
if ($result) {
while ($row = $result->fetch_assoc()) {
echo "\t<table name='" . h($table) . "'>\n";
foreach ($row as $key => $val) {
echo "\t\t<column name='" . h($key) . "'>" . h($val) . "</column>\n";
}
echo "\t</table>\n";
}
}
return true;
}
}
function dumpHeaders($identifier, $multi_table = false) {
if ($_POST["format"] == "xml") {
header("Content-Type: text/xml; charset=utf-8");
return "xml";
}
}
}

View File

@@ -1,43 +0,0 @@
<?php
/** Dump to ZIP format
* @uses ZipArchive, tempnam("")
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerDumpZip {
var $filename;
function dumpOutput() {
if (!class_exists('ZipArchive')) {
return array();
}
return array('zip' => 'ZIP');
}
function _zip($string, $state) {
static $data = "";
$data .= $string;
if ($state & PHP_OUTPUT_HANDLER_END) {
$zip = new ZipArchive;
$zipFile = tempnam("", "zip");
$zip->open($zipFile, ZipArchive::OVERWRITE); // php://output is not supported
$zip->addFromString($this->filename, $data);
$zip->close();
$return = file_get_contents($zipFile);
unlink($zipFile);
return $return;
}
return "";
}
function dumpHeaders($identifier, $multi_table = false) {
$this->filename = "$identifier." . ($multi_table && ereg("[ct]sv", $_POST["format"]) ? "tar" : $_POST["format"]);
if ($_POST["output"] == "zip") {
header("Content-Type: application/zip");
}
ob_start(array($this, '_zip'));
}
}

View File

@@ -1,47 +0,0 @@
<?php
/** Display jQuery UI Timepicker for each date and datetime field
* @uses jQuery-Timepicker, http://trentrichardson.com/examples/timepicker/
* @uses jQuery UI: core, widget, mouse, slider, datepicker
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerEditCalendar {
var $prepend, $langPath;
/**
* @param string text to append before first calendar usage
* @param string path to language file, %s stands for language code
*/
function AdminerEditCalendar($prepend = "<script type='text/javascript' src='jquery-ui/jquery.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui.js'></script>\n<script type='text/javascript' src='jquery-ui/jquery-ui-timepicker-addon.js'></script>\n<link rel='stylesheet' type='text/css' href='jquery-ui/jquery-ui.css'>\n", $langPath = "jquery-ui/i18n/jquery.ui.datepicker-%s.js") { //! insert <link> by JavaScript to achieve HTML validity
$this->prepend = $prepend;
$this->langPath = $langPath;
}
function editInput($table, $field, $attrs, $value) {
static $calendar = false;
if (ereg("date|time", $field["type"])) {
if (!$calendar) {
$calendar = true;
echo $this->prepend;
if ($this->langPath && function_exists('get_lang')) { // since Adminer 3.2.0
$lang = get_lang();
$lang = ($lang == "zh" ? "zh-CN" : ($lang == "zh-tw" ? "zh-TW" : $lang));
if ($lang != "en" && file_exists(sprintf($this->langPath, $lang))) {
printf("<script type='text/javascript' src='$this->langPath'></script>\n", $lang);
echo "<script type='text/javascript'>jQuery(function () { jQuery.timepicker.setDefaults(jQuery.datepicker.regional['$lang']); });</script>\n";
}
}
}
$dateFormat = "changeYear: true, dateFormat: 'yy-mm-dd'"; //! yy-mm-dd regional
$timeFormat = "showSecond: true, timeFormat: 'hh:mm:ss'";
return "<input id='fields-" . h($field["field"]) . "' value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . "$attrs><script type='text/javascript'>jQuery(function () { jQuery('#fields-" . js_escape($field["field"]) . "')."
. ($field["type"] == "time" ? "timepicker({ $timeFormat })"
: (ereg("time", $field["type"]) ? "datetimepicker({ $dateFormat, $timeFormat })"
: "datepicker({ $dateFormat })"
)) . "; });</script>";
}
}
}

View File

@@ -1,16 +0,0 @@
<?php
/** Use <textarea> for char and varchar
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerEditTextarea {
function editInput($table, $field, $attrs, $value) {
if (ereg('char', $field["type"])) {
return "<textarea cols='30' rows='1' style='height: 1.2em;'$attrs>" . h($value) . '</textarea>';
}
}
}

View File

@@ -1,36 +0,0 @@
<?php
/** Use <select><option> for enum edit instead of <input type="radio">
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerEnumOption {
function editInput($table, $field, $attrs, $value) {
if ($field["type"] == "enum") {
$options = array("" => array());
$selected = $value;
if (isset($_GET["select"])) {
$options[""][-1] = lang('original');
}
if ($field["null"]) {
$options[""][""] = "NULL";
if (!isset($value) && !isset($_GET["select"])) {
$selected = "";
}
}
$options[""][0] = lang('empty');
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
foreach ($matches[1] as $i => $val) {
$val = stripcslashes(str_replace("''", "'", $val));
$options[$i + 1] = $val;
if ($value === $val) {
$selected = $i + 1;
}
}
return "<select$attrs>" . optionlist($options, (string) $selected, 1) . "</select>"; // 1 - use keys
}
}
}

View File

@@ -1,48 +0,0 @@
<?php
/** Edit fields ending with "_path" by <input type="file"> and link to the uploaded files from select
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerFileUpload {
var $uploadPath, $displayPath;
/**
* @param string prefix for uploading data (create writable subdirectory for each table containing uploadable fields)
* @param string prefix for displaying data, null stands for $uploadPath
*/
function AdminerFileUpload($uploadPath = "../static/data/", $displayPath = null) {
$this->uploadPath = $uploadPath;
$this->displayPath = (isset($displayPath) ? $displayPath : $uploadPath);
}
function editInput($table, $field, $attrs, $value) {
if (ereg('(.*)_path$', $field["field"])) {
return "<input type='file' name='fields-$field[field]'>";
}
}
function processInput($field, $value, $function = "") {
if (ereg('(.*)_path$', $field["field"], $regs)) {
$table = ($_GET["edit"] != "" ? $_GET["edit"] : $_GET["select"]);
$name = "fields-$field[field]";
if ($_FILES[$name]["error"] || !eregi('(\\.([a-z0-9]+))?$', $_FILES[$name]["name"], $regs2)) {
return false;
}
//! unlink old
$filename = uniqid() . $regs2[0];
if (!move_uploaded_file($_FILES[$name]["tmp_name"], "$this->uploadPath$table/$regs[1]-$filename")) {
return false;
}
return q($filename);
}
}
function selectVal($val, &$link, $field) {
if ($val != "&nbsp;" && ereg('(.*)_path$', $field["field"], $regs)) {
$link = "$this->displayPath$_GET[select]/$regs[1]-$val";
}
}
}

View File

@@ -1,55 +0,0 @@
<?php
/** Link system tables (in mysql and information_schema databases) by foreign keys
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerForeignSystem {
function foreignKeys($table) {
if (DRIVER == "server" && DB == "mysql") {
switch ($table) {
case "columns_priv": return array(array("table" => "user", "source" => array("Host", "User"), "target" => array("Host", "User")));
case "db": return array(array("table" => "user", "source" => array("Host", "User"), "target" => array("Host", "User")));
case "help_category": return array(array("table" => "help_category", "source" => array("parent_category_id"), "target" => array("help_category_id")));
case "help_relation": return array(array("table" => "help_topic", "source" => array("help_topic_id"), "target" => array("help_topic_id")), array("table" => "help_keyword", "source" => array("help_keyword_id"), "target" => array("help_keyword_id")));
case "help_topic": return array(array("table" => "help_category", "source" => array("help_category_id"), "target" => array("help_category_id")));
case "procs_priv": return array(array("table" => "user", "source" => array("Host", "User"), "target" => array("Host", "User")), array("table" => "proc", "source" => array("Db", "Routine_name"), "target" => array("db", "name")));
case "tables_priv": return array(array("table" => "user", "source" => array("Host", "User"), "target" => array("Host", "User")));
case "time_zone_name": return array(array("table" => "time_zone", "source" => array("Time_zone_id"), "target" => array("Time_zone_id")));
case "time_zone_transition": return array(array("table" => "time_zone", "source" => array("Time_zone_id"), "target" => array("Time_zone_id")), array("table" => "time_zone_transition_type", "source" => array("Time_zone_id", "Transition_type_id"), "target" => array("Time_zone_id", "Transition_type_id")));
case "time_zone_transition_type": return array(array("table" => "time_zone", "source" => array("Time_zone_id"), "target" => array("Time_zone_id")));
}
} elseif (DB == "information_schema") {
$schemata = array("table" => "SCHEMATA", "source" => array("TABLE_CATALOG", "TABLE_SCHEMA"), "target" => array("CATALOG_NAME", "SCHEMA_NAME"));
$tables = array("table" => "TABLES", "source" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"), "target" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"));
$columns = array("table" => "COLUMNS", "source" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "COLUMN_NAME"), "target" => array("TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "COLUMN_NAME"));
$character_sets = array("table" => "CHARACTER_SETS", "source" => array("CHARACTER_SET_NAME"), "target" => array("CHARACTER_SET_NAME"));
$collations = array("table" => "COLLATIONS", "source" => array("COLLATION_NAME"), "target" => array("COLLATION_NAME"));
$routine_charsets = array(array("source" => array("CHARACTER_SET_CLIENT")) + $character_sets, array("source" => array("COLLATION_CONNECTION")) + $collations, array("source" => array("DATABASE_COLLATION")) + $collations);
switch ($table) {
case "CHARACTER_SETS": return array(array("source" => array("DEFAULT_COLLATE_NAME")) + $collations);
case "COLLATIONS": return array($character_sets);
case "COLLATION_CHARACTER_SET_APPLICABILITY": return array($collations, $character_sets);
case "COLUMNS": return array($schemata, $tables, $character_sets, $collations);
case "COLUMN_PRIVILEGES": return array($schemata, $tables, $columns);
case "TABLES": return array($schemata, array("source" => array("TABLE_COLLATION")) + $collations);
case "SCHEMATA": return array(array("source" => array("DEFAULT_CHARACTER_SET_NAME")) + $character_sets, array("source" => array("DEFAULT_COLLATION_NAME")) + $collations);
case "EVENTS": return array_merge(array(array("source" => array("EVENT_CATALOG", "EVENT_SCHEMA")) + $schemata), $routine_charsets);
case "FILES": return array($schemata, $tables);
case "KEY_COLUMN_USAGE": return array(array("source" => array("CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA")) + $schemata, $schemata, $tables, $columns, array("source" => array("TABLE_CATALOG", "REFERENCED_TABLE_SCHEMA")) + $schemata, array("source" => array("TABLE_CATALOG", "REFERENCED_TABLE_SCHEMA", "REFERENCED_TABLE_NAME")) + $tables, array("source" => array("TABLE_CATALOG", "REFERENCED_TABLE_SCHEMA", "REFERENCED_TABLE_NAME", "REFERENCED_COLUMN_NAME")) + $columns);
case "PARTITIONS": return array($schemata, $tables);
case "REFERENTIAL_CONSTRAINTS": return array(array("source" => array("CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA")) + $schemata, array("source" => array("UNIQUE_CONSTRAINT_CATALOG", "UNIQUE_CONSTRAINT_SCHEMA")) + $schemata, array("source" => array("CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA", "TABLE_NAME")) + $tables, array("source" => array("CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA", "REFERENCED_TABLE_NAME")) + $tables);
case "ROUTINES": return array_merge(array(array("source" => array("ROUTINE_CATALOG", "ROUTINE_SCHEMA")) + $schemata), $routine_charsets);
case "SCHEMA_PRIVILEGES": return array($schemata);
case "STATISTICS": return array($schemata, $tables, $columns, array("source" => array("TABLE_CATALOG", "INDEX_SCHEMA")) + $schemata);
case "TABLE_CONSTRAINTS": return array(array("source" => array("CONSTRAINT_CATALOG", "CONSTRAINT_SCHEMA")) + $schemata, array("source" => array("CONSTRAINT_CATALOG", "TABLE_SCHEMA")) + $schemata, array("source" => array("CONSTRAINT_CATALOG", "TABLE_SCHEMA", "TABLE_NAME")) + $tables);
case "TABLE_PRIVILEGES": return array($schemata, $tables);
case "TRIGGERS": return array_merge(array(array("source" => array("TRIGGER_CATALOG", "TRIGGER_SCHEMA")) + $schemata, array("source" => array("EVENT_OBJECT_CATALOG", "EVENT_OBJECT_SCHEMA")) + $schemata, array("source" => array("EVENT_OBJECT_CATALOG", "EVENT_OBJECT_SCHEMA", "EVENT_OBJECT_TABLE")) + $tables), $routine_charsets);
case "VIEWS": return array($schemata);
}
}
}
}

View File

@@ -1,26 +0,0 @@
<?php
/** Allow using Adminer inside a frame (disables ClickJacking protection)
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerFrames {
var $sameOrigin;
/**
* @param bool allow running from the same origin only
*/
function AdminerFrames($sameOrigin = false) {
$this->sameOrigin = $sameOrigin;
}
function headers() {
if ($this->sameOrigin) {
header("X-Frame-Options: SameOrigin");
}
header("X-XSS-Protection: 0");
return true;
}
}

View File

@@ -1,47 +0,0 @@
<?php
/** Display constant list of servers in login form
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerLoginServers {
var $servers;
/** Set supported servers
* @param array array($domain) or array($domain => $description) or array($category => array())
*/
function AdminerLoginServers($servers) {
$this->servers = $servers;
}
function login($login, $password) {
// check if server is allowed
foreach ($this->servers as $key => $val) {
$servers = $val;
if (!is_array($val)) {
$servers = array($key => $val);
}
foreach ($servers as $k => $v) {
if ((is_string($k) ? $k : $v) == SERVER) {
return;
}
}
}
return false;
}
function loginForm() {
?>
<table cellspacing="0">
<tr><th><?php echo lang('Server'); ?><td><input type="hidden" name="driver" value="server"><select name="server"><?php echo optionlist($this->servers, SERVER); ?></select>
<tr><th><?php echo lang('Username'); ?><td><input id="username" name="username" value="<?php echo h($_GET["username"]); ?>">
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="password">
</table>
<p><input type="submit" value="<?php echo lang('Login'); ?>">
<?php
echo checkbox("permanent", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
return true;
}
}

View File

@@ -1,32 +0,0 @@
<?php
/* Requires this table:
CREATE TABLE login (
id int NOT NULL AUTO_INCREMENT, -- optional
login varchar(30) NOT NULL, -- any length
password_sha1 char(40) NOT NULL,
UNIQUE (login),
PRIMARY KEY (id)
);
*/
/** Authenticate a user from the login table
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerLoginTable {
var $database;
/** Set database of login table
* @param string
*/
function AdminerLoginTable($database) {
$this->database = $database;
}
function login($login, $password) {
$connection = connection();
return (bool) $connection->result("SELECT COUNT(*) FROM " . idf_escape($this->database) . ".login WHERE login = " . q($login) . " AND password_sha1 = " . q(sha1($password)));
}
}

View File

@@ -1,272 +0,0 @@
<?php
/** Adminer customization allowing usage of plugins
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerPlugin extends Adminer {
var $plugins;
/**
* @param array
*/
function AdminerPlugin($plugins) {
$this->plugins = $plugins;
// it is possible to use ReflectionObject in PHP 5 to find out which plugins defines which methods at once
}
function _applyPlugin($function, $args) {
foreach ($this->plugins as $plugin) {
if (method_exists($plugin, $function)) {
switch (count($args)) { // call_user_func_array() doesn't work well with references
case 0: $return = $plugin->$function(); break;
case 1: $return = $plugin->$function($args[0]); break;
case 2: $return = $plugin->$function($args[0], $args[1]); break;
case 3: $return = $plugin->$function($args[0], $args[1], $args[2]); break;
case 4: $return = $plugin->$function($args[0], $args[1], $args[2], $args[3]); break;
default: trigger_error('Too many parameters.', E_USER_WARNING);
}
if (isset($return)) {
return $return;
}
}
}
return call_user_func_array(array($this, "parent::$function"), $args);
}
function _appendPlugin($function, $args) {
$return = call_user_func_array(array($this, "parent::$function"), $args);
foreach ($this->plugins as $plugin) {
if (method_exists($plugin, $function)) {
$return += call_user_func_array(array($plugin, $function), $args);
}
}
return $return;
}
// appendPlugin
function dumpFormat() {
$args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args);
}
function dumpOutput() {
$args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args);
}
function editFunctions() {
$args = func_get_args();
return $this->_appendPlugin(__FUNCTION__, $args);
}
// applyPlugin
function name() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function credentials() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function permanentLogin() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function database() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function headers() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function head() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function loginForm() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function login() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function tableName() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function fieldName() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectLinks() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function foreignKeys() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function backwardKeys() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function backwardKeysPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectQuery() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function rowDescription() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function rowDescriptions() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectVal() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function editVal() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectColumnsPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectSearchPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectOrderPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectLimitPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectLengthPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectActionPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectEmailPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectColumnsProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectSearchProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectOrderProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectLimitProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectLengthProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectEmailProcess() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function messageQuery() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function editInput() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function processInput() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function dumpTable() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function dumpData() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function dumpHeaders() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function homepage() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function navigation() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
function tablesPrint() {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}
}

View File

@@ -1,2 +0,0 @@
../adminer/plugin.php - demo usage
http://www.adminer.org/en/plugins/ - documentation

View File

@@ -1,40 +0,0 @@
<?php
/** Prefill field containing "_slug" with slugified value of a previous field (JavaScript)
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerSlugify {
var $from, $to;
/**
* @param string find these characters ...
* @param string ... and replace them by these
*/
function AdminerSlugify($from = 'áčďéěíňóřšťúůýž', $to = 'acdeeinorstuuyz') {
$this->from = $from;
$this->to = $to;
}
function editInput($table, $field, $attrs, $value) {
static $slugify;
if (!$_GET["select"] && !$_GET["where"]) {
if (!isset($slugify)) {
$slugify = array();
$prev = null;
foreach (fields($table) as $name => $field) {
if ($prev && ereg('(^|_)slug(_|$)', $name)) {
$slugify[$prev] = $name;
}
$prev = $name;
}
}
$slug = $slugify[$field["field"]];
if (isset($slug)) {
return "<input value='" . h($value) . "' maxlength='$field[length]' size='40'$attrs onchange=\"var find = '$this->from'; var repl = '$this->to'; this.form['fields[$slug]'].value = this.value.toLowerCase().replace(new RegExp('[' + find + ']', 'g'), function (str) { return repl[find.indexOf(str)]; }).replace(/[^a-z0-9_]+/g, '-').replace(/^-|-\$/g, '').substr(0, $field[length]);\">";
}
}
}
}

View File

@@ -1,60 +0,0 @@
<?php
/** Edit all fields containing "_html" by HTML editor TinyMCE and display the HTML in select
* @uses TinyMCE, http://tinymce.moxiecode.com/
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerTinymce {
var $path;
/**
* @param string
*/
function AdminerTinymce($path = "tiny_mce/tiny_mce.js") {
$this->path = $path;
}
function selectVal(&$val, $link, $field) {
if (ereg("_html", $field["field"]) && $val != '&nbsp;') {
$val = preg_replace('~<[^>]*$~', '', html_entity_decode($val, ENT_QUOTES)); //! close all opened tags (text can be shortened)
}
}
function editInput($table, $field, $attrs, $value) {
static $tiny_mce = false;
if (ereg("text", $field["type"]) && ereg("_html", $field["field"])) {
if (!$tiny_mce) {
$tiny_mce = true;
$lang = "en";
if (function_exists('get_lang')) { // since Adminer 3.2.0
$lang = get_lang();
$lang = ($lang == "zh" ? "zh-cn" : ($lang == "zh-tw" ? "zh" : $lang));
if (!file_exists(dirname($this->path) . "/langs/$lang.js")) {
$lang = "en";
}
}
?>
<script type="text/javascript" src="<?php echo h($this->path); ?>"></script>
<script type="text/javascript">
tinyMCE.init({
mode: 'none',
theme: 'advanced',
plugins: 'contextmenu,paste,table',
entity_encoding: 'raw',
theme_advanced_buttons1: 'bold,italic,link,unlink,|,sub,sup,|,bullist,numlist,|,cleanup,code',
theme_advanced_buttons2: 'tablecontrols',
theme_advanced_buttons3: '',
theme_advanced_toolbar_location: 'top',
theme_advanced_toolbar_align: 'left',
language: '<?php echo $lang; ?>'
});
</script>
<?php
}
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>tinyMCE.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "');</script>";
}
}
}

View File

@@ -1,54 +0,0 @@
<?php
/* Requires this table:
CREATE TABLE translation (
id int NOT NULL AUTO_INCREMENT, -- optional
language_id varchar(5) NOT NULL,
idf text NOT NULL COLLATE utf8_bin,
translation text NOT NULL,
UNIQUE (language_id, idf(100)),
PRIMARY KEY (id)
);
*/
/** Translate all table and field comments, enum and set values from the translation table (inserts new translations)
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerTranslation {
function _translate($idf) {
static $translations, $lang;
if (!isset($lang)) {
$lang = get_lang();
}
if ($idf == "" || $lang == "en") {
return $idf;
}
if (!isset($translations)) {
$translations = get_key_vals("SELECT idf, translation FROM translation WHERE language_id = " . q($lang));
}
$return = &$translations[$idf];
if (!isset($return)) {
$return = $idf;
$connection = connection();
$connection->query("INSERT INTO translation (language_id, idf, translation) VALUES (" . q($lang) . ", " . q($idf) . ", " . q($idf) . ")");
}
return $return;
}
function tableName(&$tableStatus) {
$tableStatus["Comment"] = $this->_translate($tableStatus["Comment"]);
}
function fieldName(&$field, $order = 0) {
$field["comment"] = $this->_translate($field["comment"]);
}
function editVal(&$val, $field) {
if ($field["type"] == "enum") {
$val = $this->_translate($val);
}
}
}

View File

@@ -1,19 +0,0 @@
<?php
/** Disable version checker
* @author Jakub Vrana, http://www.vrana.cz/
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerVersionNoverify {
function navigation($missing) {
?>
<script type="text/javascript">
verifyVersion = function () {
};
</script>
<?php
}
}

View File

@@ -1,16 +0,0 @@
Adminer - Database management in single PHP file
Adminer Editor - Data manipulation for end-users
http://www.adminer.org/
Supports: MySQL, PostgreSQL, SQLite, MS SQL, Oracle
Requirements: PHP 4.3.3+ or PHP 5+
Apache License 2.0 or GPL 2
adminer/index.php - Run development version of Adminer
editor/index.php - Run development version of Adminer Editor
editor/example.php - Example customization
plugins/readme.txt - Plugins for Adminer and Adminer Editor
adminer/plugin.php - Plugin demo
compile.php [driver] [lang] - Create a single file version
lang.php [lang] - Update translations
tests/selenium.html - Selenium test suite

Some files were not shown because too many files have changed in this diff Show More