mirror of
https://github.com/vrana/adminer.git
synced 2025-08-30 09:39:51 +02:00
Compare commits
349 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
85e6f2ac9e | ||
|
e148db4b0f | ||
|
660703e422 | ||
|
55f11df052 | ||
|
ea6370ef77 | ||
|
0ad6a1e578 | ||
|
e546b483a1 | ||
|
5b443a4e7d | ||
|
e4837a0564 | ||
|
83a0776e8d | ||
|
5bebb439a1 | ||
|
9f0ee9cf41 | ||
|
c002009bfe | ||
|
a592ad52f1 | ||
|
3127c0d95e | ||
|
9447d97a6a | ||
|
c8e41ee649 | ||
|
b327a76fc0 | ||
|
7f2dd73670 | ||
|
c8975a151c | ||
|
150841e5d7 | ||
|
ae03bdd4c4 | ||
|
01e08cc053 | ||
|
a426fefd40 | ||
|
90df1b14f0 | ||
|
cd3231b4af | ||
|
65c52735fb | ||
|
93ccc7502b | ||
|
84e86cf572 | ||
|
1ce5b5ad31 | ||
|
941bf22e52 | ||
|
a5c54563c6 | ||
|
0234fe4a66 | ||
|
1883e250ff | ||
|
56d8b89bee | ||
|
4d66e42817 | ||
|
94f6a45a2a | ||
|
0f08592bc0 | ||
|
a5cbad504c | ||
|
d581f3dedb | ||
|
e8e4934e97 | ||
|
e959e46fa5 | ||
|
bb3d2957e1 | ||
|
ea408aa530 | ||
|
df90d9f68c | ||
|
cf76ad529b | ||
|
3d84dcf859 | ||
|
4b9d88545e | ||
|
26a39ac243 | ||
|
3676b7fb71 | ||
|
c564a8ef50 | ||
|
2780eb01f5 | ||
|
b98d0bcc55 | ||
|
e856e28892 | ||
|
8f269d66b0 | ||
|
3de94b67ca | ||
|
a9a7488454 | ||
|
36f13031f7 | ||
|
6f25b1b5cf | ||
|
659c34f7c5 | ||
|
11f24a52e4 | ||
|
3c3d861f41 | ||
|
7b60b03e6a | ||
|
84c65fcca6 | ||
|
733fe9e430 | ||
|
5c3fb875e1 | ||
|
60d1b7b3b4 | ||
|
db11fa4c1a | ||
|
c3cfc0e69b | ||
|
5f4d407f2e | ||
|
70afe70b72 | ||
|
75f43a4454 | ||
|
78f4513d9d | ||
|
89c66ccabe | ||
|
6ba77b7899 | ||
|
d271d0b481 | ||
|
af7ac6f06a | ||
|
19034c35fe | ||
|
88438cd607 | ||
|
34c792bb59 | ||
|
6ed94f1f6d | ||
|
8c4726bb61 | ||
|
8ab2c7e03b | ||
|
665fafb297 | ||
|
67c2a91c67 | ||
|
78b8707bd0 | ||
|
7c15940be8 | ||
|
8c5603a822 | ||
|
4e7c31a589 | ||
|
cf9cad66e2 | ||
|
26a3967cf9 | ||
|
6c63c2f91e | ||
|
acee5c0011 | ||
|
36b75b4203 | ||
|
4a24ee7672 | ||
|
e21ddd9767 | ||
|
f844fc499e | ||
|
52d7c38ef1 | ||
|
53dd78f5af | ||
|
ea1dad584b | ||
|
910bb39424 | ||
|
14db884471 | ||
|
3410836c12 | ||
|
cd503f6a0d | ||
|
00721402e0 | ||
|
4355aaa96f | ||
|
b1cdc7902b | ||
|
3f4f3454f8 | ||
|
846435aef8 | ||
|
d7982e0b29 | ||
|
7b35ebd82e | ||
|
5b359263eb | ||
|
6ebbd8c719 | ||
|
8bb51bec36 | ||
|
fc5ddddf92 | ||
|
d3a429314a | ||
|
b4392b3f91 | ||
|
2021ea8fd7 | ||
|
7cb3e768bb | ||
|
baf7225602 | ||
|
0cfc68e6c6 | ||
|
03dfea2943 | ||
|
54f6806339 | ||
|
ee4f7db641 | ||
|
b53762ae5f | ||
|
866d109a9b | ||
|
37c57c386a | ||
|
1f5ca321b6 | ||
|
059d6266e2 | ||
|
0e1d8c67fc | ||
|
a113a25123 | ||
|
49a865d106 | ||
|
026b362e7d | ||
|
7c32360c67 | ||
|
8a94bc6f41 | ||
|
3f901cfe30 | ||
|
c8fd73d70a | ||
|
30d0060b96 | ||
|
8b157a673e | ||
|
ce381aaf48 | ||
|
d3eac979d4 | ||
|
f19e23c98b | ||
|
705d3a910f | ||
|
d18c7b3587 | ||
|
1f12ea4e4a | ||
|
71a6a1269d | ||
|
6a3bce1174 | ||
|
28acee861f | ||
|
42b15654c4 | ||
|
e2d858d638 | ||
|
879963dec1 | ||
|
daa19b0a6e | ||
|
d27ee7a388 | ||
|
1ec4637ade | ||
|
ea1ff7e902 | ||
|
2761f44cf4 | ||
|
557b8b178e | ||
|
07d1bc4291 | ||
|
7ac96dd0b2 | ||
|
eeb7ce1939 | ||
|
ea4ac5c8f3 | ||
|
3906231dc5 | ||
|
fad20d1065 | ||
|
ffb4ee3a61 | ||
|
34d338b185 | ||
|
1b148bc08c | ||
|
f4983dfd5f | ||
|
800fbb9b9e | ||
|
4b1960f498 | ||
|
e299e9d82d | ||
|
cf7fe88990 | ||
|
60e5d24116 | ||
|
a1927d5b71 | ||
|
76d7560d27 | ||
|
f0b7d8ccd0 | ||
|
d322e0165b | ||
|
4009ede3ee | ||
|
cddd61c214 | ||
|
8b8cfd9f04 | ||
|
99d7b88341 | ||
|
2db1c74310 | ||
|
fb2d34f739 | ||
|
6e2f681faa | ||
|
686865bc10 | ||
|
996ebf61d7 | ||
|
6a7ee5a2f3 | ||
|
4b45722fad | ||
|
14998e12b6 | ||
|
718f9d3791 | ||
|
964a988fef | ||
|
66e7ec56bb | ||
|
ca336427f5 | ||
|
8a75cbc630 | ||
|
c8bb112a5d | ||
|
06660882b5 | ||
|
42eec7d728 | ||
|
cac523402a | ||
|
02cd416093 | ||
|
33f0023d37 | ||
|
f09d26a51d | ||
|
b500a46f9a | ||
|
19653de764 | ||
|
29c127e94a | ||
|
4417a8b220 | ||
|
17b110f0d5 | ||
|
b649fb2f3f | ||
|
d3914ea58e | ||
|
31d8803db2 | ||
|
d43b773214 | ||
|
f09a04ed09 | ||
|
d7f9b6b5de | ||
|
197abdcb70 | ||
|
c2de3b8ec1 | ||
|
c52fb951b0 | ||
|
14429ff355 | ||
|
a7632fd9fd | ||
|
967d5c64a3 | ||
|
c34ada5368 | ||
|
2d7bda4d1e | ||
|
6cfb3676a7 | ||
|
11a7fc0277 | ||
|
de539cf0c7 | ||
|
880902da17 | ||
|
89ceb06208 | ||
|
d2ed0f7810 | ||
|
7b0c58af32 | ||
|
d3cdfc17de | ||
|
f097817386 | ||
|
3b55c4c0f7 | ||
|
6636434378 | ||
|
dd3e57086b | ||
|
473b60361b | ||
|
f128c2d1ea | ||
|
c75096f173 | ||
|
c0b2c506bc | ||
|
0ebf710d41 | ||
|
fa41126c37 | ||
|
09920e0056 | ||
|
685bf29abc | ||
|
0866c79afb | ||
|
e8e3ced948 | ||
|
52d98e16fa | ||
|
763e66a148 | ||
|
8868b48e4c | ||
|
4961588f7d | ||
|
f4625da53d | ||
|
dc94b2ec38 | ||
|
f8af8c9cbf | ||
|
e55f0d7cb2 | ||
|
5b7f2d9086 | ||
|
6d55395d9e | ||
|
2e6190fdf1 | ||
|
b9ad864b75 | ||
|
7296f017fb | ||
|
ae91088cb3 | ||
|
51a574926d | ||
|
532a4ee083 | ||
|
6b9c0dee14 | ||
|
be75939344 | ||
|
d667f585e0 | ||
|
ebb23a7a88 | ||
|
e9add6d985 | ||
|
e3346fb0bc | ||
|
ae2ea56681 | ||
|
080fd0f374 | ||
|
e32f90f8ff | ||
|
7ad09d2cb4 | ||
|
40038d4210 | ||
|
2adc174541 | ||
|
2fb2d208c0 | ||
|
4de6e3180d | ||
|
8829ccdf93 | ||
|
0320bcdda6 | ||
|
851700516d | ||
|
d542843fdd | ||
|
4bb2f806b1 | ||
|
cc31a69b65 | ||
|
78f0a1152e | ||
|
1f21cd4329 | ||
|
9f69160797 | ||
|
e81334ef87 | ||
|
6c3e1e2768 | ||
|
92739f48ce | ||
|
d28d01e76c | ||
|
75450548b3 | ||
|
c3b4208853 | ||
|
d38c673e2a | ||
|
93686eab65 | ||
|
224ddb5a33 | ||
|
4db23fd471 | ||
|
a003866a55 | ||
|
0d90f1f1dd | ||
|
ef5a76392d | ||
|
8d0cbb6eb4 | ||
|
536999d4dc | ||
|
827a2b8a54 | ||
|
a954f7d4b4 | ||
|
a137f248f7 | ||
|
95d02bb924 | ||
|
921e57b9aa | ||
|
25f9655a38 | ||
|
919204dd38 | ||
|
34f25afe90 | ||
|
8b29ae910f | ||
|
6c96b060e7 | ||
|
f4662d5e27 | ||
|
b15618fcfd | ||
|
03e3f517a8 | ||
|
f0d2af329a | ||
|
452b9ad7f1 | ||
|
fb18e814de | ||
|
75413c56d2 | ||
|
c3d83d5412 | ||
|
b14aa75a98 | ||
|
dbc76a2b1e | ||
|
6d774794c8 | ||
|
81be5edb97 | ||
|
e30e5dd059 | ||
|
0cdd8beab1 | ||
|
7b9d5a29aa | ||
|
5cc831c1e1 | ||
|
72aa3c5127 | ||
|
43ccfcef8f | ||
|
c789c147b7 | ||
|
a2adb67d2f | ||
|
34e2f47761 | ||
|
0d2b232bd7 | ||
|
83e16e059f | ||
|
6e4dc3911f | ||
|
2a08a11e89 | ||
|
993dce398d | ||
|
eee9a62c8f | ||
|
ce17b6cf46 | ||
|
923c0ffc87 | ||
|
48ed20323f | ||
|
9a4cd8936d | ||
|
019ada8da5 | ||
|
6a95b71164 | ||
|
3b4ce4a0b4 | ||
|
a414896885 | ||
|
47734d8ff4 | ||
|
fef1808288 | ||
|
d2c82fdeca | ||
|
e657cdbc3a | ||
|
bc14e8432f | ||
|
34b03ef835 | ||
|
329b7de9cc | ||
|
2dcad1f284 | ||
|
1b98a10100 |
7
.gitmodules
vendored
7
.gitmodules
vendored
@@ -1,9 +1,6 @@
|
||||
[submodule "jush"]
|
||||
path = externals/jush
|
||||
url = git://git.code.sf.net/p/jush/git
|
||||
[submodule "wymeditor"]
|
||||
path = externals/wymeditor
|
||||
url = git://github.com/wymeditor/wymeditor.git
|
||||
url = git://github.com/vrana/jush
|
||||
[submodule "JsShrink"]
|
||||
path = externals/JsShrink
|
||||
url = git://github.com/vrana/JsShrink.git
|
||||
url = git://github.com/vrana/JsShrink
|
||||
|
@@ -1,4 +1,5 @@
|
||||
language: php
|
||||
php:
|
||||
- '5.6'
|
||||
- '7.1'
|
||||
script: git diff --name-only $TRAVIS_COMMIT_RANGE | grep '\.php$' | xargs -n1 -P8 php -l | grep -v 'No syntax errors'; test $? -eq 1
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
$PROCEDURE = $_GET["call"];
|
||||
$PROCEDURE = ($_GET["name"] ? $_GET["name"] : $_GET["call"]);
|
||||
page_header(lang('Call') . ": " . h($PROCEDURE), $error);
|
||||
|
||||
$routine = routine($PROCEDURE, (isset($_GET["callf"]) ? "FUNCTION" : "PROCEDURE"));
|
||||
$routine = routine($_GET["call"], (isset($_GET["callf"]) ? "FUNCTION" : "PROCEDURE"));
|
||||
$in = array();
|
||||
$out = array();
|
||||
foreach ($routine["fields"] as $i => $field) {
|
||||
@@ -30,9 +30,12 @@ if (!$error && $_POST) {
|
||||
}
|
||||
|
||||
$query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . table($PROCEDURE) . "(" . implode(", ", $call) . ")";
|
||||
echo "<p><code class='jush-$jush'>" . h($query) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
|
||||
$start = microtime(true);
|
||||
$result = $connection->multi_query($query);
|
||||
$affected = $connection->affected_rows; // getting warnigns overwrites this
|
||||
echo $adminer->selectQuery($query, $start, !$result);
|
||||
|
||||
if (!$connection->multi_query($query)) {
|
||||
if (!$result) {
|
||||
echo "<p class='error'>" . error() . "\n";
|
||||
} else {
|
||||
$connection2 = connect();
|
||||
@@ -45,7 +48,7 @@ if (!$error && $_POST) {
|
||||
if (is_object($result)) {
|
||||
select($result, $connection2);
|
||||
} else {
|
||||
echo "<p class='message'>" . lang('Routine has been called, %d row(s) affected.', $connection->affected_rows) . "\n";
|
||||
echo "<p class='message'>" . lang('Routine has been called, %d row(s) affected.', $affected) . "\n";
|
||||
}
|
||||
} while ($connection->next_result());
|
||||
|
||||
@@ -59,7 +62,7 @@ if (!$error && $_POST) {
|
||||
<form action="" method="post">
|
||||
<?php
|
||||
if ($in) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<table cellspacing='0' class='layout'>\n";
|
||||
foreach ($in as $key) {
|
||||
$field = $routine["fields"][$key];
|
||||
$name = $field["field"];
|
||||
|
@@ -120,7 +120,7 @@ page_header(($TABLE != "" ? lang('Alter table') : lang('Create table')), $error,
|
||||
if (!$_POST) {
|
||||
$row = array(
|
||||
"Engine" => $_COOKIE["adminer_engine"],
|
||||
"fields" => array(array("field" => "", "type" => (isset($types["int"]) ? "int" : (isset($types["integer"]) ? "integer" : "")))),
|
||||
"fields" => array(array("field" => "", "type" => (isset($types["int"]) ? "int" : (isset($types["integer"]) ? "integer" : "")), "on_update" => "")),
|
||||
"partition_names" => array(""),
|
||||
);
|
||||
|
||||
@@ -162,7 +162,7 @@ foreach ($engines as $engine) {
|
||||
<form action="" method="post" id="form">
|
||||
<p>
|
||||
<?php if (support("columns") || $TABLE == "") { ?>
|
||||
<?php echo lang('Table name'); ?>: <input name="name" maxlength="64" value="<?php echo h($row["name"]); ?>" autocapitalize="off">
|
||||
<?php echo lang('Table name'); ?>: <input name="name" data-maxlength="64" value="<?php echo h($row["name"]); ?>" autocapitalize="off">
|
||||
<?php if ($TABLE == "" && !$_POST) { echo script("focus(qs('#form')['name']);"); } ?>
|
||||
<?php echo ($engines ? "<select name='Engine'>" . optionlist(array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . "</select>" . on_help("getTarget(event).value", 1) . script("qsl('select').onchange = helpClose;") : ""); ?>
|
||||
<?php echo ($collations && !preg_match("~sqlite|mssql~", $jush) ? html_select("Collation", array("" => "(" . lang('collation') . ")") + $collations, $row["Collation"]) : ""); ?>
|
||||
@@ -170,6 +170,7 @@ foreach ($engines as $engine) {
|
||||
<?php } ?>
|
||||
|
||||
<?php if (support("columns")) { ?>
|
||||
<div class="scrollable">
|
||||
<table cellspacing="0" id="edit-fields" class="nowrap">
|
||||
<?php
|
||||
$comments = ($_POST ? $_POST["comments"] : $row["Comment"] != "");
|
||||
@@ -184,21 +185,22 @@ if (!$_POST && !$comments) {
|
||||
edit_fields($row["fields"], $collations, "TABLE", $foreign_keys, $comments);
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<p>
|
||||
<?php echo lang('Auto Increment'); ?>: <input type="number" name="Auto_increment" size="6" value="<?php echo h($row["Auto_increment"]); ?>">
|
||||
<?php echo checkbox("defaults", 1, true, lang('Default values'), "columnShow(this.checked, 5)", "jsonly"); ?>
|
||||
<?php if (!$_POST["defaults"]) { echo script("editingHideDefaults();"); } ?>
|
||||
<?php echo checkbox("defaults", 1, !$_POST || $_POST["defaults"], lang('Default values'), "columnShow(this.checked, 5)", "jsonly"); ?>
|
||||
<?php echo ($_POST ? "" : script("editingHideDefaults();")); ?>
|
||||
<?php echo (support("comment")
|
||||
? "<label><input type='checkbox' name='comments' value='1' class='jsonly'" . ($comments ? " checked" : "") . ">" . lang('Comment') . "</label>"
|
||||
. script("qsl('input').onclick = function () { columnShow(this.checked, 6); toggle('Comment'); if (this.checked) this.form['Comment'].focus(); };")
|
||||
. ' <input name="Comment" id="Comment" value="' . h($row["Comment"]) . '" maxlength="' . ($connection->server_info >= 5.5 ? 2048 : 60) . '"' . ($comments ? '' : ' class="hidden"') . '>'
|
||||
. script("qsl('input').onclick = partial(editingCommentsClick, true);")
|
||||
. ' <input name="Comment" value="' . h($row["Comment"]) . '" data-maxlength="' . (min_version(5.5) ? 2048 : 60) . '"' . ($comments ? '' : ' class="hidden"') . '>'
|
||||
: '')
|
||||
; ?>
|
||||
<p>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($TABLE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(); ?><?php } ?>
|
||||
<?php if ($TABLE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $TABLE)); ?><?php } ?>
|
||||
<?php
|
||||
if (support("partitioning")) {
|
||||
$partition_table = preg_match('~RANGE|LIST~', $row["partition_by"]);
|
||||
@@ -225,3 +227,4 @@ foreach ($row["partition_names"] as $key => $val) {
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
<?php echo script("qs('#form')['defaults'].onclick();" . (support("comment") ? " editingCommentsClick.call(qs('#form')['comments']);" : "")); ?>
|
||||
|
@@ -47,7 +47,7 @@ if ($_POST) {
|
||||
} elseif ($jush == "sql") {
|
||||
// propose database name with limited privileges
|
||||
foreach (get_vals("SHOW GRANTS") as $grant) {
|
||||
if (preg_match('~ ON (`(([^\\\\`]|``|\\\\.)*)%`\\.\\*)?~', $grant, $match) && $match[1]) {
|
||||
if (preg_match('~ ON (`(([^\\\\`]|``|\\\\.)*)%`\.\*)?~', $grant, $match) && $match[1]) {
|
||||
$name = stripcslashes(idf_unescape("`$match[2]`"));
|
||||
break;
|
||||
}
|
||||
@@ -60,9 +60,10 @@ if ($_POST) {
|
||||
<?php
|
||||
echo ($_POST["add_x"] || strpos($name, "\n")
|
||||
? '<textarea id="name" name="name" rows="10" cols="40">' . h($name) . '</textarea><br>'
|
||||
: '<input name="name" id="name" value="' . h($name) . '" maxlength="64" autocapitalize="off">'
|
||||
: '<input name="name" id="name" value="' . h($name) . '" data-maxlength="64" autocapitalize="off">'
|
||||
) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $row["collation"]) . doc_link(array(
|
||||
'sql' => "charset-charsets.html",
|
||||
'mariadb' => "supported-character-sets-and-collations/",
|
||||
'mssql' => "ms187963.aspx",
|
||||
)) : "");
|
||||
echo script("focus(qs('#name'));");
|
||||
@@ -70,7 +71,7 @@ echo script("focus(qs('#name'));");
|
||||
<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(lang('Drop %s?', DB)) . "\n";
|
||||
} elseif (!$_POST["add_x"] && $_GET["db"] == "") {
|
||||
echo "<input type='image' class='icon' name='add' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>\n";
|
||||
}
|
||||
|
@@ -61,21 +61,23 @@ if ($adminer->homepage()) {
|
||||
echo " <input type='submit' name='search' value='" . lang('Search') . "'>\n";
|
||||
echo "</div></fieldset>\n";
|
||||
if ($_POST["search"] && $_POST["query"] != "") {
|
||||
$_GET["where"][0]["op"] = "LIKE %%";
|
||||
search_tables();
|
||||
}
|
||||
}
|
||||
$doc_link = doc_link(array('sql' => 'show-table-status.html'));
|
||||
echo "<div class='scrollable'>\n";
|
||||
echo "<table cellspacing='0' class='nowrap checkable'>\n";
|
||||
echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
|
||||
echo '<thead><tr class="wrap">';
|
||||
echo '<td><input id="check-all" type="checkbox" class="jsonly">' . script("qs('#check-all').onclick = partial(formCheck, /^(tables|views)\[/);", "");
|
||||
echo '<th>' . lang('Table');
|
||||
echo '<td>' . lang('Engine') . doc_link(array('sql' => 'storage-engines.html'));
|
||||
echo '<td>' . lang('Collation') . doc_link(array('sql' => 'charset-mysql.html'));
|
||||
echo '<td>' . lang('Collation') . doc_link(array('sql' => 'charset-charsets.html', 'mariadb' => 'supported-character-sets-and-collations/'));
|
||||
echo '<td>' . lang('Data Length') . $doc_link;
|
||||
echo '<td>' . lang('Index Length') . $doc_link;
|
||||
echo '<td>' . lang('Data Free') . $doc_link;
|
||||
echo '<td>' . lang('Auto Increment') . doc_link(array('sql' => 'example-auto-increment.html'));
|
||||
echo '<td>' . lang('Auto Increment') . doc_link(array('sql' => 'example-auto-increment.html', 'mariadb' => 'auto_increment/'));
|
||||
echo '<td>' . lang('Rows') . $doc_link;
|
||||
echo (support("comment") ? '<td>' . lang('Comment') . $doc_link : '');
|
||||
echo "</thead>\n";
|
||||
@@ -84,7 +86,7 @@ if ($adminer->homepage()) {
|
||||
foreach ($tables_list as $name => $type) {
|
||||
$view = ($type !== null && !preg_match('~table~i', $type));
|
||||
$id = h("Table-" . $name);
|
||||
echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "formUncheck('check-all');", "", $id);
|
||||
echo '<tr' . odd() . '><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "", "", $id);
|
||||
echo '<th>' . (support("table") || support("indexes") ? "<a href='" . h(ME) . "table=" . urlencode($name) . "' title='" . lang('Show structure') . "' id='$id'>" . h($name) . '</a>' : h($name));
|
||||
if ($view) {
|
||||
echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '" title="' . lang('Alter view') . '">' . (preg_match('~materialized~i', $type) ? lang('Materialized view') : lang('View')) . '</a>';
|
||||
@@ -103,22 +105,24 @@ if ($adminer->homepage()) {
|
||||
echo ($link ? "<td align='right'>" . (support("table") || $key == "Rows" || (support("indexes") && $key != "Data_length")
|
||||
? "<a href='" . h(ME . "$link[0]=") . urlencode($name) . "'$id title='$link[1]'>?</a>"
|
||||
: "<span$id>?</span>"
|
||||
) : "<td id='$key-" . h($name) . "'> ");
|
||||
) : "<td id='$key-" . h($name) . "'>");
|
||||
}
|
||||
$tables++;
|
||||
}
|
||||
echo (support("comment") ? "<td id='Comment-" . h($name) . "'> " : "");
|
||||
echo (support("comment") ? "<td id='Comment-" . h($name) . "'>" : "");
|
||||
}
|
||||
|
||||
echo "<tr><td> <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()));
|
||||
echo "<tr><td><th>" . lang('%d in total', count($tables_list));
|
||||
echo "<td>" . h($jush == "sql" ? $connection->result("SELECT @@storage_engine") : "");
|
||||
echo "<td>" . h(db_collation(DB, collations()));
|
||||
foreach (array("Data_length", "Index_length", "Data_free") as $key) {
|
||||
echo "<td align='right' id='sum-$key'> ";
|
||||
echo "<td align='right' id='sum-$key'>";
|
||||
}
|
||||
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
if (!information_schema(DB)) {
|
||||
echo "<div class='footer'><div>\n";
|
||||
$vacuum = "<input type='submit' value='" . lang('Vacuum') . "'> " . on_help("'VACUUM'");
|
||||
$optimize = "<input type='submit' name='optimize' value='" . lang('Optimize') . "'> " . on_help($jush == "sql" ? "'OPTIMIZE TABLE'" : "'VACUUM OPTIMIZE'");
|
||||
echo "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>"
|
||||
@@ -143,6 +147,7 @@ if ($adminer->homepage()) {
|
||||
echo script("qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^(tables|views)\[/));" . (support("table") ? " selectCount('selected2', formChecked(this, /^tables\[/) || $tables);" : "") . " }");
|
||||
echo "<input type='hidden' name='token' value='$token'>\n";
|
||||
echo "</div></fieldset>\n";
|
||||
echo "</div></div>\n";
|
||||
}
|
||||
echo "</form>\n";
|
||||
echo script("tableCheck();");
|
||||
@@ -156,14 +161,15 @@ if ($adminer->homepage()) {
|
||||
$routines = routines();
|
||||
if ($routines) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td> </thead>\n";
|
||||
echo '<thead><tr><th>' . lang('Name') . '<td>' . lang('Type') . '<td>' . lang('Return type') . "<td></thead>\n";
|
||||
odd('');
|
||||
foreach ($routines as $row) {
|
||||
$name = ($row["SPECIFIC_NAME"] == $row["ROUTINE_NAME"] ? "" : "&name=" . urlencode($row["ROUTINE_NAME"])); // not computed on the pages to be able to print the header first
|
||||
echo '<tr' . odd() . '>';
|
||||
echo '<th><a href="' . h(ME) . ($row["ROUTINE_TYPE"] != "PROCEDURE" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . h($row["ROUTINE_NAME"]) . '</a>';
|
||||
echo '<th><a href="' . h(ME . ($row["ROUTINE_TYPE"] != "PROCEDURE" ? 'callf=' : 'call=') . urlencode($row["SPECIFIC_NAME"]) . $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"] != "PROCEDURE" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a>";
|
||||
echo '<td><a href="' . h(ME . ($row["ROUTINE_TYPE"] != "PROCEDURE" ? 'function=' : 'procedure=') . urlencode($row["SPECIFIC_NAME"]) . $name) . '">' . lang('Alter') . "</a>";
|
||||
}
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
14
adminer/designs.php
Normal file
14
adminer/designs.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
function adminer_object() {
|
||||
include_once "../plugins/plugin.php";
|
||||
include_once "../plugins/designs.php";
|
||||
$designs = array();
|
||||
foreach (glob("../designs/*", GLOB_ONLYDIR) as $filename) {
|
||||
$designs["$filename/adminer.css"] = basename($filename);
|
||||
}
|
||||
return new AdminerPlugin(array(
|
||||
new AdminerDesigns($designs),
|
||||
));
|
||||
}
|
||||
|
||||
include "./index.php";
|
@@ -6,5 +6,5 @@ header("Content-Disposition: attachment; filename=" . friendly_url("$TABLE-" . i
|
||||
$select = array(idf_escape($_GET["field"]));
|
||||
$result = $driver->select($TABLE, $select, array(where($_GET, $fields)), $select);
|
||||
$row = ($result ? $result->fetch_row() : array());
|
||||
echo $row[0];
|
||||
echo $driver->value($row[0], $fields[$_GET["field"]]);
|
||||
exit; // don't output footer
|
||||
|
354
adminer/drivers/clickhouse.inc.php
Normal file
354
adminer/drivers/clickhouse.inc.php
Normal file
@@ -0,0 +1,354 @@
|
||||
<?php
|
||||
$drivers["clickhouse"] = "ClickHouse (alpha)";
|
||||
|
||||
if (isset($_GET["clickhouse"])) {
|
||||
define("DRIVER", "clickhouse");
|
||||
|
||||
class Min_DB {
|
||||
var $extension = "JSON", $server_info, $errno, $_result, $error, $_url;
|
||||
var $_db = 'default';
|
||||
|
||||
function rootQuery($db, $query) {
|
||||
@ini_set('track_errors', 1); // @ - may be disabled
|
||||
$file = @file_get_contents("$this->_url/?database=$db", false, stream_context_create(array('http' => array(
|
||||
'method' => 'POST',
|
||||
'content' => $this->isQuerySelectLike($query) ? "$query FORMAT JSONCompact" : $query,
|
||||
'header' => 'Content-type: application/x-www-form-urlencoded',
|
||||
'ignore_errors' => 1, // available since PHP 5.2.10
|
||||
))));
|
||||
|
||||
if ($file === false) {
|
||||
$this->error = $php_errormsg;
|
||||
return $file;
|
||||
}
|
||||
if (!preg_match('~^HTTP/[0-9.]+ 2~i', $http_response_header[0])) {
|
||||
$this->error = $file;
|
||||
return false;
|
||||
}
|
||||
$return = json_decode($file, true);
|
||||
if ($return === null) {
|
||||
$this->errno = json_last_error();
|
||||
if (function_exists('json_last_error_msg')) {
|
||||
$this->error = json_last_error_msg();
|
||||
} else {
|
||||
$constants = get_defined_constants(true);
|
||||
foreach ($constants['json'] as $name => $value) {
|
||||
if ($value == $this->errno && preg_match('~^JSON_ERROR_~', $name)) {
|
||||
$this->error = $name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Min_Result($return);
|
||||
}
|
||||
|
||||
function isQuerySelectLike($query) {
|
||||
return (bool) preg_match('~^(select|show)~i', $query);
|
||||
}
|
||||
|
||||
function query($query) {
|
||||
return $this->rootQuery($this->_db, $query);
|
||||
}
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
preg_match('~^(https?://)?(.*)~', $server, $match);
|
||||
$this->_url = ($match[1] ? $match[1] : "http://") . "$username:$password@$match[2]";
|
||||
$return = $this->query('SELECT 1');
|
||||
return (bool) $return;
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
$this->_db = $database;
|
||||
return true;
|
||||
}
|
||||
|
||||
function quote($string) {
|
||||
return "'" . addcslashes($string, "\\'") . "'";
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
return $this->_result = $this->query($query);
|
||||
}
|
||||
|
||||
function store_result() {
|
||||
return $this->_result;
|
||||
}
|
||||
|
||||
function next_result() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
return $result['data'];
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
var $num_rows, $_rows, $columns, $meta, $_offset = 0;
|
||||
|
||||
function __construct($result) {
|
||||
$this->num_rows = $result['rows'];
|
||||
$this->_rows = $result['data'];
|
||||
$this->meta = $result['meta'];
|
||||
$this->columns = array_column($this->meta, 'name');
|
||||
reset($this->_rows);
|
||||
}
|
||||
|
||||
function fetch_assoc() {
|
||||
$row = current($this->_rows);
|
||||
next($this->_rows);
|
||||
return $row === false ? false : array_combine($this->columns, $row);
|
||||
}
|
||||
|
||||
function fetch_row() {
|
||||
$row = current($this->_rows);
|
||||
next($this->_rows);
|
||||
return $row;
|
||||
}
|
||||
|
||||
function fetch_field() {
|
||||
$column = $this->_offset++;
|
||||
$return = new stdClass;
|
||||
if ($column < count($this->columns)) {
|
||||
$return->name = $this->meta[$column]['name'];
|
||||
$return->orgname = $return->name;
|
||||
$return->type = $this->meta[$column]['type'];
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
function delete($table, $queryWhere, $limit = 0) {
|
||||
return queries("ALTER TABLE " . table($table) . " DELETE $queryWhere");
|
||||
}
|
||||
|
||||
function update($table, $set, $queryWhere, $limit = 0, $separator = "\n") {
|
||||
$values = array();
|
||||
foreach ($set as $key => $val) {
|
||||
$values[] = "$key = $val";
|
||||
}
|
||||
$query = $separator . implode(",$separator", $values);
|
||||
return queries("ALTER TABLE " . table($table) . " UPDATE $query$queryWhere");
|
||||
}
|
||||
}
|
||||
|
||||
function idf_escape($idf) {
|
||||
return "`" . str_replace("`", "``", $idf) . "`";
|
||||
}
|
||||
|
||||
function table($idf) {
|
||||
return idf_escape($idf);
|
||||
}
|
||||
|
||||
function explain($connection, $query) {
|
||||
return '';
|
||||
}
|
||||
|
||||
function found_rows($table_status, $where) {
|
||||
$rows = get_vals("SELECT COUNT(*) FROM " . idf_escape($table_status["Name"]) . ($where ? " WHERE " . implode(" AND ", $where) : ""));
|
||||
return empty($rows) ? false : $rows[0];
|
||||
}
|
||||
|
||||
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
|
||||
foreach ($fields as $field) {
|
||||
if ($field[1][2] === " NULL") {
|
||||
$field[1][1] = " Nullable({$field[1][1]})";
|
||||
}
|
||||
unset($field[1][2]);
|
||||
}
|
||||
}
|
||||
|
||||
function truncate_tables($tables) {
|
||||
return apply_queries("TRUNCATE TABLE", $tables);
|
||||
}
|
||||
|
||||
function drop_views($views) {
|
||||
return drop_tables($views);
|
||||
}
|
||||
|
||||
function drop_tables($tables) {
|
||||
return apply_queries("DROP TABLE", $tables);
|
||||
}
|
||||
|
||||
function connect() {
|
||||
global $adminer;
|
||||
$connection = new Min_DB;
|
||||
$credentials = $adminer->credentials();
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
return $connection;
|
||||
}
|
||||
return $connection->error;
|
||||
}
|
||||
|
||||
function get_databases($flush) {
|
||||
global $connection;
|
||||
$result = get_rows('SHOW DATABASES');
|
||||
|
||||
$return = array();
|
||||
foreach ($result as $row) {
|
||||
$return[] = $row['name'];
|
||||
}
|
||||
sort($return);
|
||||
return $return;
|
||||
}
|
||||
|
||||
function limit($query, $where, $limit, $offset = 0, $separator = " ") {
|
||||
return " $query$where" . ($limit !== null ? $separator . "LIMIT $limit" . ($offset ? ", $offset" : "") : "");
|
||||
}
|
||||
|
||||
function limit1($table, $query, $where, $separator = "\n") {
|
||||
return limit($query, $where, 1, 0, $separator);
|
||||
}
|
||||
|
||||
function db_collation($db, $collations) {
|
||||
}
|
||||
|
||||
function engines() {
|
||||
return array('MergeTree');
|
||||
}
|
||||
|
||||
function logged_user() {
|
||||
global $adminer;
|
||||
$credentials = $adminer->credentials();
|
||||
return $credentials[1];
|
||||
}
|
||||
|
||||
function tables_list() {
|
||||
$result = get_rows('SHOW TABLES');
|
||||
$return = array();
|
||||
foreach ($result as $row) {
|
||||
$return[$row['name']] = 'table';
|
||||
}
|
||||
ksort($return);
|
||||
return $return;
|
||||
}
|
||||
|
||||
function count_tables($databases) {
|
||||
return array();
|
||||
}
|
||||
|
||||
function table_status($name = "", $fast = false) {
|
||||
global $connection;
|
||||
$return = array();
|
||||
$tables = get_rows("SELECT name, engine FROM system.tables WHERE database = " . q($connection->_db));
|
||||
foreach ($tables as $table) {
|
||||
$return[$table['name']] = array(
|
||||
'Name' => $table['name'],
|
||||
'Engine' => $table['engine'],
|
||||
);
|
||||
if ($name === $table['name']) {
|
||||
return $return[$table['name']];
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function is_view($table_status) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function fk_support($table_status) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function convert_field($field) {
|
||||
}
|
||||
|
||||
function unconvert_field($field, $return) {
|
||||
if (in_array($field['type'], ["Int8", "Int16", "Int32", "Int64", "UInt8", "UInt16", "UInt32", "UInt64", "Float32", "Float64"])) {
|
||||
return "to$field[type]($return)";
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function fields($table) {
|
||||
$return = array();
|
||||
$result = get_rows("SELECT name, type, default_expression FROM system.columns WHERE " . idf_escape('table') . " = " . q($table));
|
||||
foreach($result as $row) {
|
||||
$type = trim($row['type']);
|
||||
$nullable = strpos($type, 'Nullable(') === 0;
|
||||
$return[trim($row['name'])] = array(
|
||||
"field" => trim($row['name']),
|
||||
"full_type" => $type,
|
||||
"type" => $type,
|
||||
"default" => trim($row['default_expression']),
|
||||
"null" => $nullable,
|
||||
"auto_increment" => '0',
|
||||
"privileges" => array("insert" => 1, "select" => 1, "update" => 0),
|
||||
);
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
function indexes($table, $connection2 = null) {
|
||||
return array();
|
||||
}
|
||||
|
||||
function foreign_keys($table) {
|
||||
return array();
|
||||
}
|
||||
|
||||
function collations() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function information_schema($db) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function error() {
|
||||
global $connection;
|
||||
return h($connection->error);
|
||||
}
|
||||
|
||||
function types() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function schemas() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function get_schema() {
|
||||
return "";
|
||||
}
|
||||
|
||||
function set_schema($schema) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function auto_increment() {
|
||||
return '';
|
||||
}
|
||||
|
||||
function last_id() {
|
||||
return 0; // ClickHouse doesn't have it
|
||||
}
|
||||
|
||||
function support($feature) {
|
||||
return preg_match("~^(columns|sql|status|table)$~", $feature);
|
||||
}
|
||||
|
||||
$jush = "clickhouse";
|
||||
$types = array();
|
||||
$structured_types = array();
|
||||
foreach (array( //! arrays
|
||||
lang('Numbers') => array("Int8" => 3, "Int16" => 5, "Int32" => 10, "Int64" => 19, "UInt8" => 3, "UInt16" => 5, "UInt32" => 10, "UInt64" => 20, "Float32" => 7, "Float64" => 16, 'Decimal' => 38, 'Decimal32' => 9, 'Decimal64' => 18, 'Decimal128' => 38),
|
||||
lang('Date and time') => array("Date" => 13, "DateTime" => 20),
|
||||
lang('Strings') => array("String" => 0),
|
||||
lang('Binary') => array("FixedString" => 0),
|
||||
) 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", "SQL");
|
||||
$functions = array();
|
||||
$grouping = array("avg", "count", "count distinct", "max", "min", "sum");
|
||||
$edit_functions = array();
|
||||
}
|
@@ -2,10 +2,10 @@
|
||||
$drivers["elastic"] = "Elasticsearch (beta)";
|
||||
|
||||
if (isset($_GET["elastic"])) {
|
||||
$possible_drivers = array("json");
|
||||
$possible_drivers = array("json + allow_url_fopen");
|
||||
define("DRIVER", "elastic");
|
||||
|
||||
if (function_exists('json_decode')) {
|
||||
if (function_exists('json_decode') && ini_bool('allow_url_fopen')) {
|
||||
class Min_DB {
|
||||
var $extension = "JSON", $server_info, $errno, $error, $_url;
|
||||
|
||||
@@ -17,9 +17,10 @@ if (isset($_GET["elastic"])) {
|
||||
*/
|
||||
function rootQuery($path, $content = array(), $method = 'GET') {
|
||||
@ini_set('track_errors', 1); // @ - may be disabled
|
||||
$file = @file_get_contents($this->_url . '/' . ltrim($path, '/'), false, stream_context_create(array('http' => array(
|
||||
$file = @file_get_contents("$this->_url/" . ltrim($path, '/'), false, stream_context_create(array('http' => array(
|
||||
'method' => $method,
|
||||
'content' => json_encode($content),
|
||||
'content' => $content === null ? $content : json_encode($content),
|
||||
'header' => 'Content-Type: application/json',
|
||||
'ignore_errors' => 1, // available since PHP 5.2.10
|
||||
))));
|
||||
if (!$file) {
|
||||
@@ -60,7 +61,7 @@ if (isset($_GET["elastic"])) {
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
preg_match('~^(https?://)?(.*)~', $server, $match);
|
||||
$this->_url = ($match[1] ? $match[1] : "http://") . "$username:$password@$match[2]/";
|
||||
$this->_url = ($match[1] ? $match[1] : "http://") . "$username:$password@$match[2]";
|
||||
$return = $this->query('');
|
||||
if ($return) {
|
||||
$this->server_info = $return['version']['number'];
|
||||
@@ -128,7 +129,7 @@ if (isset($_GET["elastic"])) {
|
||||
}
|
||||
}
|
||||
foreach ($where as $val) {
|
||||
list($col,$op,$val) = explode(" ",$val,3);
|
||||
list($col, $op, $val) = explode(" ", $val, 3);
|
||||
if ($col == "_id") {
|
||||
$data["query"]["ids"]["values"][] = $val;
|
||||
}
|
||||
@@ -147,7 +148,7 @@ if (isset($_GET["elastic"])) {
|
||||
$start = microtime(true);
|
||||
$search = $this->_conn->query($query, $data);
|
||||
if ($print) {
|
||||
echo $adminer->selectQuery("$query: " . print_r($data, true), format_time($start));
|
||||
echo $adminer->selectQuery("$query: " . print_r($data, true), $start, !$search);
|
||||
}
|
||||
if (!$search) {
|
||||
return false;
|
||||
@@ -156,7 +157,7 @@ if (isset($_GET["elastic"])) {
|
||||
foreach ($search['hits']['hits'] as $hit) {
|
||||
$row = array();
|
||||
if ($select == array("*")) {
|
||||
$row["_id"] = $hit["_id"];
|
||||
$row["_id"] = $hit["_id"];
|
||||
}
|
||||
$fields = $hit['_source'];
|
||||
if ($select != array("*")) {
|
||||
@@ -176,6 +177,49 @@ if (isset($_GET["elastic"])) {
|
||||
return new Min_Result($return);
|
||||
}
|
||||
|
||||
function update($type, $record, $queryWhere, $limit = 0, $separator = "\n") {
|
||||
//! use $limit
|
||||
$parts = preg_split('~ *= *~', $queryWhere);
|
||||
if (count($parts) == 2) {
|
||||
$id = trim($parts[1]);
|
||||
$query = "$type/$id";
|
||||
return $this->_conn->query($query, $record, 'POST');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function insert($type, $record) {
|
||||
$id = ""; //! user should be able to inform _id
|
||||
$query = "$type/$id";
|
||||
$response = $this->_conn->query($query, $record, 'POST');
|
||||
$this->_conn->last_id = $response['_id'];
|
||||
return $response['created'];
|
||||
}
|
||||
|
||||
function delete($type, $queryWhere, $limit = 0) {
|
||||
//! use $limit
|
||||
$ids = array();
|
||||
if (is_array($_GET["where"]) && $_GET["where"]["_id"]) {
|
||||
$ids[] = $_GET["where"]["_id"];
|
||||
}
|
||||
if (is_array($_POST['check'])) {
|
||||
foreach ($_POST['check'] as $check) {
|
||||
$parts = preg_split('~ *= *~', $check);
|
||||
if (count($parts) == 2) {
|
||||
$ids[] = trim($parts[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_conn->affected_rows = 0;
|
||||
foreach ($ids as $id) {
|
||||
$query = "{$type}/{$id}";
|
||||
$response = $this->_conn->query($query, '{}', 'DELETE');
|
||||
if (is_array($response) && $response['found'] == true) {
|
||||
$this->_conn->affected_rows++;
|
||||
}
|
||||
}
|
||||
return $this->_conn->affected_rows;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -183,8 +227,11 @@ if (isset($_GET["elastic"])) {
|
||||
function connect() {
|
||||
global $adminer;
|
||||
$connection = new Min_DB;
|
||||
$credentials = $adminer->credentials();
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
list($server, $username, $password) = $adminer->credentials();
|
||||
if ($password != "" && $connection->connect($server, $username, "")) {
|
||||
return lang('Database does not support password.');
|
||||
}
|
||||
if ($connection->connect($server, $username, $password)) {
|
||||
return $connection;
|
||||
}
|
||||
return $connection->error;
|
||||
@@ -223,9 +270,14 @@ if (isset($_GET["elastic"])) {
|
||||
|
||||
function count_tables($databases) {
|
||||
global $connection;
|
||||
$return = $connection->query('_mapping');
|
||||
if ($return) {
|
||||
$return = array_map('count', $return);
|
||||
$return = array();
|
||||
$result = $connection->query('_stats');
|
||||
if ($result && $result['indices']) {
|
||||
$indices = $result['indices'];
|
||||
foreach ($indices as $indice => $stats) {
|
||||
$indexing = $stats['total']['indexing'];
|
||||
$return[$indice] = $indexing['index_total'];
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -241,24 +293,26 @@ if (isset($_GET["elastic"])) {
|
||||
|
||||
function table_status($name = "", $fast = false) {
|
||||
global $connection;
|
||||
$search = $connection->query("_search?search_type=count", array(
|
||||
"facets" => array(
|
||||
$search = $connection->query("_search", array(
|
||||
"size" => 0,
|
||||
"aggregations" => array(
|
||||
"count_by_type" => array(
|
||||
"terms" => array(
|
||||
"field" => "_type",
|
||||
"field" => "_type"
|
||||
)
|
||||
)
|
||||
)
|
||||
), "POST");
|
||||
$return = array();
|
||||
if ($search) {
|
||||
foreach ($search["facets"]["count_by_type"]["terms"] as $table) {
|
||||
$return[$table["term"]] = array(
|
||||
"Name" => $table["term"],
|
||||
$tables = $search["aggregations"]["count_by_type"]["buckets"];
|
||||
foreach ($tables as $table) {
|
||||
$return[$table["key"]] = array(
|
||||
"Name" => $table["key"],
|
||||
"Engine" => "table",
|
||||
"Rows" => $table["count"],
|
||||
"Rows" => $table["doc_count"],
|
||||
);
|
||||
if ($name != "" && $name == $table["term"]) {
|
||||
if ($name != "" && $name == $table["key"]) {
|
||||
return $return[$name];
|
||||
}
|
||||
}
|
||||
@@ -336,16 +390,16 @@ if (isset($_GET["elastic"])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Create database
|
||||
/** Create index
|
||||
* @param string
|
||||
* @return mixed
|
||||
*/
|
||||
function create_database($db) {
|
||||
global $connection;
|
||||
return $connection->rootQuery(urlencode($db), array(), 'PUT');
|
||||
return $connection->rootQuery(urlencode($db), null, 'PUT');
|
||||
}
|
||||
|
||||
/** Drop databases
|
||||
/** Remove index
|
||||
* @param array
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -354,7 +408,27 @@ if (isset($_GET["elastic"])) {
|
||||
return $connection->rootQuery(urlencode(implode(',', $databases)), array(), 'DELETE');
|
||||
}
|
||||
|
||||
/** Drop tables
|
||||
/** Alter type
|
||||
* @param array
|
||||
* @return mixed
|
||||
*/
|
||||
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
|
||||
global $connection;
|
||||
$properties = array();
|
||||
foreach ($fields as $f) {
|
||||
$field_name = trim($f[1][0]);
|
||||
$field_type = trim($f[1][1] ? $f[1][1] : "text");
|
||||
$properties[$field_name] = array(
|
||||
'type' => $field_type
|
||||
);
|
||||
}
|
||||
if (!empty($properties)) {
|
||||
$properties = array('properties' => $properties);
|
||||
}
|
||||
return $connection->query("_mapping/{$name}", $properties, 'PUT');
|
||||
}
|
||||
|
||||
/** Drop types
|
||||
* @param array
|
||||
* @return bool
|
||||
*/
|
||||
@@ -367,9 +441,25 @@ if (isset($_GET["elastic"])) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
function last_id() {
|
||||
global $connection;
|
||||
return $connection->last_id;
|
||||
}
|
||||
|
||||
$jush = "elastic";
|
||||
$operators = array("=", "query");
|
||||
$functions = array();
|
||||
$grouping = array();
|
||||
$edit_functions = array(array("json"));
|
||||
$types = array(); ///< @var array ($type => $maximum_unsigned_length, ...)
|
||||
$structured_types = array(); ///< @var array ($description => array($type, ...), ...)
|
||||
foreach (array(
|
||||
lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21),
|
||||
lang('Date and time') => array("date" => 10),
|
||||
lang('Strings') => array("string" => 65535, "text" => 65535),
|
||||
lang('Binary') => array("binary" => 255),
|
||||
) as $key => $val) {
|
||||
$types += $val;
|
||||
$structured_types[$key] = array_keys($val);
|
||||
}
|
||||
}
|
||||
|
@@ -147,8 +147,8 @@ if (isset($_GET["firebird"])) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
function limit1($query, $where) {
|
||||
return limit($query, $where, 1);
|
||||
function limit1($table, $query, $where, $separator = "\n") {
|
||||
return limit($query, $where, 1, 0, $separator);
|
||||
}
|
||||
|
||||
function db_collation($db, $collations) {
|
||||
|
@@ -1,32 +1,16 @@
|
||||
<?php
|
||||
$drivers["mongo"] = "MongoDB (beta)";
|
||||
$drivers["mongo"] = "MongoDB";
|
||||
|
||||
if (isset($_GET["mongo"])) {
|
||||
$possible_drivers = array("mongo");
|
||||
$possible_drivers = array("mongo", "mongodb");
|
||||
define("DRIVER", "mongo");
|
||||
|
||||
if (class_exists('MongoDB')) {
|
||||
class Min_DB {
|
||||
var $extension = "Mongo", $error, $last_id, $_link, $_db;
|
||||
var $extension = "Mongo", $server_info = MongoClient::VERSION, $error, $last_id, $_link, $_db;
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
global $adminer;
|
||||
$db = $adminer->database();
|
||||
$options = array();
|
||||
if ($username != "") {
|
||||
$options["username"] = $username;
|
||||
$options["password"] = $password;
|
||||
}
|
||||
if ($db != "") {
|
||||
$options["db"] = $db;
|
||||
}
|
||||
try {
|
||||
$this->_link = @new MongoClient("mongodb://$server", $options);
|
||||
return true;
|
||||
} catch (Exception $ex) {
|
||||
$this->error = $ex->getMessage();
|
||||
return false;
|
||||
}
|
||||
function connect($uri, $options) {
|
||||
return @new MongoClient($uri, $options);
|
||||
}
|
||||
|
||||
function query($query) {
|
||||
@@ -109,97 +93,481 @@ if (isset($_GET["mongo"])) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Min_Driver extends Min_SQL {
|
||||
public $primary = "_id";
|
||||
|
||||
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
|
||||
$select = ($select == array("*")
|
||||
? array()
|
||||
: array_fill_keys($select, true)
|
||||
);
|
||||
$sort = array();
|
||||
foreach ($order as $val) {
|
||||
$val = preg_replace('~ DESC$~', '', $val, 1, $count);
|
||||
$sort[$val] = ($count ? -1 : 1);
|
||||
class Min_Driver extends Min_SQL {
|
||||
public $primary = "_id";
|
||||
|
||||
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
|
||||
$select = ($select == array("*")
|
||||
? array()
|
||||
: array_fill_keys($select, true)
|
||||
);
|
||||
$sort = array();
|
||||
foreach ($order as $val) {
|
||||
$val = preg_replace('~ DESC$~', '', $val, 1, $count);
|
||||
$sort[$val] = ($count ? -1 : 1);
|
||||
}
|
||||
return new Min_Result($this->_conn->_db->selectCollection($table)
|
||||
->find(array(), $select)
|
||||
->sort($sort)
|
||||
->limit($limit != "" ? +$limit : 0)
|
||||
->skip($page * $limit)
|
||||
);
|
||||
}
|
||||
|
||||
function insert($table, $set) {
|
||||
try {
|
||||
$return = $this->_conn->_db->selectCollection($table)->insert($set);
|
||||
$this->_conn->errno = $return['code'];
|
||||
$this->_conn->error = $return['err'];
|
||||
$this->_conn->last_id = $set['_id'];
|
||||
return !$return['err'];
|
||||
} catch (Exception $ex) {
|
||||
$this->_conn->error = $ex->getMessage();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return new Min_Result($this->_conn->_db->selectCollection($table)
|
||||
->find(array(), $select)
|
||||
->sort($sort)
|
||||
->limit($limit != "" ? +$limit : 0)
|
||||
->skip($page * $limit)
|
||||
);
|
||||
}
|
||||
|
||||
function insert($table, $set) {
|
||||
try {
|
||||
$return = $this->_conn->_db->selectCollection($table)->insert($set);
|
||||
$this->_conn->errno = $return['code'];
|
||||
$this->_conn->error = $return['err'];
|
||||
$this->_conn->last_id = $set['_id'];
|
||||
return !$return['err'];
|
||||
} catch (Exception $ex) {
|
||||
$this->_conn->error = $ex->getMessage();
|
||||
|
||||
function get_databases($flush) {
|
||||
global $connection;
|
||||
$return = array();
|
||||
$dbs = $connection->_link->listDBs();
|
||||
foreach ($dbs['databases'] as $db) {
|
||||
$return[] = $db['name'];
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function count_tables($databases) {
|
||||
global $connection;
|
||||
$return = array();
|
||||
foreach ($databases as $db) {
|
||||
$return[$db] = count($connection->_link->selectDB($db)->getCollectionNames(true));
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function tables_list() {
|
||||
global $connection;
|
||||
return array_fill_keys($connection->_db->getCollectionNames(true), 'table');
|
||||
}
|
||||
|
||||
function drop_databases($databases) {
|
||||
global $connection;
|
||||
foreach ($databases as $db) {
|
||||
$response = $connection->_link->selectDB($db)->drop();
|
||||
if (!$response['ok']) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function indexes($table, $connection2 = null) {
|
||||
global $connection;
|
||||
$return = array();
|
||||
foreach ($connection->_db->selectCollection($table)->getIndexInfo() as $index) {
|
||||
$descs = array();
|
||||
foreach ($index["key"] as $column => $type) {
|
||||
$descs[] = ($type == -1 ? '1' : null);
|
||||
}
|
||||
$return[$index["name"]] = array(
|
||||
"type" => ($index["name"] == "_id_" ? "PRIMARY" : ($index["unique"] ? "UNIQUE" : "INDEX")),
|
||||
"columns" => array_keys($index["key"]),
|
||||
"lengths" => array(),
|
||||
"descs" => $descs,
|
||||
);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function fields($table) {
|
||||
return fields_from_edit();
|
||||
}
|
||||
|
||||
function found_rows($table_status, $where) {
|
||||
global $connection;
|
||||
//! don't call count_rows()
|
||||
return $connection->_db->selectCollection($_GET["select"])->count($where);
|
||||
}
|
||||
|
||||
$operators = array("=");
|
||||
|
||||
} elseif (class_exists('MongoDB\Driver\Manager')) {
|
||||
class Min_DB {
|
||||
var $extension = "MongoDB", $server_info = MONGODB_VERSION, $error, $last_id;
|
||||
/** @var MongoDB\Driver\Manager */
|
||||
var $_link;
|
||||
var $_db, $_db_name;
|
||||
|
||||
function connect($uri, $options) {
|
||||
$class = 'MongoDB\Driver\Manager';
|
||||
return new $class($uri, $options);
|
||||
}
|
||||
|
||||
function query($query) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
$this->_db_name = $database;
|
||||
return true;
|
||||
}
|
||||
|
||||
function quote($string) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
var $num_rows, $_rows = array(), $_offset = 0, $_charset = array();
|
||||
|
||||
function __construct($result) {
|
||||
foreach ($result as $item) {
|
||||
$row = array();
|
||||
foreach ($item as $key => $val) {
|
||||
if (is_a($val, 'MongoDB\BSON\Binary')) {
|
||||
$this->_charset[$key] = 63;
|
||||
}
|
||||
$row[$key] =
|
||||
(is_a($val, 'MongoDB\BSON\ObjectID') ? 'MongoDB\BSON\ObjectID("' . strval($val) . '")' :
|
||||
(is_a($val, 'MongoDB\BSON\UTCDatetime') ? $val->toDateTime()->format('Y-m-d H:i:s') :
|
||||
(is_a($val, 'MongoDB\BSON\Binary') ? $val->bin : //! allow downloading
|
||||
(is_a($val, 'MongoDB\BSON\Regex') ? strval($val) :
|
||||
(is_object($val) ? json_encode($val, 256) : // 256 = JSON_UNESCAPED_UNICODE
|
||||
$val // MongoMinKey, MongoMaxKey
|
||||
)))));
|
||||
}
|
||||
$this->_rows[] = $row;
|
||||
foreach ($row as $key => $val) {
|
||||
if (!isset($this->_rows[0][$key])) {
|
||||
$this->_rows[0][$key] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->num_rows = $result->count;
|
||||
}
|
||||
|
||||
function fetch_assoc() {
|
||||
$row = current($this->_rows);
|
||||
if (!$row) {
|
||||
return $row;
|
||||
}
|
||||
$return = array();
|
||||
foreach ($this->_rows[0] as $key => $val) {
|
||||
$return[$key] = $row[$key];
|
||||
}
|
||||
next($this->_rows);
|
||||
return $return;
|
||||
}
|
||||
|
||||
function fetch_row() {
|
||||
$return = $this->fetch_assoc();
|
||||
if (!$return) {
|
||||
return $return;
|
||||
}
|
||||
return array_values($return);
|
||||
}
|
||||
|
||||
function fetch_field() {
|
||||
$keys = array_keys($this->_rows[0]);
|
||||
$name = $keys[$this->_offset++];
|
||||
return (object) array(
|
||||
'name' => $name,
|
||||
'charsetnr' => $this->_charset[$name],
|
||||
);
|
||||
}
|
||||
|
||||
function connect() {
|
||||
global $adminer;
|
||||
$connection = new Min_DB;
|
||||
$credentials = $adminer->credentials();
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
return $connection;
|
||||
}
|
||||
return $connection->error;
|
||||
}
|
||||
|
||||
function error() {
|
||||
global $connection;
|
||||
return h($connection->error);
|
||||
}
|
||||
|
||||
function logged_user() {
|
||||
global $adminer;
|
||||
$credentials = $adminer->credentials();
|
||||
return $credentials[1];
|
||||
}
|
||||
class Min_Driver extends Min_SQL {
|
||||
public $primary = "_id";
|
||||
|
||||
function get_databases($flush) {
|
||||
global $connection;
|
||||
$return = array();
|
||||
$dbs = $connection->_link->listDBs();
|
||||
foreach ($dbs['databases'] as $db) {
|
||||
$return[] = $db['name'];
|
||||
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
|
||||
global $connection;
|
||||
$select = ($select == array("*")
|
||||
? array()
|
||||
: array_fill_keys($select, 1)
|
||||
);
|
||||
if (count($select) && !isset($select['_id'])) {
|
||||
$select['_id'] = 0;
|
||||
}
|
||||
$where = where_to_query($where);
|
||||
$sort = array();
|
||||
foreach ($order as $val) {
|
||||
$val = preg_replace('~ DESC$~', '', $val, 1, $count);
|
||||
$sort[$val] = ($count ? -1 : 1);
|
||||
}
|
||||
if (isset($_GET['limit']) && is_numeric($_GET['limit']) && $_GET['limit'] > 0) {
|
||||
$limit = $_GET['limit'];
|
||||
}
|
||||
$limit = min(200, max(1, (int) $limit));
|
||||
$skip = $page * $limit;
|
||||
$class = 'MongoDB\Driver\Query';
|
||||
$query = new $class($where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort));
|
||||
$results = $connection->_link->executeQuery("$connection->_db_name.$table", $query);
|
||||
return new Min_Result($results);
|
||||
}
|
||||
|
||||
function update($table, $set, $queryWhere, $limit = 0, $separator = "\n") {
|
||||
global $connection;
|
||||
$db = $connection->_db_name;
|
||||
$where = sql_query_where_parser($queryWhere);
|
||||
$class = 'MongoDB\Driver\BulkWrite';
|
||||
$bulk = new $class(array());
|
||||
if (isset($set['_id'])) {
|
||||
unset($set['_id']);
|
||||
}
|
||||
$removeFields = array();
|
||||
foreach ($set as $key => $value) {
|
||||
if ($value == 'NULL') {
|
||||
$removeFields[$key] = 1;
|
||||
unset($set[$key]);
|
||||
}
|
||||
}
|
||||
$update = array('$set' => $set);
|
||||
if (count($removeFields)) {
|
||||
$update['$unset'] = $removeFields;
|
||||
}
|
||||
$bulk->update($where, $update, array('upsert' => false));
|
||||
$results = $connection->_link->executeBulkWrite("$db.$table", $bulk);
|
||||
$connection->affected_rows = $results->getModifiedCount();
|
||||
return true;
|
||||
}
|
||||
|
||||
function delete($table, $queryWhere, $limit = 0) {
|
||||
global $connection;
|
||||
$db = $connection->_db_name;
|
||||
$where = sql_query_where_parser($queryWhere);
|
||||
$class = 'MongoDB\Driver\BulkWrite';
|
||||
$bulk = new $class(array());
|
||||
$bulk->delete($where, array('limit' => $limit));
|
||||
$results = $connection->_link->executeBulkWrite("$db.$table", $bulk);
|
||||
$connection->affected_rows = $results->getDeletedCount();
|
||||
return true;
|
||||
}
|
||||
|
||||
function insert($table, $set) {
|
||||
global $connection;
|
||||
$db = $connection->_db_name;
|
||||
$class = 'MongoDB\Driver\BulkWrite';
|
||||
$bulk = new $class(array());
|
||||
if (isset($set['_id']) && empty($set['_id'])) {
|
||||
unset($set['_id']);
|
||||
}
|
||||
$bulk->insert($set);
|
||||
$results = $connection->_link->executeBulkWrite("$db.$table", $bulk);
|
||||
$connection->affected_rows = $results->getInsertedCount();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function collations() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function db_collation($db, $collations) {
|
||||
}
|
||||
|
||||
function count_tables($databases) {
|
||||
global $connection;
|
||||
$return = array();
|
||||
foreach ($databases as $db) {
|
||||
$return[$db] = count($connection->_link->selectDB($db)->getCollectionNames(true));
|
||||
function get_databases($flush) {
|
||||
/** @var Min_DB */
|
||||
global $connection;
|
||||
$return = array();
|
||||
$class = 'MongoDB\Driver\Command';
|
||||
$command = new $class(array('listDatabases' => 1));
|
||||
$results = $connection->_link->executeCommand('admin', $command);
|
||||
foreach ($results as $dbs) {
|
||||
foreach ($dbs->databases as $db) {
|
||||
$return[] = $db->name;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
return $return;
|
||||
|
||||
function count_tables($databases) {
|
||||
$return = array();
|
||||
return $return;
|
||||
}
|
||||
|
||||
function tables_list() {
|
||||
global $connection;
|
||||
$class = 'MongoDB\Driver\Command';
|
||||
$command = new $class(array('listCollections' => 1));
|
||||
$results = $connection->_link->executeCommand($connection->_db_name, $command);
|
||||
$collections = array();
|
||||
foreach ($results as $result) {
|
||||
$collections[$result->name] = 'table';
|
||||
}
|
||||
return $collections;
|
||||
}
|
||||
|
||||
function drop_databases($databases) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function indexes($table, $connection2 = null) {
|
||||
global $connection;
|
||||
$return = array();
|
||||
$class = 'MongoDB\Driver\Command';
|
||||
$command = new $class(array('listIndexes' => $table));
|
||||
$results = $connection->_link->executeCommand($connection->_db_name, $command);
|
||||
foreach ($results as $index) {
|
||||
$descs = array();
|
||||
$columns = array();
|
||||
foreach (get_object_vars($index->key) as $column => $type) {
|
||||
$descs[] = ($type == -1 ? '1' : null);
|
||||
$columns[] = $column;
|
||||
}
|
||||
$return[$index->name] = array(
|
||||
"type" => ($index->name == "_id_" ? "PRIMARY" : (isset($index->unique) ? "UNIQUE" : "INDEX")),
|
||||
"columns" => $columns,
|
||||
"lengths" => array(),
|
||||
"descs" => $descs,
|
||||
);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function fields($table) {
|
||||
$fields = fields_from_edit();
|
||||
if (!count($fields)) {
|
||||
global $driver;
|
||||
$result = $driver->select($table, array("*"), null, null, array(), 10);
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
foreach ($row as $key => $val) {
|
||||
$row[$key] = null;
|
||||
$fields[$key] = array(
|
||||
"field" => $key,
|
||||
"type" => "string",
|
||||
"null" => ($key != $driver->primary),
|
||||
"auto_increment" => ($key == $driver->primary),
|
||||
"privileges" => array(
|
||||
"insert" => 1,
|
||||
"select" => 1,
|
||||
"update" => 1,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $fields;
|
||||
}
|
||||
|
||||
function found_rows($table_status, $where) {
|
||||
global $connection;
|
||||
$where = where_to_query($where);
|
||||
$class = 'MongoDB\Driver\Command';
|
||||
$command = new $class(array('count' => $table_status['Name'], 'query' => $where));
|
||||
$results = $connection->_link->executeCommand($connection->_db_name, $command);
|
||||
$toArray = $results->toArray();
|
||||
return $toArray[0]->n;
|
||||
}
|
||||
|
||||
function sql_query_where_parser($queryWhere) {
|
||||
$queryWhere = trim(preg_replace('/WHERE[\s]?[(]?\(?/', '', $queryWhere));
|
||||
$queryWhere = preg_replace('/\)\)\)$/', ')', $queryWhere);
|
||||
$wheres = explode(' AND ', $queryWhere);
|
||||
$wheresOr = explode(') OR (', $queryWhere);
|
||||
$where = array();
|
||||
foreach ($wheres as $whereStr) {
|
||||
$where[] = trim($whereStr);
|
||||
}
|
||||
if (count($wheresOr) == 1) {
|
||||
$wheresOr = array();
|
||||
} elseif (count($wheresOr) > 1) {
|
||||
$where = array();
|
||||
}
|
||||
return where_to_query($where, $wheresOr);
|
||||
}
|
||||
|
||||
function where_to_query($whereAnd = array(), $whereOr = array()) {
|
||||
global $adminer;
|
||||
$data = array();
|
||||
foreach (array('and' => $whereAnd, 'or' => $whereOr) as $type => $where) {
|
||||
if (is_array($where)) {
|
||||
foreach ($where as $expression) {
|
||||
list($col, $op, $val) = explode(" ", $expression, 3);
|
||||
if ($col == "_id") {
|
||||
$val = str_replace('MongoDB\BSON\ObjectID("', "", $val);
|
||||
$val = str_replace('")', "", $val);
|
||||
$class = 'MongoDB\BSON\ObjectID';
|
||||
$val = new $class($val);
|
||||
}
|
||||
if (!in_array($op, $adminer->operators)) {
|
||||
continue;
|
||||
}
|
||||
if (preg_match('~^\(f\)(.+)~', $op, $match)) {
|
||||
$val = (float) $val;
|
||||
$op = $match[1];
|
||||
} elseif (preg_match('~^\(date\)(.+)~', $op, $match)) {
|
||||
$dateTime = new DateTime($val);
|
||||
$class = 'MongoDB\BSON\UTCDatetime';
|
||||
$val = new $class($dateTime->getTimestamp() * 1000);
|
||||
$op = $match[1];
|
||||
}
|
||||
switch ($op) {
|
||||
case '=':
|
||||
$op = '$eq';
|
||||
break;
|
||||
case '!=':
|
||||
$op = '$ne';
|
||||
break;
|
||||
case '>':
|
||||
$op = '$gt';
|
||||
break;
|
||||
case '<':
|
||||
$op = '$lt';
|
||||
break;
|
||||
case '>=':
|
||||
$op = '$gte';
|
||||
break;
|
||||
case '<=':
|
||||
$op = '$lte';
|
||||
break;
|
||||
case 'regex':
|
||||
$op = '$regex';
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if ($type == 'and') {
|
||||
$data['$and'][] = array($col => array($op => $val));
|
||||
} elseif ($type == 'or') {
|
||||
$data['$or'][] = array($col => array($op => $val));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
$operators = array(
|
||||
"=",
|
||||
"!=",
|
||||
">",
|
||||
"<",
|
||||
">=",
|
||||
"<=",
|
||||
"regex",
|
||||
"(f)=",
|
||||
"(f)!=",
|
||||
"(f)>",
|
||||
"(f)<",
|
||||
"(f)>=",
|
||||
"(f)<=",
|
||||
"(date)=",
|
||||
"(date)!=",
|
||||
"(date)>",
|
||||
"(date)<",
|
||||
"(date)>=",
|
||||
"(date)<=",
|
||||
);
|
||||
}
|
||||
|
||||
function tables_list() {
|
||||
global $connection;
|
||||
return array_fill_keys($connection->_db->getCollectionNames(true), 'table');
|
||||
function table($idf) {
|
||||
return $idf;
|
||||
}
|
||||
|
||||
function idf_escape($idf) {
|
||||
return $idf;
|
||||
}
|
||||
|
||||
function table_status($name = "", $fast = false) {
|
||||
@@ -213,43 +581,97 @@ if (isset($_GET["mongo"])) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
function information_schema() {
|
||||
function create_database($db, $collation) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function is_view($table_status) {
|
||||
}
|
||||
|
||||
function drop_databases($databases) {
|
||||
function last_id() {
|
||||
global $connection;
|
||||
foreach ($databases as $db) {
|
||||
$response = $connection->_link->selectDB($db)->drop();
|
||||
if (!$response['ok']) {
|
||||
return $connection->last_id;
|
||||
}
|
||||
|
||||
function error() {
|
||||
global $connection;
|
||||
return h($connection->error);
|
||||
}
|
||||
|
||||
function collations() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function logged_user() {
|
||||
global $adminer;
|
||||
$credentials = $adminer->credentials();
|
||||
return $credentials[1];
|
||||
}
|
||||
|
||||
function connect() {
|
||||
global $adminer;
|
||||
$connection = new Min_DB;
|
||||
list($server, $username, $password) = $adminer->credentials();
|
||||
$options = array();
|
||||
if ($username . $password != "") {
|
||||
$options["username"] = $username;
|
||||
$options["password"] = $password;
|
||||
}
|
||||
$db = $adminer->database();
|
||||
if ($db != "") {
|
||||
$options["db"] = $db;
|
||||
}
|
||||
try {
|
||||
$connection->_link = $connection->connect("mongodb://$server", $options);
|
||||
if ($password != "") {
|
||||
$options["password"] = "";
|
||||
try {
|
||||
$connection->connect("mongodb://$server", $options);
|
||||
return lang('Database does not support password.');
|
||||
} catch (Exception $ex) {
|
||||
// this is what we want
|
||||
}
|
||||
}
|
||||
return $connection;
|
||||
} catch (Exception $ex) {
|
||||
return $ex->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
function alter_indexes($table, $alter) {
|
||||
global $connection;
|
||||
foreach ($alter as $val) {
|
||||
list($type, $name, $set) = $val;
|
||||
if ($set == "DROP") {
|
||||
$return = $connection->_db->command(array("deleteIndexes" => $table, "index" => $name));
|
||||
} else {
|
||||
$columns = array();
|
||||
foreach ($set as $column) {
|
||||
$column = preg_replace('~ DESC$~', '', $column, 1, $count);
|
||||
$columns[$column] = ($count ? -1 : 1);
|
||||
}
|
||||
$return = $connection->_db->selectCollection($table)->ensureIndex($columns, array(
|
||||
"unique" => ($type == "UNIQUE"),
|
||||
"name" => $name,
|
||||
//! "sparse"
|
||||
));
|
||||
}
|
||||
if ($return['errmsg']) {
|
||||
$connection->error = $return['errmsg'];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function indexes($table, $connection2 = null) {
|
||||
global $connection;
|
||||
$return = array();
|
||||
foreach ($connection->_db->selectCollection($table)->getIndexInfo() as $index) {
|
||||
$descs = array();
|
||||
foreach ($index["key"] as $column => $type) {
|
||||
$descs[] = ($type == -1 ? '1' : null);
|
||||
}
|
||||
$return[$index["name"]] = array(
|
||||
"type" => ($index["name"] == "_id_" ? "PRIMARY" : ($index["unique"] ? "UNIQUE" : "INDEX")),
|
||||
"columns" => array_keys($index["key"]),
|
||||
"lengths" => array(),
|
||||
"descs" => $descs,
|
||||
);
|
||||
}
|
||||
return $return;
|
||||
function support($feature) {
|
||||
return preg_match("~database|indexes|descidx~", $feature);
|
||||
}
|
||||
|
||||
function fields($table) {
|
||||
return fields_from_edit();
|
||||
function db_collation($db, $collations) {
|
||||
}
|
||||
|
||||
function information_schema() {
|
||||
}
|
||||
|
||||
function is_view($table_status) {
|
||||
}
|
||||
|
||||
function convert_field($field) {
|
||||
@@ -270,12 +692,6 @@ if (isset($_GET["mongo"])) {
|
||||
return array();
|
||||
}
|
||||
|
||||
function found_rows($table_status, $where) {
|
||||
global $connection;
|
||||
//! don't call count_rows()
|
||||
return $connection->_db->selectCollection($_GET["select"])->count($where);
|
||||
}
|
||||
|
||||
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
|
||||
global $connection;
|
||||
if ($table == "") {
|
||||
@@ -306,51 +722,7 @@ if (isset($_GET["mongo"])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function alter_indexes($table, $alter) {
|
||||
global $connection;
|
||||
foreach ($alter as $val) {
|
||||
list($type, $name, $set) = $val;
|
||||
if ($set == "DROP") {
|
||||
$return = $connection->_db->command(array("deleteIndexes" => $table, "index" => $name));
|
||||
} else {
|
||||
$columns = array();
|
||||
foreach ($set as $column) {
|
||||
$column = preg_replace('~ DESC$~', '', $column, 1, $count);
|
||||
$columns[$column] = ($count ? -1 : 1);
|
||||
}
|
||||
$return = $connection->_db->selectCollection($table)->ensureIndex($columns, array(
|
||||
"unique" => ($type == "UNIQUE"),
|
||||
"name" => $name,
|
||||
//! "sparse"
|
||||
));
|
||||
}
|
||||
if ($return['errmsg']) {
|
||||
$connection->error = $return['errmsg'];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function last_id() {
|
||||
global $connection;
|
||||
return $connection->last_id;
|
||||
}
|
||||
|
||||
function table($idf) {
|
||||
return $idf;
|
||||
}
|
||||
|
||||
function idf_escape($idf) {
|
||||
return $idf;
|
||||
}
|
||||
|
||||
function support($feature) {
|
||||
return preg_match("~database|indexes~", $feature);
|
||||
}
|
||||
|
||||
$jush = "mongo";
|
||||
$operators = array("=");
|
||||
$functions = array();
|
||||
$grouping = array();
|
||||
$edit_functions = array(array("json"));
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* @author Jakub Vrana
|
||||
*/
|
||||
|
||||
$drivers["mssql"] = "MS SQL";
|
||||
$drivers["mssql"] = "MS SQL (beta)";
|
||||
|
||||
if (isset($_GET["mssql"])) {
|
||||
$possible_drivers = array("SQLSRV", "MSSQL", "PDO_DBLIB");
|
||||
@@ -24,7 +24,13 @@ if (isset($_GET["mssql"])) {
|
||||
}
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
$this->_link = @sqlsrv_connect($server, array("UID" => $username, "PWD" => $password, "CharacterSet" => "UTF-8"));
|
||||
global $adminer;
|
||||
$db = $adminer->database();
|
||||
$connection_info = array("UID" => $username, "PWD" => $password, "CharacterSet" => "UTF-8");
|
||||
if ($db != "") {
|
||||
$connection_info["Database"] = $db;
|
||||
}
|
||||
$this->_link = @sqlsrv_connect(preg_replace('~:~', ',', $server), $connection_info);
|
||||
if ($this->_link) {
|
||||
$info = sqlsrv_server_info($this->_link);
|
||||
$this->server_info = $info['SQLServerVersion'];
|
||||
@@ -147,8 +153,10 @@ if (isset($_GET["mssql"])) {
|
||||
$this->_link = @mssql_connect($server, $username, $password);
|
||||
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]";
|
||||
if ($result) {
|
||||
$row = $result->fetch_row();
|
||||
$this->server_info = $this->result("sp_server_info 2", 2) . " [$row[0]] $row[1]";
|
||||
}
|
||||
} else {
|
||||
$this->error = mssql_get_last_message();
|
||||
}
|
||||
@@ -239,7 +247,7 @@ if (isset($_GET["mssql"])) {
|
||||
var $extension = "PDO_DBLIB";
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
$this->dsn("dblib:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password);
|
||||
$this->dsn("dblib:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\d)~', ';port=\1', $server)), $username, $password);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -308,13 +316,13 @@ if (isset($_GET["mssql"])) {
|
||||
return ($limit !== null ? " TOP (" . ($limit + $offset) . ")" : "") . " $query$where"; // seek later
|
||||
}
|
||||
|
||||
function limit1($query, $where) {
|
||||
return limit($query, $where, 1);
|
||||
function limit1($table, $query, $where, $separator = "\n") {
|
||||
return limit($query, $where, 1, 0, $separator);
|
||||
}
|
||||
|
||||
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 = " . q($db));
|
||||
}
|
||||
|
||||
function engines() {
|
||||
@@ -361,7 +369,7 @@ if (isset($_GET["mssql"])) {
|
||||
|
||||
function fields($table) {
|
||||
$return = array();
|
||||
foreach (get_rows("SELECT c.*, t.name type, d.definition [default]
|
||||
foreach (get_rows("SELECT c.max_length, c.precision, c.scale, c.name, c.is_nullable, c.is_identity, c.collation_name, t.name type, CAST(d.definition as text) [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
|
||||
@@ -406,7 +414,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
|
||||
|
||||
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))));
|
||||
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() {
|
||||
@@ -423,7 +431,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
|
||||
|
||||
function error() {
|
||||
global $connection;
|
||||
return nl_br(h(preg_replace('~^(\\[[^]]*])+~m', '', $connection->error)));
|
||||
return nl_br(h(preg_replace('~^(\[[^]]*])+~m', '', $connection->error)));
|
||||
}
|
||||
|
||||
function create_database($db, $collation) {
|
||||
@@ -454,7 +462,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
|
||||
if (!$val) {
|
||||
$alter["DROP"][] = " COLUMN $column";
|
||||
} else {
|
||||
$val[1] = preg_replace("~( COLLATE )'(\\w+)'~", "\\1\\2", $val[1]);
|
||||
$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 {
|
||||
@@ -561,7 +569,7 @@ WHERE s.xtype = 'TR' AND s.name = " . q($name)
|
||||
); // triggers are not schema-scoped
|
||||
$return = reset($rows);
|
||||
if ($return) {
|
||||
$return["Statement"] = preg_replace('~^.+\\s+AS\\s+~isU', '', $return["text"]); //! identifiers, comments
|
||||
$return["Statement"] = preg_replace('~^.+\s+AS\s+~isU', '', $return["text"]); //! identifiers, comments
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -624,7 +632,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)
|
||||
}
|
||||
|
||||
function support($feature) {
|
||||
return preg_match('~^(columns|database|drop_col|indexes|scheme|sql|table|trigger|view|view_trigger)$~', $feature); //! routine|
|
||||
return preg_match('~^(columns|database|drop_col|indexes|descidx|scheme|sql|table|trigger|view|view_trigger)$~', $feature); //! routine|
|
||||
}
|
||||
|
||||
$jush = "mssql";
|
||||
|
@@ -14,16 +14,23 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
|
||||
function connect($server = "", $username = "", $password = "", $database = null, $port = null, $socket = null) {
|
||||
global $adminer;
|
||||
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
|
||||
$ssl = $adminer->connectSsl();
|
||||
if ($ssl) {
|
||||
$this->ssl_set($ssl['key'], $ssl['cert'], $ssl['ca'], '', '');
|
||||
}
|
||||
$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")),
|
||||
$database,
|
||||
(is_numeric($port) ? $port : ini_get("mysqli.default_port")),
|
||||
(!is_numeric($port) ? $port : $socket)
|
||||
(!is_numeric($port) ? $port : $socket),
|
||||
($ssl ? 64 : 0) // 64 - MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT (not available before PHP 5.6.16)
|
||||
);
|
||||
$this->options(MYSQLI_OPT_LOCAL_INFILE, false);
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -50,7 +57,7 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("mysql") && !(ini_get("sql.safe_mode") && extension_loaded("pdo_mysql"))) {
|
||||
} elseif (extension_loaded("mysql") && !((ini_bool("sql.safe_mode") || ini_bool("mysql.allow_local_infile")) && extension_loaded("pdo_mysql"))) {
|
||||
class Min_DB {
|
||||
var
|
||||
$extension = "MySQL", ///< @var string extension name
|
||||
@@ -68,6 +75,10 @@ if (!defined("DRIVER")) {
|
||||
* @return bool
|
||||
*/
|
||||
function connect($server, $username, $password) {
|
||||
if (ini_bool("mysql.allow_local_infile")) {
|
||||
$this->error = lang('Disable %s or enable %s or %s extensions.', "'mysql.allow_local_infile'", "MySQLi", "PDO_MySQL");
|
||||
return false;
|
||||
}
|
||||
$this->_link = @mysql_connect(
|
||||
($server != "" ? $server : ini_get("mysql.default_host")),
|
||||
("$server$username" != "" ? $username : ini_get("mysql.default_user")),
|
||||
@@ -223,7 +234,22 @@ if (!defined("DRIVER")) {
|
||||
var $extension = "PDO_MySQL";
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
$this->dsn("mysql:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\\d)~', ';port=\\1', $server)), $username, $password);
|
||||
global $adminer;
|
||||
$options = array(PDO::MYSQL_ATTR_LOCAL_INFILE => false);
|
||||
$ssl = $adminer->connectSsl();
|
||||
if ($ssl) {
|
||||
$options += array(
|
||||
PDO::MYSQL_ATTR_SSL_KEY => $ssl['key'],
|
||||
PDO::MYSQL_ATTR_SSL_CERT => $ssl['cert'],
|
||||
PDO::MYSQL_ATTR_SSL_CA => $ssl['ca'],
|
||||
);
|
||||
}
|
||||
$this->dsn(
|
||||
"mysql:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\d)~', ';port=\1', $server)),
|
||||
$username,
|
||||
$password,
|
||||
$options
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -276,6 +302,42 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
return queries($prefix . implode(",\n", $values) . $suffix);
|
||||
}
|
||||
|
||||
function slowQuery($query, $timeout) {
|
||||
if (min_version('5.7.8', '10.1.2')) {
|
||||
if (preg_match('~MariaDB~', $this->_conn->server_info)) {
|
||||
return "SET STATEMENT max_statement_time=$timeout FOR $query";
|
||||
} elseif (preg_match('~^(SELECT\b)(.+)~is', $query, $match)) {
|
||||
return "$match[1] /*+ MAX_EXECUTION_TIME(" . ($timeout * 1000) . ") */ $match[2]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function convertSearch($idf, $val, $field) {
|
||||
return (preg_match('~char|text|enum|set~', $field["type"]) && !preg_match("~^utf8~", $field["collation"]) && preg_match('~[\x80-\xFF]~', $val['val'])
|
||||
? "CONVERT($idf USING " . charset($this->_conn) . ")"
|
||||
: $idf
|
||||
);
|
||||
}
|
||||
|
||||
function warnings() {
|
||||
$result = $this->_conn->query("SHOW WARNINGS");
|
||||
if ($result && $result->num_rows) {
|
||||
ob_start();
|
||||
select($result); // select() usually needs to print a big table progressively
|
||||
return ob_get_clean();
|
||||
}
|
||||
}
|
||||
|
||||
function tableHelp($name) {
|
||||
$maria = preg_match('~MariaDB~', $this->_conn->server_info);
|
||||
if (information_schema(DB)) {
|
||||
return strtolower(($maria ? "information-schema-$name-table/" : str_replace("_", "-", $name) . "-table.html"));
|
||||
}
|
||||
if (DB == "mysql") {
|
||||
return ($maria ? "mysql$name-table/" : "system-database.html"); //! more precise link
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -307,7 +369,7 @@ if (!defined("DRIVER")) {
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
$connection->set_charset(charset($connection)); // available in MySQLi since PHP 5.0.5
|
||||
$connection->query("SET sql_quote_show_create = 1, autocommit = 1");
|
||||
if (version_compare($connection->server_info, '5.7.8') >= 0) {
|
||||
if (min_version('5.7.8', 10.2, $connection)) {
|
||||
$structured_types[lang('Strings')][] = "json";
|
||||
$types["json"] = 4294967295;
|
||||
}
|
||||
@@ -325,12 +387,11 @@ if (!defined("DRIVER")) {
|
||||
* @return array
|
||||
*/
|
||||
function get_databases($flush) {
|
||||
global $connection;
|
||||
// SHOW DATABASES can take a very long time so it is cached
|
||||
$return = get_session("dbs");
|
||||
if ($return === null) {
|
||||
$query = ($connection->server_info >= 5
|
||||
? "SELECT SCHEMA_NAME FROM information_schema.SCHEMATA"
|
||||
$query = (min_version(5)
|
||||
? "SELECT SCHEMA_NAME FROM information_schema.SCHEMATA ORDER BY SCHEMA_NAME"
|
||||
: "SHOW DATABASES"
|
||||
); // SHOW DATABASES can be disabled by skip_show_database
|
||||
$return = ($flush ? slow_query($query) : get_vals($query));
|
||||
@@ -354,12 +415,14 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
|
||||
/** Formulate SQL modification query with limit 1
|
||||
* @param string
|
||||
* @param string everything after UPDATE or DELETE
|
||||
* @param string
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function limit1($query, $where) {
|
||||
return limit($query, $where, 1);
|
||||
function limit1($table, $query, $where, $separator = "\n") {
|
||||
return limit($query, $where, 1, 0, $separator);
|
||||
}
|
||||
|
||||
/** Get database collation
|
||||
@@ -405,8 +468,7 @@ if (!defined("DRIVER")) {
|
||||
* @return array array($name => $type)
|
||||
*/
|
||||
function tables_list() {
|
||||
global $connection;
|
||||
return get_key_vals($connection->server_info >= 5
|
||||
return get_key_vals(min_version(5)
|
||||
? "SELECT TABLE_NAME, TABLE_TYPE FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ORDER BY TABLE_NAME"
|
||||
: "SHOW TABLES"
|
||||
);
|
||||
@@ -430,15 +492,14 @@ if (!defined("DRIVER")) {
|
||||
* @return array array($name => array("Name" => , "Engine" => , "Comment" => , "Oid" => , "Rows" => , "Collation" => , "Auto_increment" => , "Data_length" => , "Index_length" => , "Data_free" => )) or only inner array with $name
|
||||
*/
|
||||
function table_status($name = "", $fast = false) {
|
||||
global $connection;
|
||||
$return = array();
|
||||
foreach (get_rows($fast && $connection->server_info >= 5
|
||||
foreach (get_rows($fast && min_version(5)
|
||||
? "SELECT TABLE_NAME AS Name, ENGINE AS Engine, TABLE_COMMENT AS Comment FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() " . ($name != "" ? "AND TABLE_NAME = " . q($name) : "ORDER BY Name")
|
||||
: "SHOW TABLE STATUS" . ($name != "" ? " LIKE " . q(addcslashes($name, "%_\\")) : "")
|
||||
) as $row) {
|
||||
if ($row["Engine"] == "InnoDB") {
|
||||
// ignore internal comment, unnecessary since MySQL 5.1.21
|
||||
$row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\\1', $row["Comment"]);
|
||||
$row["Comment"] = preg_replace('~(?:(.+); )?InnoDB free: .*~', '\1', $row["Comment"]);
|
||||
}
|
||||
if (!isset($row["Engine"])) {
|
||||
$row["Comment"] = "";
|
||||
@@ -464,9 +525,8 @@ if (!defined("DRIVER")) {
|
||||
* @return bool
|
||||
*/
|
||||
function fk_support($table_status) {
|
||||
global $connection;
|
||||
return preg_match('~InnoDB|IBMDB2I~i', $table_status["Engine"])
|
||||
|| (preg_match('~NDB~i', $table_status["Engine"]) && version_compare($connection->server_info, '5.6') >= 0);
|
||||
|| (preg_match('~NDB~i', $table_status["Engine"]) && min_version(5.6));
|
||||
}
|
||||
|
||||
/** Get information about fields
|
||||
@@ -476,7 +536,7 @@ if (!defined("DRIVER")) {
|
||||
function fields($table) {
|
||||
$return = array();
|
||||
foreach (get_rows("SHOW FULL COLUMNS FROM " . table($table)) as $row) {
|
||||
preg_match('~^([^( ]+)(?:\\((.+)\\))?( unsigned)?( zerofill)?$~', $row["Type"], $match);
|
||||
preg_match('~^([^( ]+)(?:\((.+)\))?( unsigned)?( zerofill)?$~', $row["Type"], $match);
|
||||
$return[$row["Field"]] = array(
|
||||
"field" => $row["Field"],
|
||||
"full_type" => $row["Type"],
|
||||
@@ -519,7 +579,7 @@ if (!defined("DRIVER")) {
|
||||
*/
|
||||
function foreign_keys($table) {
|
||||
global $connection, $on_actions;
|
||||
static $pattern = '`(?:[^`]|``)+`';
|
||||
static $pattern = '(?:`(?:[^`]|``)+`)|(?:"(?:[^"]|"")+")';
|
||||
$return = array();
|
||||
$create_table = $connection->result("SHOW CREATE TABLE " . table($table), 1);
|
||||
if ($create_table) {
|
||||
@@ -546,7 +606,7 @@ if (!defined("DRIVER")) {
|
||||
*/
|
||||
function view($name) {
|
||||
global $connection;
|
||||
return array("select" => preg_replace('~^(?:[^`]|`[^`]*`)*\\s+AS\\s+~isU', '', $connection->result("SHOW CREATE VIEW " . table($name), 1)));
|
||||
return array("select" => preg_replace('~^(?:[^`]|`[^`]*`)*\s+AS\s+~isU', '', $connection->result("SHOW CREATE VIEW " . table($name), 1)));
|
||||
}
|
||||
|
||||
/** Get sorted grouped list of collations
|
||||
@@ -573,9 +633,8 @@ if (!defined("DRIVER")) {
|
||||
* @return bool
|
||||
*/
|
||||
function information_schema($db) {
|
||||
global $connection;
|
||||
return ($connection->server_info >= 5 && $db == "information_schema")
|
||||
|| ($connection->server_info >= 5.5 && $db == "performance_schema");
|
||||
return (min_version(5) && $db == "information_schema")
|
||||
|| (min_version(5.5) && $db == "performance_schema");
|
||||
}
|
||||
|
||||
/** Get escaped error message
|
||||
@@ -751,19 +810,22 @@ if (!defined("DRIVER")) {
|
||||
queries("SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'");
|
||||
foreach ($tables as $table) {
|
||||
$name = ($target == DB ? table("copy_$table") : idf_escape($target) . "." . table($table));
|
||||
if (!queries("\nDROP TABLE IF EXISTS $name")
|
||||
|| !queries("CREATE TABLE $name LIKE " . table($table))
|
||||
if (!queries("CREATE TABLE $name LIKE " . table($table))
|
||||
|| !queries("INSERT INTO $name SELECT * FROM " . table($table))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
foreach (get_rows("SHOW TRIGGERS LIKE " . q(addcslashes($table, "%_\\"))) as $row) {
|
||||
$trigger = $row["Trigger"];
|
||||
if (!queries("CREATE TRIGGER " . ($target == DB ? idf_escape("copy_$trigger") : idf_escape($target) . "." . idf_escape($trigger)) . " $row[Timing] $row[Event] ON $name FOR EACH ROW\n$row[Statement];")) {
|
||||
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
|
||||
) {
|
||||
if (!queries("CREATE VIEW $name AS $view[select]")) { //! USE to avoid db.table
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -813,8 +875,9 @@ 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");
|
||||
$space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";
|
||||
$type_pattern = "((" . implode("|", array_merge(array_keys($types), $aliases)) . ")\\b(?:\\s*\\(((?:[^'\")]|$enum_length)++)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s,]+)['\"]?)?";
|
||||
$pattern = "\\s*(" . ($type == "FUNCTION" ? "" : $inout) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
|
||||
$pattern = "$space*(" . ($type == "FUNCTION" ? "" : $inout) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
|
||||
$create = $connection->result("SHOW CREATE $type " . idf_escape($name), 2);
|
||||
preg_match("~\\(((?:$pattern\\s*,?)*)\\)\\s*" . ($type == "FUNCTION" ? "RETURNS\\s+$type_pattern\\s+" : "") . "(.*)~is", $create, $match);
|
||||
$fields = array();
|
||||
@@ -825,7 +888,7 @@ if (!defined("DRIVER")) {
|
||||
"field" => $name,
|
||||
"type" => strtolower($param[5]),
|
||||
"length" => preg_replace_callback("~$enum_length~s", 'normalize_enum', $param[6]),
|
||||
"unsigned" => strtolower(preg_replace('~\\s+~', ' ', trim("$param[8] $param[7]"))),
|
||||
"unsigned" => strtolower(preg_replace('~\s+~', ' ', trim("$param[8] $param[7]"))),
|
||||
"null" => 1,
|
||||
"full_type" => $param[4],
|
||||
"inout" => strtoupper($param[1]),
|
||||
@@ -844,10 +907,10 @@ if (!defined("DRIVER")) {
|
||||
}
|
||||
|
||||
/** Get list of routines
|
||||
* @return array ("ROUTINE_TYPE" => , "ROUTINE_NAME" => , "DTD_IDENTIFIER" => )
|
||||
* @return array ("SPECIFIC_NAME" => , "ROUTINE_NAME" => , "ROUTINE_TYPE" => , "DTD_IDENTIFIER" => )
|
||||
*/
|
||||
function routines() {
|
||||
return get_rows("SELECT ROUTINE_NAME, ROUTINE_TYPE, DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . q(DB));
|
||||
return get_rows("SELECT ROUTINE_NAME AS SPECIFIC_NAME, ROUTINE_NAME, ROUTINE_TYPE, DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = " . q(DB));
|
||||
}
|
||||
|
||||
/** Get list of available routine languages
|
||||
@@ -857,6 +920,15 @@ if (!defined("DRIVER")) {
|
||||
return array(); // "SQL" not required
|
||||
}
|
||||
|
||||
/** Get routine signature
|
||||
* @param string
|
||||
* @param array result of routine()
|
||||
* @return string
|
||||
*/
|
||||
function routine_id($name, $row) {
|
||||
return idf_escape($name);
|
||||
}
|
||||
|
||||
/** Get last auto increment ID
|
||||
* @return string
|
||||
*/
|
||||
@@ -871,7 +943,7 @@ if (!defined("DRIVER")) {
|
||||
* @return Min_Result
|
||||
*/
|
||||
function explain($connection, $query) {
|
||||
return $connection->query("EXPLAIN " . ($connection->server_info >= 5.1 ? "PARTITIONS " : "") . $query);
|
||||
return $connection->query("EXPLAIN " . (min_version(5.1) ? "PARTITIONS " : "") . $query);
|
||||
}
|
||||
|
||||
/** Get approximate number of rows
|
||||
@@ -915,13 +987,14 @@ if (!defined("DRIVER")) {
|
||||
/** Get SQL command to create table
|
||||
* @param string
|
||||
* @param bool
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function create_sql($table, $auto_increment) {
|
||||
function create_sql($table, $auto_increment, $style) {
|
||||
global $connection;
|
||||
$return = $connection->result("SHOW CREATE TABLE " . table($table), 1);
|
||||
if (!$auto_increment) {
|
||||
$return = preg_replace('~ AUTO_INCREMENT=\\d+~', '', $return); //! skip comments
|
||||
$return = preg_replace('~ AUTO_INCREMENT=\d+~', '', $return); //! skip comments
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -944,14 +1017,12 @@ if (!defined("DRIVER")) {
|
||||
|
||||
/** Get SQL commands to create triggers
|
||||
* @param string
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function trigger_sql($table, $style) {
|
||||
function trigger_sql($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";
|
||||
$return .= "\nCREATE TRIGGER " . idf_escape($row["Trigger"]) . " $row[Timing] $row[Event] ON " . table($row["Table"]) . " FOR EACH ROW\n$row[Statement];;\n";
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -989,7 +1060,7 @@ if (!defined("DRIVER")) {
|
||||
return "BIN(" . idf_escape($field["field"]) . " + 0)"; // + 0 is required outside MySQLnd
|
||||
}
|
||||
if (preg_match("~geometry|point|linestring|polygon~", $field["type"])) {
|
||||
return "AsWKT(" . idf_escape($field["field"]) . ")";
|
||||
return (min_version(8) ? "ST_" : "") . "AsWKT(" . idf_escape($field["field"]) . ")";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1006,18 +1077,17 @@ if (!defined("DRIVER")) {
|
||||
$return = "CONV($return, 2, 10) + 0";
|
||||
}
|
||||
if (preg_match("~geometry|point|linestring|polygon~", $field["type"])) {
|
||||
$return = "GeomFromText($return)";
|
||||
$return = (min_version(8) ? "ST_" : "") . "GeomFromText($return)";
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Check whether a feature is supported
|
||||
* @param string "comment", "copy", "database", "drop_col", "dump", "event", "kill", "materializedview", "partitioning", "privileges", "procedure", "processlist", "routine", "scheme", "sequence", "status", "table", "trigger", "type", "variables", "view", "view_trigger"
|
||||
* @param string "comment", "copy", "database", "descidx", "drop_col", "dump", "event", "indexes", "kill", "materializedview", "partitioning", "privileges", "procedure", "processlist", "routine", "scheme", "sequence", "status", "table", "trigger", "type", "variables", "view", "view_trigger"
|
||||
* @return bool
|
||||
*/
|
||||
function support($feature) {
|
||||
global $connection;
|
||||
return !preg_match("~scheme|sequence|type|view_trigger|materializedview" . ($connection->server_info < 5.1 ? "|event|partitioning" . ($connection->server_info < 5 ? "|routine|trigger|view" : "") : "") . "~", $feature);
|
||||
return !preg_match("~scheme|sequence|type|view_trigger|materializedview" . (min_version(8) ? "" : "|descidx" . (min_version(5.1) ? "" : "|event|partitioning" . (min_version(5) ? "" : "|routine|trigger|view"))) . "~", $feature);
|
||||
}
|
||||
|
||||
function kill_process($val) {
|
||||
@@ -1048,16 +1118,16 @@ 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", "SQL"); ///< @var array operators used in select
|
||||
$functions = array("char_length", "date", "from_unixtime", "lower", "round", "sec_to_time", "time_to_sec", "upper"); ///< @var array functions used in select
|
||||
$operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "FIND_IN_SET", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL"); ///< @var array operators used in select
|
||||
$functions = array("char_length", "date", "from_unixtime", "lower", "round", "floor", "ceil", "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
|
||||
"char" => "md5/sha1/password/encrypt/uuid",
|
||||
"binary" => "md5/sha1",
|
||||
"date|time" => "now",
|
||||
), array(
|
||||
"(^|[^o])int|float|double|decimal" => "+/-", // not point
|
||||
number_type() => "+/-",
|
||||
"date" => "+ interval/- interval",
|
||||
"time" => "addtime/subtime",
|
||||
"char|text" => "concat",
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$drivers["oracle"] = "Oracle";
|
||||
$drivers["oracle"] = "Oracle (beta)";
|
||||
|
||||
if (isset($_GET["oracle"])) {
|
||||
$possible_drivers = array("OCI8", "PDO_OCI");
|
||||
@@ -175,8 +175,8 @@ if (isset($_GET["oracle"])) {
|
||||
));
|
||||
}
|
||||
|
||||
function limit1($query, $where) {
|
||||
return " $query$where";
|
||||
function limit1($table, $query, $where, $separator = "\n") {
|
||||
return " $query$where"; //! limit
|
||||
}
|
||||
|
||||
function db_collation($db, $collations) {
|
||||
@@ -398,7 +398,7 @@ ORDER BY PROCESS
|
||||
}
|
||||
|
||||
function support($feature) {
|
||||
return preg_match('~^(columns|database|drop_col|indexes|processlist|scheme|sql|status|table|variables|view|view_trigger)$~', $feature); //!
|
||||
return preg_match('~^(columns|database|drop_col|indexes|descidx|processlist|scheme|sql|status|table|variables|view|view_trigger)$~', $feature); //!
|
||||
}
|
||||
|
||||
$jush = "oracle";
|
||||
|
@@ -6,7 +6,7 @@ if (isset($_GET["pgsql"])) {
|
||||
define("DRIVER", "pgsql");
|
||||
if (extension_loaded("pgsql")) {
|
||||
class Min_DB {
|
||||
var $extension = "PgSQL", $_link, $_result, $_string, $_database = true, $server_info, $affected_rows, $error;
|
||||
var $extension = "PgSQL", $_link, $_result, $_string, $_database = true, $server_info, $affected_rows, $error, $timeout;
|
||||
|
||||
function _error($errno, $error) {
|
||||
if (ini_bool("html_errors")) {
|
||||
@@ -37,7 +37,15 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
|
||||
function quote($string) {
|
||||
return "'" . pg_escape_string($this->_link, $string) . "'"; //! bytea
|
||||
return "'" . pg_escape_string($this->_link, $string) . "'";
|
||||
}
|
||||
|
||||
function value($val, $field) {
|
||||
return ($field["type"] == "bytea" ? pg_unescape_bytea($val) : $val);
|
||||
}
|
||||
|
||||
function quoteBinary($string) {
|
||||
return "'" . pg_escape_bytea($this->_link, $string) . "'";
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
@@ -61,12 +69,18 @@ if (isset($_GET["pgsql"])) {
|
||||
$this->error = "";
|
||||
if (!$result) {
|
||||
$this->error = pg_last_error($this->_link);
|
||||
return false;
|
||||
$return = false;
|
||||
} elseif (!pg_num_fields($result)) {
|
||||
$this->affected_rows = pg_affected_rows($result);
|
||||
return true;
|
||||
$return = true;
|
||||
} else {
|
||||
$return = new Min_Result($result);
|
||||
}
|
||||
return new Min_Result($result);
|
||||
if ($this->timeout) {
|
||||
$this->timeout = 0;
|
||||
$this->query("RESET statement_timeout");
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
@@ -89,6 +103,10 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
return pg_fetch_result($result->_result, 0, $field);
|
||||
}
|
||||
|
||||
function warnings() {
|
||||
return h(pg_last_notice($this->_link)); // second parameter is available since PHP 7.1.0
|
||||
}
|
||||
}
|
||||
|
||||
class Min_Result {
|
||||
@@ -127,7 +145,7 @@ if (isset($_GET["pgsql"])) {
|
||||
|
||||
} elseif (extension_loaded("pdo_pgsql")) {
|
||||
class Min_DB extends Min_PDO {
|
||||
var $extension = "PDO_PgSQL";
|
||||
var $extension = "PDO_PgSQL", $timeout;
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
global $adminer;
|
||||
@@ -143,6 +161,23 @@ if (isset($_GET["pgsql"])) {
|
||||
return ($adminer->database() == $database);
|
||||
}
|
||||
|
||||
function quoteBinary($s) {
|
||||
return q($s);
|
||||
}
|
||||
|
||||
function query($query, $unbuffered = false) {
|
||||
$return = parent::query($query, $unbuffered);
|
||||
if ($this->timeout) {
|
||||
$this->timeout = 0;
|
||||
parent::query("RESET statement_timeout");
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function warnings() {
|
||||
return ''; // not implemented in PDO_PgSQL as of PHP 7.2.1
|
||||
}
|
||||
|
||||
function close() {
|
||||
}
|
||||
}
|
||||
@@ -173,6 +208,40 @@ if (isset($_GET["pgsql"])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function slowQuery($query, $timeout) {
|
||||
$this->_conn->query("SET statement_timeout = " . (1000 * $timeout));
|
||||
$this->_conn->timeout = 1000 * $timeout;
|
||||
return $query;
|
||||
}
|
||||
|
||||
function convertSearch($idf, $val, $field) {
|
||||
return (preg_match('~char|text'
|
||||
. (!preg_match('~LIKE~', $val["op"]) ? '|date|time(stamp)?|boolean|uuid|' . number_type() : '')
|
||||
. '~', $field["type"])
|
||||
? $idf
|
||||
: "CAST($idf AS text)"
|
||||
);
|
||||
}
|
||||
|
||||
function quoteBinary($s) {
|
||||
return $this->_conn->quoteBinary($s);
|
||||
}
|
||||
|
||||
function warnings() {
|
||||
return $this->_conn->warnings();
|
||||
}
|
||||
|
||||
function tableHelp($name) {
|
||||
$links = array(
|
||||
"information_schema" => "infoschema",
|
||||
"pg_catalog" => "catalog",
|
||||
);
|
||||
$link = $links[$_GET["ns"]];
|
||||
if ($link) {
|
||||
return "$link-" . str_replace("_", "-", $name) . ".html";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -190,12 +259,12 @@ if (isset($_GET["pgsql"])) {
|
||||
$connection = new Min_DB;
|
||||
$credentials = $adminer->credentials();
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
if ($connection->server_info >= 9) {
|
||||
if (min_version(9, 0, $connection)) {
|
||||
$connection->query("SET application_name = 'Adminer'");
|
||||
if ($connection->server_info >= 9.2) {
|
||||
if (min_version(9.2, 0, $connection)) {
|
||||
$structured_types[lang('Strings')][] = "json";
|
||||
$types["json"] = 4294967295;
|
||||
if ($connection->server_info >= 9.4) {
|
||||
if (min_version(9.4, 0, $connection)) {
|
||||
$structured_types[lang('Strings')][] = "jsonb";
|
||||
$types["jsonb"] = 4294967295;
|
||||
}
|
||||
@@ -214,8 +283,11 @@ if (isset($_GET["pgsql"])) {
|
||||
return " $query$where" . ($limit !== null ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
||||
}
|
||||
|
||||
function limit1($query, $where) {
|
||||
return " $query$where";
|
||||
function limit1($table, $query, $where, $separator = "\n") {
|
||||
return (preg_match('~^INTO~', $query)
|
||||
? limit($query, $where, 1, 0, $separator)
|
||||
: " $query" . (is_view(table_status1($table)) ? $where : " WHERE ctid = (SELECT ctid FROM " . table($table) . $where . $separator . "LIMIT 1)")
|
||||
);
|
||||
}
|
||||
|
||||
function db_collation($db, $collations) {
|
||||
@@ -252,10 +324,10 @@ ORDER BY 1";
|
||||
|
||||
function table_status($name = "") {
|
||||
$return = array();
|
||||
foreach (get_rows("SELECT c.relname AS \"Name\", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'm' THEN 'materialized view' ELSE 'view' END AS \"Engine\", pg_relation_size(c.oid) AS \"Data_length\", pg_total_relation_size(c.oid) - pg_relation_size(c.oid) AS \"Index_length\", obj_description(c.oid, 'pg_class') AS \"Comment\", c.relhasoids::int AS \"Oid\", c.reltuples as \"Rows\", n.nspname
|
||||
foreach (get_rows("SELECT c.relname AS \"Name\", CASE c.relkind WHEN 'r' THEN 'table' WHEN 'm' THEN 'materialized view' ELSE 'view' END AS \"Engine\", pg_relation_size(c.oid) AS \"Data_length\", pg_total_relation_size(c.oid) - pg_relation_size(c.oid) AS \"Index_length\", obj_description(c.oid, 'pg_class') AS \"Comment\", CASE WHEN c.relhasoids THEN 'oid' ELSE '' END AS \"Oid\", c.reltuples as \"Rows\", n.nspname
|
||||
FROM pg_class c
|
||||
JOIN pg_namespace n ON(n.nspname = current_schema() AND n.oid = c.relnamespace)
|
||||
WHERE relkind IN ('r', 'm', 'v')
|
||||
WHERE relkind IN ('r', 'm', 'v', 'f')
|
||||
" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname")
|
||||
) as $row) { //! Index_length, Auto_increment
|
||||
$return[$row["Name"]] = $row;
|
||||
@@ -277,7 +349,10 @@ WHERE relkind IN ('r', 'm', 'v')
|
||||
'timestamp without time zone' => 'timestamp',
|
||||
'timestamp with time zone' => 'timestamptz',
|
||||
);
|
||||
foreach (get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, d.adsrc AS default, a.attnotnull::int, col_description(c.oid, a.attnum) AS comment
|
||||
|
||||
$identity_column = min_version(10) ? "(a.attidentity = 'd')::int" : '0';
|
||||
|
||||
foreach (get_rows("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, d.adsrc AS default, a.attnotnull::int, col_description(c.oid, a.attnum) AS comment, $identity_column AS identity
|
||||
FROM pg_class c
|
||||
JOIN pg_namespace n ON c.relnamespace = n.oid
|
||||
JOIN pg_attribute a ON c.oid = a.attrelid
|
||||
@@ -300,11 +375,14 @@ ORDER BY a.attnum"
|
||||
$row["type"] = $type;
|
||||
$row["full_type"] = $row["type"] . $length . $addon . $array;
|
||||
}
|
||||
if ($row['identity']) {
|
||||
$row['default'] = 'GENERATED BY DEFAULT AS IDENTITY';
|
||||
}
|
||||
$row["null"] = !$row["attnotnull"];
|
||||
$row["auto_increment"] = preg_match('~^nextval\\(~i', $row["default"]);
|
||||
$row["auto_increment"] = $row['identity'] || preg_match('~^nextval\(~i', $row["default"]);
|
||||
$row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1);
|
||||
if (preg_match('~(.+)::[^)]+(.*)~', $row["default"], $match)) {
|
||||
$row["default"] = ($match[1][0] == "'" ? idf_unescape($match[1]) : $match[1]) . $match[2];
|
||||
$row["default"] = ($match[1] == "NULL" ? null : (($match[1][0] == "'" ? idf_unescape($match[1]) : $match[1]) . $match[2]));
|
||||
}
|
||||
$return[$row["field"]] = $row;
|
||||
}
|
||||
@@ -360,7 +438,9 @@ ORDER BY conkey, conname") as $row) {
|
||||
|
||||
function view($name) {
|
||||
global $connection;
|
||||
return array("select" => trim($connection->result("SELECT pg_get_viewdef(" . q($name) . ")")));
|
||||
return array("select" => trim($connection->result("SELECT view_definition
|
||||
FROM information_schema.views
|
||||
WHERE table_schema = current_schema() AND table_name = " . q($name))));
|
||||
}
|
||||
|
||||
function collations() {
|
||||
@@ -375,8 +455,8 @@ ORDER BY conkey, conname") as $row) {
|
||||
function error() {
|
||||
global $connection;
|
||||
$return = h($connection->error);
|
||||
if (preg_match('~^(.*\\n)?([^\\n]*)\\n( *)\\^(\\n.*)?$~s', $return, $match)) {
|
||||
$return = $match[1] . preg_replace('~((?:[^&]|&[^;]*;){' . strlen($match[3]) . '})(.*)~', '\\1<b>\\2</b>', $match[2]) . $match[4];
|
||||
if (preg_match('~^(.*\n)?([^\n]*)\n( *)\^(\n.*)?$~s', $return, $match)) {
|
||||
$return = $match[1] . preg_replace('~((?:[^&]|&[^;]*;){' . strlen($match[3]) . '})(.*)~', '\1<b>\2</b>', $match[2]) . $match[4];
|
||||
}
|
||||
return nl_br($return);
|
||||
}
|
||||
@@ -541,30 +621,36 @@ ORDER BY conkey, conname") as $row) {
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
function routine($name, $type) {
|
||||
//! there can be more functions with the same name differing only in parameters, it must be also passed to DROP FUNCTION
|
||||
//! no procedures, only functions
|
||||
//! different syntax of CREATE FUNCTION
|
||||
$rows = get_rows('SELECT pg_catalog.format_type(p.prorettype, NULL) AS "returns", p.prosrc AS "definition"
|
||||
FROM pg_catalog.pg_namespace n
|
||||
JOIN pg_catalog.pg_proc p ON p.pronamespace = n.oid
|
||||
WHERE n.nspname = current_schema() AND p.proname = ' . q($name));
|
||||
$rows[0]["fields"] = array(); //!
|
||||
return $rows[0];
|
||||
$rows = get_rows('SELECT routine_definition AS definition, LOWER(external_language) AS language, *
|
||||
FROM information_schema.routines
|
||||
WHERE routine_schema = current_schema() AND specific_name = ' . q($name));
|
||||
$return = $rows[0];
|
||||
$return["returns"] = array("type" => $return["type_udt_name"]);
|
||||
$return["fields"] = get_rows('SELECT parameter_name AS field, data_type AS type, character_maximum_length AS length, parameter_mode AS inout
|
||||
FROM information_schema.parameters
|
||||
WHERE specific_schema = current_schema() AND specific_name = ' . q($name) . '
|
||||
ORDER BY ordinal_position');
|
||||
return $return;
|
||||
}
|
||||
*/
|
||||
|
||||
function routines() {
|
||||
return get_rows('SELECT p.proname AS "ROUTINE_NAME", p.proargtypes AS "ROUTINE_TYPE", pg_catalog.format_type(p.prorettype, NULL) AS "DTD_IDENTIFIER"
|
||||
FROM pg_catalog.pg_namespace n
|
||||
JOIN pg_catalog.pg_proc p ON p.pronamespace = n.oid
|
||||
WHERE n.nspname = current_schema()
|
||||
ORDER BY p.proname');
|
||||
return get_rows('SELECT specific_name AS "SPECIFIC_NAME", routine_type AS "ROUTINE_TYPE", routine_name AS "ROUTINE_NAME", type_udt_name AS "DTD_IDENTIFIER"
|
||||
FROM information_schema.routines
|
||||
WHERE routine_schema = current_schema()
|
||||
ORDER BY SPECIFIC_NAME');
|
||||
}
|
||||
|
||||
function routine_languages() {
|
||||
return get_vals("SELECT langname FROM pg_catalog.pg_language");
|
||||
return get_vals("SELECT LOWER(lanname) FROM pg_catalog.pg_language");
|
||||
}
|
||||
|
||||
function routine_id($name, $row) {
|
||||
$return = array();
|
||||
foreach ($row["fields"] as $field) {
|
||||
$return[] = $field["type"];
|
||||
}
|
||||
return idf_escape($name) . "(" . implode(", ", $return) . ")";
|
||||
}
|
||||
|
||||
function last_id() {
|
||||
@@ -617,12 +703,7 @@ AND typelem = 0"
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Get SQL command to create table
|
||||
* @param string
|
||||
* @param bool
|
||||
* @return string
|
||||
*/
|
||||
function create_sql($table, $auto_increment) {
|
||||
function create_sql($table, $auto_increment, $style) {
|
||||
global $connection;
|
||||
$return = '';
|
||||
$return_parts = array();
|
||||
@@ -634,7 +715,6 @@ AND typelem = 0"
|
||||
ksort($indexes);
|
||||
$fkeys = foreign_keys($table);
|
||||
ksort($fkeys);
|
||||
$triggers = triggers($table);
|
||||
|
||||
if (!$status || empty($fields)) {
|
||||
return false;
|
||||
@@ -645,15 +725,19 @@ AND typelem = 0"
|
||||
// fields' definitions
|
||||
foreach ($fields as $field_name => $field) {
|
||||
$part = idf_escape($field['field']) . ' ' . $field['full_type']
|
||||
. (is_null($field['default']) ? "" : " DEFAULT $field[default]")
|
||||
. default_value($field)
|
||||
. ($field['attnotnull'] ? " NOT NULL" : "");
|
||||
$return_parts[] = $part;
|
||||
|
||||
// sequences for fields
|
||||
if (preg_match('~nextval\(\'([^\']+)\'\)~', $field['default'], $matches)) {
|
||||
$sequence_name = $matches[1];
|
||||
$sq = reset(get_rows("SELECT * FROM $sequence_name"));
|
||||
$sequences[] = "CREATE SEQUENCE $sequence_name INCREMENT $sq[increment_by] MINVALUE $sq[min_value] MAXVALUE $sq[max_value] START " . ($auto_increment ? $sq['last_value'] : 1) . " CACHE $sq[cache_value];";
|
||||
$sq = reset(get_rows(min_version(10)
|
||||
? "SELECT *, cache_size AS cache_value FROM pg_sequences WHERE schemaname = current_schema() AND sequencename = " . q($sequence_name)
|
||||
: "SELECT * FROM $sequence_name"
|
||||
));
|
||||
$sequences[] = ($style == "DROP+CREATE" ? "DROP SEQUENCE IF EXISTS $sequence_name;\n" : "")
|
||||
. "CREATE SEQUENCE $sequence_name INCREMENT $sq[increment_by] MINVALUE $sq[min_value] MAXVALUE $sq[max_value] START " . ($auto_increment ? $sq['last_value'] : 1) . " CACHE $sq[cache_value];";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -680,7 +764,11 @@ AND typelem = 0"
|
||||
// "basic" indexes after table definition
|
||||
foreach ($indexes as $index_name => $index) {
|
||||
if ($index['type'] == 'INDEX') {
|
||||
$return .= "\n\nCREATE INDEX " . idf_escape($index_name) . " ON " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " USING btree (" . implode(', ', array_map('idf_escape', $index['columns'])) . ");";
|
||||
$columns = array();
|
||||
foreach ($index['columns'] as $key => $val) {
|
||||
$columns[] = idf_escape($val) . ($index['descs'][$key] ? " DESC" : "");
|
||||
}
|
||||
$return .= "\n\nCREATE INDEX " . idf_escape($index_name) . " ON " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " USING btree (" . implode(', ', $columns) . ");";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -695,30 +783,21 @@ AND typelem = 0"
|
||||
}
|
||||
}
|
||||
|
||||
// triggers
|
||||
foreach ($triggers as $trg_id => $trg) {
|
||||
$trigger = trigger($trg_id, $status['Name']);
|
||||
$return .= "\n\nCREATE TRIGGER " . idf_escape($trigger['Trigger']) . " $trigger[Timing] $trigger[Events] ON " . idf_escape($status["nspname"]) . "." . idf_escape($status['Name']) . " $trigger[Type] $trigger[Statement];";
|
||||
}
|
||||
|
||||
return rtrim($return, ';');
|
||||
}
|
||||
|
||||
/** Get SQL commands to create triggers
|
||||
* @param string
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
//@TODO
|
||||
function trigger_sql($table, $style) {
|
||||
$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";
|
||||
//}
|
||||
//return $return;
|
||||
function truncate_sql($table) {
|
||||
return "TRUNCATE " . table($table);
|
||||
}
|
||||
|
||||
return false;
|
||||
function trigger_sql($table) {
|
||||
$status = table_status($table);
|
||||
$return = "";
|
||||
foreach (triggers($table) as $trg_id => $trg) {
|
||||
$trigger = trigger($trg_id, $status['Name']);
|
||||
$return .= "\nCREATE TRIGGER " . idf_escape($trigger['Trigger']) . " $trigger[Timing] $trigger[Events] ON " . idf_escape($status["nspname"]) . "." . idf_escape($status['Name']) . " $trigger[Type] $trigger[Statement];;\n";
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
@@ -731,8 +810,7 @@ AND typelem = 0"
|
||||
}
|
||||
|
||||
function process_list() {
|
||||
global $connection;
|
||||
return get_rows("SELECT * FROM pg_stat_activity ORDER BY " . ($connection->server_info < 9.2 ? "procpid" : "pid"));
|
||||
return get_rows("SELECT * FROM pg_stat_activity ORDER BY " . (min_version(9.2) ? "pid" : "procpid"));
|
||||
}
|
||||
|
||||
function show_status() {
|
||||
@@ -746,8 +824,7 @@ AND typelem = 0"
|
||||
}
|
||||
|
||||
function support($feature) {
|
||||
global $connection;
|
||||
return preg_match('~^(database|table|columns|sql|indexes|comment|view|' . ($connection->server_info >= 9.3 ? 'materializedview|' : '') . 'scheme|processlist|sequence|trigger|type|variables|drop_col|kill|dump)$~', $feature); //! routine|
|
||||
return preg_match('~^(database|table|columns|sql|indexes|descidx|comment|view|' . (min_version(9.3) ? 'materializedview|' : '') . 'scheme|routine|processlist|sequence|trigger|type|variables|drop_col|kill|dump)$~', $feature);
|
||||
}
|
||||
|
||||
function kill_process($val) {
|
||||
@@ -778,7 +855,7 @@ AND typelem = 0"
|
||||
$structured_types[$key] = array_keys($val);
|
||||
}
|
||||
$unsigned = array();
|
||||
$operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid SQL injection
|
||||
$operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF
|
||||
$functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
|
||||
$grouping = array("avg", "count", "count distinct", "max", "min", "sum");
|
||||
$edit_functions = array(
|
||||
@@ -786,7 +863,7 @@ AND typelem = 0"
|
||||
"char" => "md5",
|
||||
"date|time" => "now",
|
||||
), array(
|
||||
"int|numeric|real|money" => "+/-",
|
||||
number_type() => "+/-",
|
||||
"date|time" => "+ interval/- interval", //! escape
|
||||
"char|text" => "||",
|
||||
)
|
||||
|
@@ -2,10 +2,10 @@
|
||||
$drivers["simpledb"] = "SimpleDB";
|
||||
|
||||
if (isset($_GET["simpledb"])) {
|
||||
$possible_drivers = array("SimpleXML");
|
||||
$possible_drivers = array("SimpleXML + allow_url_fopen");
|
||||
define("DRIVER", "simpledb");
|
||||
|
||||
if (class_exists('SimpleXMLElement')) {
|
||||
if (class_exists('SimpleXMLElement') && ini_bool('allow_url_fopen')) {
|
||||
class Min_DB {
|
||||
var $extension = "SimpleXML", $server_info = '2009-04-15', $error, $timeout, $next, $affected_rows, $_result;
|
||||
|
||||
@@ -19,6 +19,7 @@ if (isset($_GET["simpledb"])) {
|
||||
$params['NextToken'] = $this->next;
|
||||
}
|
||||
$result = sdb_request_all('Select', 'Item', $params, $this->timeout); //! respect $unbuffered
|
||||
$this->timeout = 0;
|
||||
if ($result === false) {
|
||||
return $result;
|
||||
}
|
||||
@@ -236,12 +237,22 @@ if (isset($_GET["simpledb"])) {
|
||||
function rollback() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function slowQuery($query, $timeout) {
|
||||
$this->_conn->timeout = $timeout;
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function connect() {
|
||||
global $adminer;
|
||||
list(, , $password) = $adminer->credentials();
|
||||
if ($password != "") {
|
||||
return lang('Database does not support password.');
|
||||
}
|
||||
return new Min_DB;
|
||||
}
|
||||
|
||||
|
@@ -152,7 +152,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
|
||||
function fetch_field() {
|
||||
$name = $this->_result->fieldName($this->_offset++);
|
||||
$pattern = '(\\[.*]|"(?:[^"]|"")*"|(.+))';
|
||||
$pattern = '(\[.*]|"(?:[^"]|"")*"|(.+))';
|
||||
if (preg_match("~^($pattern\\.)?$pattern\$~", $name, $match)) {
|
||||
$table = ($match[3] != "" ? $match[3] : idf_unescape($match[2]));
|
||||
$name = ($match[5] != "" ? $match[5] : idf_unescape($match[4]));
|
||||
@@ -184,11 +184,13 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct(":memory:");
|
||||
$this->query("PRAGMA foreign_keys = 1");
|
||||
}
|
||||
|
||||
function select_db($filename) {
|
||||
if (is_readable($filename) && $this->query("ATTACH " . $this->quote(preg_match("~(^[/\\\\]|:)~", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) { // is_readable - SQLite 3
|
||||
parent::__construct($filename);
|
||||
$this->query("PRAGMA foreign_keys = 1");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -216,6 +218,15 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
return queries("REPLACE INTO " . table($table) . " (" . implode(", ", array_keys(reset($rows))) . ") VALUES\n" . implode(",\n", $values));
|
||||
}
|
||||
|
||||
function tableHelp($name) {
|
||||
if ($name == "sqlite_sequence") {
|
||||
return "fileformat2.html#seqtab";
|
||||
}
|
||||
if ($name == "sqlite_master") {
|
||||
return "fileformat2.html#$name";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -229,6 +240,11 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
}
|
||||
|
||||
function connect() {
|
||||
global $adminer;
|
||||
list(, , $password) = $adminer->credentials();
|
||||
if ($password != "") {
|
||||
return lang('Database does not support password.');
|
||||
}
|
||||
return new Min_DB;
|
||||
}
|
||||
|
||||
@@ -240,9 +256,12 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
return " $query$where" . ($limit !== null ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
||||
}
|
||||
|
||||
function limit1($query, $where) {
|
||||
function limit1($table, $query, $where, $separator = "\n") {
|
||||
global $connection;
|
||||
return ($connection->result("SELECT sqlite_compileoption_used('ENABLE_UPDATE_DELETE_LIMIT')") ? limit($query, $where, 1) : " $query$where");
|
||||
return (preg_match('~^INTO~', $query) || $connection->result("SELECT sqlite_compileoption_used('ENABLE_UPDATE_DELETE_LIMIT')")
|
||||
? limit($query, $where, 1, 0, $separator)
|
||||
: " $query WHERE rowid = (SELECT rowid FROM " . table($table) . $where . $separator . "LIMIT 1)" //! use primary key in tables with WITHOUT rowid
|
||||
);
|
||||
}
|
||||
|
||||
function db_collation($db, $collations) {
|
||||
@@ -259,7 +278,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') ORDER BY (name = 'sqlite_sequence'), name");
|
||||
}
|
||||
|
||||
function count_tables($databases) {
|
||||
@@ -269,9 +288,7 @@ 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) : "ORDER BY name")) as $row) {
|
||||
$row["Oid"] = 1;
|
||||
$row["Auto_increment"] = "";
|
||||
foreach (get_rows("SELECT name AS Name, type AS Engine, 'rowid' AS Oid, '' AS Auto_increment FROM sqlite_master WHERE type IN ('table', 'view') " . ($name != "" ? "AND name = " . q($name) : "ORDER BY name")) as $row) {
|
||||
$row["Rows"] = $connection->result("SELECT COUNT(*) FROM " . idf_escape($row["Name"]));
|
||||
$return[$row["Name"]] = $row;
|
||||
}
|
||||
@@ -334,9 +351,9 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
}
|
||||
$return = array();
|
||||
$sql = $connection2->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . q($table));
|
||||
if (preg_match('~\bPRIMARY\s+KEY\s*\((([^)"]+|"[^"]*")++)~i', $sql, $match)) {
|
||||
if (preg_match('~\bPRIMARY\s+KEY\s*\((([^)"]+|"[^"]*"|`[^`]*`)++)~i', $sql, $match)) {
|
||||
$return[""] = array("type" => "PRIMARY", "columns" => array(), "lengths" => array(), "descs" => array());
|
||||
preg_match_all('~((("[^"]*+")+)|(\S+))(\s+(ASC|DESC))?(,\s*|$)~i', $match[1], $matches, PREG_SET_ORDER);
|
||||
preg_match_all('~((("[^"]*+")+|(?:`[^`]*+`)+)|(\S+))(\s+(ASC|DESC))?(,\s*|$)~i', $match[1], $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $match) {
|
||||
$return[""]["columns"][] = idf_unescape($match[2]) . $match[4];
|
||||
$return[""]["descs"][] = (preg_match('~DESC~i', $match[5]) ? '1' : null);
|
||||
@@ -390,7 +407,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
|
||||
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 = " . q($name)))); //! identifiers may be inside []
|
||||
}
|
||||
|
||||
function collations() {
|
||||
@@ -504,6 +521,9 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
if ($table != "") {
|
||||
if (!$fields) {
|
||||
foreach (fields($table) as $key => $field) {
|
||||
if ($indexes) {
|
||||
$field["auto_increment"] = 0;
|
||||
}
|
||||
$fields[] = process_field($field, $field);
|
||||
$originals[$key] = idf_escape($key);
|
||||
}
|
||||
@@ -634,7 +654,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
if ($name == "") {
|
||||
return array("Statement" => "BEGIN\n\t;\nEND");
|
||||
}
|
||||
$idf = '(?:[^`"\\s]+|`[^`]*`|"[^"]*")+';
|
||||
$idf = '(?:[^`"\s]+|`[^`]*`|"[^"]*")+';
|
||||
$trigger_options = trigger_options();
|
||||
preg_match(
|
||||
"~^CREATE\\s+TRIGGER\\s*$idf\\s*(" . implode("|", $trigger_options["Timing"]) . ")\\s+([a-z]+)(?:\\s+OF\\s+($idf))?\\s+ON\\s*$idf\\s*(?:FOR\\s+EACH\\s+ROW\\s)?(.*)~is",
|
||||
@@ -655,7 +675,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
$return = array();
|
||||
$trigger_options = trigger_options();
|
||||
foreach (get_rows("SELECT * FROM sqlite_master WHERE type = 'trigger' AND tbl_name = " . q($table)) as $row) {
|
||||
preg_match('~^CREATE\\s+TRIGGER\\s*(?:[^`"\\s]+|`[^`]*`|"[^"]*")+\\s*(' . implode("|", $trigger_options["Timing"]) . ')\\s*(.*)\\s+ON\\b~iU', $row["sql"], $match);
|
||||
preg_match('~^CREATE\s+TRIGGER\s*(?:[^`"\s]+|`[^`]*`|"[^"]*")+\s*(' . implode("|", $trigger_options["Timing"]) . ')\s*(.*)\s+ON\b~iU', $row["sql"], $match);
|
||||
$return[$row["name"]] = array($match[1], $match[2]);
|
||||
}
|
||||
return $return;
|
||||
@@ -669,18 +689,6 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
);
|
||||
}
|
||||
|
||||
function routine($name, $type) {
|
||||
// not supported by SQLite
|
||||
}
|
||||
|
||||
function routines() {
|
||||
// not supported by SQLite
|
||||
}
|
||||
|
||||
function routine_languages() {
|
||||
// not supported by SQLite
|
||||
}
|
||||
|
||||
function begin() {
|
||||
return queries("BEGIN");
|
||||
}
|
||||
@@ -713,7 +721,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function create_sql($table, $auto_increment) {
|
||||
function create_sql($table, $auto_increment, $style) {
|
||||
global $connection;
|
||||
$return = $connection->result("SELECT sql FROM sqlite_master WHERE type IN ('table', 'view') AND name = " . q($table));
|
||||
foreach (indexes($table) as $name => $index) {
|
||||
@@ -732,7 +740,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
function use_sql($database) {
|
||||
}
|
||||
|
||||
function trigger_sql($table, $style) {
|
||||
function trigger_sql($table) {
|
||||
return implode(get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND tbl_name = " . q($table)));
|
||||
}
|
||||
|
||||
@@ -762,7 +770,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
||||
}
|
||||
|
||||
function support($feature) {
|
||||
return preg_match('~^(columns|database|drop_col|dump|indexes|move_col|sql|status|table|trigger|variables|view|view_trigger)$~', $feature);
|
||||
return preg_match('~^(columns|database|drop_col|dump|indexes|descidx|move_col|sql|status|table|trigger|variables|view|view_trigger)$~', $feature);
|
||||
}
|
||||
|
||||
$jush = "sqlite";
|
||||
|
@@ -92,7 +92,7 @@ SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
|
||||
$fields = fields($name);
|
||||
$adminer->dumpData($name, $_POST["data_style"], "SELECT *" . convert_fields($fields, $fields) . " FROM " . table($name));
|
||||
}
|
||||
if ($is_sql && $_POST["triggers"] && $table && ($triggers = trigger_sql($name, $_POST["table_style"]))) {
|
||||
if ($is_sql && $_POST["triggers"] && $table && ($triggers = trigger_sql($name))) {
|
||||
echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n";
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ page_header(lang('Export'), $error, ($_GET["export"] != "" ? array("table" => $_
|
||||
?>
|
||||
|
||||
<form action="" method="post">
|
||||
<table cellspacing="0">
|
||||
<table cellspacing="0" class="layout">
|
||||
<?php
|
||||
$db_style = array('', 'USE', 'DROP+CREATE', 'CREATE');
|
||||
$table_style = array('', 'DROP+CREATE', 'CREATE');
|
||||
@@ -165,6 +165,7 @@ echo "<tr><th>" . lang('Data') . "<td>" . html_select('data_style', $data_style,
|
||||
|
||||
<table cellspacing="0">
|
||||
<?php
|
||||
echo script("qsl('table').onclick = dumpClick;");
|
||||
$prefixes = array();
|
||||
if (DB != "") {
|
||||
$checked = ($TABLE != "" ? "" : " checked");
|
||||
@@ -178,11 +179,11 @@ if (DB != "") {
|
||||
foreach ($tables_list as $name => $type) {
|
||||
$prefix = preg_replace('~_.*~', '', $name);
|
||||
$checked = ($TABLE == "" || $TABLE == (substr($TABLE, -1) == "%" ? "$prefix%" : $name)); //! % may be part of table name
|
||||
$print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "checkboxClick.call(this, event); formUncheck('check-tables');", "block");
|
||||
$print = "<tr><td>" . checkbox("tables[]", $name, $checked, $name, "", "block");
|
||||
if ($type !== null && !preg_match('~table~i', $type)) {
|
||||
$views .= "$print\n";
|
||||
} else {
|
||||
echo "$print<td align='right'><label class='block'><span id='Rows-" . h($name) . "'></span>" . checkbox("data[]", $name, $checked, "", "checkboxClick.call(this, event); formUncheck('check-data');") . "</label>\n";
|
||||
echo "$print<td align='right'><label class='block'><span id='Rows-" . h($name) . "'></span>" . checkbox("data[]", $name, $checked) . "</label>\n";
|
||||
}
|
||||
$prefixes[$prefix]++;
|
||||
}
|
||||
@@ -202,7 +203,7 @@ if (DB != "") {
|
||||
foreach ($databases as $db) {
|
||||
if (!information_schema($db)) {
|
||||
$prefix = preg_replace('~_.*~', '', $db);
|
||||
echo "<tr><td>" . checkbox("databases[]", $db, $TABLE == "" || $TABLE == "$prefix%", $db, "formUncheck('check-databases');", "block") . "\n";
|
||||
echo "<tr><td>" . checkbox("databases[]", $db, $TABLE == "" || $TABLE == "$prefix%", $db, "", "block") . "\n";
|
||||
$prefixes[$prefix]++;
|
||||
}
|
||||
}
|
||||
|
@@ -82,9 +82,13 @@ if ($_POST["save"]) {
|
||||
}
|
||||
if ($select) {
|
||||
$result = $driver->select($TABLE, $select, array($where), $select, array(), (isset($_GET["select"]) ? 2 : 1));
|
||||
$row = $result->fetch_assoc();
|
||||
if (!$row) { // MySQLi returns null
|
||||
$row = false;
|
||||
if (!$result) {
|
||||
$error = error();
|
||||
} else {
|
||||
$row = $result->fetch_assoc();
|
||||
if (!$row) { // MySQLi returns null
|
||||
$row = false;
|
||||
}
|
||||
}
|
||||
if (isset($_GET["select"]) && (!$row || $result->fetch_assoc())) { // $result->num_rows != 1 isn't available in all drivers
|
||||
$row = null;
|
||||
|
@@ -35,18 +35,18 @@ if (!$row && $EVENT != "") {
|
||||
?>
|
||||
|
||||
<form action="" method="post">
|
||||
<table cellspacing="0">
|
||||
<tr><th><?php echo lang('Name'); ?><td><input name="EVENT_NAME" value="<?php echo h($row["EVENT_NAME"]); ?>" maxlength="64" autocapitalize="off">
|
||||
<table cellspacing="0" class="layout">
|
||||
<tr><th><?php echo lang('Name'); ?><td><input name="EVENT_NAME" value="<?php echo h($row["EVENT_NAME"]); ?>" data-maxlength="64" autocapitalize="off">
|
||||
<tr><th title="datetime"><?php echo lang('Start'); ?><td><input name="STARTS" value="<?php echo h("$row[EXECUTE_AT]$row[STARTS]"); ?>">
|
||||
<tr><th title="datetime"><?php echo lang('End'); ?><td><input name="ENDS" value="<?php echo h($row["ENDS"]); ?>">
|
||||
<tr><th><?php echo lang('Every'); ?><td><input type="number" name="INTERVAL_VALUE" value="<?php echo h($row["INTERVAL_VALUE"]); ?>" class="size"> <?php echo html_select("INTERVAL_FIELD", $intervals, $row["INTERVAL_FIELD"]); ?>
|
||||
<tr><th><?php echo lang('Status'); ?><td><?php echo html_select("STATUS", $statuses, $row["STATUS"]); ?>
|
||||
<tr><th><?php echo lang('Comment'); ?><td><input name="EVENT_COMMENT" value="<?php echo h($row["EVENT_COMMENT"]); ?>" maxlength="64">
|
||||
<tr><th> <td><?php echo checkbox("ON_COMPLETION", "PRESERVE", $row["ON_COMPLETION"] == "PRESERVE", lang('On completion preserve')); ?>
|
||||
<tr><th><?php echo lang('Comment'); ?><td><input name="EVENT_COMMENT" value="<?php echo h($row["EVENT_COMMENT"]); ?>" data-maxlength="64">
|
||||
<tr><th><td><?php echo checkbox("ON_COMPLETION", "PRESERVE", $row["ON_COMPLETION"] == "PRESERVE", lang('On completion preserve')); ?>
|
||||
</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 } ?>
|
||||
<?php if ($EVENT != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $EVENT)); ?><?php } ?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
|
@@ -1,12 +1,5 @@
|
||||
<?php
|
||||
if ($_SERVER["HTTP_IF_MODIFIED_SINCE"]) {
|
||||
header("HTTP/1.1 304 Not Modified");
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 365*24*60*60) . " GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Cache-Control: immutable");
|
||||
// caching headers added in compile.php
|
||||
|
||||
if ($_GET["file"] == "favicon.ico") {
|
||||
header("Content-Type: image/x-icon");
|
||||
|
@@ -78,6 +78,7 @@ foreach ($row["source"] as $key => $val) {
|
||||
<?php echo lang('ON UPDATE'); ?>: <?php echo html_select("on_update", array(-1 => "") + explode("|", $on_actions), $row["on_update"]); ?>
|
||||
<?php echo doc_link(array(
|
||||
'sql' => "innodb-foreign-key-constraints.html",
|
||||
'mariadb' => "foreign-keys/",
|
||||
'pgsql' => "sql-createtable.html#SQL-CREATETABLE-REFERENCES",
|
||||
'mssql' => "ms174979.aspx",
|
||||
'oracle' => "clauses002.htm#sthref2903",
|
||||
@@ -86,6 +87,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 ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(); ?><?php } ?>
|
||||
<?php if ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $name)); ?><?php } ?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
|
@@ -9,7 +9,7 @@ class Adminer {
|
||||
* @return string HTML code
|
||||
*/
|
||||
function name() {
|
||||
return "<a href='https://www.adminer.org/' target='_blank' id='h1'>Adminer</a>";
|
||||
return "<a href='https://www.adminer.org/'" . target_blank() . " id='h1'>Adminer</a>";
|
||||
}
|
||||
|
||||
/** Connection parameters
|
||||
@@ -19,6 +19,12 @@ class Adminer {
|
||||
return array(SERVER, $_GET["username"], get_password());
|
||||
}
|
||||
|
||||
/** Get SSL connection options
|
||||
* @return array array("key" => filename, "cert" => filename, "ca" => filename) or null
|
||||
*/
|
||||
function connectSsl() {
|
||||
}
|
||||
|
||||
/** Get key used for permanent login
|
||||
* @param bool
|
||||
* @return string cryptic string which gets combined with password or false in case of an error
|
||||
@@ -33,6 +39,14 @@ class Adminer {
|
||||
function bruteForceKey() {
|
||||
return $_SERVER["REMOTE_ADDR"];
|
||||
}
|
||||
|
||||
/** Get server name displayed in breadcrumbs
|
||||
* @param string
|
||||
* @return string HTML code or null
|
||||
*/
|
||||
function serverName($server) {
|
||||
return h($server);
|
||||
}
|
||||
|
||||
/** Identifier of selected database
|
||||
* @return string
|
||||
@@ -61,7 +75,7 @@ class Adminer {
|
||||
* @return float number of seconds
|
||||
*/
|
||||
function queryTimeout() {
|
||||
return 5;
|
||||
return 2;
|
||||
}
|
||||
|
||||
/** Headers to send before HTML output
|
||||
@@ -78,7 +92,7 @@ class Adminer {
|
||||
}
|
||||
|
||||
/** Print HTML code inside <head>
|
||||
* @return bool true to link adminer.css if exists
|
||||
* @return bool true to link favicon.ico and adminer.css if exists
|
||||
*/
|
||||
function head() {
|
||||
?>
|
||||
@@ -87,24 +101,43 @@ class Adminer {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Get URLs of the CSS files
|
||||
* @return array of strings
|
||||
*/
|
||||
function css() {
|
||||
$return = array();
|
||||
$filename = "adminer.css";
|
||||
if (file_exists($filename)) {
|
||||
$return[] = $filename;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Print login form
|
||||
* @return null
|
||||
*/
|
||||
function loginForm() {
|
||||
global $drivers;
|
||||
?>
|
||||
<table cellspacing="0">
|
||||
<tr><th><?php echo lang('System'); ?><td><?php echo html_select("auth[driver]", $drivers, DRIVER) . "\n"; ?>
|
||||
<tr><th><?php echo lang('Server'); ?><td><input name="auth[server]" value="<?php echo h(SERVER); ?>" title="hostname[:port]" placeholder="localhost" autocapitalize="off">
|
||||
<tr><th><?php echo lang('Username'); ?><td><input name="auth[username]" id="username" value="<?php echo h($_GET["username"]); ?>" autocapitalize="off">
|
||||
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="auth[password]">
|
||||
<tr><th><?php echo lang('Database'); ?><td><input name="auth[db]" value="<?php echo h($_GET["db"]); ?>" autocapitalize="off">
|
||||
</table>
|
||||
<?php
|
||||
echo script("focus(qs('#username'));");
|
||||
echo "<table cellspacing='0' class='layout'>\n";
|
||||
echo $this->loginFormField('driver', '<tr><th>' . lang('System') . '<td>', html_select("auth[driver]", $drivers, DRIVER) . "\n");
|
||||
echo $this->loginFormField('server', '<tr><th>' . lang('Server') . '<td>', '<input name="auth[server]" value="' . h(SERVER) . '" title="hostname[:port]" placeholder="localhost" autocapitalize="off">' . "\n");
|
||||
echo $this->loginFormField('username', '<tr><th>' . lang('Username') . '<td>', '<input name="auth[username]" id="username" value="' . h($_GET["username"]) . '" autocapitalize="off">' . script("focus(qs('#username'));"));
|
||||
echo $this->loginFormField('password', '<tr><th>' . lang('Password') . '<td>', '<input type="password" name="auth[password]">' . "\n");
|
||||
echo $this->loginFormField('db', '<tr><th>' . lang('Database') . '<td>', '<input name="auth[db]" value="' . h($_GET["db"]) . '" autocapitalize="off">' . "\n");
|
||||
echo "</table>\n";
|
||||
echo "<p><input type='submit' value='" . lang('Login') . "'>\n";
|
||||
echo checkbox("auth[permanent]", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
|
||||
}
|
||||
|
||||
/** Get login form field
|
||||
* @param string
|
||||
* @param string HTML
|
||||
* @param string HTML
|
||||
* @return string
|
||||
*/
|
||||
function loginFormField($name, $heading, $value) {
|
||||
return $heading . $value;
|
||||
}
|
||||
|
||||
/** Authorize the user
|
||||
* @param string
|
||||
@@ -112,9 +145,8 @@ class Adminer {
|
||||
* @return mixed true for success, string for error message, false for unknown error
|
||||
*/
|
||||
function login($login, $password) {
|
||||
global $jush;
|
||||
if ($jush == "sqlite") {
|
||||
return lang('<a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to use SQLite.', '<code>login()</code>');
|
||||
if ($password == "") {
|
||||
return lang('Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.', target_blank());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -142,6 +174,7 @@ class Adminer {
|
||||
* @return null
|
||||
*/
|
||||
function selectLinks($tableStatus, $set = "") {
|
||||
global $jush, $driver;
|
||||
echo '<p class="links">';
|
||||
$links = array("select" => lang('Select data'));
|
||||
if (support("table") || support("indexes")) {
|
||||
@@ -157,9 +190,11 @@ class Adminer {
|
||||
if ($set !== null) {
|
||||
$links["edit"] = lang('New item');
|
||||
}
|
||||
$name = $tableStatus["Name"];
|
||||
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($name) . ($key == "edit" ? $set : "") . "'" . bold(isset($_GET[$key])) . ">$val</a>";
|
||||
}
|
||||
echo doc_link(array($jush => $driver->tableHelp($name)), "?");
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
@@ -190,14 +225,22 @@ class Adminer {
|
||||
|
||||
/** Query printed in select before execution
|
||||
* @param string query to be executed
|
||||
* @param string elapsed time
|
||||
* @param float start time of the query
|
||||
* @param bool
|
||||
* @return string
|
||||
*/
|
||||
function selectQuery($query, $time) {
|
||||
global $jush;
|
||||
return "<p><code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <span class='time'>($time)</span>"
|
||||
function selectQuery($query, $start, $failed = false) {
|
||||
global $jush, $driver;
|
||||
$return = "</p>\n"; // required for IE9 inline edit
|
||||
if (!$failed && ($warnings = $driver->warnings())) {
|
||||
$id = "warnings";
|
||||
$return = ", <a href='#$id'>" . lang('Warnings') . "</a>" . script("qsl('a').onclick = partial(toggle, '$id');", "")
|
||||
. "$return<div id='$id' class='hidden'>\n$warnings</div>\n"
|
||||
;
|
||||
}
|
||||
return "<p><code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <span class='time'>(" . format_time($start) . ")</span>"
|
||||
. (support("sql") ? " <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>" : "")
|
||||
. "</p>" // </p> - required for IE9 inline edit
|
||||
. $return
|
||||
;
|
||||
}
|
||||
|
||||
@@ -243,14 +286,14 @@ class Adminer {
|
||||
* @return string
|
||||
*/
|
||||
function selectVal($val, $link, $field, $original) {
|
||||
$return = ($val === null ? "<i>NULL</i>" : (preg_match("~char|binary~", $field["type"]) && !preg_match("~var~", $field["type"]) ? "<code>$val</code>" : $val));
|
||||
$return = ($val === null ? "<i>NULL</i>" : (preg_match("~char|binary|boolean~", $field["type"]) && !preg_match("~var~", $field["type"]) ? "<code>$val</code>" : $val));
|
||||
if (preg_match('~blob|bytea|raw|file~', $field["type"]) && !is_utf8($val)) {
|
||||
$return = "<i>" . lang('%d byte(s)', strlen($original)) . "</i>";
|
||||
}
|
||||
if (preg_match('~json~', $field["type"])) {
|
||||
$return = "<code class='jush-js'>$return</code>";
|
||||
}
|
||||
return ($link ? "<a href='" . h($link) . "'" . (is_url($link) ? " rel='noreferrer'" : "") . ">$return</a>" : $return);
|
||||
return ($link ? "<a href='" . h($link) . "'" . (is_url($link) ? target_blank() : "") . ">$return</a>" : $return);
|
||||
}
|
||||
|
||||
/** Value conversion used in select and edit
|
||||
@@ -267,7 +310,8 @@ class Adminer {
|
||||
* @return null
|
||||
*/
|
||||
function tableStructurePrint($fields) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<div class='scrollable'>\n";
|
||||
echo "<table cellspacing='0' class='nowrap'>\n";
|
||||
echo "<thead><tr><th>" . lang('Column') . "<td>" . lang('Type') . (support("comment") ? "<td>" . lang('Comment') : "") . "</thead>\n";
|
||||
foreach ($fields as $field) {
|
||||
echo "<tr" . odd() . "><th>" . h($field["field"]);
|
||||
@@ -275,10 +319,11 @@ class Adminer {
|
||||
echo ($field["null"] ? " <i>NULL</i>" : "");
|
||||
echo ($field["auto_increment"] ? " <i>" . lang('Auto Increment') . "</i>" : "");
|
||||
echo (isset($field["default"]) ? " <span title='" . lang('Default value') . "'>[<b>" . h($field["default"]) . "</b>]</span>" : "");
|
||||
echo (support("comment") ? "<td>" . nbsp($field["comment"]) : "");
|
||||
echo (support("comment") ? "<td>" . h($field["comment"]) : "");
|
||||
echo "\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
/** Print list of indexes on table in tabular format
|
||||
@@ -317,7 +362,7 @@ class Adminer {
|
||||
" name='columns[$i][col]'",
|
||||
$columns,
|
||||
$val["col"],
|
||||
($key !== "" ? "selectFieldChange" : "selectAddRow")
|
||||
($key !== "" ? "selectFieldChange" : "selectAddRow")
|
||||
);
|
||||
echo "<div>" . ($functions || $grouping ? "<select name='columns[$i][fun]'>"
|
||||
. optionlist(array(-1 => "") + array_filter(array(lang('Functions') => $functions, lang('Aggregation') => $grouping)), $val["fun"]) . "</select>"
|
||||
@@ -339,18 +384,15 @@ class Adminer {
|
||||
print_fieldset("search", lang('Search'), $where);
|
||||
foreach ($indexes as $i => $index) {
|
||||
if ($index["type"] == "FULLTEXT") {
|
||||
echo "(<i>" . implode("</i>, <i>", array_map('h', $index["columns"])) . "</i>) AGAINST";
|
||||
echo "<div>(<i>" . implode("</i>, <i>", array_map('h', $index["columns"])) . "</i>) AGAINST";
|
||||
echo " <input type='search' name='fulltext[$i]' value='" . h($_GET["fulltext"][$i]) . "'>";
|
||||
echo script("qsl('input').oninput = selectFieldChange;", "");
|
||||
echo checkbox("boolean[$i]", 1, isset($_GET["boolean"][$i]), "BOOL");
|
||||
echo "<br>\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
$_GET["where"] = (array) $_GET["where"];
|
||||
reset($_GET["where"]);
|
||||
$change_next = "this.parentNode.firstChild.onchange();";
|
||||
for ($i = 0; $i <= count($_GET["where"]); $i++) {
|
||||
list(, $val) = each($_GET["where"]);
|
||||
foreach (array_merge((array) $_GET["where"], array(array())) as $i => $val) {
|
||||
if (!$val || ("$val[col]$val[val]" != "" && in_array($val["op"], $this->operators))) {
|
||||
echo "<div>" . select_input(
|
||||
" name='where[$i][col]'",
|
||||
@@ -487,15 +529,16 @@ class Adminer {
|
||||
* @return array expressions to join by AND
|
||||
*/
|
||||
function selectSearchProcess($fields, $indexes) {
|
||||
global $connection, $jush;
|
||||
global $connection, $driver;
|
||||
$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" : "") . ")";
|
||||
}
|
||||
}
|
||||
foreach ((array) $_GET["where"] as $val) {
|
||||
foreach ((array) $_GET["where"] as $key => $val) {
|
||||
if ("$val[col]$val[val]" != "" && in_array($val["op"], $this->operators)) {
|
||||
$prefix = "";
|
||||
$cond = " $val[op]";
|
||||
if (preg_match('~IN$~', $val["op"])) {
|
||||
$in = process_length($val["val"]);
|
||||
@@ -506,24 +549,25 @@ class Adminer {
|
||||
$cond = " LIKE " . $this->processInput($fields[$val["col"]], "%$val[val]%");
|
||||
} elseif ($val["op"] == "ILIKE %%") {
|
||||
$cond = " ILIKE " . $this->processInput($fields[$val["col"]], "%$val[val]%");
|
||||
} elseif ($val["op"] == "FIND_IN_SET") {
|
||||
$prefix = "$val[op](" . q($val["val"]) . ", ";
|
||||
$cond = ")";
|
||||
} elseif (!preg_match('~NULL$~', $val["op"])) {
|
||||
$cond .= " " . $this->processInput($fields[$val["col"]], $val["val"]);
|
||||
}
|
||||
if ($val["col"] != "") {
|
||||
$return[] = idf_escape($val["col"]) . $cond;
|
||||
$return[] = $prefix . $driver->convertSearch(idf_escape($val["col"]), $val, $fields[$val["col"]]) . $cond;
|
||||
} else {
|
||||
// find anywhere
|
||||
$cols = array();
|
||||
foreach ($fields as $name => $field) {
|
||||
$is_text = preg_match('~char|text|enum|set~', $field["type"]);
|
||||
if ((is_numeric($val["val"]) || !preg_match('~(^|[^o])int|float|double|decimal|bit~', $field["type"]))
|
||||
&& (!preg_match("~[\x80-\xFF]~", $val["val"]) || $is_text)
|
||||
if ((preg_match('~^[-\d.' . (preg_match('~IN$~', $val["op"]) ? ',' : '') . ']+$~', $val["val"]) || !preg_match('~' . number_type() . '|bit~', $field["type"]))
|
||||
&& (!preg_match("~[\x80-\xFF]~", $val["val"]) || preg_match('~char|text|enum|set~', $field["type"]))
|
||||
) {
|
||||
$name = idf_escape($name);
|
||||
$cols[] = ($jush == "sql" && $is_text && !preg_match("~^utf8_~", $field["collation"]) ? "CONVERT($name USING " . charset($connection) . ")" : $name);
|
||||
$cols[] = $prefix . $driver->convertSearch(idf_escape($name), $val, $field) . $cond;
|
||||
}
|
||||
}
|
||||
$return[] = ($cols ? "(" . implode("$cond OR ", $cols) . "$cond)" : "0");
|
||||
$return[] = ($cols ? "(" . implode(" OR ", $cols) . ")" : "1 = 0");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -539,7 +583,7 @@ class Adminer {
|
||||
$return = array();
|
||||
foreach ((array) $_GET["order"] as $key => $val) {
|
||||
if ($val != "") {
|
||||
$return[] = (preg_match('~^((COUNT\\(DISTINCT |[A-Z0-9_]+\\()(`(?:[^`]|``)+`|"(?:[^"]|"")+")\\)|COUNT\\(\\*\\))$~', $val) ? $val : idf_escape($val)) //! MS SQL uses []
|
||||
$return[] = (preg_match('~^((COUNT\(DISTINCT |[A-Z0-9_]+\()(`(?:[^`]|``)+`|"(?:[^"]|"")+")\)|COUNT\(\*\))$~', $val) ? $val : idf_escape($val)) //! MS SQL uses []
|
||||
. (isset($_GET["desc"][$key]) ? " DESC" : "")
|
||||
;
|
||||
}
|
||||
@@ -586,23 +630,28 @@ class Adminer {
|
||||
/** Query printed after execution in the message
|
||||
* @param string executed query
|
||||
* @param string elapsed time
|
||||
* @param bool
|
||||
* @return string
|
||||
*/
|
||||
function messageQuery($query, $time) {
|
||||
global $jush;
|
||||
function messageQuery($query, $time, $failed = false) {
|
||||
global $jush, $driver;
|
||||
restart_session();
|
||||
$history = &get_session("queries");
|
||||
if (!$history[$_GET["db"]]) {
|
||||
$history[$_GET["db"]] = array();
|
||||
}
|
||||
$id = "sql-" . count($history[$_GET["db"]]);
|
||||
if (strlen($query) > 1e6) {
|
||||
$query = preg_replace('~[\x80-\xFF]+$~', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
|
||||
}
|
||||
$history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"]
|
||||
$sql_id = "sql-" . count($history[$_GET["db"]]);
|
||||
$return = "<a href='#$sql_id' class='toggle'>" . lang('SQL command') . "</a>\n";
|
||||
if (!$failed && ($warnings = $driver->warnings())) {
|
||||
$id = "warnings-" . count($history[$_GET["db"]]);
|
||||
$return = "<a href='#$id' class='toggle'>" . lang('Warnings') . "</a>, $return<div id='$id' class='hidden'>\n$warnings</div>\n";
|
||||
}
|
||||
return " <span class='time'>" . @date("H:i:s") . "</span>" // @ - time zone may be not set
|
||||
. " <a href='#$id' class='toggle'>" . lang('SQL command') . "</a>"
|
||||
. "<div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre>'
|
||||
. " $return<div id='$sql_id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . "</code></pre>"
|
||||
. ($time ? " <span class='time'>($time)</span>" : '')
|
||||
. (support("sql") ? '<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>'
|
||||
@@ -677,7 +726,7 @@ class Adminer {
|
||||
$return = "$function()";
|
||||
} elseif (preg_match('~^current_(date|timestamp)$~', $function)) {
|
||||
$return = $function;
|
||||
} elseif (preg_match('~^([+-]|\\|\\|)$~', $function)) {
|
||||
} elseif (preg_match('~^([+-]|\|\|)$~', $function)) {
|
||||
$return = idf_escape($name) . " $function $return";
|
||||
} elseif (preg_match('~^[+-] interval$~', $function)) {
|
||||
$return = idf_escape($name) . " $function " . (preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+\$~i", $value) ? $value : $return);
|
||||
@@ -734,7 +783,7 @@ class Adminer {
|
||||
}
|
||||
$create = "CREATE TABLE " . table($table) . " (" . implode(", ", $fields) . ")";
|
||||
} else {
|
||||
$create = create_sql($table, $_POST["auto_increment"]);
|
||||
$create = create_sql($table, $_POST["auto_increment"], $style);
|
||||
}
|
||||
set_utf8mb4($create);
|
||||
if ($style && $create) {
|
||||
@@ -796,7 +845,7 @@ class Adminer {
|
||||
foreach ($row as $key => $val) {
|
||||
$field = $fields[$key];
|
||||
$row[$key] = ($val !== null
|
||||
? unconvert_field($field, preg_match('~(^|[^o])int|float|double|decimal~', $field["type"]) && $val != '' ? $val : q($val))
|
||||
? unconvert_field($field, preg_match(number_type(), $field["type"]) && $val != '' && !preg_match('~\[~', $field["full_type"]) ? $val : q(($val === false ? 0 : $val)))
|
||||
: "NULL"
|
||||
);
|
||||
}
|
||||
@@ -847,6 +896,13 @@ class Adminer {
|
||||
return $ext;
|
||||
}
|
||||
|
||||
/** Set the path of the file for webserver load
|
||||
* @return string path of the sql dump file
|
||||
*/
|
||||
function importServerPath() {
|
||||
return "adminer.sql";
|
||||
}
|
||||
|
||||
/** Print homepage
|
||||
* @return bool whether to print default homepage
|
||||
*/
|
||||
@@ -867,7 +923,7 @@ class Adminer {
|
||||
?>
|
||||
<h1>
|
||||
<?php echo $this->name(); ?> <span class="version"><?php echo $VERSION; ?></span>
|
||||
<a href="https://www.adminer.org/#download" target="_blank" id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a>
|
||||
<a href="https://www.adminer.org/#download"<?php echo target_blank(); ?> id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a>
|
||||
</h1>
|
||||
<?php
|
||||
if ($missing == "auth") {
|
||||
@@ -882,7 +938,7 @@ class Adminer {
|
||||
}
|
||||
$dbs = $_SESSION["db"][$vendor][$server][$username];
|
||||
foreach (($dbs ? array_keys($dbs) : array("")) as $db) {
|
||||
echo "<a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>($drivers[$vendor]) " . h($username . ($server != "" ? "@$server" : "") . ($db != "" ? " - $db" : "")) . "</a><br>\n";
|
||||
echo "<a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>($drivers[$vendor]) " . h($username . ($server != "" ? "@" . $this->serverName($server) : "") . ($db != "" ? " - $db" : "")) . "</a><br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -912,8 +968,9 @@ class Adminer {
|
||||
echo "jushLinks.$val = jushLinks.$jush;\n";
|
||||
}
|
||||
}
|
||||
$server_info = $connection->server_info;
|
||||
?>
|
||||
bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');
|
||||
bodyLoad('<?php echo (is_object($connection) ? preg_replace('~^(\d\.?\d).*~s', '\1', $server_info) : ""); ?>'<?php echo (preg_match('~MariaDB~', $server_info) ? ", true" : ""); ?>);
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
@@ -942,15 +999,18 @@ bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info,
|
||||
function databasesPrint($missing) {
|
||||
global $adminer, $connection;
|
||||
$databases = $this->databases();
|
||||
if ($databases && !in_array(DB, $databases)) {
|
||||
array_unshift($databases, DB);
|
||||
}
|
||||
?>
|
||||
<form action="">
|
||||
<p id="dbs">
|
||||
<?php
|
||||
hidden_fields_get();
|
||||
$db_events = script("mixin(qsl('select'), {onmousedown: dbMouseDown, onchange: dbChange});", "");
|
||||
echo "<span title='" . lang('database') . "'>DB</span>: " . ($databases
|
||||
$db_events = script("mixin(qsl('select'), {onmousedown: dbMouseDown, onchange: dbChange});");
|
||||
echo "<span title='" . lang('database') . "'>" . lang('DB') . "</span>: " . ($databases
|
||||
? "<select name='db'>" . optionlist(array("" => "") + $databases, DB) . "</select>$db_events"
|
||||
: '<input name="db" value="' . h(DB) . '" autocapitalize="off">'
|
||||
: "<input name='db' value='" . h(DB) . "' autocapitalize='off'>\n"
|
||||
);
|
||||
echo "<input type='submit' value='" . lang('Use') . "'" . ($databases ? " class='hidden'" : "") . ">\n";
|
||||
if ($missing != "db" && DB != "" && $connection->select_db(DB)) {
|
||||
@@ -961,11 +1021,12 @@ bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info,
|
||||
}
|
||||
}
|
||||
}
|
||||
echo (isset($_GET["sql"]) ? '<input type="hidden" name="sql" value="">'
|
||||
: (isset($_GET["schema"]) ? '<input type="hidden" name="schema" value="">'
|
||||
: (isset($_GET["dump"]) ? '<input type="hidden" name="dump" value="">'
|
||||
: (isset($_GET["privileges"]) ? '<input type="hidden" name="privileges" value="">'
|
||||
: ""))));
|
||||
foreach (array("import", "sql", "schema", "dump", "privileges") as $val) {
|
||||
if (isset($_GET[$val])) {
|
||||
echo "<input type='hidden' name='$val' value=''>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
echo "</p></form>\n";
|
||||
}
|
||||
|
||||
@@ -976,14 +1037,16 @@ bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info,
|
||||
function tablesPrint($tables) {
|
||||
echo "<ul id='tables'>" . script("mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
foreach ($tables as $table => $status) {
|
||||
echo '<li><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . ">" . lang('select') . "</a> ";
|
||||
$name = $this->tableName($status);
|
||||
echo (support("table") || support("indexes")
|
||||
? '<a href="' . h(ME) . 'table=' . urlencode($table) . '"'
|
||||
. bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"])), (is_view($status) ? "view" : "structure"))
|
||||
. " title='" . lang('Show structure') . "'>$name</a>"
|
||||
: "<span>$name</span>"
|
||||
) . "\n";
|
||||
if ($name != "") {
|
||||
echo '<li><a href="' . h(ME) . 'select=' . urlencode($table) . '"' . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select") . ">" . lang('select') . "</a> ";
|
||||
echo (support("table") || support("indexes")
|
||||
? '<a href="' . h(ME) . 'table=' . urlencode($table) . '"'
|
||||
. bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"])), (is_view($status) ? "view" : "structure"))
|
||||
. " title='" . lang('Show structure') . "'>$name</a>"
|
||||
: "<span>$name</span>"
|
||||
) . "\n";
|
||||
}
|
||||
}
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
@@ -17,15 +17,10 @@ if ($_COOKIE["adminer_permanent"]) {
|
||||
|
||||
function add_invalid_login() {
|
||||
global $adminer;
|
||||
$filename = get_temp_dir() . "/adminer.invalid";
|
||||
$fp = @fopen($filename, "r+"); // @ - may not exist
|
||||
if (!$fp) { // c+ is available since PHP 5.2.6
|
||||
$fp = @fopen($filename, "w"); // @ - may not be writable
|
||||
if (!$fp) {
|
||||
return;
|
||||
}
|
||||
$fp = file_open_lock(get_temp_dir() . "/adminer.invalid");
|
||||
if (!$fp) {
|
||||
return;
|
||||
}
|
||||
flock($fp, LOCK_EX);
|
||||
$invalids = unserialize(stream_get_contents($fp));
|
||||
$time = time();
|
||||
if ($invalids) {
|
||||
@@ -40,19 +35,14 @@ function add_invalid_login() {
|
||||
$invalid = array($time + 30*60, 0); // active for 30 minutes
|
||||
}
|
||||
$invalid[1]++;
|
||||
$serialized = serialize($invalids);
|
||||
rewind($fp);
|
||||
fwrite($fp, $serialized);
|
||||
ftruncate($fp, strlen($serialized));
|
||||
flock($fp, LOCK_UN);
|
||||
fclose($fp);
|
||||
file_write_unlock($fp, serialize($invalids));
|
||||
}
|
||||
|
||||
function check_invalid_login() {
|
||||
global $adminer;
|
||||
$invalids = unserialize(@file_get_contents(get_temp_dir() . "/adminer.invalid")); // @ - may not exist
|
||||
$invalid = $invalids[$adminer->bruteForceKey()];
|
||||
$next_attempt = ($invalid[1] > 30 ? $invalid[0] - time() : 0); // allow 30 invalid attempts
|
||||
$next_attempt = ($invalid[1] > 29 ? $invalid[0] - time() : 0); // allow 30 invalid attempts
|
||||
if ($next_attempt > 0) { //! do the same with permanent login
|
||||
auth_error(lang('Too many unsuccessful logins, try again in %d minute(s).', ceil($next_attempt / 60)));
|
||||
}
|
||||
@@ -93,7 +83,7 @@ if ($auth) {
|
||||
set_session($key, null);
|
||||
}
|
||||
unset_permanent();
|
||||
redirect(substr(preg_replace('~\b(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.') . ' ' . lang('Thanks for using Adminer, consider <a href="%s">donating</a>.', 'https://sourceforge.net/donate/index.php?group_id=264133'));
|
||||
redirect(substr(preg_replace('~\b(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.') . ' ' . lang('Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.'));
|
||||
}
|
||||
|
||||
} elseif ($permanent && !$_SESSION["pwds"]) {
|
||||
@@ -130,11 +120,12 @@ function auth_error($error) {
|
||||
if (($_COOKIE[$session_name] || $_GET[$session_name]) && !$has_token) {
|
||||
$error = lang('Session expired, please login again.');
|
||||
} else {
|
||||
restart_session();
|
||||
add_invalid_login();
|
||||
$password = get_password();
|
||||
if ($password !== null) {
|
||||
if ($password === false) {
|
||||
$error .= '<br>' . lang('Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.', '<code>permanentLogin()</code>');
|
||||
$error .= '<br>' . lang('Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.', target_blank(), '<code>permanentLogin()</code>');
|
||||
}
|
||||
set_password(DRIVER, SERVER, $_GET["username"], null);
|
||||
}
|
||||
@@ -148,35 +139,41 @@ function auth_error($error) {
|
||||
cookie("adminer_key", ($_COOKIE["adminer_key"] ? $_COOKIE["adminer_key"] : rand_string()), $params["lifetime"]);
|
||||
page_header(lang('Login'), $error, null);
|
||||
echo "<form action='' method='post'>\n";
|
||||
$adminer->loginForm();
|
||||
echo "<div>";
|
||||
hidden_fields($_POST, array("auth")); // expired session
|
||||
if (hidden_fields($_POST, array("auth"))) { // expired session
|
||||
echo "<p class='message'>" . lang('The action will be performed after successful login with the same credentials.') . "\n";
|
||||
}
|
||||
echo "</div>\n";
|
||||
$adminer->loginForm();
|
||||
echo "</form>\n";
|
||||
page_footer("auth");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET["username"]) && !class_exists("Min_DB")) {
|
||||
unset($_SESSION["pwds"][DRIVER]);
|
||||
unset_permanent();
|
||||
page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", $possible_drivers)), false);
|
||||
page_footer("auth");
|
||||
exit;
|
||||
}
|
||||
|
||||
stop_session(true);
|
||||
|
||||
if (isset($_GET["username"])) {
|
||||
if (!class_exists("Min_DB")) {
|
||||
unset($_SESSION["pwds"][DRIVER]);
|
||||
unset_permanent();
|
||||
page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", $possible_drivers)), false);
|
||||
page_footer("auth");
|
||||
exit;
|
||||
}
|
||||
list($host, $port) = explode(":", SERVER, 2);
|
||||
if (is_numeric($port) && $port < 1024) {
|
||||
auth_error('Connecting to privileged ports is not allowed.');
|
||||
auth_error(lang('Connecting to privileged ports is not allowed.'));
|
||||
}
|
||||
check_invalid_login();
|
||||
$connection = connect();
|
||||
$driver = new Min_Driver($connection);
|
||||
}
|
||||
|
||||
$driver = new Min_Driver($connection);
|
||||
|
||||
$login = null;
|
||||
if (!is_object($connection) || ($login = $adminer->login($_GET["username"], get_password())) !== true) {
|
||||
auth_error((is_string($connection) ? h($connection) : (is_string($login) ? $login : lang('Invalid credentials.'))));
|
||||
$error = (is_string($connection) ? h($connection) : (is_string($login) ? $login : lang('Invalid credentials.')));
|
||||
auth_error($error . (preg_match('~^ | $~', get_password()) ? '<br>' . lang('There is a space in the input password which might be the cause.') : ''));
|
||||
}
|
||||
|
||||
if ($auth && $_POST["token"]) {
|
||||
|
@@ -18,14 +18,22 @@ if (function_exists("mb_internal_encoding")) {
|
||||
mb_internal_encoding("8bit");
|
||||
}
|
||||
|
||||
include "../adminer/include/functions.inc.php";
|
||||
|
||||
// used only in compiled file
|
||||
if (isset($_GET["file"])) {
|
||||
include "../adminer/file.inc.php";
|
||||
}
|
||||
|
||||
include "../adminer/include/functions.inc.php";
|
||||
if ($_GET["script"] == "version") {
|
||||
$fp = file_open_lock(get_temp_dir() . "/adminer.version");
|
||||
if ($fp) {
|
||||
file_write_unlock($fp, serialize(array("signature" => $_POST["signature"], "version" => $_POST["version"])));
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
global $adminer, $connection, $drivers, $edit_functions, $enum_length, $error, $functions, $grouping, $HTTPS, $inout, $jush, $LANG, $langs, $on_actions, $permanent, $structured_types, $has_token, $token, $translations, $types, $unsigned, $VERSION; // allows including Adminer inside a function
|
||||
global $adminer, $connection, $driver, $drivers, $edit_functions, $enum_length, $error, $functions, $grouping, $HTTPS, $inout, $jush, $LANG, $langs, $on_actions, $permanent, $structured_types, $has_token, $token, $translations, $types, $unsigned, $VERSION; // allows including Adminer inside a function
|
||||
|
||||
if (!$_SERVER["REQUEST_URI"]) { // IIS 5 compatibility
|
||||
$_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"];
|
||||
@@ -33,13 +41,16 @@ if (!$_SERVER["REQUEST_URI"]) { // IIS 5 compatibility
|
||||
if (!strpos($_SERVER["REQUEST_URI"], '?') && $_SERVER["QUERY_STRING"] != "") { // IIS 7 compatibility
|
||||
$_SERVER["REQUEST_URI"] .= "?$_SERVER[QUERY_STRING]";
|
||||
}
|
||||
$HTTPS = $_SERVER["HTTPS"] && strcasecmp($_SERVER["HTTPS"], "off");
|
||||
if ($_SERVER["HTTP_X_FORWARDED_PREFIX"]) {
|
||||
$_SERVER["REQUEST_URI"] = $_SERVER["HTTP_X_FORWARDED_PREFIX"] . $_SERVER["REQUEST_URI"];
|
||||
}
|
||||
$HTTPS = ($_SERVER["HTTPS"] && strcasecmp($_SERVER["HTTPS"], "off")) || ini_bool("session.cookie_secure"); // session.cookie_secure could be set on HTTP if we are behind a reverse proxy
|
||||
|
||||
@ini_set("session.use_trans_sid", false); // protect links in export, @ - may be disabled
|
||||
if (!defined("SID")) {
|
||||
session_cache_limiter(""); // to allow restarting session
|
||||
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"]), "", $HTTPS);
|
||||
if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
|
||||
$params[] = true; // HttpOnly
|
||||
}
|
||||
@@ -54,7 +65,7 @@ if (get_magic_quotes_runtime()) {
|
||||
}
|
||||
@set_time_limit(0); // @ - can be disabled
|
||||
@ini_set("zend.ze1_compatibility_mode", false); // @ - deprecated
|
||||
@ini_set("precision", 20); // @ - can be disabled
|
||||
@ini_set("precision", 15); // @ - can be disabled, 15 - internal PHP precision
|
||||
|
||||
include "../adminer/include/lang.inc.php";
|
||||
include "../adminer/lang/$LANG.inc.php";
|
||||
@@ -68,11 +79,12 @@ include "../adminer/drivers/firebird.inc.php";
|
||||
include "../adminer/drivers/simpledb.inc.php";
|
||||
include "../adminer/drivers/mongo.inc.php";
|
||||
include "../adminer/drivers/elastic.inc.php";
|
||||
include "../adminer/drivers/clickhouse.inc.php";
|
||||
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"]) . '?'
|
||||
define("ME", preg_replace('~^[^?]*/([^?]*).*~', '\1', $_SERVER["REQUEST_URI"]) . '?'
|
||||
. (sid() ? SID . '&' : '')
|
||||
. (SERVER !== null ? DRIVER . "=" . urlencode(SERVER) . '&' : '')
|
||||
. (isset($_GET["username"]) ? "username=" . urlencode($_GET["username"]) . '&' : '')
|
||||
@@ -84,11 +96,6 @@ include "./include/adminer.inc.php";
|
||||
include "../adminer/include/design.inc.php";
|
||||
include "../adminer/include/xxtea.inc.php";
|
||||
include "../adminer/include/auth.inc.php";
|
||||
|
||||
if (!ini_bool("session.use_cookies") || @ini_set("session.use_cookies", false) !== false) { // @ - may be disabled
|
||||
session_write_close(); // improves concurrency if a user opens several pages at once, may be restarted later
|
||||
}
|
||||
|
||||
include "./include/editing.inc.php";
|
||||
include "./include/connect.inc.php";
|
||||
|
||||
|
@@ -32,7 +32,7 @@ function connect_error() {
|
||||
echo "<table cellspacing='0' class='checkable'>\n";
|
||||
echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
|
||||
echo "<thead><tr>"
|
||||
. (support("database") ? "<td> " : "")
|
||||
. (support("database") ? "<td>" : "")
|
||||
. "<th>" . lang('Database') . " - <a href='" . h(ME) . "refresh=1'>" . lang('Refresh') . "</a>"
|
||||
. "<td>" . lang('Collation')
|
||||
. "<td>" . lang('Tables')
|
||||
@@ -46,8 +46,8 @@ function connect_error() {
|
||||
$root = h(ME) . "db=" . urlencode($db);
|
||||
$id = h("Db-" . $db);
|
||||
echo "<tr" . odd() . ">" . (support("database") ? "<td>" . checkbox("db[]", $db, in_array($db, (array) $_POST["db"]), "", "", "", $id) : "");
|
||||
echo "<th><a href='$root' id='$db'>" . h($db) . "</a>";
|
||||
$collation = nbsp(db_collation($db, $collations));
|
||||
echo "<th><a href='$root' id='$id'>" . h($db) . "</a>";
|
||||
$collation = h(db_collation($db, $collations));
|
||||
echo "<td>" . (support("database") ? "<a href='$root" . ($scheme ? "&ns=" : "") . "&database=' title='" . lang('Alter database') . "'>$collation</a>" : $collation);
|
||||
echo "<td align='right'><a href='$root&schema=' id='tables-" . h($db) . "' title='" . lang('Database schema') . "'>" . ($_GET["dbsize"] ? $tables : "?") . "</a>";
|
||||
echo "<td align='right' id='size-" . h($db) . "'>" . ($_GET["dbsize"] ? db_size($db) : "?");
|
||||
@@ -56,15 +56,17 @@ function connect_error() {
|
||||
|
||||
echo "</table>\n";
|
||||
echo (support("database")
|
||||
? "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>\n"
|
||||
? "<div class='footer'><div>\n"
|
||||
. "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>\n"
|
||||
. "<input type='hidden' name='all' value=''>" . script("qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^db/)); };") // used by trCheck()
|
||||
. "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm() . "\n"
|
||||
. "</div></fieldset>\n"
|
||||
. "</div></div>\n"
|
||||
: ""
|
||||
);
|
||||
echo script("tableCheck();");
|
||||
echo "<input type='hidden' name='token' value='$token'>\n";
|
||||
echo "</form>\n";
|
||||
echo script("tableCheck();");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -27,16 +27,38 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
||||
<?php if ($adminer->head()) { ?>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
|
||||
<link rel="apple-touch-icon" href="../adminer/static/favicon.ico">
|
||||
<?php if (file_exists("adminer.css")) { ?>
|
||||
<link rel="stylesheet" type="text/css" href="adminer.css">
|
||||
<?php foreach ($adminer->css() as $css) { ?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo h($css); ?>">
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<body class="<?php echo lang('ltr'); ?> nojs">
|
||||
<?php
|
||||
$filename = get_temp_dir() . "/adminer.version";
|
||||
if (!$_COOKIE["adminer_version"] && function_exists('openssl_verify') && file_exists($filename) && filemtime($filename) + 86400 > time()) { // 86400 - 1 day in seconds
|
||||
$version = unserialize(file_get_contents($filename));
|
||||
$public = "-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwqWOVuF5uw7/+Z70djoK
|
||||
RlHIZFZPO0uYRezq90+7Amk+FDNd7KkL5eDve+vHRJBLAszF/7XKXe11xwliIsFs
|
||||
DFWQlsABVZB3oisKCBEuI71J4kPH8dKGEWR9jDHFw3cWmoH3PmqImX6FISWbG3B8
|
||||
h7FIx3jEaw5ckVPVTeo5JRm/1DZzJxjyDenXvBQ/6o9DgZKeNDgxwKzH+sw9/YCO
|
||||
jHnq1cFpOIISzARlrHMa/43YfeNRAm/tsBXjSxembBPo7aQZLAWHmaj5+K19H10B
|
||||
nCpz9Y++cipkVEiKRGih4ZEvjoFysEOdRLj6WiD/uUNky4xGeA6LaJqh5XpkFkcQ
|
||||
fQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
";
|
||||
if (openssl_verify($version["version"], base64_decode($version["signature"]), $public) == 1) {
|
||||
$_COOKIE["adminer_version"] = $version["version"]; // doesn't need to send to the browser
|
||||
}
|
||||
}
|
||||
?>
|
||||
<script<?php echo nonce(); ?>>
|
||||
mixin(document.body, {onkeydown: bodyKeydown, onclick: bodyClick<?php echo (isset($_COOKIE["adminer_version"]) ? "" : ", onload: partial(verifyVersion, '$VERSION')"); ?>});
|
||||
mixin(document.body, {onkeydown: bodyKeydown, onclick: bodyClick<?php
|
||||
echo (isset($_COOKIE["adminer_version"]) ? "" : ", onload: partial(verifyVersion, '$VERSION', '" . js_escape(ME) . "', '" . get_token() . "')"); // $token may be empty in auth.inc.php
|
||||
?>});
|
||||
document.body.className = document.body.className.replace(/ nojs/, ' js');
|
||||
var offlineMessage = '<?php echo js_escape(lang('You are offline.')); ?>';
|
||||
var thousandsSeparator = '<?php echo js_escape(lang(',')); ?>';
|
||||
</script>
|
||||
|
||||
<div id="help" class="jush-<?php echo $jush; ?> jsonly hidden"></div>
|
||||
@@ -48,7 +70,8 @@ var offlineMessage = '<?php echo js_escape(lang('You are offline.')); ?>';
|
||||
$link = substr(preg_replace('~\b(username|db|ns)=[^&]*&~', '', ME), 0, -1);
|
||||
echo '<p id="breadcrumb"><a href="' . h($link ? $link : ".") . '">' . $drivers[DRIVER] . '</a> » ';
|
||||
$link = substr(preg_replace('~\b(db|ns)=[^&]*&~', '', ME), 0, -1);
|
||||
$server = (SERVER != "" ? h(SERVER) : lang('Server'));
|
||||
$server = $adminer->serverName(SERVER);
|
||||
$server = ($server != "" ? $server : lang('Server'));
|
||||
if ($breadcrumb === false) {
|
||||
echo "$server\n";
|
||||
} else {
|
||||
@@ -109,12 +132,11 @@ function page_headers() {
|
||||
function csp() {
|
||||
return array(
|
||||
array(
|
||||
"default-src" => "'none'",
|
||||
"script-src" => "'self' 'unsafe-inline' 'nonce-" . get_nonce() . "' 'strict-dynamic'", // 'self' is a fallback for browsers not supporting 'strict-dynamic', 'unsafe-inline' is a fallback for browsers not supporting 'nonce-'
|
||||
"style-src" => "'self' 'unsafe-inline'",
|
||||
"connect-src" => "'self'",
|
||||
"img-src" => "'self' data:",
|
||||
"frame-src" => "https://www.adminer.org",
|
||||
"object-src" => "'none'",
|
||||
"base-uri" => "'none'",
|
||||
"form-action" => "'self'",
|
||||
),
|
||||
);
|
||||
|
@@ -37,7 +37,7 @@
|
||||
$start = microtime(true);
|
||||
$return = $this->_conn->query($query);
|
||||
if ($print) {
|
||||
echo $adminer->selectQuery($query, format_time($start));
|
||||
echo $adminer->selectQuery($query, $start, !$return);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -50,7 +50,7 @@
|
||||
*/
|
||||
function delete($table, $queryWhere, $limit = 0) {
|
||||
$query = "FROM " . table($table);
|
||||
return queries("DELETE" . ($limit ? limit1($query, $queryWhere) : " $query$queryWhere"));
|
||||
return queries("DELETE" . ($limit ? limit1($table, $query, $queryWhere) : " $query$queryWhere"));
|
||||
}
|
||||
|
||||
/** Update data in table
|
||||
@@ -67,7 +67,7 @@
|
||||
$values[] = "$key = $val";
|
||||
}
|
||||
$query = table($table) . " SET$separator" . implode(",$separator", $values);
|
||||
return queries("UPDATE" . ($limit ? limit1($query, $queryWhere) : " $query$queryWhere"));
|
||||
return queries("UPDATE" . ($limit ? limit1($table, $query, $queryWhere, $separator) : " $query$queryWhere"));
|
||||
}
|
||||
|
||||
/** Insert data into table
|
||||
@@ -99,12 +99,70 @@
|
||||
return queries("BEGIN");
|
||||
}
|
||||
|
||||
/** Commit transaction
|
||||
* @return bool
|
||||
*/
|
||||
function commit() {
|
||||
return queries("COMMIT");
|
||||
}
|
||||
|
||||
/** Rollback transaction
|
||||
* @return bool
|
||||
*/
|
||||
function rollback() {
|
||||
return queries("ROLLBACK");
|
||||
}
|
||||
|
||||
/** Return query with a timeout
|
||||
* @param string
|
||||
* @param int seconds
|
||||
* @return string or null if the driver doesn't support query timeouts
|
||||
*/
|
||||
function slowQuery($query, $timeout) {
|
||||
}
|
||||
|
||||
/** Convert column to be searchable
|
||||
* @param string escaped column name
|
||||
* @param array array("op" => , "val" => )
|
||||
* @param array
|
||||
* @return string
|
||||
*/
|
||||
function convertSearch($idf, $val, $field) {
|
||||
return $idf;
|
||||
}
|
||||
|
||||
/** Convert value returned by database to actual value
|
||||
* @param string
|
||||
* @param array
|
||||
* @return string
|
||||
*/
|
||||
function value($val, $field) {
|
||||
return (method_exists($this->_conn, 'value')
|
||||
? $this->_conn->value($val, $field)
|
||||
: (is_resource($val) ? stream_get_contents($val) : $val)
|
||||
);
|
||||
}
|
||||
|
||||
/** Quote binary string
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function quoteBinary($s) {
|
||||
return q($s);
|
||||
}
|
||||
|
||||
/** Get warnings about the last command
|
||||
* @return string HTML
|
||||
*/
|
||||
function warnings() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/** Get help link for table
|
||||
* @param string
|
||||
* @return string relative URL or null
|
||||
*/
|
||||
function tableHelp($name) {
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@ function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
|
||||
odd(''); // reset odd for each result
|
||||
for ($i=0; (!$limit || $i < $limit) && ($row = $result->fetch_row()); $i++) {
|
||||
if (!$i) {
|
||||
echo "<div class='scrollable'>\n";
|
||||
echo "<table cellspacing='0' class='nowrap'>\n";
|
||||
echo "<thead><tr>";
|
||||
for ($j=0; $j < count($row); $j++) {
|
||||
@@ -50,7 +51,10 @@ function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
|
||||
}
|
||||
$types[$j] = $field->type;
|
||||
echo "<th" . ($orgtable != "" || $field->name != $orgname ? " title='" . h(($orgtable != "" ? "$orgtable." : "") . $orgname) . "'" : "") . ">" . h($name)
|
||||
. ($orgtables ? doc_link(array('sql' => "explain-output.html#explain_" . strtolower($name))) : "")
|
||||
. ($orgtables ? doc_link(array(
|
||||
'sql' => "explain-output.html#explain_" . strtolower($name),
|
||||
'mariadb' => "explain/#the-columns-in-explain-select",
|
||||
)) : "")
|
||||
;
|
||||
}
|
||||
echo "</thead>\n";
|
||||
@@ -61,8 +65,6 @@ function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
|
||||
$val = "<i>NULL</i>";
|
||||
} elseif ($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 = " "; // some content to print a border
|
||||
} else {
|
||||
$val = h($val);
|
||||
if ($types[$key] == 254) { // 254 - char
|
||||
@@ -84,7 +86,7 @@ function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
|
||||
echo "<td>$val";
|
||||
}
|
||||
}
|
||||
echo ($i ? "</table>" : "<p class='message'>" . lang('No rows.')) . "\n";
|
||||
echo ($i ? "</table>\n</div>" : "<p class='message'>" . lang('No rows.')) . "\n";
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -135,27 +137,28 @@ function textarea($name, $value, $rows = 10, $cols = 80) {
|
||||
* @param array
|
||||
* @param array
|
||||
* @param array returned by referencable_primary()
|
||||
* @param array extra types to prepend
|
||||
* @return null
|
||||
*/
|
||||
function edit_type($key, $field, $collations, $foreign_keys = array()) {
|
||||
function edit_type($key, $field, $collations, $foreign_keys = array(), $extra_types = array()) {
|
||||
global $structured_types, $types, $unsigned, $on_actions;
|
||||
$type = $field["type"];
|
||||
?>
|
||||
<td><select name="<?php echo h($key); ?>[type]" class="type" aria-labelledby="label-type"><?php
|
||||
if ($type && !isset($types[$type]) && !isset($foreign_keys[$type])) {
|
||||
array_unshift($structured_types, $type);
|
||||
if ($type && !isset($types[$type]) && !isset($foreign_keys[$type]) && !in_array($type, $extra_types)) {
|
||||
$extra_types[] = $type;
|
||||
}
|
||||
if ($foreign_keys) {
|
||||
$structured_types[lang('Foreign keys')] = $foreign_keys;
|
||||
}
|
||||
echo optionlist($structured_types, $type);
|
||||
echo optionlist(array_merge($extra_types, $structured_types), $type);
|
||||
?></select>
|
||||
<?php echo on_help("getTarget(event).value", 1); ?>
|
||||
<?php echo script("mixin(qsl('select'), {onfocus: function () { lastType = selectValue(this); }, onchange: editingTypeChange});", ""); ?>
|
||||
<td><input name="<?php echo h($key); ?>[length]" value="<?php echo h($field["length"]); ?>" size="3"<?php echo (!$field["length"] && preg_match('~var(char|binary)$~', $type) ? " class='required'" : ""); ?> aria-labelledby="label-length"><?php echo script("mixin(qsl('input'), {onfocus: editingLengthFocus, oninput: editingLengthChange});", ""); ?><td class="options"><?php //! type="number" with enabled JavaScript
|
||||
<td><input name="<?php echo h($key); ?>[length]" value="<?php echo h($field["length"]); ?>" size="3"<?php echo (!$field["length"] && preg_match('~var(char|binary)$~', $type) ? " class='required'" : ""); //! type="number" with enabled JavaScript ?> aria-labelledby="label-length"><?php echo script("mixin(qsl('input'), {onfocus: editingLengthFocus, oninput: editingLengthChange});", ""); ?><td class="options"><?php
|
||||
echo "<select name='" . h($key) . "[collation]'" . (preg_match('~(char|text|enum|set)$~', $type) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
|
||||
echo ($unsigned ? "<select name='" . h($key) . "[unsigned]'" . (!$type || preg_match('~((^|[^o])int|float|double|decimal)$~', $type) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
|
||||
echo (isset($field['on_update']) ? "<select name='" . h($key) . "[on_update]'" . (preg_match('~timestamp|datetime~', $type) ? "" : " class='hidden'") . '>' . optionlist(array("" => "(" . lang('ON UPDATE') . ")", "CURRENT_TIMESTAMP"), $field["on_update"]) . '</select>' : '');
|
||||
echo ($unsigned ? "<select name='" . h($key) . "[unsigned]'" . (!$type || preg_match(number_type(), $type) ? "" : " class='hidden'") . '><option>' . optionlist($unsigned, $field["unsigned"]) . '</select>' : '');
|
||||
echo (isset($field['on_update']) ? "<select name='" . h($key) . "[on_update]'" . (preg_match('~timestamp|datetime~', $type) ? "" : " class='hidden'") . '>' . optionlist(array("" => "(" . lang('ON UPDATE') . ")", "CURRENT_TIMESTAMP"), (preg_match('~^CURRENT_TIMESTAMP~i', $field["on_update"]) ? "CURRENT_TIMESTAMP" : $field["on_update"])) . '</select>' : '');
|
||||
echo ($foreign_keys ? "<select name='" . h($key) . "[on_delete]'" . (preg_match("~`~", $type) ? "" : " class='hidden'") . "><option value=''>(" . lang('ON DELETE') . ")" . optionlist(explode("|", $on_actions), $field["on_delete"]) . "</select> " : " "); // space for IE
|
||||
}
|
||||
|
||||
@@ -180,7 +183,7 @@ function process_type($field, $collate = "COLLATE") {
|
||||
global $unsigned;
|
||||
return " $field[type]"
|
||||
. process_length($field["length"])
|
||||
. (preg_match('~(^|[^o])int|float|double|decimal~', $field["type"]) && in_array($field["unsigned"], $unsigned) ? " $field[unsigned]" : "")
|
||||
. (preg_match(number_type(), $field["type"]) && in_array($field["unsigned"], $unsigned) ? " $field[unsigned]" : "")
|
||||
. (preg_match('~char|text|enum|set~', $field["type"]) && $field["collation"] ? " $collate " . q($field["collation"]) : "")
|
||||
;
|
||||
}
|
||||
@@ -191,24 +194,26 @@ 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 $jush;
|
||||
$default = $field["default"];
|
||||
return array(
|
||||
idf_escape(trim($field["field"])),
|
||||
process_type($type_field),
|
||||
($field["null"] ? " NULL" : " NOT NULL"), // NULL for timestamp
|
||||
(isset($default) ? " DEFAULT " . (
|
||||
(preg_match('~time~', $field["type"]) && preg_match('~^CURRENT_TIMESTAMP$~i', $default))
|
||||
|| ($jush == "sqlite" && preg_match('~^CURRENT_(TIME|TIMESTAMP|DATE)$~i', $default))
|
||||
|| ($field["type"] == "bit" && preg_match("~^([0-9]+|b'[0-1]+')\$~", $default))
|
||||
|| ($jush == "pgsql" && preg_match("~^[a-z]+\\(('[^']*')+\\)\$~", $default))
|
||||
? $default : q($default)) : ""),
|
||||
default_value($field),
|
||||
(preg_match('~timestamp|datetime~', $field["type"]) && $field["on_update"] ? " ON UPDATE $field[on_update]" : ""),
|
||||
(support("comment") && $field["comment"] != "" ? " COMMENT " . q($field["comment"]) : ""),
|
||||
($field["auto_increment"] ? auto_increment() : null),
|
||||
);
|
||||
}
|
||||
|
||||
/** Get default value clause
|
||||
* @param array
|
||||
* @return string
|
||||
*/
|
||||
function default_value($field) {
|
||||
$default = $field["default"];
|
||||
return ($default === null ? "" : " DEFAULT " . (preg_match('~char|binary|text|enum|set~', $field["type"]) || preg_match('~^(?![a-z])~i', $default) ? q($default) : $default));
|
||||
}
|
||||
|
||||
/** Get type class to use in CSS
|
||||
* @param string
|
||||
* @return string class=''
|
||||
@@ -235,11 +240,11 @@ function type_class($type) {
|
||||
* @return null
|
||||
*/
|
||||
function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = array(), $comments = false) {
|
||||
global $connection, $inout;
|
||||
global $inout;
|
||||
$fields = array_values($fields);
|
||||
?>
|
||||
<thead><tr class="wrap">
|
||||
<?php if ($type == "PROCEDURE") { ?><td> <?php } ?>
|
||||
<thead><tr>
|
||||
<?php if ($type == "PROCEDURE") { ?><td><?php } ?>
|
||||
<th id="label-name"><?php echo ($type == "TABLE" ? lang('Column name') : lang('Parameter name')); ?>
|
||||
<td id="label-type"><?php echo lang('Type'); ?><textarea id="enum-edit" rows="4" cols="12" wrap="off" style="display: none;"></textarea><?php echo script("qs('#enum-edit').onblur = editingLengthBlur;"); ?>
|
||||
<td id="label-length"><?php echo lang('Length'); ?>
|
||||
@@ -248,6 +253,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
|
||||
<td id="label-null">NULL
|
||||
<td><input type="radio" name="auto_increment_col" value=""><acronym id="label-ai" title="<?php echo lang('Auto Increment'); ?>">AI</acronym><?php echo doc_link(array(
|
||||
'sql' => "example-auto-increment.html",
|
||||
'mariadb' => "auto_increment/",
|
||||
'sqlite' => "autoinc.html",
|
||||
'pgsql' => "datatype.html#DATATYPE-SERIAL",
|
||||
'mssql' => "ms186775.aspx",
|
||||
@@ -259,7 +265,7 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
echo script("qsl('tbody').onkeydown = editingKeydown;");
|
||||
echo script("mixin(qsl('tbody'), {onclick: editingClick, onkeydown: editingKeydown, oninput: editingInput});");
|
||||
foreach ($fields as $i => $field) {
|
||||
$i++;
|
||||
$orig = $field[($_POST ? "orig" : "field")];
|
||||
@@ -267,23 +273,22 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
|
||||
?>
|
||||
<tr<?php echo ($display ? "" : " style='display: none;'"); ?>>
|
||||
<?php echo ($type == "PROCEDURE" ? "<td>" . html_select("fields[$i][inout]", explode("|", $inout), $field["inout"]) : ""); ?>
|
||||
<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" maxlength="64" autocapitalize="off" aria-labelledby="label-name"><?php echo script("qsl('input').oninput = function () { editingNameChange.call(this);" . ($field["field"] != "" || count($fields) > 1 ? "" : " editingAddRow.call(this);") . " };", ""); ?><?php } ?>
|
||||
<th><?php if ($display) { ?><input name="fields[<?php echo $i; ?>][field]" value="<?php echo h($field["field"]); ?>" data-maxlength="64" autocapitalize="off" aria-labelledby="label-name"><?php echo script("qsl('input').oninput = function () { editingNameChange.call(this);" . ($field["field"] != "" || count($fields) > 1 ? "" : " editingAddRow.call(this);") . " };", ""); ?><?php } ?>
|
||||
<input type="hidden" name="fields[<?php echo $i; ?>][orig]" value="<?php echo h($orig); ?>">
|
||||
<?php edit_type("fields[$i]", $field, $collations, $foreign_keys); ?>
|
||||
<?php if ($type == "TABLE") { ?>
|
||||
<td><?php echo checkbox("fields[$i][null]", 1, $field["null"], "", "", "block", "label-null"); ?>
|
||||
<td><label class="block"><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?> aria-labelledby="label-ai"><?php echo script("qsl('input').onclick = function () { var field = this.form['fields[' + this.value + '][field]']; if (!field.value) { field.value = 'id'; field.oninput(); } }"); ?></label><td><?php
|
||||
echo checkbox("fields[$i][has_default]", 1, $field["has_default"], "", "", "", "label-default"); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" aria-labelledby="label-default"><?php echo script("qsl('input').oninput = function () { this.previousSibling.checked = true; }", ""); ?>
|
||||
<?php echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . "><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' maxlength='" . ($connection->server_info >= 5.5 ? 1024 : 255) . "' aria-labelledby='label-comment'>" : ""); ?>
|
||||
<?php } ?>
|
||||
<?php
|
||||
<td><label class="block"><input type="radio" name="auto_increment_col" value="<?php echo $i; ?>"<?php if ($field["auto_increment"]) { ?> checked<?php } ?> aria-labelledby="label-ai"></label><td><?php
|
||||
echo checkbox("fields[$i][has_default]", 1, $field["has_default"], "", "", "", "label-default"); ?><input name="fields[<?php echo $i; ?>][default]" value="<?php echo h($field["default"]); ?>" aria-labelledby="label-default"><?php
|
||||
echo (support("comment") ? "<td" . ($comments ? "" : " class='hidden'") . "><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' data-maxlength='" . (min_version(5.5) ? 1024 : 255) . "' aria-labelledby='label-comment'>" : "");
|
||||
}
|
||||
echo "<td>";
|
||||
echo (support("move_col") ?
|
||||
"<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'> " . script("qsl('input').onclick = partial(editingAddRow, 1);", "")
|
||||
. "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='^' title='" . lang('Move up') . "'> " . script("qsl('input').onclick = partial(editingMoveRow, 1);", "")
|
||||
. "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='v' title='" . lang('Move down') . "'> " . script("qsl('input').onclick = partial(editingMoveRow, 0);", "")
|
||||
"<input type='image' class='icon' name='add[$i]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'> "
|
||||
. "<input type='image' class='icon' name='up[$i]' src='../adminer/static/up.gif' alt='↑' title='" . lang('Move up') . "'> "
|
||||
. "<input type='image' class='icon' name='down[$i]' src='../adminer/static/down.gif' alt='↓' title='" . lang('Move down') . "'> "
|
||||
: "");
|
||||
echo ($orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "'>" . script("qsl('input').onclick = partial(editingRemoveRow, 'fields\$1[field]');") : "");
|
||||
echo ($orig == "" || support("drop_col") ? "<input type='image' class='icon' name='drop_col[$i]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "'>" : "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,7 +359,7 @@ function grant($grant, $privileges, $columns, $on) {
|
||||
: queries("$grant ALL PRIVILEGES$on") && queries("$grant GRANT OPTION$on")
|
||||
);
|
||||
}
|
||||
return queries("$grant " . preg_replace('~(GRANT OPTION)\\([^)]*\\)~', '\\1', implode("$columns, ", $privileges) . $columns) . $on);
|
||||
return queries("$grant " . preg_replace('~(GRANT OPTION)\([^)]*\)~', '\1', implode("$columns, ", $privileges) . $columns) . $on);
|
||||
}
|
||||
|
||||
/** Drop old object and create a new one
|
||||
@@ -413,7 +418,7 @@ function create_trigger($on, $row) {
|
||||
* @return string
|
||||
*/
|
||||
function create_routine($routine, $row) {
|
||||
global $inout;
|
||||
global $inout, $jush;
|
||||
$set = array();
|
||||
$fields = (array) $row["fields"];
|
||||
ksort($fields); // enforce fields order
|
||||
@@ -422,13 +427,13 @@ function create_routine($routine, $row) {
|
||||
$set[] = (preg_match("~^($inout)\$~", $field["inout"]) ? "$field[inout] " : "") . idf_escape($field["field"]) . process_type($field, "CHARACTER SET");
|
||||
}
|
||||
}
|
||||
$definition = rtrim("\n$row[definition]", ";");
|
||||
return "CREATE $routine "
|
||||
. idf_escape(trim($row["name"]))
|
||||
. " (" . implode(", ", $set) . ")"
|
||||
. (isset($_GET["function"]) ? " RETURNS" . process_type($row["returns"], "CHARACTER SET") : "")
|
||||
. ($row["language"] ? " LANGUAGE $row[language]" : "")
|
||||
. rtrim("\n$row[definition]", ";")
|
||||
. ";"
|
||||
. ($jush == "pgsql" ? " AS " . q($definition) : "$definition;")
|
||||
;
|
||||
}
|
||||
|
||||
@@ -437,7 +442,7 @@ function create_routine($routine, $row) {
|
||||
* @return string
|
||||
*/
|
||||
function remove_definer($query) {
|
||||
return preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\\1)', logged_user()) . '`~', '\\1', $query); //! proper escaping of user
|
||||
return preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\1)', logged_user()) . '`~', '\1', $query); //! proper escaping of user
|
||||
}
|
||||
|
||||
/** Format foreign key to use in SQL query
|
||||
@@ -487,18 +492,25 @@ function ini_bytes($ini) {
|
||||
|
||||
/** Create link to database documentation
|
||||
* @param array $jush => $path
|
||||
* @param string HTML code
|
||||
* @return string HTML code
|
||||
*/
|
||||
function doc_link($paths) {
|
||||
function doc_link($paths, $text = "<sup>?</sup>") {
|
||||
global $jush, $connection;
|
||||
$server_info = $connection->server_info;
|
||||
$version = preg_replace('~^(\d\.?\d).*~s', '\1', $server_info); // two most significant digits
|
||||
$urls = array(
|
||||
'sql' => "https://dev.mysql.com/doc/refman/" . substr($connection->server_info, 0, 3) . "/en/",
|
||||
'sql' => "https://dev.mysql.com/doc/refman/$version/en/",
|
||||
'sqlite' => "https://www.sqlite.org/",
|
||||
'pgsql' => "https://www.postgresql.org/docs/" . substr($connection->server_info, 0, 3) . "/static/",
|
||||
'pgsql' => "https://www.postgresql.org/docs/$version/static/",
|
||||
'mssql' => "https://msdn.microsoft.com/library/",
|
||||
'oracle' => "https://download.oracle.com/docs/cd/B19306_01/server.102/b14200/",
|
||||
);
|
||||
return ($paths[$jush] ? "<a href='$urls[$jush]$paths[$jush]' target='_blank' rel='noreferrer'><sup>?</sup></a>" : "");
|
||||
if (preg_match('~MariaDB~', $server_info)) {
|
||||
$urls['sql'] = "https://mariadb.com/kb/en/library/";
|
||||
$paths['sql'] = (isset($paths['mariadb']) ? $paths['mariadb'] : str_replace(".html", "/", $paths['sql']));
|
||||
}
|
||||
return ($paths[$jush] ? "<a href='$urls[$jush]$paths[$jush]'" . target_blank() . ">$text</a>" : "");
|
||||
}
|
||||
|
||||
/** Wrap gzencode() for usage in ob_start()
|
||||
@@ -531,7 +543,7 @@ function db_size($db) {
|
||||
* @return null
|
||||
*/
|
||||
function set_utf8mb4($create) {
|
||||
global $connection;
|
||||
global $connection;
|
||||
static $set = false;
|
||||
if (!$set && preg_match('~\butf8mb4~i', $create)) { // possible false positive
|
||||
$set = true;
|
||||
|
@@ -16,6 +16,14 @@ function adminer() {
|
||||
return $adminer;
|
||||
}
|
||||
|
||||
/** Get Adminer version
|
||||
* @return string
|
||||
*/
|
||||
function version() {
|
||||
global $VERSION;
|
||||
return $VERSION;
|
||||
}
|
||||
|
||||
/** Unescape database identifier
|
||||
* @param string text inside ``
|
||||
* @return string
|
||||
@@ -38,7 +46,14 @@ function escape_string($val) {
|
||||
* @return string
|
||||
*/
|
||||
function number($val) {
|
||||
return preg_replace('~[^0-9]+~', '', $val);
|
||||
return preg_replace('~[^0-9]+~', '', $val);
|
||||
}
|
||||
|
||||
/** Get regular expression to match numeric types
|
||||
* @return string
|
||||
*/
|
||||
function number_type() {
|
||||
return '((?<!o)int(?!er)|numeric|real|float|double|decimal|money)'; // not point, not interval
|
||||
}
|
||||
|
||||
/** Disable magic_quotes_gpc
|
||||
@@ -73,12 +88,31 @@ function bracket_escape($idf, $back = false) {
|
||||
return strtr($idf, ($back ? array_flip($trans) : $trans));
|
||||
}
|
||||
|
||||
/** Check if connection has at least the given version
|
||||
* @param string required version
|
||||
* @param string required MariaDB version
|
||||
* @param Min_DB defaults to $connection
|
||||
* @return bool
|
||||
*/
|
||||
function min_version($version, $maria_db = "", $connection2 = null) {
|
||||
global $connection;
|
||||
if (!$connection2) {
|
||||
$connection2 = $connection;
|
||||
}
|
||||
$server_info = $connection2->server_info;
|
||||
if ($maria_db && preg_match('~([\d.]+)-MariaDB~', $server_info, $match)) {
|
||||
$server_info = $match[1];
|
||||
$version = $maria_db;
|
||||
}
|
||||
return (version_compare($server_info, $version) >= 0);
|
||||
}
|
||||
|
||||
/** Get connection charset
|
||||
* @param Min_DB
|
||||
* @return string
|
||||
*/
|
||||
function charset($connection) {
|
||||
return (version_compare($connection->server_info, "5.5.3") >= 0 ? "utf8mb4" : "utf8"); // SHOW CHARSET would require an extra query
|
||||
return (min_version("5.5.3", 0, $connection) ? "utf8mb4" : "utf8"); // SHOW CHARSET would require an extra query
|
||||
}
|
||||
|
||||
/** Return <script> element
|
||||
@@ -105,6 +139,13 @@ function nonce() {
|
||||
return ' nonce="' . get_nonce() . '"';
|
||||
}
|
||||
|
||||
/** Get a target="_blank" attribute
|
||||
* @return string
|
||||
*/
|
||||
function target_blank() {
|
||||
return ' target="_blank" rel="noreferrer noopener"';
|
||||
}
|
||||
|
||||
/** Escape for HTML
|
||||
* @param string
|
||||
* @return string
|
||||
@@ -113,14 +154,6 @@ function h($string) {
|
||||
return str_replace("\0", "�", htmlspecialchars($string, ENT_QUOTES, 'utf-8'));
|
||||
}
|
||||
|
||||
/** Escape for TD
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function nbsp($string) {
|
||||
return (trim($string) != "" ? h($string) : " ");
|
||||
}
|
||||
|
||||
/** Convert \n to <br>
|
||||
* @param string
|
||||
* @return string
|
||||
@@ -214,10 +247,11 @@ function select_input($attrs, $options, $value = "", $onchange = "", $placeholde
|
||||
|
||||
/** Get onclick confirmation
|
||||
* @param string
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function confirm($selector = "qsl('input')") {
|
||||
return script("$selector.onclick = function () { return confirm('" . lang('Are you sure?') . "'); };", "");
|
||||
function confirm($message = "", $selector = "qsl('input')") {
|
||||
return script("$selector.onclick = function () { return confirm('" . ($message ? js_escape($message) : lang('Are you sure?')) . "'); };", "");
|
||||
}
|
||||
|
||||
/** Print header for hidden fieldset (close by </div></fieldset>)
|
||||
@@ -359,21 +393,23 @@ function get_vals($query, $column = 0) {
|
||||
/** Get keys from first column and values from second
|
||||
* @param string
|
||||
* @param Min_DB
|
||||
* @param float
|
||||
* @param bool
|
||||
* @return array
|
||||
*/
|
||||
function get_key_vals($query, $connection2 = null, $timeout = 0) {
|
||||
function get_key_vals($query, $connection2 = null, $set_keys = true) {
|
||||
global $connection;
|
||||
if (!is_object($connection2)) {
|
||||
$connection2 = $connection;
|
||||
}
|
||||
$return = array();
|
||||
$connection2->timeout = $timeout;
|
||||
$result = $connection2->query($query);
|
||||
$connection2->timeout = 0;
|
||||
if (is_object($result)) {
|
||||
while ($row = $result->fetch_row()) {
|
||||
$return[$row[0]] = $row[1];
|
||||
if ($set_keys) {
|
||||
$return[$row[0]] = $row[1];
|
||||
} else {
|
||||
$return[] = $row[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
@@ -383,7 +419,7 @@ function get_key_vals($query, $connection2 = null, $timeout = 0) {
|
||||
* @param string
|
||||
* @param Min_DB
|
||||
* @param string
|
||||
* @return array associative
|
||||
* @return array of associative arrays
|
||||
*/
|
||||
function get_rows($query, $connection2 = null, $error = "<p class='error'>") {
|
||||
global $connection;
|
||||
@@ -443,7 +479,7 @@ function where($where, $fields = array()) {
|
||||
$key = bracket_escape($key, 1); // 1 - back
|
||||
$column = escape_key($key);
|
||||
$return[] = $column
|
||||
. ($jush == "sql" && preg_match('~^[0-9]*\\.[0-9]*$~', $val) ? " LIKE " . q(addcslashes($val, "%_\\"))
|
||||
. ($jush == "sql" && preg_match('~^[0-9]*\.[0-9]*$~', $val) ? " LIKE " . q(addcslashes($val, "%_\\"))
|
||||
: ($jush == "mssql" ? " LIKE " . q(preg_replace('~[_%[]~', '[\0]', $val))
|
||||
: " = " . unconvert_field($fields[$key], q($val))
|
||||
)) // LIKE because of floats but slow with ints, in MS SQL because of text
|
||||
@@ -510,7 +546,7 @@ function cookie($name, $value, $lifetime = 2592000) { // 2592000 - 30 days
|
||||
global $HTTPS;
|
||||
return header("Set-Cookie: $name=" . urlencode($value)
|
||||
. ($lifetime ? "; expires=" . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT" : "")
|
||||
. "; path=" . preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"])
|
||||
. "; path=" . preg_replace('~\?.*~', '', $_SERVER["REQUEST_URI"])
|
||||
. ($HTTPS ? "; secure" : "")
|
||||
. "; HttpOnly; SameSite=lax",
|
||||
false);
|
||||
@@ -525,12 +561,13 @@ function restart_session() {
|
||||
}
|
||||
}
|
||||
|
||||
/** Stop session if it would be possible to restart it later
|
||||
/** Stop session if possible
|
||||
* @param bool
|
||||
* @return null
|
||||
*/
|
||||
function stop_session() {
|
||||
if (!ini_bool("session.use_cookies")) {
|
||||
session_write_close();
|
||||
function stop_session($force = false) {
|
||||
if (!ini_bool("session.use_cookies") || ($force && @ini_set("session.use_cookies", false) !== false)) { // @ - may be disabled
|
||||
session_write_close(); // improves concurrency if a user opens several pages at once, may be restarted later
|
||||
}
|
||||
}
|
||||
|
||||
@@ -560,7 +597,7 @@ function set_session($key, $val) {
|
||||
*/
|
||||
function auth_url($vendor, $server, $username, $db = null) {
|
||||
global $drivers;
|
||||
preg_match('~([^?]*)\\??(.*)~', remove_from_uri(implode("|", array_keys($drivers)) . "|username|" . ($db !== null ? "db|" : "") . session_name()), $match);
|
||||
preg_match('~([^?]*)\??(.*)~', remove_from_uri(implode("|", array_keys($drivers)) . "|username|" . ($db !== null ? "db|" : "") . session_name()), $match);
|
||||
return "$match[1]?"
|
||||
. (sid() ? SID . "&" : "")
|
||||
. ($vendor != "server" || $server != "" ? urlencode($vendor) . "=" . urlencode($server) . "&" : "")
|
||||
@@ -615,7 +652,7 @@ function query_redirect($query, $location, $message, $redirect = true, $execute
|
||||
}
|
||||
$sql = "";
|
||||
if ($query) {
|
||||
$sql = $adminer->messageQuery($query, $time);
|
||||
$sql = $adminer->messageQuery($query, $time, $failed);
|
||||
}
|
||||
if ($failed) {
|
||||
$error = error() . $sql . script("messagesPrint();");
|
||||
@@ -720,7 +757,7 @@ function get_file($key, $decompress = false) {
|
||||
}
|
||||
$name = $file["name"][$key];
|
||||
$tmp_name = $file["tmp_name"][$key];
|
||||
$content = file_get_contents($decompress && preg_match('~\\.gz$~', $name)
|
||||
$content = file_get_contents($decompress && preg_match('~\.gz$~', $name)
|
||||
? "compress.zlib://$tmp_name"
|
||||
: $tmp_name
|
||||
); //! may not be reachable because of open_basedir
|
||||
@@ -765,7 +802,7 @@ function repeat_pattern($pattern, $length) {
|
||||
*/
|
||||
function is_utf8($val) {
|
||||
// don't print control chars except \t\r\n
|
||||
return (preg_match('~~u', $val) && !preg_match('~[\\0-\\x8\\xB\\xC\\xE-\\x1F]~', $val));
|
||||
return (preg_match('~~u', $val) && !preg_match('~[\0-\x8\xB\xC\xE-\x1F]~', $val));
|
||||
}
|
||||
|
||||
/** Shorten UTF-8 string
|
||||
@@ -786,7 +823,7 @@ function shorten_utf8($string, $length = 80, $suffix = "") {
|
||||
* @return string
|
||||
*/
|
||||
function format_number($val) {
|
||||
return strtr(number_format($val, 0, ".", lang(',')), preg_split('~~u', lang('0123456789'), -1, PREG_SPLIT_NO_EMPTY));
|
||||
return strtr(number_format($val, 0, ".", lang(',')), preg_split('~~u', lang('0123456789'), -1, PREG_SPLIT_NO_EMPTY));
|
||||
}
|
||||
|
||||
/** Generate friendly URL
|
||||
@@ -801,9 +838,10 @@ function friendly_url($val) {
|
||||
/** Print hidden fields
|
||||
* @param array
|
||||
* @param array
|
||||
* @return null
|
||||
* @return bool
|
||||
*/
|
||||
function hidden_fields($process, $ignore = array()) {
|
||||
$return = false;
|
||||
while (list($key, $val) = each($process)) {
|
||||
if (!in_array($key, $ignore)) {
|
||||
if (is_array($val)) {
|
||||
@@ -811,10 +849,12 @@ function hidden_fields($process, $ignore = array()) {
|
||||
$process[$key . "[$k]"] = $v;
|
||||
}
|
||||
} else {
|
||||
$return = true;
|
||||
echo '<input type="hidden" name="' . h($key) . '" value="' . h($val) . '">';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Print hidden fields for GET forms
|
||||
@@ -878,7 +918,7 @@ function enum_input($type, $attrs, $field, $value, $empty = null) {
|
||||
* @return null
|
||||
*/
|
||||
function input($field, $value, $function) {
|
||||
global $connection, $types, $adminer, $jush;
|
||||
global $types, $adminer, $jush;
|
||||
$name = h(bracket_escape($field["field"]));
|
||||
echo "<td class='function'>";
|
||||
if (is_array($value) && !$function) {
|
||||
@@ -896,21 +936,21 @@ function input($field, $value, $function) {
|
||||
$functions = (isset($_GET["select"]) || $reset ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
|
||||
$attrs = " name='fields[$name]'";
|
||||
if ($field["type"] == "enum") {
|
||||
echo nbsp($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
|
||||
echo h($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
|
||||
} else {
|
||||
$has_function = (in_array($function, $functions) || isset($functions[$function]));
|
||||
echo (count($functions) > 1
|
||||
? "<select name='function[$name]'>" . optionlist($functions, $function === null || $has_function ? $function : "") . "</select>"
|
||||
. on_help("getTarget(event).value.replace(/^SQL\$/, '')", 1)
|
||||
. script("qsl('select').onchange = functionChange;", "")
|
||||
: nbsp(reset($functions))
|
||||
: h(reset($functions))
|
||||
) . '<td>';
|
||||
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
|
||||
if ($input != "") {
|
||||
echo $input;
|
||||
} elseif (preg_match('~bool~', $field["type"])) {
|
||||
echo "<input type='hidden'$attrs value='0'>" .
|
||||
"<input type='checkbox'" . (in_array(strtolower($value), array('1', 't', 'true', 'y', 'yes', 'on')) ? " checked='checked'" : "") . "$attrs value='1'>";
|
||||
"<input type='checkbox'" . (preg_match('~^(1|t|true|y|yes|on)$~i', $value) ? " checked='checked'" : "") . "$attrs value='1'>";
|
||||
} elseif ($field["type"] == "set") { //! 64 bits
|
||||
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
|
||||
foreach ($matches[1] as $i => $val) {
|
||||
@@ -932,13 +972,13 @@ function input($field, $value, $function) {
|
||||
echo "<textarea$attrs cols='50' rows='12' class='jush-js'>" . h($value) . '</textarea>';
|
||||
} else {
|
||||
// int(3) is only a display hint
|
||||
$maxlength = (!preg_match('~int~', $field["type"]) && preg_match('~^(\\d+)(,(\\d+))?$~', $field["length"], $match) ? ((preg_match("~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));
|
||||
if ($jush == 'sql' && $connection->server_info >= 5.6 && preg_match('~time~', $field["type"])) {
|
||||
$maxlength = (!preg_match('~int~', $field["type"]) && preg_match('~^(\d+)(,(\d+))?$~', $field["length"], $match) ? ((preg_match("~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));
|
||||
if ($jush == 'sql' && min_version(5.6) && preg_match('~time~', $field["type"])) {
|
||||
$maxlength += 7; // microtime
|
||||
}
|
||||
// type='date' and type='time' display localized value which may be confusing, type='datetime' uses 'T' as date and time separator
|
||||
echo "<input"
|
||||
. ((!$has_function || $function === "") && preg_match('~(?<!o)int~', $field["type"]) && !preg_match('~\[\]~', $field["full_type"]) ? " type='number'" : "")
|
||||
. ((!$has_function || $function === "") && preg_match('~(?<!o)int(?!er)~', $field["type"]) && !preg_match('~\[\]~', $field["full_type"]) ? " type='number'" : "")
|
||||
. " value='" . h($value) . "'" . ($maxlength ? " data-maxlength='$maxlength'" : "")
|
||||
. (preg_match('~char|binary~', $field["type"]) && $maxlength > 20 ? " size='40'" : "")
|
||||
. "$attrs>"
|
||||
@@ -964,7 +1004,7 @@ function input($field, $value, $function) {
|
||||
* @return string or false to leave the original value
|
||||
*/
|
||||
function process_input($field) {
|
||||
global $adminer;
|
||||
global $adminer, $driver;
|
||||
$idf = bracket_escape($field["field"]);
|
||||
$function = $_POST["function"][$idf];
|
||||
$value = $_POST["fields"][$idf];
|
||||
@@ -981,7 +1021,7 @@ function process_input($field) {
|
||||
return null;
|
||||
}
|
||||
if ($function == "orig") {
|
||||
return ($field["on_update"] == "CURRENT_TIMESTAMP" ? idf_escape($field["field"]) : false);
|
||||
return (preg_match('~^CURRENT_TIMESTAMP~i', $field["on_update"]) ? idf_escape($field["field"]) : false);
|
||||
}
|
||||
if ($function == "NULL") {
|
||||
return "NULL";
|
||||
@@ -1002,7 +1042,7 @@ function process_input($field) {
|
||||
if (!is_string($file)) {
|
||||
return false; //! report errors
|
||||
}
|
||||
return q($file);
|
||||
return $driver->quoteBinary($file);
|
||||
}
|
||||
return $adminer->processInput($field, $value, $function);
|
||||
}
|
||||
@@ -1040,23 +1080,19 @@ function fields_from_edit() {
|
||||
function search_tables() {
|
||||
global $adminer, $connection;
|
||||
$_GET["where"][0]["val"] = $_POST["query"];
|
||||
$found = false;
|
||||
$sep = "<ul>\n";
|
||||
foreach (table_status('', true) 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 || $result->fetch_row()) {
|
||||
if (!$found) {
|
||||
echo "<ul>\n";
|
||||
$found = true;
|
||||
}
|
||||
echo "<li>" . ($result
|
||||
? "<a href='" . h(ME . "select=" . urlencode($table) . "&where[0][op]=" . urlencode($_GET["where"][0]["op"]) . "&where[0][val]=" . urlencode($_GET["where"][0]["val"])) . "'>$name</a>\n"
|
||||
: "$name: <span class='error'>" . error() . "</span>\n");
|
||||
$print = "<a href='" . h(ME . "select=" . urlencode($table) . "&where[0][op]=" . urlencode($_GET["where"][0]["op"]) . "&where[0][val]=" . urlencode($_GET["where"][0]["val"])) . "'>$name</a>";
|
||||
echo "$sep<li>" . ($result ? $print : "<p class='error'>$print: " . error()) . "\n";
|
||||
$sep = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo ($found ? "</ul>" : "<p class='message'>" . lang('No tables.')) . "\n";
|
||||
echo ($sep ? "<p class='message'>" . lang('No tables.') : "</ul>") . "\n";
|
||||
}
|
||||
|
||||
/** Send headers for export
|
||||
@@ -1119,6 +1155,35 @@ function get_temp_dir() {
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Open and exclusively lock a file
|
||||
* @param string
|
||||
* @return resource or null for error
|
||||
*/
|
||||
function file_open_lock($filename) {
|
||||
$fp = @fopen($filename, "r+"); // @ - may not exist
|
||||
if (!$fp) { // c+ is available since PHP 5.2.6
|
||||
$fp = @fopen($filename, "w"); // @ - may not be writable
|
||||
if (!$fp) {
|
||||
return;
|
||||
}
|
||||
chmod($filename, 0660);
|
||||
}
|
||||
flock($fp, LOCK_EX);
|
||||
return $fp;
|
||||
}
|
||||
|
||||
/** Write and unlock a file
|
||||
* @param resource
|
||||
* @param string
|
||||
*/
|
||||
function file_write_unlock($fp, $data) {
|
||||
rewind($fp);
|
||||
fwrite($fp, $data);
|
||||
ftruncate($fp, strlen($data));
|
||||
flock($fp, LOCK_UN);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
/** Read password from file adminer.key in temporary directory or create one
|
||||
* @param bool
|
||||
* @return string or false if the file can not be created
|
||||
@@ -1154,7 +1219,7 @@ function rand_string() {
|
||||
* @return string HTML
|
||||
*/
|
||||
function select_value($val, $link, $field, $text_length) {
|
||||
global $adminer, $HTTPS;
|
||||
global $adminer;
|
||||
if (is_array($val)) {
|
||||
$return = "";
|
||||
foreach ($val as $k => $v) {
|
||||
@@ -1172,18 +1237,13 @@ function select_value($val, $link, $field, $text_length) {
|
||||
if (is_mail($val)) {
|
||||
$link = "mailto:$val";
|
||||
}
|
||||
if ($protocol = is_url($val)) {
|
||||
$link = (($protocol == "http" && $HTTPS) || preg_match('~WebKit|Firefox~i', $_SERVER["HTTP_USER_AGENT"]) // WebKit supports noreferrer since 2009, Firefox since version 38
|
||||
? $val // HTTP links from HTTPS pages don't receive Referer automatically
|
||||
: "https://www.adminer.org/redirect/?url=" . urlencode($val) // intermediate page to hide Referer
|
||||
);
|
||||
if (is_url($val)) {
|
||||
$link = $val; // IE 11 and all modern browsers hide referrer
|
||||
}
|
||||
}
|
||||
$return = $adminer->editVal($val, $field);
|
||||
if ($return !== null) {
|
||||
if ($return === "") { // === - may be int
|
||||
$return = " ";
|
||||
} elseif (!is_utf8($return)) {
|
||||
if (!is_utf8($return)) {
|
||||
$return = "\0"; // htmlspecialchars of binary data returns an empty string
|
||||
} elseif ($text_length != "" && is_shortable($field)) {
|
||||
$return = shorten_utf8($return, max(0, +$text_length)); // usage of LEFT() would reduce traffic but complicate query - expected average speedup: .001 s VS .01 s on local network
|
||||
@@ -1207,11 +1267,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
|
||||
return preg_match("~^(https?)://($domain?\\.)+$domain(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string); //! restrict path, query and fragment characters
|
||||
}
|
||||
|
||||
/** Check if field should be shortened
|
||||
@@ -1219,7 +1279,7 @@ function is_url($string) {
|
||||
* @return bool
|
||||
*/
|
||||
function is_shortable($field) {
|
||||
return preg_match('~char|text|lob|geometry|point|linestring|polygon|string|bytea~', $field["type"]);
|
||||
return preg_match('~char|text|json|lob|geometry|point|linestring|polygon|string|bytea~', $field["type"]);
|
||||
}
|
||||
|
||||
/** Get query to compute number of found rows
|
||||
@@ -1234,7 +1294,7 @@ function count_rows($table, $where, $is_group, $group) {
|
||||
$query = " FROM " . table($table) . ($where ? " WHERE " . implode(" AND ", $where) : "");
|
||||
return ($is_group && ($jush == "sql" || count($group) == 1)
|
||||
? "SELECT COUNT(DISTINCT " . implode(", ", $group) . ")$query"
|
||||
: "SELECT COUNT(*)" . ($is_group ? " FROM (SELECT 1$query$group_by) x" : $query)
|
||||
: "SELECT COUNT(*)" . ($is_group ? " FROM (SELECT 1$query GROUP BY " . implode(", ", $group) . ") x" : $query)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1243,16 +1303,17 @@ function count_rows($table, $where, $is_group, $group) {
|
||||
* @return array of strings
|
||||
*/
|
||||
function slow_query($query) {
|
||||
global $adminer, $token;
|
||||
global $adminer, $token, $driver;
|
||||
$db = $adminer->database();
|
||||
$timeout = $adminer->queryTimeout();
|
||||
if (support("kill") && is_object($connection2 = connect()) && ($db == "" || $connection2->select_db($db))) {
|
||||
$slow_query = $driver->slowQuery($query, $timeout);
|
||||
if (!$slow_query && support("kill") && is_object($connection2 = connect()) && ($db == "" || $connection2->select_db($db))) {
|
||||
$kill = $connection2->result(connection_id()); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL
|
||||
?>
|
||||
<script<?php echo nonce(); ?>>
|
||||
var timeout = setTimeout(function () {
|
||||
ajax('<?php echo js_escape(ME); ?>script=kill', function () {
|
||||
}, 'token=<?php echo $token; ?>&kill=<?php echo $kill; ?>');
|
||||
}, 'kill=<?php echo $kill; ?>&token=<?php echo $token; ?>');
|
||||
}, <?php echo 1000 * $timeout; ?>);
|
||||
</script>
|
||||
<?php
|
||||
@@ -1261,13 +1322,13 @@ var timeout = setTimeout(function () {
|
||||
}
|
||||
ob_flush();
|
||||
flush();
|
||||
$return = @get_key_vals($query, $connection2, $timeout); // @ - may be killed
|
||||
$return = @get_key_vals(($slow_query ? $slow_query : $query), $connection2, false); // @ - may be killed
|
||||
if ($connection2) {
|
||||
echo script("clearTimeout(timeout);");
|
||||
ob_flush();
|
||||
flush();
|
||||
}
|
||||
return array_keys($return);
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Generate BREACH resistant CSRF token
|
||||
@@ -1358,7 +1419,7 @@ function edit_form($TABLE, $fields, $row, $update) {
|
||||
if (!$fields) {
|
||||
echo "<p class='error'>" . lang('You have no privileges to update this table.') . "\n";
|
||||
} else {
|
||||
echo "<table cellspacing='0'>" . script("qsl('table').onkeydown = editingKeydown;");
|
||||
echo "<table cellspacing='0' class='layout'>" . script("qsl('table').onkeydown = editingKeydown;");
|
||||
|
||||
foreach ($fields as $name => $field) {
|
||||
echo "<tr><th>" . $adminer->fieldName($field);
|
||||
@@ -1384,12 +1445,12 @@ function edit_form($TABLE, $fields, $row, $update) {
|
||||
}
|
||||
$function = ($_POST["save"]
|
||||
? (string) $_POST["function"][$name]
|
||||
: ($update && $field["on_update"] == "CURRENT_TIMESTAMP"
|
||||
: ($update && preg_match('~^CURRENT_TIMESTAMP~i', $field["on_update"])
|
||||
? "now"
|
||||
: ($value === false ? null : ($value !== null ? '' : 'NULL'))
|
||||
)
|
||||
);
|
||||
if (preg_match("~time~", $field["type"]) && $value == "CURRENT_TIMESTAMP") {
|
||||
if (preg_match("~time~", $field["type"]) && preg_match('~^CURRENT_TIMESTAMP~i', $value)) {
|
||||
$value = "";
|
||||
$function = "now";
|
||||
}
|
||||
|
@@ -23,8 +23,10 @@ $langs = array(
|
||||
'id' => 'Bahasa Indonesia', // Ivan Lanin - http://ivan.lanin.org
|
||||
'it' => 'Italiano', // Alessandro Fiorotto, Paolo Asperti
|
||||
'ja' => '日本語', // Hitoshi Ozawa - http://sourceforge.jp/projects/oss-ja-jpn/releases/
|
||||
'ka' => 'ქართული', // Saba Khmaladze skhmaladze@uglt.org
|
||||
'ko' => '한국어', // dalli - skcha67@gmail.com
|
||||
'lt' => 'Lietuvių', // Paulius Leščinskas - http://www.lescinskas.lt
|
||||
'ms' => 'Bahasa Melayu', // Pisyek
|
||||
'nl' => 'Nederlands', // Maarten Balliauw - http://blog.maartenballiauw.be
|
||||
'no' => 'Norsk', // Iver Odin Kvello, mupublishing.com
|
||||
'pl' => 'Polski', // Radosław Kowalewski - http://srsbiz.pl/
|
||||
@@ -36,7 +38,7 @@ $langs = array(
|
||||
'sl' => 'Slovenski', // Matej Ferlan - www.itdinamik.com, matej.ferlan@itdinamik.com
|
||||
'sr' => 'Српски', // Nikola Radovanović - cobisimo@gmail.com
|
||||
'ta' => 'தமிழ்', // G. Sampath Kumar, Chennai, India, sampathkumar11@gmail.com
|
||||
'th' => 'ภาษาไทย', // Panya Saraphi, elect.tu@gmail.com - http://www.opencart2u.com/
|
||||
'th' => 'ภาษาไทย', // Panya Saraphi, elect.tu@gmail.com - http://www.opencart2u.com/
|
||||
'tr' => 'Türkçe', // Bilgehan Korkmaz - turktron.com
|
||||
'uk' => 'Українська', // Valerii Kryzhov
|
||||
'vi' => 'Tiếng Việt', // Giang Manh @ manhgd google mail
|
||||
|
@@ -12,9 +12,9 @@ if (extension_loaded('pdo')) {
|
||||
}
|
||||
}
|
||||
|
||||
function dsn($dsn, $username, $password) {
|
||||
function dsn($dsn, $username, $password, $options = array()) {
|
||||
try {
|
||||
parent::__construct($dsn, $username, $password);
|
||||
parent::__construct($dsn, $username, $password, $options);
|
||||
} catch (Exception $ex) {
|
||||
auth_error(h($ex->getMessage()));
|
||||
}
|
||||
@@ -29,6 +29,9 @@ if (extension_loaded('pdo')) {
|
||||
$this->error = "";
|
||||
if (!$result) {
|
||||
list(, $this->errno, $this->error) = $this->errorInfo();
|
||||
if (!$this->error) {
|
||||
$this->error = lang('Unknown error.');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
$this->store_result($result);
|
||||
|
@@ -1,2 +1,2 @@
|
||||
<?php
|
||||
$VERSION = "4.4.0";
|
||||
$VERSION = "4.7.0";
|
||||
|
@@ -2,10 +2,10 @@
|
||||
$TABLE = $_GET["indexes"];
|
||||
$index_types = array("PRIMARY", "UNIQUE", "INDEX");
|
||||
$table_status = table_status($TABLE, true);
|
||||
if (preg_match('~MyISAM|M?aria' . ($connection->server_info >= 5.6 ? '|InnoDB' : '') . '~i', $table_status["Engine"])) {
|
||||
if (preg_match('~MyISAM|M?aria' . (min_version(5.6, '10.0.5') ? '|InnoDB' : '') . '~i', $table_status["Engine"])) {
|
||||
$index_types[] = "FULLTEXT";
|
||||
}
|
||||
if (preg_match('~MyISAM|M?aria' . ($connection->server_info >= 5.7 ? '|InnoDB' : '') . '~i', $table_status["Engine"])) {
|
||||
if (preg_match('~MyISAM|M?aria' . (min_version(5.7, '10.2.2') ? '|InnoDB' : '') . '~i', $table_status["Engine"])) {
|
||||
$index_types[] = "SPATIAL";
|
||||
}
|
||||
$indexes = indexes($TABLE);
|
||||
@@ -94,12 +94,13 @@ if (!$row) {
|
||||
?>
|
||||
|
||||
<form action="" method="post">
|
||||
<div class="scrollable">
|
||||
<table cellspacing="0" class="nowrap">
|
||||
<thead><tr>
|
||||
<th id="label-type"><?php echo lang('Index Type'); ?>
|
||||
<th><input type="submit" class="wayoff"><?php echo lang('Column (length)'); ?>
|
||||
<th id="label-name"><?php echo lang('Name'); ?>
|
||||
<th><noscript><input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='<?php echo lang('Add next'); ?>'></noscript>
|
||||
<th><noscript><?php echo "<input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?></noscript>
|
||||
</thead>
|
||||
<?php
|
||||
if ($primary) {
|
||||
@@ -126,7 +127,7 @@ foreach ($row["indexes"] as $index) {
|
||||
"partial(" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . ", '" . js_escape($jush == "sql" ? "" : $_GET["indexes"] . "_") . "')"
|
||||
);
|
||||
echo ($jush == "sql" || $jush == "mssql" ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h($index["lengths"][$key]) . "' title='" . lang('Length') . "'>" : "");
|
||||
echo ($jush != "sql" ? checkbox("indexes[$j][descs][$i]", 1, $index["descs"][$key], lang('descending')) : "");
|
||||
echo (support("descidx") ? checkbox("indexes[$j][descs][$i]", 1, $index["descs"][$key], lang('descending')) : "");
|
||||
echo " </span>";
|
||||
$i++;
|
||||
}
|
||||
@@ -138,6 +139,7 @@ foreach ($row["indexes"] as $index) {
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<p>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
|
@@ -184,7 +184,7 @@ $translations = array(
|
||||
'Move to other database' => 'نقل إلى قاعدة بيانات أخرى',
|
||||
'Move' => 'نقل',
|
||||
'%d item(s) have been affected.' => 'عدد العناصر المعدلة هو %d.',
|
||||
'whole result' => 'نتيجة كاملة',
|
||||
'Whole result' => 'نتيجة كاملة',
|
||||
'Clone' => 'نسخ',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'لقد تجاوزت العدد الأقصى للحقول. يرجى الرفع من %s.',
|
||||
'Partition by' => 'مقسم بواسطة',
|
||||
|
@@ -12,7 +12,7 @@ $translations = array(
|
||||
'Logout successful.' => 'Излизането е успешно.',
|
||||
'Invalid credentials.' => 'Невалидни потребителски данни.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Прекалено много неуспешни опити за вход, опитайте пак след %d минута.', 'Прекалено много неуспешни опити за вход, опитайте пак след %d минути.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Главната парола вече е невалидна. <a href="https://www.adminer.org/en/extension/" target="_blank">Изберете</a> %s метод, за да я направите постоянна.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Главната парола вече е невалидна. <a href="https://www.adminer.org/en/extension/"%s>Изберете</a> %s метод, за да я направите постоянна.',
|
||||
'Language' => 'Език',
|
||||
'Invalid CSRF token. Send the form again.' => 'Невалиден шифроващ ключ. Попълнете и изпратете формуляра отново.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Ако не сте изпратили тази заявка през Adminer, затворете тази страница.',
|
||||
@@ -245,7 +245,7 @@ $translations = array(
|
||||
'last' => 'последен',
|
||||
'Load more data' => 'Зареждане на повече данни',
|
||||
'Loading' => 'Зареждане',
|
||||
'whole result' => 'пълен резултат',
|
||||
'Whole result' => 'Пълен резултат',
|
||||
'%d byte(s)' => array('%d байт', '%d байта'),
|
||||
|
||||
'Import' => 'Импорт',
|
||||
|
@@ -186,7 +186,7 @@ $translations = array(
|
||||
'original' => 'প্রকৃত',
|
||||
'Tables have been dropped.' => 'টেবিলসমূহ মুছে ফেলা হয়েছে।',
|
||||
'%d item(s) have been affected.' => '%d টি বিষয়বস্তু প্রভাবিত হয়েছে',
|
||||
'whole result' => 'সম্পূর্ণ ফলাফল',
|
||||
'Whole result' => 'সম্পূর্ণ ফলাফল',
|
||||
'Clone' => 'ক্লোন',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'অনুমোদিত ফিল্ড এর সর্বাধিক সংখ্যা অতিক্রম করে গেছে। অনুগ্রহপূর্বক %s বৃদ্ধি করুন।',
|
||||
'Partition by' => 'পার্টিশন যার মাধ্যমে',
|
||||
|
@@ -234,7 +234,7 @@ $translations = array(
|
||||
'last' => 'poslijednja',
|
||||
'Loading' => 'Učitavam',
|
||||
'Load more data' => 'Učitavam još podataka',
|
||||
'whole result' => 'ceo rezultat',
|
||||
'Whole result' => 'Ceo rezultat',
|
||||
'%d byte(s)' => array('%d bajt', '%d bajta', '%d bajtova'),
|
||||
|
||||
'Import' => 'Uvoz',
|
||||
|
@@ -185,7 +185,7 @@ $translations = array(
|
||||
'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',
|
||||
'Whole result' => 'Tots els resultats',
|
||||
'Tables have been dropped.' => 'S\'han suprimit les taules.',
|
||||
'Clone' => 'Clona',
|
||||
'Partition by' => 'Fes particions segons',
|
||||
|
@@ -10,19 +10,23 @@ $translations = array(
|
||||
'Logout' => 'Odhlásit',
|
||||
'Logged as: %s' => 'Přihlášen jako: %s',
|
||||
'Logout successful.' => 'Odhlášení proběhlo v pořádku.',
|
||||
'Thanks for using Adminer, consider <a href="%s">donating</a>.' => 'Díky za použití Admineru, zvažte <a href="%s">příspěvek</a>.',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Díky za použití Admineru, <a href="https://www.adminer.org/cs/donation/">přispějte</a> na vývoj.',
|
||||
'Invalid credentials.' => 'Neplatné přihlašovací údaje.',
|
||||
'<a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to use SQLite.' => 'Pro přihlášení k SQLite <a href="https://www.adminer.org/cs/extension/" target="_blank">implementujte</a> metodu %s.',
|
||||
'There is a space in the input password which might be the cause.' => 'Problém může být, že je v zadaném hesle mezera.',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer nepodporuje přístup k databázi bez hesla, <a href="https://www.adminer.org/cs/password/"%s>více informací</a>.',
|
||||
'Database does not support password.' => 'Databáze nepodporuje heslo.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minutu.', 'Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minuty.', 'Příliš mnoho pokusů o přihlášení, zkuste to znovu za %d minut.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Platnost hlavního hesla vypršela. <a href="https://www.adminer.org/cs/extension/" target="_blank">Implementujte</a> metodu %s, aby platilo stále.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Platnost hlavního hesla vypršela. <a href="https://www.adminer.org/cs/extension/"%s>Implementujte</a> metodu %s, aby platilo stále.',
|
||||
'Language' => 'Jazyk',
|
||||
'Invalid CSRF token. Send the form again.' => 'Neplatný token CSRF. Odešlete formulář znovu.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Pokud jste tento požadavek neposlali z Adminera, tak tuto stránku zavřete.',
|
||||
'No extension' => 'Žádné rozšíření',
|
||||
'None of the supported PHP extensions (%s) are available.' => 'Není dostupné žádné z podporovaných PHP rozšíření (%s).',
|
||||
'Connecting to privileged ports is not allowed.' => 'Připojování k privilegovaným portům není povoleno.',
|
||||
'Disable %s or enable %s or %s extensions.' => 'Zakažte %s nebo povolte extenze %s nebo %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.',
|
||||
'The action will be performed after successful login with the same credentials.' => 'Akce bude provedena po úspěšném přihlášení se stejnými přihlašovacími údaji.',
|
||||
'%s version: %s through PHP extension %s' => 'Verze %s: %s přes PHP rozšíření %s',
|
||||
'Refresh' => 'Obnovit',
|
||||
|
||||
@@ -52,6 +56,8 @@ $translations = array(
|
||||
'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',
|
||||
'Unknown error.' => 'Neznámá chyba.',
|
||||
'Warnings' => 'Varování',
|
||||
'ATTACH queries are not supported.' => 'Dotazy ATTACH nejsou podporované.',
|
||||
'Execute' => 'Provést',
|
||||
'Stop on error' => 'Zastavit při chybě',
|
||||
@@ -83,6 +89,7 @@ $translations = array(
|
||||
|
||||
'Database' => 'Databáze',
|
||||
'database' => 'databáze',
|
||||
'DB' => 'DB',
|
||||
'Use' => 'Vybrat',
|
||||
'Select database' => 'Vybrat databázi',
|
||||
'Invalid database.' => 'Nesprávná databáze.',
|
||||
@@ -171,6 +178,7 @@ $translations = array(
|
||||
'Default value' => 'Výchozí hodnota',
|
||||
'Default values' => 'Výchozí hodnoty',
|
||||
'Drop' => 'Odstranit',
|
||||
'Drop %s?' => 'Odstranit %s?',
|
||||
'Are you sure?' => 'Opravdu?',
|
||||
'Size' => 'Velikost',
|
||||
'Compute' => 'Spočítat',
|
||||
@@ -249,7 +257,7 @@ $translations = array(
|
||||
'last' => 'poslední',
|
||||
'Load more data' => 'Nahrát další data',
|
||||
'Loading' => 'Nahrává se',
|
||||
'whole result' => 'celý výsledek',
|
||||
'Whole result' => 'Celý výsledek',
|
||||
'%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtů'),
|
||||
|
||||
'Import' => 'Import',
|
||||
|
@@ -10,7 +10,7 @@ $translations = array(
|
||||
'Logged as: %s' => 'Logget ind som: %s',
|
||||
'Logout successful.' => 'Log af vellykket.',
|
||||
'Invalid credentials.' => 'Ugyldige log ind oplysninger.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Master-kodeordet er udløbet. <a href="https://www.adminer.org/en/extension/" target="_blank">Implementer</a> en metode for %s for at gøre det permanent.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Master-kodeordet er udløbet. <a href="https://www.adminer.org/en/extension/"%s>Implementer</a> en metode for %s for at gøre det permanent.',
|
||||
'Language' => 'Sprog',
|
||||
'Invalid CSRF token. Send the form again.' => 'Ugyldigt CSRF-token - Genindsend formen.',
|
||||
'No extension' => 'Ingen udvidelse',
|
||||
@@ -212,7 +212,7 @@ $translations = array(
|
||||
'last' => 'sidste',
|
||||
'Load more data' => 'Indlæs mere data',
|
||||
'Loading' => 'Indlæser',
|
||||
'whole result' => 'hele resultatet',
|
||||
'Whole result' => 'Hele resultatet',
|
||||
'%d byte(s)' => array('%d byte', '%d bytes'),
|
||||
'Import' => 'Importer',
|
||||
'%d row(s) have been imported.' => array('%d række er importeret.', '%d rækker er importeret.'),
|
||||
|
@@ -186,7 +186,7 @@ $translations = array(
|
||||
'original' => 'Original',
|
||||
'Tables have been dropped.' => 'Tabellen wurden entfernt (drop).',
|
||||
'%d item(s) have been affected.' => '%d Artikel betroffen.',
|
||||
'whole result' => 'Gesamtergebnis',
|
||||
'Whole result' => 'Gesamtergebnis',
|
||||
'Clone' => 'Klonen',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Die maximal erlaubte Anzahl der Felder ist überschritten. Bitte %s erhöhen.',
|
||||
'Partition by' => 'Partitionieren um',
|
||||
@@ -283,6 +283,6 @@ $translations = array(
|
||||
'Saving' => 'Speichere',
|
||||
'yes' => 'ja',
|
||||
'no' => 'nein',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Das Master-Passwort ist abgelaufen. <a href="https://www.adminer.org/de/extension/" target="_blank">Implementieren</a> Sie die %s Methode, um es permanent zu machen.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Das Master-Passwort ist abgelaufen. <a href="https://www.adminer.org/de/extension/"%s>Implementieren</a> Sie die %s Methode, um es permanent zu machen.',
|
||||
'%d / ' => '%d / ',
|
||||
);
|
||||
|
@@ -12,7 +12,7 @@ $translations = array(
|
||||
'Logout successful.' => 'Αποσυνδεθήκατε με επιτυχία.',
|
||||
'Invalid credentials.' => 'Εσφαλμένα Διαπιστευτήρια.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Επανηλημμένες ανεπιτυχείς προσπάθειες σύνδεσης, δοκιμάστε ξανά σε %s λεπτό.', 'Επανηλημμένες ανεπιτυχείς προσπάθειες σύνδεσης, δοκιμάστε ξανά σε %s λεπτά.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Έλειξε ο Κύριος Κωδικός. <a href="https://www.adminer.org/en/extension/" target="_blank">Ενεργοποιήστε</a> τη μέθοδο %s για να τον κάνετε μόνιμο.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Έλειξε ο Κύριος Κωδικός. <a href="https://www.adminer.org/en/extension/"%s>Ενεργοποιήστε</a> τη μέθοδο %s για να τον κάνετε μόνιμο.',
|
||||
'Language' => 'Γλώσσα',
|
||||
'Invalid CSRF token. Send the form again.' => 'Άκυρο κουπόνι CSRF. Στείλτε τη φόρμα ξανά.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Αν δε στείλατε αυτό το αίτημα από το Adminer, τότε κλείστε αυτή τη σελίδα.',
|
||||
@@ -149,7 +149,7 @@ $translations = array(
|
||||
'Table' => 'Πίνακας',
|
||||
'No tables.' => 'Χωρίς πίνακες.',
|
||||
'Alter table' => 'Τροποποίηση πίνακα',
|
||||
'Create table' => 'Δημιουργία πίνακα',
|
||||
'Create table' => 'Δημιουργία πίνακα',
|
||||
'Table has been dropped.' => 'Ο πίνακας διαγράφηκε.',
|
||||
'Tables have been dropped.' => 'Οι πινακες διαγράφηκαν.',
|
||||
'Tables have been optimized.' => 'Οι πίνακες βελτιστοποιήθηκαν.',
|
||||
@@ -246,7 +246,7 @@ $translations = array(
|
||||
'last' => 'τελευταία',
|
||||
'Load more data' => 'Φόρτωση κι άλλων δεδομένων',
|
||||
'Loading' => 'Φορτώνει',
|
||||
'whole result' => 'όλο το αποτέλεσμα',
|
||||
'Whole result' => 'Όλο το αποτέλεσμα',
|
||||
'%d byte(s)' => array('%d byte', '%d bytes'),
|
||||
|
||||
'Import' => 'Εισαγωγή',
|
||||
|
@@ -186,7 +186,7 @@ $translations = array(
|
||||
'original' => 'original',
|
||||
'Tables have been dropped.' => 'Tablas eliminadas.',
|
||||
'%d item(s) have been affected.' => array('%d elemento afectado.', '%d elementos afectados.'),
|
||||
'whole result' => 'resultado completo',
|
||||
'Whole result' => 'Resultado completo',
|
||||
'Clone' => 'Clonar',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Excedida la cantidad máxima de campos permitidos. Por favor aumente %s.',
|
||||
'Partition by' => 'Particionar por',
|
||||
|
@@ -186,7 +186,7 @@ $translations = array(
|
||||
'Move to other database' => 'Liiguta teise andmebaasi',
|
||||
'Move' => 'Liiguta',
|
||||
'%d item(s) have been affected.' => 'Mõjutatud kirjeid: %d.',
|
||||
'whole result' => 'Täielikud tulemused',
|
||||
'Whole result' => 'Täielikud tulemused',
|
||||
'Clone' => 'Kloon',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Maksimaalne väljade arv ületatud. Palun suurendage %s.',
|
||||
'Partition by' => 'Partitsiooni',
|
||||
|
@@ -12,7 +12,7 @@ $translations = array(
|
||||
'Logout successful.' => 'با موفقیت خارج شدید.',
|
||||
'Invalid credentials.' => 'اعتبار سنجی نامعتبر.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('ورودهای ناموفق بیش از حد، %d دقیقه دیگر تلاش نمایید.', 'ورودهای ناموفق بیش از حد، %d دقیقه دیگر تلاش نمایید.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'رمز اصلی باطل شده است. روش %s را <a href="https://www.adminer.org/en/extension/" target="_blank">پیاده سازی</a> کرده تا آن را دائمی سازید.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'رمز اصلی باطل شده است. روش %s را <a href="https://www.adminer.org/en/extension/"%s>پیاده سازی</a> کرده تا آن را دائمی سازید.',
|
||||
'Language' => 'زبان',
|
||||
'Invalid CSRF token. Send the form again.' => 'CSRF token نامعتبر است. دوباره سعی کنید.',
|
||||
'No extension' => 'پسوند نامعتبر',
|
||||
@@ -244,7 +244,7 @@ $translations = array(
|
||||
'last' => 'آخری',
|
||||
'Load more data' => 'بارگزاری اطلاعات بیشتر',
|
||||
'Loading' => 'در حال بارگزاری',
|
||||
'whole result' => 'همه نتایج',
|
||||
'Whole result' => 'همه نتایج',
|
||||
'%d byte(s)' => array('%d بایت', '%d بایت'),
|
||||
|
||||
'Import' => 'وارد کردن',
|
||||
|
@@ -12,7 +12,7 @@ $translations = array(
|
||||
'Logout successful.' => 'Uloskirjautuminen onnistui.',
|
||||
'Invalid credentials.' => 'Virheelliset kirjautumistiedot.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Liian monta epäonnistunutta sisäänkirjautumisyritystä, kokeile uudestaan %d minuutin kuluttua.', 'Liian monta epäonnistunutta sisäänkirjautumisyritystä, kokeile uudestaan %d minuutin kuluttua.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Master-salasana ei ole enää voimassa. <a href="https://www.adminer.org/en/extension/" target="_blank">Toteuta</a> %s-metodi sen tekemiseksi pysyväksi.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Master-salasana ei ole enää voimassa. <a href="https://www.adminer.org/en/extension/"%s>Toteuta</a> %s-metodi sen tekemiseksi pysyväksi.',
|
||||
'Language' => 'Kieli',
|
||||
'Invalid CSRF token. Send the form again.' => 'Virheellinen CSRF-vastamerkki. Lähetä lomake uudelleen.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Jollet lähettänyt tämä pyyntö Adminerista, sulje tämä sivu.',
|
||||
@@ -246,7 +246,7 @@ $translations = array(
|
||||
'last' => 'viimeinen',
|
||||
'Load more data' => 'Lataa lisää dataa',
|
||||
'Loading' => 'Ladataan',
|
||||
'whole result' => 'koko tulos',
|
||||
'Whole result' => 'Koko tulos',
|
||||
'%d byte(s)' => array('%d tavu', '%d tavua'),
|
||||
|
||||
'Import' => 'Tuonti',
|
||||
|
@@ -184,7 +184,7 @@ $translations = array(
|
||||
'Move to other database' => 'Déplacer vers 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.'),
|
||||
'whole result' => 'résultat entier',
|
||||
'Whole result' => 'Résultat entier',
|
||||
'Clone' => 'Cloner',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Le nombre maximum de champs est dépassé. Veuillez augmenter %s.',
|
||||
'Partition by' => 'Partitionner par',
|
||||
@@ -274,7 +274,7 @@ $translations = array(
|
||||
'File must be in UTF-8 encoding.' => 'Les fichiers doivent être encodés en UTF-8.',
|
||||
'Full table scan' => 'Scan de toute la table',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Trop de connexions échouées, essayez à nouveau dans %d minute.', 'Trop de connexions échouées, essayez à nouveau dans %d minutes.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Le mot de passe a expiré. <a href="https://www.adminer.org/en/extension/" target="_blank">Implémentez</a> la méthode %s afin de le rendre permanent.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Le mot de passe a expiré. <a href="https://www.adminer.org/en/extension/"%s>Implémentez</a> la méthode %s afin de le rendre permanent.',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'Vous pouvez uploader un gros fichier SQL par FTP et ensuite l\'importer depuis le serveur.',
|
||||
'Size' => 'Taille',
|
||||
'Compute' => 'Calcul',
|
||||
|
@@ -186,7 +186,7 @@ $translations = array(
|
||||
'original' => 'orixinal',
|
||||
'Tables have been dropped.' => 'Elimináronse as táboas.',
|
||||
'%d item(s) have been affected.' => array('%d elemento afectado.', '%d elementos afectados.'),
|
||||
'whole result' => 'resultado completo',
|
||||
'Whole result' => 'Resultado completo',
|
||||
'Clone' => 'Clonar',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Excedida o número máximo de campos permitidos. Por favor aumente %s.',
|
||||
'Partition by' => 'Particionar por',
|
||||
@@ -278,7 +278,7 @@ $translations = array(
|
||||
'Default value' => 'Valor por defecto',
|
||||
'Full table scan' => 'Escaneo completo da táboa',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Demasiados intentos de conexión, intentao de novo en %d minuto', 'Demasiados intentos de conexión, intentao de novo en %d minutos'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'O contrasinal principal caducou. <a href="https://www.adminer.org/en/extension/" target="_blank">Implementa</a> o método %s para facelo permanente.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'O contrasinal principal caducou. <a href="https://www.adminer.org/en/extension/"%s>Implementa</a> o método %s para facelo permanente.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Se non enviaches esta petición dende o Adminer entón pecha esta páxina',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'Podes subir un ficheiro SQL de gran tamaño vía FTP e importalo dende o servidor',
|
||||
'Size' => 'Tamaño',
|
||||
|
@@ -184,7 +184,7 @@ $translations = array(
|
||||
'Move to other database' => 'העבר למסד נתונים אחר',
|
||||
'Move' => 'העבר',
|
||||
'%d item(s) have been affected.' => '%d פריטים הושפעו',
|
||||
'whole result' => 'כל התוצאות',
|
||||
'Whole result' => 'כל התוצאות',
|
||||
'Clone' => 'שכפל',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'הגעת למספר השדות המרבי. בבקשה הגדל את %s',
|
||||
'Partition by' => 'מחיצות ע"י',
|
||||
@@ -276,12 +276,11 @@ $translations = array(
|
||||
'ATTACH queries are not supported.' => 'שאילתת ATTACH אינה נתמכת',
|
||||
'%d / ' => '%d / ',
|
||||
'Limit rows' => 'הגבל שורות',
|
||||
'<a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to use SQLite.' => '<a href="https://www.adminer.org/en/extension/" target="_blank">התקן</a> את תוסף SQLite בשביל להתחבר',
|
||||
'Default value' => 'ערך ברירת מחדל',
|
||||
'Full table scan' => 'סריקה טבלה מלאה',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => 'יותר מידי נסיונות כניסה נכשלו, אנא נסה עוד %d דקות',
|
||||
'Thanks for using Adminer, consider <a href="%s">donating</a>.' => 'תודה שהשתמש ב-adminer אנא שקול <a href="%s">לתרום</a>.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'סיסמת המאסטר פגה <a href="https://www.adminer.org/en/extension/" target="_blank">התקן תוסף</a> על מנת להפוך את זה לתמידי',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'תודה שהשתמש ב-adminer אנא שקול <a href="https://www.adminer.org/en/donation/">לתרום</a>.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'סיסמת המאסטר פגה <a href="https://www.adminer.org/en/extension/"%s>התקן תוסף</a> על מנת להפוך את זה לתמידי',
|
||||
'If you did not send this request from Adminer then close this page.' => 'אם לא אתה שלחת בקשה ל-Adminer הינך יכול לסגור חלון זה',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'ניתן לעלות קבצים ב-FTP ואז למשוך אותם מהשרת',
|
||||
'Size' => 'גודל',
|
||||
|
@@ -185,7 +185,7 @@ $translations = array(
|
||||
'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',
|
||||
'Whole result' => 'Összes eredményt mutatása',
|
||||
'Tables have been dropped.' => 'Táblák eldobva.',
|
||||
'Clone' => 'Klónoz',
|
||||
'Partition by' => 'Particionálás ezzel',
|
||||
|
@@ -231,7 +231,7 @@ $translations = array(
|
||||
'%d row(s)' => '%d baris',
|
||||
'Page' => 'Halaman',
|
||||
'last' => 'terakhir',
|
||||
'whole result' => 'Seluruh hasil',
|
||||
'Whole result' => 'Seluruh hasil',
|
||||
'%d byte(s)' => '%d bita',
|
||||
|
||||
'Import' => 'Impor',
|
||||
|
@@ -186,7 +186,7 @@ $translations = array(
|
||||
'Move to other database' => 'Sposta in altro database',
|
||||
'Move' => 'Sposta',
|
||||
'%d item(s) have been affected.' => array('Il risultato consiste in %d elemento.', 'Il risultato consiste in %d elementi.'),
|
||||
'whole result' => 'intero risultato',
|
||||
'Whole result' => 'Intero risultato',
|
||||
'Clone' => 'Clona',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Troppi campi. Per favore aumentare %s.',
|
||||
'Partition by' => 'Partiziona per',
|
||||
|
@@ -184,7 +184,7 @@ $translations = array(
|
||||
'Save and continue edit' => '保存して継続',
|
||||
'original' => '元',
|
||||
'%d item(s) have been affected.' => '%d を更新しました',
|
||||
'whole result' => '全結果',
|
||||
'Whole result' => '全結果',
|
||||
'Tables have been dropped.' => 'テーブルを削除しました',
|
||||
'Clone' => 'クローン',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => '定義可能な最大フィールド数を越えました。%s を増やしてください。',
|
||||
|
303
adminer/lang/ka.inc.php
Normal file
303
adminer/lang/ka.inc.php
Normal file
@@ -0,0 +1,303 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
'Login' => 'შესვლა',
|
||||
'Logout successful.' => 'გამოხვედით სისტემიდან.',
|
||||
'Invalid credentials.' => 'არასწორი მომხმარებელი ან პაროლი.',
|
||||
'Server' => 'სერვერი',
|
||||
'Username' => 'მომხმარებელი',
|
||||
'Password' => 'პაროლი',
|
||||
'Select database' => 'ბაზა',
|
||||
'Invalid 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-ბრძანება',
|
||||
'Logout' => 'გასვლა',
|
||||
'database' => 'ბაზა',
|
||||
'Use' => 'არჩევა',
|
||||
'No tables.' => 'ბაზაში ცხრილი არაა.',
|
||||
'select' => 'არჩევა',
|
||||
'Item has been deleted.' => 'ჩანაწერი წაიშალა.',
|
||||
'Item has been updated.' => 'ჩანაწერი განახლდა.',
|
||||
'Item%s has been inserted.' => 'ჩანაწერი%s ჩაჯდა.',
|
||||
'Edit' => 'შეცვლა',
|
||||
'Insert' => 'ჩასმა',
|
||||
'Save and insert next' => 'შენახვა და სხვის ჩასმა',
|
||||
'Delete' => 'წაშლა',
|
||||
'Database' => 'ბაზა',
|
||||
'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-ტოკენი. ფორმის კიდევ ერთხელ გაგზავნა.',
|
||||
'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.' => 'არც ერთი მხარდაჭერილი გაფართოება არ მოიძებნა (%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' => 'გარე გასაღები',
|
||||
'Change' => 'შეცვლა',
|
||||
'Source' => 'წყარო',
|
||||
'Target' => 'სამიზნე',
|
||||
'Add column' => 'ველის დამატება',
|
||||
'Alter' => 'შეცვლა',
|
||||
'Add foreign key' => 'გარე გასაღები დამატება',
|
||||
'ON DELETE' => 'წაშლისას',
|
||||
'ON UPDATE' => 'განახლებისას',
|
||||
'Index Type' => 'ინდექსის სახეობა',
|
||||
'Column (length)' => 'ველი (სიგრძე)',
|
||||
'View has been dropped.' => 'წარმოდგენა წაიშალა.',
|
||||
'View has been altered.' => 'წარმოდგენა შეიცვალა.',
|
||||
'View has been created.' => 'წარმოდგენა შეიქმნა.',
|
||||
'Alter view' => 'წარმოდგენის შეცვლა',
|
||||
'Create view' => 'წარმოდგენის შექმნა',
|
||||
'Name' => 'სახელი',
|
||||
'Process list' => 'პროცესების სია',
|
||||
'%d process(es) 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' => 'ღონისძიება',
|
||||
'%s version: %s through PHP extension %s' => 'ვერსია %s: %s PHP-გაფართოება %s',
|
||||
'%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' => 'დაშვება',
|
||||
'Revoke' => 'შეზღუდვა',
|
||||
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'POST ინფორმაცია ძალიან დიდია. შეამცირეთ ზომა ან გაზარდეს POST ინფორმაციის ზომა პარამეტრებიდან %s.',
|
||||
'Logged as: %s' => 'შესული ხართ როგორც: %s',
|
||||
'Move up' => 'ზემოთ ატანა',
|
||||
'Move down' => 'ქვემოთ ჩატანა',
|
||||
'Functions' => 'ფუნქციები',
|
||||
'Aggregation' => 'აგრეგაცია',
|
||||
'Export' => 'ექსპორტი',
|
||||
'Output' => 'გამომავალი ინფორმაცია',
|
||||
'open' => 'გახსნა',
|
||||
'save' => 'შენახვა',
|
||||
'Format' => 'ფორმატი',
|
||||
'Tables' => 'ცხრილები',
|
||||
'Data' => 'ინფორმაცია',
|
||||
'Event has been dropped.' => 'ღონისძიება წაიშალა.',
|
||||
'Event has been altered.' => 'ღონისძიება შეიცვალა.',
|
||||
'Event has been created.' => 'ღონისძიება შეიქმნა.',
|
||||
'Alter event' => 'ღონისძიების შეცვლა',
|
||||
'Create event' => 'ღონისძიების შექმნა',
|
||||
'At given time' => 'მოცემულ დროში',
|
||||
'Every' => 'ყოველ',
|
||||
'Events' => 'ღონისძიება',
|
||||
'Schedule' => 'განრიგი',
|
||||
'Start' => 'დასაწყისი',
|
||||
'End' => 'დასასრული',
|
||||
'Status' => 'მდგომარეობა',
|
||||
'On completion preserve' => 'შენახვა დასრულებისას',
|
||||
'Tables and views' => 'ცხრილები და წარმოდგენები',
|
||||
'Data Length' => 'ინფორმაციის მოცულობა',
|
||||
'Index Length' => 'ინდექსების მოცულობა',
|
||||
'Data Free' => 'თავისუფალი სივრცე',
|
||||
'Collation' => 'კოდირება',
|
||||
'Analyze' => 'ანალიზი',
|
||||
'Optimize' => 'ოპტიმიზაცია',
|
||||
'Check' => 'შემოწმება',
|
||||
'Repair' => 'გასწორება',
|
||||
'Truncate' => 'გასუფთავება',
|
||||
'Tables have been truncated.' => 'ცხრილი გასუფთავდა.',
|
||||
'Rows' => 'რიგი',
|
||||
',' => ' ',
|
||||
'0123456789' => '0123456789',
|
||||
'Tables have been moved.' => 'ცხრილი გადაადგილდა.',
|
||||
'Move to other database' => 'გადატანა სხვა ბაზაში',
|
||||
'Move' => 'გადატანა',
|
||||
'Engine' => 'ძრავი',
|
||||
'Save and continue edit' => 'შენახვა და ცვლილების გაგრძელება',
|
||||
'original' => 'საწყისი',
|
||||
'%d item(s) have been affected.' => 'შეიცვალა %d ჩანაწერი.',
|
||||
'Whole result' => 'სრული შედეგი',
|
||||
'Tables have been dropped.' => 'ცხრილები წაიშალა.',
|
||||
'Clone' => 'კლონირება',
|
||||
'Partition by' => 'დაყოფა',
|
||||
'Partitions' => 'დანაყოფები',
|
||||
'Partition name' => 'დანაყოფის სახელი',
|
||||
'Values' => 'პარამეტრები',
|
||||
'%d row(s) have been imported.' => 'დაიმპორტდა %d რიგი.',
|
||||
'Import' => 'იმპორტი',
|
||||
'Stop on error' => 'გაჩერება შეცდომისას',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'მიღწეულია დაშვებული ველების მაქსიმალური რაოდენობა, გაზარდეთ %s.',
|
||||
'anywhere' => 'ნებისმიერ ადგილას',
|
||||
'%.3f s' => '%.3f s',
|
||||
'$1-$3-$5' => '$5.$3.$1',
|
||||
'[yyyy]-mm-dd' => 'დდ.თთ.[წწწწ]',
|
||||
'History' => 'ისტორია',
|
||||
'Variables' => 'ცვლადები',
|
||||
'Relations' => 'ურთიერთობა',
|
||||
'Run file' => 'ფაილის გაშვება',
|
||||
'Clear' => 'გასუფთავება',
|
||||
'Maximum allowed file size is %sB.' => 'ფაილის მაქსიმალური ზომა - %sB.',
|
||||
'Numbers' => 'ციფრები',
|
||||
'Date and time' => 'დრო და თარიღი',
|
||||
'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.' => 'ბაზა წაიშალა.',
|
||||
'Search data in tables' => 'ცხრილებში ძებნა',
|
||||
'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.' => 'სახეობა შეიქმნა.',
|
||||
'Ctrl+click on a value to modify it.' => 'შესაცვლელად გამოიყენეთ Ctrl+თაგვის ღილაკი.',
|
||||
'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' => 'მხოლოდ შეცდომები',
|
||||
'Refresh' => 'განახლება',
|
||||
'Invalid schema.' => 'არასწორი სქემა.',
|
||||
'Please use one of the extensions %s.' => 'გამოიყენეთ ერთ-ერთი გაფართოება %s.',
|
||||
'now' => 'ახლა',
|
||||
'ltr' => 'ltr',
|
||||
'Tables have been copied.' => 'ცხრილი დაკოპირდა.',
|
||||
'Copy' => 'კოპირება',
|
||||
'Permanent link' => 'მუდმივი ბმული',
|
||||
'Edit all' => 'ყველას შეცვლა',
|
||||
'HH:MM:SS' => 'სთ:წთ:წმ',
|
||||
'Tables have been optimized.' => 'ცხრილებს გაუკეთდა ოპტიმიზაცია.',
|
||||
'Materialized view' => 'მატერიალური ხედი',
|
||||
'Vacuum' => 'ვაკუუმი',
|
||||
'Selected' => 'არჩეული',
|
||||
'File must be in UTF-8 encoding.' => 'ფაილი უნდა იყოს კოდირებაში UTF-8.',
|
||||
'Modify' => 'შეცვლა',
|
||||
'Loading' => 'ჩატვირთვა',
|
||||
'Load more data' => 'მეტი ინფორმაციის ჩატვირთვა',
|
||||
'ATTACH queries are not supported.' => 'ATTACH-მოთხოვნები არაა მხარდაჭერილი.',
|
||||
'%d / ' => '%d / ',
|
||||
'Limit rows' => 'რიგების შეზღუდვა',
|
||||
'Default value' => 'სტანდარტული მნიშვნელობა',
|
||||
'Full table scan' => 'სრული ცხრილის ანალიზი',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => 'ძალიან ბევრჯერ შეგეშალათ მომხმარებელი და პაროლი. სცადეთ %d წუთში.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'ძირითად პაროლს ვადა გაუვიდა. <a href="https://www.adminer.org/en/extension/"%s>გამოიყენეთ</a> მეთოდი %s, რათა ის მუდმივი გახადოთ.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'ეს მოთხოვნა თქვენ თუ არ გაგიგზავნაით Adminer-იდან, დახურეთ ეს ფანჯარა..',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'დიდი ფაილი უნდა ატვირტოთ FTP-თი და შემდეგ გაუკეთოთ იმპორტი სერვერიდან.',
|
||||
'Size' => 'ზომა',
|
||||
'Compute' => 'გამოთვლა',
|
||||
'You are offline.' => 'არ გაგივლიათ ავტორიზაცია.',
|
||||
'You have no privileges to update this table.' => 'ამ ცხრილის განახლების უფლება არ გაქვთ.',
|
||||
'Saving' => 'შენახვა',
|
||||
'yes' => 'კი',
|
||||
'no' => 'არა',
|
||||
'Routines' => 'რუტინები',
|
||||
'Target table' => 'მიზნობრივი ცხრილი',
|
||||
'Strings' => 'ველები',
|
||||
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'საწყისი და მიზნობრივი ველები უნდა იყოს ერთიდაიგივე სახეობის, მიზნობრივ ველზე უნდა იყოს ინდექსი და უნდა არსებობდეს შესაბამისი ინფორმაცია.',
|
||||
'Drop %s?' => 'წაიშალოს %s?',
|
||||
'Warnings' => 'გაფრთხილება',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'უპაროლო წვდომა ბაზასთან არაა დაშვებული Adminer-ში, მეტი ინფორმაციისთვის ეწვიეთ <a href="https://www.adminer.org/en/password/"%s>ბმულს</a>.',
|
||||
'DB' => 'ბაზა',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'მადლობას გიხდით Adminer-ით სარგებლობისთვის, გადახედეთ ბმულს <a href="https://www.adminer.org/en/donation/">შემოწირულობა</a>.',
|
||||
'The action will be performed after successful login with the same credentials.' => 'მოქმედება შესრულდება იგივე მომხმარებლით წარმატებული ავტორიზაციის შემდეგ.',
|
||||
'Connecting to privileged ports is not allowed.' => 'პრივილეგირებულ პორტთან წვდომა დაუშვებელია.',
|
||||
'There is a space in the input password which might be the cause.' => 'პაროლში არის გამოტოვება, შეიძლება ეს ქმნის პრობლემას.',
|
||||
'Unknown error.' => 'უცნობი შეცდომა.',
|
||||
'Database does not support password.' => 'ბაზაში არაა მხარდაჭერილი პაროლი.',
|
||||
'Disable %s or enable %s or %s extensions.' => 'გათიშეთ %s ან ჩართეთ %s ან %s გაფართოება.',
|
||||
);
|
@@ -184,7 +184,7 @@ $translations = array(
|
||||
'Save and continue edit' => '저장하고 계속',
|
||||
'original' => '원래',
|
||||
'%d item(s) have been affected.' => '%d를 갱신했습니다.',
|
||||
'whole result' => '모든 결과',
|
||||
'Whole result' => '모든 결과',
|
||||
'Tables have been dropped.' => '테이블을 삭제했습니다.',
|
||||
'Clone' => '복제',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => '정의 가능한 최대 필드 수를 초과했습니다. %s를 늘리십시오.',
|
||||
|
@@ -229,7 +229,7 @@ $translations = array(
|
||||
'%d row(s)' => array('%d įrašas', '%d įrašai', '%d įrašų'),
|
||||
'Page' => 'Puslapis',
|
||||
'last' => 'paskutinis',
|
||||
'whole result' => 'visas rezultatas',
|
||||
'Whole result' => 'Visas rezultatas',
|
||||
'%d byte(s)' => array('%d baitas', '%d baigai', '%d baitų'),
|
||||
|
||||
'Import' => 'Importas',
|
||||
|
340
adminer/lang/ms.inc.php
Normal file
340
adminer/lang/ms.inc.php
Normal file
@@ -0,0 +1,340 @@
|
||||
<?php
|
||||
$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Sistem',
|
||||
'Server' => 'Pelayan',
|
||||
'Username' => 'Nama pengguna',
|
||||
'Password' => 'Kata laluan',
|
||||
'Permanent login' => 'Log masuk kekal',
|
||||
'Login' => 'Log masuk',
|
||||
'Logout' => 'Log keluar',
|
||||
'Logged as: %s' => 'Log masuk sebagai: %s',
|
||||
'Logout successful.' => 'Log keluar berjaya.',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Terima kasih kerana menggunakan Adminer, pertimbangkan untuk <a href="https://www.adminer.org/en/donation/">menderma</a>.',
|
||||
'Invalid credentials.' => 'Akses tidak sah.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => 'Terlalu banyak percubaan log masuk yang gagal, sila cuba lagi dalam masa %d minit.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Kata laluan utama telah luput. <a href="https://www.adminer.org/en/extension/"%s>Gunakan</a> cara %s untuk mengekalkannya.',
|
||||
'Language' => 'Bahasa',
|
||||
'Invalid CSRF token. Send the form again.' => 'Token CSRF tidak sah. Sila hantar borang sekali lagi.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Jika anda tidak menghantar permintaan ini dari Adminer sila tutup halaman ini.',
|
||||
'No extension' => 'Tiada sambungan',
|
||||
'None of the supported PHP extensions (%s) are available.' => 'Sambungan PHP yang (%s) disokong tidak wujud.',
|
||||
'Connecting to privileged ports is not allowed.' => 'Penyambungan ke port yang istimewa tidak dibenarkan.',
|
||||
'Session support must be enabled.' => 'Sokongan sesi perlu diaktifkan.',
|
||||
'Session expired, please login again.' => 'Sesi telah luput, sila log masuk kembali.',
|
||||
'%s version: %s through PHP extension %s' => 'Versi %s: %s melalui sambungan PHP %s',
|
||||
'Refresh' => 'Segar kembali',
|
||||
|
||||
// text direction - 'ltr' or 'rtl'
|
||||
'ltr' => 'ltr',
|
||||
|
||||
'Privileges' => 'Keistimewaan',
|
||||
'Create user' => 'Bina pengguna',
|
||||
'User has been dropped.' => 'Pengguna telah dijatuhkan.',
|
||||
'User has been altered.' => 'Pengguna telah diubah.',
|
||||
'User has been created.' => 'Pengguna telah dibuat.',
|
||||
'Hashed' => 'Hashed',
|
||||
'Column' => 'Kolum',
|
||||
'Routine' => 'Rutin',
|
||||
'Grant' => 'Beri',
|
||||
'Revoke' => 'Batal',
|
||||
|
||||
'Process list' => 'Senarai proses',
|
||||
'%d process(es) have been killed.' => '%d proses telah dihentikan.',
|
||||
'Kill' => 'Henti',
|
||||
|
||||
'Variables' => 'Pembolehubah',
|
||||
'Status' => 'Status',
|
||||
|
||||
'SQL command' => 'Arahan SQL',
|
||||
'%d query(s) executed OK.' => '%d query berjaya dilaksanakan.',
|
||||
'Query executed OK, %d row(s) affected.' => 'Query berjaya dilaksanakan, %d baris terjejas.',
|
||||
'No commands to execute.' => 'Tiada arahan untuk dilaksanakan.',
|
||||
'Error in query' => 'Ralat pada query',
|
||||
'ATTACH queries are not supported.' => 'Query berikut tidak disokong.',
|
||||
'Execute' => 'Laksana',
|
||||
'Stop on error' => 'Berhenti jika ralat',
|
||||
'Show only errors' => 'Paparkan jika ralat',
|
||||
// sprintf() format for time of the command
|
||||
'%.3f s' => '%.3f s',
|
||||
'History' => 'Sejarah',
|
||||
'Clear' => 'Bersih',
|
||||
'Edit all' => 'Ubah semua',
|
||||
|
||||
'File upload' => 'Muat naik fail',
|
||||
'From server' => 'Dari pelayan',
|
||||
'Webserver file %s' => 'Fail pelayan sesawang %s',
|
||||
'Run file' => 'Jalankan fail',
|
||||
'File does not exist.' => 'Fail tidak wujud.',
|
||||
'File uploads are disabled.' => 'Muat naik fail dihalang.',
|
||||
'Unable to upload a file.' => 'Muat naik fail gagal.',
|
||||
'Maximum allowed file size is %sB.' => 'Saiz fail maksimum yang dibenarkan adalah %sB.',
|
||||
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Data POST terlalu besar. Kecilkan data atau tingkatkan tetapan %s.',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'Anda boleh muat naik fail SQL yang besar melalui FTP dan import melalui pelayan.',
|
||||
'You are offline.' => 'Anda sedang offline.',
|
||||
|
||||
'Export' => 'Eksport',
|
||||
'Output' => 'Pengeluaran',
|
||||
'open' => 'buka',
|
||||
'save' => 'simpan',
|
||||
'Saving' => 'Menyimpan',
|
||||
'Format' => 'Format',
|
||||
'Data' => 'Data',
|
||||
|
||||
'Database' => 'Pangkalan data',
|
||||
'database' => 'pangkalan data',
|
||||
'Use' => 'Guna',
|
||||
'Select database' => 'Pilih pangkalan data',
|
||||
'Invalid database.' => 'Pangkalan data tidak sah.',
|
||||
'Database has been dropped.' => 'Pangkalan data telah dijatuhkan.',
|
||||
'Databases have been dropped.' => 'Pangkalan data telah dijatuhkan.',
|
||||
'Database has been created.' => 'Pangkalan data telah dibuat.',
|
||||
'Database has been renamed.' => 'Pangkalan data telah ditukar nama.',
|
||||
'Database has been altered.' => 'Pangkalan data telah diubah.',
|
||||
'Alter database' => 'Ubah pangkalan data',
|
||||
'Create database' => 'Bina pangkalan data',
|
||||
'Database schema' => 'Skema pangkalan data',
|
||||
|
||||
// link to current database schema layout
|
||||
'Permanent link' => 'Pautan kekal',
|
||||
|
||||
// thousands separator - must contain single byte
|
||||
',' => ',',
|
||||
'0123456789' => '0123456789',
|
||||
'Engine' => 'Enjin',
|
||||
'Collation' => 'Collation',
|
||||
'Data Length' => 'Panjang Data',
|
||||
'Index Length' => 'Panjang Indeks',
|
||||
'Data Free' => 'Data Free',
|
||||
'Rows' => 'Baris',
|
||||
'%d in total' => '%d secara keseluruhan',
|
||||
'Analyze' => 'Menganalisis',
|
||||
'Optimize' => 'Mengoptimum',
|
||||
'Vacuum' => 'Vacuum',
|
||||
'Check' => 'Periksa',
|
||||
'Repair' => 'Baiki',
|
||||
'Truncate' => 'Memangkas',
|
||||
'Tables have been truncated.' => 'Jadual telah dimangkaskan.',
|
||||
'Move to other database' => 'Pindahkan ke pangkalan data yang lain',
|
||||
'Move' => 'Pindah',
|
||||
'Tables have been moved.' => 'Jadual telah dipindahkan.',
|
||||
'Copy' => 'Salin',
|
||||
'Tables have been copied.' => 'Jadual telah disalin.',
|
||||
|
||||
'Routines' => 'Rutin',
|
||||
'Routine has been called, %d row(s) affected.' => 'Rutin telah dipanggil, %d baris terjejas.',
|
||||
'Call' => 'Panggil',
|
||||
'Parameter name' => 'Nama pembolehubah',
|
||||
'Create procedure' => 'Bina prosedur',
|
||||
'Create function' => 'Bina fungsi',
|
||||
'Routine has been dropped.' => 'Rutin telah dijatuhkan.',
|
||||
'Routine has been altered.' => 'Rutin telah diubah.',
|
||||
'Routine has been created.' => 'Rutin telah dibuat.',
|
||||
'Alter function' => 'Ubah fungsi',
|
||||
'Alter procedure' => 'Ubah prosedur',
|
||||
'Return type' => 'Jenis Return',
|
||||
|
||||
'Events' => 'Peristiwa',
|
||||
'Event has been dropped.' => 'Peristiwa telah dijatuhkan.',
|
||||
'Event has been altered.' => 'Peristiwa telah diubah.',
|
||||
'Event has been created.' => 'Peristiwa telah dibuat.',
|
||||
'Alter event' => 'Ubah peristiwa',
|
||||
'Create event' => 'Bina peristiwa',
|
||||
'At given time' => 'Pada masa tersebut',
|
||||
'Every' => 'Setiap',
|
||||
'Schedule' => 'Jadual',
|
||||
'Start' => 'Mula',
|
||||
'End' => 'Habis',
|
||||
'On completion preserve' => 'Dalam melestarikan penyelesaian',
|
||||
|
||||
'Tables' => 'Jadual',
|
||||
'Tables and views' => 'Jadual dan pandangan',
|
||||
'Table' => 'Jadual',
|
||||
'No tables.' => 'Tiada jadual.',
|
||||
'Alter table' => 'Ubah jadual',
|
||||
'Create table' => 'Bina jadual',
|
||||
'Table has been dropped.' => 'Jadual telah dijatuhkan.',
|
||||
'Tables have been dropped.' => 'Jadual telah dijatuhkan.',
|
||||
'Tables have been optimized.' => 'Jadual telah dioptimumkan.',
|
||||
'Table has been altered.' => 'Jadual telah diubah.',
|
||||
'Table has been created.' => 'Jadual telah dibuat.',
|
||||
'Table name' => 'Nama jadual',
|
||||
'Show structure' => 'Paparkan struktur',
|
||||
'engine' => 'enjin',
|
||||
'collation' => 'collation',
|
||||
'Column name' => 'Nama kolum',
|
||||
'Type' => 'Jenis',
|
||||
'Length' => 'Kepanjangan',
|
||||
'Auto Increment' => 'Kenaikan Auto',
|
||||
'Options' => 'Pilihan',
|
||||
'Comment' => 'Komen',
|
||||
'Default value' => 'Nilai lalai',
|
||||
'Default values' => 'Nilai lalai',
|
||||
'Drop' => 'Jatuh',
|
||||
'Drop %s?' => 'Jatuhkan %s?',
|
||||
'Are you sure?' => 'Anda pasti?',
|
||||
'Size' => 'Saiz',
|
||||
'Compute' => 'Kira',
|
||||
'Move up' => 'Gerak ke atas',
|
||||
'Move down' => 'Gerak ke bawah',
|
||||
'Remove' => 'Buang',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Bilangan medan telah melebihi had yang dibenarkan. Sila tingkatkan %s.',
|
||||
|
||||
'Partition by' => 'Partition mengikut',
|
||||
'Partitions' => 'Partition',
|
||||
'Partition name' => 'Nama partition',
|
||||
'Values' => 'Nilai',
|
||||
|
||||
'View' => 'Papar',
|
||||
'Materialized view' => 'Paparan yang menjadi kenyataan',
|
||||
'View has been dropped.' => 'Paparan telah dijatuhkan.',
|
||||
'View has been altered.' => 'Paparan telah diubah.',
|
||||
'View has been created.' => 'Paparan telah dibuat.',
|
||||
'Alter view' => 'Ubah paparan',
|
||||
'Create view' => 'Bina paparan',
|
||||
|
||||
'Indexes' => 'Indeks',
|
||||
'Indexes have been altered.' => 'Indeks telah diubah.',
|
||||
'Alter indexes' => 'Ubah indeks',
|
||||
'Add next' => 'Tambah yang seterusnya',
|
||||
'Index Type' => 'Jenis Indeks',
|
||||
'Column (length)' => 'Kolum (kepanjangan)',
|
||||
|
||||
'Foreign keys' => 'Kunci asing',
|
||||
'Foreign key' => 'Kunci asing',
|
||||
'Foreign key has been dropped.' => 'Kunci asing telah dijatuhkan.',
|
||||
'Foreign key has been altered.' => 'Kunci asing telah diubah.',
|
||||
'Foreign key has been created.' => 'Kunci asing telah dibuat.',
|
||||
'Target table' => 'Jadual sasaran',
|
||||
'Change' => 'Tukar',
|
||||
'Source' => 'Sumber',
|
||||
'Target' => 'Sasaran',
|
||||
'Add column' => 'Tambah kolum',
|
||||
'Alter' => 'Ubah',
|
||||
'Add foreign key' => 'Tambah kunci asing',
|
||||
'ON DELETE' => 'ON DELETE',
|
||||
'ON UPDATE' => 'ON UPDATE',
|
||||
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Kolum sumber dan sasaran perlu mempunyai jenis data yang sama, indeks diperlukan pada kolum sasaran dan data yang dirujuk wujud.',
|
||||
|
||||
'Triggers' => ' Pencetus',
|
||||
'Add trigger' => 'Tambah pencetus',
|
||||
'Trigger has been dropped.' => 'Pencetus telah dijatuhkan.',
|
||||
'Trigger has been altered.' => 'Pencetus telah diubah.',
|
||||
'Trigger has been created.' => 'Pencetus telah dibuat.',
|
||||
'Alter trigger' => 'Ubah pencetus',
|
||||
'Create trigger' => 'Buat pencetus',
|
||||
'Time' => 'Masa',
|
||||
'Event' => 'Peristiwa',
|
||||
'Name' => 'Nama',
|
||||
|
||||
'select' => 'pilih',
|
||||
'Select' => 'Pilih',
|
||||
'Select data' => 'Pilih data',
|
||||
'Functions' => 'Fungsi',
|
||||
'Aggregation' => 'Pengagregatan',
|
||||
'Search' => 'Cari',
|
||||
'anywhere' => 'di mana-mana',
|
||||
'Search data in tables' => 'Cari data dalam jadual',
|
||||
'Sort' => 'Susun',
|
||||
'descending' => 'menurun',
|
||||
'Limit' => 'Had',
|
||||
'Limit rows' => 'Had baris',
|
||||
'Text length' => 'Kepanjangan teks',
|
||||
'Action' => 'Aksi',
|
||||
'Full table scan' => 'Imbasan penuh jadual',
|
||||
'Unable to select the table' => 'Pemilihan jadual tidak berjaya',
|
||||
'No rows.' => 'Tiada baris.',
|
||||
'%d / ' => '%d / ',
|
||||
'%d row(s)' => '%d baris',
|
||||
'Page' => 'Halaman',
|
||||
'last' => 'akhir',
|
||||
'Load more data' => 'Load lebih data',
|
||||
'Loading' => 'Loading',
|
||||
'Whole result' => 'Keputusan keseluruhan',
|
||||
'%d byte(s)' => array('%d byte', '%d bytes'),
|
||||
|
||||
'Import' => 'Import',
|
||||
'%d row(s) have been imported.' => '%d baris telah diimport.',
|
||||
'File must be in UTF-8 encoding.' => 'Fail mesti dalam pengekodan UTF-8.',
|
||||
|
||||
// in-place editing in select
|
||||
'Modify' => 'Pinda',
|
||||
'Ctrl+click on a value to modify it.' => 'Ctrl+click pada nilai untuk meminda.',
|
||||
'Use edit link to modify this value.' => 'Guna pautan ubah untuk meminda nilai ini.',
|
||||
|
||||
// %s can contain auto-increment value
|
||||
'Item%s has been inserted.' => 'Item%s telah dimasukkan.',
|
||||
'Item has been deleted.' => 'Item telah dipadamkan.',
|
||||
'Item has been updated.' => 'Item telah dikemaskini.',
|
||||
'%d item(s) have been affected.' => '%d item telah terjejas.',
|
||||
'New item' => 'Item baru',
|
||||
'original' => 'asli',
|
||||
// label for value '' in enum data type
|
||||
'empty' => 'kosong',
|
||||
'edit' => 'ubah',
|
||||
'Edit' => 'Ubah',
|
||||
'Insert' => 'Masukkan',
|
||||
'Save' => 'Simpan',
|
||||
'Save and continue edit' => 'Simpan dan sambung ubah',
|
||||
'Save and insert next' => 'Simpan dan masukkan seterusnya',
|
||||
'Selected' => 'Terpilih',
|
||||
'Clone' => 'Klon',
|
||||
'Delete' => 'Padam',
|
||||
'You have no privileges to update this table.' => 'Anda tidak mempunyai keistimewaan untuk mengemaskini jadual ini.',
|
||||
|
||||
'E-mail' => 'Emel',
|
||||
'From' => 'Dari',
|
||||
'Subject' => 'Subjek',
|
||||
'Attachments' => 'Lampiran',
|
||||
'Send' => 'Hantar',
|
||||
'%d e-mail(s) have been sent.' => '%d emel telah dihantar.',
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Nombor',
|
||||
'Date and time' => 'Tarikh dan masa',
|
||||
'Strings' => 'String',
|
||||
'Binary' => 'Binari',
|
||||
'Lists' => 'Senarai',
|
||||
'Network' => 'Rangkaian',
|
||||
'Geometry' => 'Geometri',
|
||||
'Relations' => 'Hubungan',
|
||||
|
||||
'Editor' => 'Editor',
|
||||
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
|
||||
'$1-$3-$5' => '$1-$3-$5',
|
||||
// hint for date format - use language equivalents for day, month and year shortcuts
|
||||
'[yyyy]-mm-dd' => '[yyyy]-mm-dd',
|
||||
// hint for time format - use language equivalents for hour, minute and second shortcuts
|
||||
'HH:MM:SS' => 'HH:MM:SS',
|
||||
'now' => 'sekarang',
|
||||
'yes' => 'ya',
|
||||
'no' => 'tidak',
|
||||
|
||||
// general SQLite error in create, drop or rename database
|
||||
'File exists.' => 'Fail wujud.',
|
||||
'Please use one of the extensions %s.' => 'Sila guna salah satu sambungan %s.',
|
||||
|
||||
// PostgreSQL and MS SQL schema support
|
||||
'Alter schema' => 'Ubah skema',
|
||||
'Create schema' => 'Buat skema',
|
||||
'Schema has been dropped.' => 'Skema telah dijatuhkan.',
|
||||
'Schema has been created.' => 'Skema telah dibuat.',
|
||||
'Schema has been altered.' => 'Skema telah diubah.',
|
||||
'Schema' => 'Skema',
|
||||
'Invalid schema.' => 'Skema tidak sah.',
|
||||
|
||||
// PostgreSQL sequences support
|
||||
'Sequences' => 'Turutan',
|
||||
'Create sequence' => 'Buat turutan',
|
||||
'Sequence has been dropped.' => 'Turutan telah dijatuhkan.',
|
||||
'Sequence has been created.' => 'Turutan telah dibuat.',
|
||||
'Sequence has been altered.' => 'Turutan telah diubah.',
|
||||
'Alter sequence' => 'Ubah turutan',
|
||||
|
||||
// PostgreSQL user types support
|
||||
'User types' => 'Jenis pengguna',
|
||||
'Create type' => 'Buat jenis',
|
||||
'Type has been dropped.' => 'Jenis telah dijatuhkan.',
|
||||
'Type has been created.' => 'Jenis telah dibuat.',
|
||||
'Alter type' => 'Ubah jenis',
|
||||
);
|
@@ -187,7 +187,7 @@ $translations = array(
|
||||
'Move to other database' => 'Verplaats naar andere database',
|
||||
'Move' => 'Verplaats',
|
||||
'%d item(s) have been affected.' => array('%d item aangepast.', '%d items aangepast.'),
|
||||
'whole result' => 'volledig resultaat',
|
||||
'Whole result' => 'Volledig resultaat',
|
||||
'Clone' => 'Dupliceer',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Maximum aantal velden bereikt. Verhoog %s.',
|
||||
'Partition by' => 'Partitioneren op',
|
||||
|
@@ -10,7 +10,7 @@ $translations = array(
|
||||
'Logged as: %s' => 'Logget inn som: %s',
|
||||
'Logout successful.' => 'Utlogging vellykket.',
|
||||
'Invalid credentials.' => 'Ugylding innloggingsinformasjon.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Master-passord er utløpt. <a href="https://www.adminer.org/en/extension/" target="_blank">Implementer</a> en metode for %s for å gjøre det permanent.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Master-passord er utløpt. <a href="https://www.adminer.org/en/extension/"%s>Implementer</a> en metode for %s for å gjøre det permanent.',
|
||||
'Language' => 'Språk',
|
||||
'Invalid CSRF token. Send the form again.' => 'Ugylding CSRF-token - Send inn skjemaet igjen.',
|
||||
'No extension' => 'Ingen utvidelse',
|
||||
@@ -212,7 +212,7 @@ $translations = array(
|
||||
'last' => 'siste',
|
||||
'Load more data' => 'Last mer data',
|
||||
'Loading' => 'Laster',
|
||||
'whole result' => 'hele resultatet',
|
||||
'Whole result' => 'Hele resultatet',
|
||||
'%d byte(s)' => array('%d byte', '%d bytes'),
|
||||
'Import' => 'Importer',
|
||||
'%d row(s) have been imported.' => array('%d rad er importert.', '%d rader er importert.'),
|
||||
|
@@ -10,14 +10,16 @@ $translations = array(
|
||||
'Logout' => 'Wyloguj',
|
||||
'Logged as: %s' => 'Zalogowany jako: %s',
|
||||
'Logout successful.' => 'Wylogowano pomyślnie.',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Dziękujemy za używanie Adminera, rozważ proszę <a href="https://www.adminer.org/pl/donation/">dotację</a>.',
|
||||
'Invalid credentials.' => 'Nieprawidłowe dane logowania.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Za dużo nieudanych prób logowania, spróbuj ponownie za %d minutę.', 'Za dużo nieudanych prób logowania, spróbuj ponownie za %d minuty.', 'Za dużo nieudanych prób logowania, spróbuj ponownie za %d minut.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Ważność hasła głównego wygasła. <a href="https://www.adminer.org/pl/extension/" target="_blank">Zaimplementuj</a> własną metodę %s, aby ustawić je na stałe.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Ważność hasła głównego wygasła. <a href="https://www.adminer.org/pl/extension/"%s>Zaimplementuj</a> własną metodę %s, aby ustawić je na stałe.',
|
||||
'Language' => 'Język',
|
||||
'Invalid CSRF token. Send the form again.' => 'Nieprawidłowy token CSRF. Spróbuj wysłać formularz ponownie.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Jeżeli nie wywołałeś tej strony z Adminera, zamknij to okno.',
|
||||
'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.',
|
||||
'Connecting to privileged ports is not allowed.' => 'Łączenie do portów uprzywilejowanych jest niedozwolone.',
|
||||
'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',
|
||||
@@ -49,6 +51,7 @@ $translations = array(
|
||||
'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',
|
||||
'ATTACH queries are not supported.' => 'Zapytania ATTACH są niewspierane.',
|
||||
'Execute' => 'Wykonaj',
|
||||
'Stop on error' => 'Zatrzymaj w przypadku błędu',
|
||||
'Show only errors' => 'Pokaż tylko błędy',
|
||||
@@ -167,6 +170,7 @@ $translations = array(
|
||||
'Default value' => 'Wartość domyślna',
|
||||
'Default values' => 'Wartości domyślne',
|
||||
'Drop' => 'Usuń',
|
||||
'Drop %s?' => 'Usunąć %s?',
|
||||
'Are you sure?' => 'Czy jesteś pewien?',
|
||||
'Size' => 'Wielkość',
|
||||
'Compute' => 'Oblicz',
|
||||
@@ -233,17 +237,19 @@ $translations = array(
|
||||
'Sort' => 'Sortuj',
|
||||
'descending' => 'malejąco',
|
||||
'Limit' => 'Limit',
|
||||
'Limit rows' => 'Limit rekordów',
|
||||
'Text length' => 'Długość tekstu',
|
||||
'Action' => 'Czynność',
|
||||
'Full table scan' => 'Wymaga pełnego przeskanowania tabeli',
|
||||
'Unable to select the table' => 'Nie udało się pobrać danych z tabeli',
|
||||
'No rows.' => 'Brak rekordów.',
|
||||
'%d / ' => '%d / ',
|
||||
'%d row(s)' => array('%d rekord', '%d rekordy', '%d rekordów'),
|
||||
'Page' => 'Strona',
|
||||
'last' => 'ostatni',
|
||||
'Load more data' => 'Wczytaj więcej danych',
|
||||
'Loading' => 'Wczytywanie',
|
||||
'whole result' => 'wybierz wszystkie',
|
||||
'Whole result' => 'Wybierz wszystkie',
|
||||
'%d byte(s)' => array('%d bajt', '%d bajty', '%d bajtów'),
|
||||
|
||||
'Import' => 'Import',
|
||||
|
@@ -186,7 +186,7 @@ $translations = array(
|
||||
'original' => 'original',
|
||||
'Tables have been dropped.' => 'As Tabelas foram eliminadas.',
|
||||
'%d item(s) have been affected.' => array('%d item foi afetado.', '%d itens foram afetados.'),
|
||||
'whole result' => 'resultado completo',
|
||||
'Whole result' => 'Resultado completo',
|
||||
'Clone' => 'Clonar',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Quantidade máxima de campos permitidos excedidos. Por favor aumente %s.',
|
||||
'Partition by' => 'Particionar por',
|
||||
|
@@ -186,7 +186,7 @@ $translations = array(
|
||||
'original' => 'original',
|
||||
'Tables have been dropped.' => 'As tabelas foram eliminadas.',
|
||||
'%d item(s) have been affected.' => array('%d item afetado.', '%d itens afetados.'),
|
||||
'whole result' => 'resultado completo',
|
||||
'Whole result' => 'Resultado completo',
|
||||
'Clone' => 'Clonar',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Quantidade máxima de campos permitidos excedidos. Por favor aumente %s.',
|
||||
'Partition by' => 'Particionar por',
|
||||
|
@@ -185,7 +185,7 @@ $translations = array(
|
||||
'Save and continue edit' => 'Salvează și continuă editarea',
|
||||
'original' => 'original',
|
||||
'%d item(s) have been affected.' => array('A fost modificată %d înscriere.', 'Au fost modificate %d înscrieri.'),
|
||||
'whole result' => 'tot rezultatul',
|
||||
'Whole result' => 'Tot rezultatul',
|
||||
'Tables have been dropped.' => 'Tabelele au fost șterse.',
|
||||
'Clone' => 'Clonează',
|
||||
'Partition by' => 'Împarte',
|
||||
|
@@ -185,7 +185,7 @@ $translations = array(
|
||||
'Save and continue edit' => 'Сохранить и продолжить редактирование',
|
||||
'original' => 'исходный',
|
||||
'%d item(s) have been affected.' => array('Была изменена %d запись.', 'Были изменены %d записи.', 'Было изменено %d записей.'),
|
||||
'whole result' => 'весь результат',
|
||||
'Whole result' => 'Весь результат',
|
||||
'Tables have been dropped.' => 'Таблицы были удалены.',
|
||||
'Clone' => 'Клонировать',
|
||||
'Partition by' => 'Разделить по',
|
||||
@@ -276,11 +276,10 @@ $translations = array(
|
||||
'ATTACH queries are not supported.' => 'ATTACH-запросы не поддерживаются.',
|
||||
'%d / ' => '%d / ',
|
||||
'Limit rows' => 'Лимит строк',
|
||||
'<a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to use SQLite.' => '<a href="https://www.adminer.org/en/extension/" target="_blank">Реализуйте</a> метод %s, чтобы использовать SQLite.',
|
||||
'Default value' => 'Значение по умолчанию',
|
||||
'Full table scan' => 'Анализ полной таблицы',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Слишком много неудачных попыток входа. Попробуйте снова через %d минуту.', 'Слишком много неудачных попыток входа. Попробуйте снова через %d минуты.', 'Слишком много неудачных попыток входа. Попробуйте снова через %d минут.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Мастер-пароль истёк. <a href="https://www.adminer.org/en/extension/" target="_blank">Реализуйте</a> метод %s, чтобы сделать его постоянным.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Мастер-пароль истёк. <a href="https://www.adminer.org/en/extension/"%s>Реализуйте</a> метод %s, чтобы сделать его постоянным.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Если вы не посылали этот запрос из Adminer, закройте эту страницу.',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'Вы можете закачать большой SQL-файл по FTP и затем импортировать его с сервера.',
|
||||
'Size' => 'Размер',
|
||||
|
@@ -187,7 +187,7 @@ $translations = array(
|
||||
'Move to other database' => 'Presunúť do inej databázy',
|
||||
'Move' => 'Presunúť',
|
||||
'%d item(s) have been affected.' => '%d položiek bolo ovplyvnených.',
|
||||
'whole result' => 'celý výsledok',
|
||||
'Whole result' => 'Celý výsledok',
|
||||
'Clone' => 'Klonovať',
|
||||
'Partition by' => 'Rozdeliť podľa',
|
||||
'Partitions' => 'Oddiely',
|
||||
|
@@ -225,7 +225,7 @@ $translations = array(
|
||||
'%d row(s)' => array('%d vrstica', '%d vrstici', '%d vrstice', '%d vrstic'),
|
||||
'Page' => 'Stran',
|
||||
'last' => 'Zadnja',
|
||||
'whole result' => 'cel razultat',
|
||||
'Whole result' => 'Cel razultat',
|
||||
'%d byte(s)' => array('%d bajt', '%d bajta', '%d bajti', '%d bajtov'),
|
||||
|
||||
'Import' => 'Uvozi',
|
||||
|
@@ -231,9 +231,9 @@ $translations = array(
|
||||
'%d row(s)' => array('%d ред', '%d реда', '%d редова'),
|
||||
'Page' => 'Страна',
|
||||
'last' => 'последња',
|
||||
'Loading' => 'Учитавам',
|
||||
'Load more data' => 'Учитавам још података',
|
||||
'whole result' => 'цео резултат',
|
||||
'Loading' => 'Учитавам',
|
||||
'Load more data' => 'Учитавам још података',
|
||||
'Whole result' => 'Цео резултат',
|
||||
'%d byte(s)' => array('%d бајт', '%d бајта', '%d бајтова'),
|
||||
|
||||
'Import' => 'Увоз',
|
||||
|
@@ -183,7 +183,7 @@ $translations = array(
|
||||
'original' => 'அசல்',
|
||||
'Tables have been dropped.' => 'அட்டவணை நீக்கப்பட்டது.',
|
||||
'%d item(s) have been affected.' => array('%d உருப்படி மாற்றமடைந்தது.', '%d உருப்படிகள் மாற்றமடைந்தன.'),
|
||||
'whole result' => 'முழுமையான முடிவு',
|
||||
'Whole result' => 'முழுமையான முடிவு',
|
||||
'Clone' => 'நகலி (Clone)',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'அனுமதிக்கப்பட்ட அதிகபட்ச கோப்புகளின் எண்ணிக்கை மீறப்பட்டது. தயவு செய்து %s மற்றும் %s யை அதிகரிக்கவும்.',
|
||||
'Partition by' => 'பிரித்தது',
|
||||
|
@@ -186,7 +186,7 @@ $translations = array(
|
||||
'original' => 'ต้นฉบับ',
|
||||
'Tables have been dropped.' => 'ตารางถูกลบแล้ว.',
|
||||
'%d item(s) have been affected.' => 'มี %d รายการถูกดำเนินการแล้ว.',
|
||||
'whole result' => 'รวมผล',
|
||||
'Whole result' => 'รวมผล',
|
||||
'Clone' => 'ทำซ้ำ',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'จำนวนสูงสุดของฟิลด์อนุญาตให้เกิน กรุณาเพิ่มอีก %s.',
|
||||
'Partition by' => 'พาร์ทิชันโดย',
|
||||
|
@@ -9,14 +9,20 @@ $translations = array(
|
||||
'Login' => 'Giriş',
|
||||
'Logout' => 'Çıkış',
|
||||
'Logged as: %s' => '%s olarak giriş yapıldı.',
|
||||
'Logout successful.' => 'Başarıyla çıkış yapıldı.',
|
||||
'Invalid credentials.' => 'Geçersiz kimlik.',
|
||||
'Logout successful.' => 'Oturum başarıyla sonlandı.',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Adminer kullandığınız için teşekkür ederiz <a href="https://www.adminer.org/en/donation/">bağış yapmayı düşünün</a>.',
|
||||
'Invalid credentials.' => 'Geçersiz kimlik bilgileri.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Çok fazla oturum açma denemesi yapıldı.', '%d Dakika sonra tekrar deneyiniz.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Ana şifrenin süresi doldu. Kalıcı olması için <a href="https://www.adminer.org/en/extension/"%s>%s medodunu</a> kullanın.',
|
||||
'Language' => 'Dil',
|
||||
'Invalid CSRF token. Send the form again.' => 'Geçersiz (CSRF) jetonu. Formu tekrar yolla.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Bu isteği Adminer\'den göndermediyseniz bu sayfayı kapatın.',
|
||||
'No extension' => 'Uzantı yok',
|
||||
'None of the supported PHP extensions (%s) are available.' => 'Desteklenen PHP eklentilerinden (%s) hiçbiri mevcut değil.',
|
||||
'Connecting to privileged ports is not allowed.' => 'Ayrıcalıklı bağlantı noktalarına bağlanmaya izin verilmiyor.',
|
||||
'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.',
|
||||
'The action will be performed after successful login with the same credentials.' => 'İşlem, aynı kimlik bilgileriyle başarıyla oturum açıldıktan sonra gerçekleştirilecektir.',
|
||||
'%s version: %s through PHP extension %s' => '%s sürüm: %s, %s PHP eklentisi ile',
|
||||
'Refresh' => 'Tazele',
|
||||
|
||||
@@ -46,6 +52,8 @@ $translations = array(
|
||||
'Query executed OK, %d row(s) affected.' => array('Sorgu başarıyla çalıştırıldı, %d adet kayıt etkilendi.', 'Sorgu başarıyla çalıştırıldı, %d adet kayıt etkilendi.'),
|
||||
'No commands to execute.' => 'Çalıştırılacak komut yok.',
|
||||
'Error in query' => 'Sorguda hata',
|
||||
'Warnings' => 'Uyarılar',
|
||||
'ATTACH queries are not supported.' => 'ATTACH sorguları desteklenmiyor.',
|
||||
'Execute' => 'Çalıştır',
|
||||
'Stop on error' => 'Hata oluşursa dur',
|
||||
'Show only errors' => 'Sadece hataları göster.',
|
||||
@@ -64,16 +72,20 @@ $translations = array(
|
||||
'Unable to upload a file.' => 'Dosya gönderilemiyor.',
|
||||
'Maximum allowed file size is %sB.' => 'İzin verilen dosya boyutu 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 %s ayar yönergesini uygun olarak yapılandırın.',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'FTP yoluyla büyük bir SQL dosyası yükleyebilir ve sunucudan içe aktarabilirsiniz.',
|
||||
'You are offline.' => 'Çevrimdışısınız.',
|
||||
|
||||
'Export' => 'Dışarı Aktar',
|
||||
'Output' => 'Çıktı',
|
||||
'open' => 'aç',
|
||||
'save' => 'kaydet',
|
||||
'Saving' => 'Saydediliyor',
|
||||
'Format' => 'Biçim',
|
||||
'Data' => 'Veri',
|
||||
|
||||
'Database' => 'Veri Tabanı',
|
||||
'database' => 'veri tabanı',
|
||||
'DB' => 'DB',
|
||||
'Use' => 'Kullan',
|
||||
'Select database' => 'Veri tabanı seç',
|
||||
'Invalid database.' => 'Geçersiz veri tabanı.',
|
||||
@@ -95,12 +107,13 @@ $translations = array(
|
||||
'Engine' => 'Motor',
|
||||
'Collation' => 'Karşılaştırma',
|
||||
'Data Length' => 'Veri Uzunluğu',
|
||||
'Index Length' => 'Dizin Uzunluğu',
|
||||
'Index Length' => 'İndex Uzunluğu',
|
||||
'Data Free' => 'Boş Veri',
|
||||
'Rows' => 'Kayıtlar',
|
||||
'%d in total' => 'toplam %d',
|
||||
'Analyze' => 'Çözümle',
|
||||
'Optimize' => 'En uygun hale getir',
|
||||
'Optimize' => 'Optimize Et',
|
||||
'Vacuum' => 'Vakumla',
|
||||
'Check' => 'Denetle',
|
||||
'Repair' => 'Tamir Et',
|
||||
'Truncate' => 'Boşalt',
|
||||
@@ -158,9 +171,13 @@ $translations = array(
|
||||
'Auto Increment' => 'Otomatik Artır',
|
||||
'Options' => 'Seçenekler',
|
||||
'Comment' => 'Yorum',
|
||||
'Default value' => 'Varsayılan değer',
|
||||
'Default values' => 'Varsayılan değerler',
|
||||
'Drop' => 'Sil',
|
||||
'Drop %s?' => 'Sil %s?',
|
||||
'Are you sure?' => 'Emin misiniz?',
|
||||
'Size' => 'Boyut',
|
||||
'Compute' => 'Hesapla',
|
||||
'Move up' => 'Yukarı taşı',
|
||||
'Move down' => 'Aşağı taşı',
|
||||
'Remove' => 'Sil',
|
||||
@@ -172,17 +189,18 @@ $translations = array(
|
||||
'Values' => 'Değerler',
|
||||
|
||||
'View' => 'Görünüm',
|
||||
'Materialized view' => 'Materialized Görünüm',
|
||||
'View has been dropped.' => 'Görünüm silindi.',
|
||||
'View has been altered.' => 'Görünüm değiştirildi.',
|
||||
'View has been created.' => 'Görünüm oluşturuldu.',
|
||||
'Alter view' => 'Görünümü değiştir',
|
||||
'Create view' => 'Görünüm oluştur',
|
||||
|
||||
'Indexes' => 'Dizinler',
|
||||
'Indexes have been altered.' => 'Dizinler değiştirildi.',
|
||||
'Alter indexes' => 'Dizinleri değiştir',
|
||||
'Indexes' => 'İndeksler',
|
||||
'Indexes have been altered.' => 'İndeksler değiştirildi.',
|
||||
'Alter indexes' => 'İndeksleri değiştir',
|
||||
'Add next' => 'Bundan sonra ekle',
|
||||
'Index Type' => 'Dizin Türü',
|
||||
'Index Type' => 'İndex Türü',
|
||||
'Column (length)' => 'Kolon (uzunluğu)',
|
||||
|
||||
'Foreign keys' => 'Dış anahtarlar',
|
||||
@@ -221,25 +239,29 @@ $translations = array(
|
||||
'anywhere' => 'hiçbir yerde',
|
||||
'Search data in tables' => 'Tablolarda veri ara',
|
||||
'Sort' => 'Sırala',
|
||||
'descending' => 'azalan',
|
||||
'Limit' => 'sınır',
|
||||
'Text length' => 'Yazı uzunluğu',
|
||||
'Action' => 'Eylem',
|
||||
'Full table scan' => 'Tam tablo tarama',
|
||||
'descending' => 'Azalan',
|
||||
'Limit' => 'Limit',
|
||||
'Limit rows' => 'Satır Limiti',
|
||||
'Text length' => 'Metin Boyutu',
|
||||
'Action' => 'İşlem',
|
||||
'Full table scan' => 'Tam tablo taraması',
|
||||
'Unable to select the table' => 'Tablo seçilemedi',
|
||||
'No rows.' => 'Kayıt yok.',
|
||||
'%d / ' => '%d / ',
|
||||
'%d row(s)' => array('%d kayıt', '%d adet kayıt'),
|
||||
'Page' => 'Sayfa',
|
||||
'last' => 'son',
|
||||
'Load more data' => 'Daha fazla veri yükle',
|
||||
'Loading' => 'Yükleniyor',
|
||||
'whole result' => 'tüm sonuç',
|
||||
'Whole result' => 'Tüm sonuç',
|
||||
'%d byte(s)' => array('%d bayt', '%d bayt'),
|
||||
|
||||
'Import' => 'İçeri Aktar',
|
||||
'%d row(s) have been imported.' => array('%d kayıt içeri aktarıldı.', '%d adet kayıt içeri aktarıldı.'),
|
||||
'File must be in UTF-8 encoding.' => 'Dosya UTF-8 kodlamasında olmalıdır.',
|
||||
|
||||
// in-place editing in select
|
||||
'Modify' => 'Düzenle',
|
||||
'Ctrl+click on a value to modify it.' => 'Bir değeri değiştirmek için üzerine Ctrl+tıklayın.',
|
||||
'Use edit link to modify this value.' => 'Değeri değiştirmek için düzenleme bağlantısını kullanın.',
|
||||
|
||||
@@ -258,8 +280,10 @@ $translations = array(
|
||||
'Save' => 'Kaydet',
|
||||
'Save and continue edit' => 'Kaydet ve düzenlemeye devam et',
|
||||
'Save and insert next' => 'Kaydet ve sonrakini ekle',
|
||||
'Selected' => 'Seçildi',
|
||||
'Clone' => 'Kopyala',
|
||||
'Delete' => 'Sil',
|
||||
'You have no privileges to update this table.' => 'Bu tabloyu güncellemek için yetkiniz yok.',
|
||||
|
||||
'E-mail' => 'E-posta',
|
||||
'From' => 'Gönderen',
|
||||
|
@@ -230,7 +230,7 @@ $translations = array(
|
||||
'%d row(s)' => array('%d рядок', '%d рядки', '%d рядків'),
|
||||
'Page' => 'Сторінка',
|
||||
'last' => 'остання',
|
||||
'whole result' => 'весь результат',
|
||||
'Whole result' => 'Весь результат',
|
||||
'%d byte(s)' => array('%d байт', '%d байта', '%d байтів'),
|
||||
|
||||
'Import' => 'Імпортувати',
|
||||
|
@@ -12,7 +12,7 @@ $translations = array(
|
||||
'Logout successful.' => 'Đã thoát xong.',
|
||||
'Invalid credentials.' => 'Tài khoản sai.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => 'Bạn gõ sai tài khoản quá nhiều lần, hãy thử lại sau %d phút nữa.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Mật khẩu đã hết hạn. <a href="https://www.adminer.org/en/extension/" target="_blank">Thử cách làm</a> để giữ cố định.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Mật khẩu đã hết hạn. <a href="https://www.adminer.org/en/extension/"%s>Thử cách làm</a> để giữ cố định.',
|
||||
'Language' => 'Ngôn ngữ',
|
||||
'Invalid CSRF token. Send the form again.' => 'Mã kiểm tra CSRF sai, hãy nhập lại biểu mẫu.',
|
||||
'No extension' => 'Không có phần mở rộng',
|
||||
@@ -206,8 +206,8 @@ $translations = array(
|
||||
'ON UPDATE' => 'Khi cập nhật',
|
||||
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Cột gốc và cột đích phải cùng kiểu, phải đặt chỉ mục trong cột đích và dữ liệu tham chiếu phải tồn tại.',
|
||||
|
||||
'Triggers' => 'xx',
|
||||
'Add trigger' => 'xx',
|
||||
'Triggers' => 'Phản xạ',
|
||||
'Add trigger' => 'Thêm phản xạ',
|
||||
'Trigger has been dropped.' => 'Đã xoá phản xạ.',
|
||||
'Trigger has been altered.' => 'Đã sửa phản xạ.',
|
||||
'Trigger has been created.' => 'Đã tạo phản xạ.',
|
||||
@@ -238,7 +238,7 @@ $translations = array(
|
||||
'last' => 'cuối',
|
||||
'Load more data' => 'Xem thêm dữ liệu',
|
||||
'Loading' => 'Đang nạp',
|
||||
'whole result' => 'toàn bộ kết quả',
|
||||
'Whole result' => 'Toàn bộ kết quả',
|
||||
'%d byte(s)' => '%d byte(s)',
|
||||
|
||||
'Import' => 'Nhập khẩu',
|
||||
@@ -308,12 +308,12 @@ $translations = array(
|
||||
'Schema has been dropped.' => 'Đã xoá schema.',
|
||||
'Schema has been created.' => 'Đã tạo schema.',
|
||||
'Schema has been altered.' => 'Đã thay đổi schema.',
|
||||
'Schema' => 'schema',
|
||||
'Invalid schema.' => 'Schema khong hợp lệ.',
|
||||
'Schema' => 'Schema',
|
||||
'Invalid schema.' => 'Schema không hợp lệ.',
|
||||
|
||||
// PostgreSQL sequences support
|
||||
'Sequences' => 'Dãy số',
|
||||
'Create sequence' => 'Tạo đãy số',
|
||||
'Create sequence' => 'Tạo dãy số',
|
||||
'Sequence has been dropped.' => 'Dãy số đã bị xoá.',
|
||||
'Sequence has been created.' => 'Đã tạo dãy số.',
|
||||
'Sequence has been altered.' => 'Đã sửa dãy số.',
|
||||
|
@@ -8,21 +8,26 @@ $translations = array(
|
||||
'Permanent login' => 'Xx',
|
||||
'Login' => 'Xx',
|
||||
'Logout' => 'Xx',
|
||||
'Logged as: %s' => 'Xx',
|
||||
'Logged as: %s' => 'Xx: %s',
|
||||
'Logout successful.' => 'Xx.',
|
||||
'Thanks for using Adminer, consider <a href="%s">donating</a>.' => 'Xx.',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Xx <a href="https://www.adminer.org/en/donation/">xx</a>.',
|
||||
'Invalid credentials.' => 'Xx.',
|
||||
'<a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to use SQLite.' => 'Xx.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Xx.', 'Xx.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.' => 'Xx.',
|
||||
'There is a space in the input password which might be the cause.' => 'Xx.',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Xx, <a href="https://www.adminer.org/en/password/"%s>xx</a>.',
|
||||
'Database does not support password.' => 'Xx.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Xx %d.', 'Xx %d.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => '<a href="https://www.adminer.org/en/extension/"%s>Xx</a> %s xx.',
|
||||
'Language' => 'Xx',
|
||||
'Invalid CSRF token. Send the form again.' => 'Xx.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Xx.',
|
||||
'No extension' => 'Xx',
|
||||
'None of the supported PHP extensions (%s) are available.' => 'Xx.',
|
||||
'None of the supported PHP extensions (%s) are available.' => 'Xx (%s).',
|
||||
'Connecting to privileged ports is not allowed.' => 'Xx.',
|
||||
'Disable %s or enable %s or %s extensions.' => 'Xx %s xx %s xx %s xx.',
|
||||
'Session support must be enabled.' => 'Xx.',
|
||||
'Session expired, please login again.' => 'Xx.',
|
||||
'%s version: %s through PHP extension %s' => 'Xx',
|
||||
'The action will be performed after successful login with the same credentials.' => 'Xx.',
|
||||
'%s version: %s through PHP extension %s' => '%s xx: %s xx %s',
|
||||
'Refresh' => 'Xx',
|
||||
|
||||
// text direction - 'ltr' or 'rtl'
|
||||
@@ -40,36 +45,38 @@ $translations = array(
|
||||
'Revoke' => 'Xx',
|
||||
|
||||
'Process list' => 'Xx',
|
||||
'%d process(es) have been killed.' => array('Xx.', 'Xx.'),
|
||||
'%d process(es) have been killed.' => array('%d xx.', '%d xx.'),
|
||||
'Kill' => 'Xx',
|
||||
|
||||
'Variables' => 'Xx',
|
||||
'Status' => 'Xx',
|
||||
|
||||
'SQL command' => 'Xx',
|
||||
'%d query(s) executed OK.' => array('Xx.', 'Xx.'),
|
||||
'Query executed OK, %d row(s) affected.' => array('Xx.', 'Xx.'),
|
||||
'%d query(s) executed OK.' => array('%d xx.', '%d xx.'),
|
||||
'Query executed OK, %d row(s) affected.' => array('Xx, %d.', 'Xx, %d.'),
|
||||
'No commands to execute.' => 'Xx.',
|
||||
'Error in query' => 'Xx',
|
||||
'Unknown error.' => 'Xx.',
|
||||
'Warnings' => 'Xx',
|
||||
'ATTACH queries are not supported.' => 'Xx.',
|
||||
'Execute' => 'Xx',
|
||||
'Stop on error' => 'Xx',
|
||||
'Show only errors' => 'Xx',
|
||||
// sprintf() format for time of the command
|
||||
'%.3f s' => 'xx',
|
||||
'%.3f s' => '%.3f xx',
|
||||
'History' => 'Xx',
|
||||
'Clear' => 'Xx',
|
||||
'Edit all' => 'Xx',
|
||||
|
||||
'File upload' => 'Xx',
|
||||
'From server' => 'Xx',
|
||||
'Webserver file %s' => 'Xx',
|
||||
'Webserver file %s' => 'Xx %s',
|
||||
'Run file' => 'Xx',
|
||||
'File does not exist.' => 'Xx.',
|
||||
'File uploads are disabled.' => 'Xx.',
|
||||
'Unable to upload a file.' => 'Xx.',
|
||||
'Maximum allowed file size is %sB.' => 'Xx.',
|
||||
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Xx.',
|
||||
'Maximum allowed file size is %sB.' => 'Xx %sB.',
|
||||
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Xx %s.',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'Xx.',
|
||||
'You are offline.' => 'Xx.',
|
||||
|
||||
@@ -83,6 +90,7 @@ $translations = array(
|
||||
|
||||
'Database' => 'Xx',
|
||||
'database' => 'xx',
|
||||
'DB' => 'XX',
|
||||
'Use' => 'Xx',
|
||||
'Select database' => 'Xx',
|
||||
'Invalid database.' => 'Xx.',
|
||||
@@ -107,7 +115,7 @@ $translations = array(
|
||||
'Index Length' => 'Xx',
|
||||
'Data Free' => 'Xx',
|
||||
'Rows' => 'Xx',
|
||||
'%d in total' => 'xx',
|
||||
'%d in total' => '%d xx',
|
||||
'Analyze' => 'Xx',
|
||||
'Optimize' => 'Xx',
|
||||
'Vacuum' => 'Xx',
|
||||
@@ -122,7 +130,7 @@ $translations = array(
|
||||
'Tables have been copied.' => 'Xx.',
|
||||
|
||||
'Routines' => 'Xx',
|
||||
'Routine has been called, %d row(s) affected.' => array('Xx.', 'Xx.'),
|
||||
'Routine has been called, %d row(s) affected.' => array('Xx, %d.', 'Xx, %d.'),
|
||||
'Call' => 'Xx',
|
||||
'Parameter name' => 'Xx',
|
||||
'Create procedure' => 'Xx',
|
||||
@@ -171,13 +179,14 @@ $translations = array(
|
||||
'Default value' => 'Xx',
|
||||
'Default values' => 'Xx',
|
||||
'Drop' => 'Xx',
|
||||
'Are you sure?' => 'Xx',
|
||||
'Drop %s?' => 'Xx %s?',
|
||||
'Are you sure?' => 'Xx?',
|
||||
'Size' => 'Xx',
|
||||
'Compute' => 'Xx',
|
||||
'Move up' => 'Xx',
|
||||
'Move down' => 'Xx',
|
||||
'Remove' => 'Xx',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Xx.',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Xx %s.',
|
||||
|
||||
'Partition by' => 'Xx',
|
||||
'Partitions' => 'Xx',
|
||||
@@ -243,17 +252,17 @@ $translations = array(
|
||||
'Full table scan' => 'Xx',
|
||||
'Unable to select the table' => 'Xx',
|
||||
'No rows.' => 'Xx.',
|
||||
'%d / ' => 'xx',
|
||||
'%d row(s)' => array('xx', 'xx'),
|
||||
'%d / ' => '%d / ',
|
||||
'%d row(s)' => array('%d xx', '%d xx'),
|
||||
'Page' => 'Xx',
|
||||
'last' => 'xx',
|
||||
'Load more data' => 'Xx',
|
||||
'Loading' => 'Xx',
|
||||
'whole result' => 'xx',
|
||||
'%d byte(s)' => array('xx', 'xx'),
|
||||
'Whole result' => 'Xx',
|
||||
'%d byte(s)' => array('%d xx', '%d xx'),
|
||||
|
||||
'Import' => 'Xx',
|
||||
'%d row(s) have been imported.' => array('Xx.', 'Xx.'),
|
||||
'%d row(s) have been imported.' => array('%d xx.', '%d xx.'),
|
||||
'File must be in UTF-8 encoding.' => 'Xx.',
|
||||
|
||||
// in-place editing in select
|
||||
@@ -262,10 +271,10 @@ $translations = array(
|
||||
'Use edit link to modify this value.' => 'Xx.',
|
||||
|
||||
// %s can contain auto-increment value
|
||||
'Item%s has been inserted.' => 'Xx.',
|
||||
'Item%s has been inserted.' => 'Xx%s.',
|
||||
'Item has been deleted.' => 'Xx.',
|
||||
'Item has been updated.' => 'Xx.',
|
||||
'%d item(s) have been affected.' => array('Xx.', 'Xx.'),
|
||||
'%d item(s) have been affected.' => array('%d xx.', '%d xx.'),
|
||||
'New item' => 'Xx',
|
||||
'original' => 'xx',
|
||||
// label for value '' in enum data type
|
||||
@@ -286,7 +295,7 @@ $translations = array(
|
||||
'Subject' => 'Xx',
|
||||
'Attachments' => 'Xx',
|
||||
'Send' => 'Xx',
|
||||
'%d e-mail(s) have been sent.' => array('Xx.', 'Xx.'),
|
||||
'%d e-mail(s) have been sent.' => array('%d xx.', '%d xx.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Xx',
|
||||
@@ -311,7 +320,7 @@ $translations = array(
|
||||
|
||||
// general SQLite error in create, drop or rename database
|
||||
'File exists.' => 'Xx.',
|
||||
'Please use one of the extensions %s.' => 'Xx.',
|
||||
'Please use one of the extensions %s.' => 'Xx %s.',
|
||||
|
||||
// PostgreSQL and MS SQL schema support
|
||||
'Alter schema' => 'Xx',
|
||||
|
@@ -9,13 +9,13 @@ $translations = array(
|
||||
'Select database' => '選擇資料庫',
|
||||
'Invalid database.' => '無效的資料庫。',
|
||||
'Table has been altered.' => '資料表已修改。',
|
||||
'Table has been created.' => '資料表已修改。',
|
||||
'Table has been created.' => '資料表已建立。',
|
||||
'Alter table' => '修改資料表',
|
||||
'Create table' => '建立資料表',
|
||||
'Table name' => '資料表名稱',
|
||||
'engine' => '引擎',
|
||||
'collation' => '校對',
|
||||
'Column name' => '列名',
|
||||
'Column name' => '欄位名稱',
|
||||
'Type' => '類型',
|
||||
'Length' => '長度',
|
||||
'Auto Increment' => '自動遞增',
|
||||
@@ -28,14 +28,14 @@ $translations = array(
|
||||
'Database has been altered.' => '已修改資料庫。',
|
||||
'Alter database' => '修改資料庫',
|
||||
'Create database' => '建立資料庫',
|
||||
'SQL command' => 'SQL命令',
|
||||
'SQL command' => 'SQL 命令',
|
||||
'Logout' => '登出',
|
||||
'database' => '資料庫',
|
||||
'Use' => '使用',
|
||||
'No tables.' => '沒有資料表。',
|
||||
'select' => '選擇',
|
||||
'Item has been updated.' => '已更新項目。',
|
||||
'Item%s has been inserted.' => '已新增項目%s。',
|
||||
'Item%s has been inserted.' => '已新增項目 %s。',
|
||||
'Edit' => '編輯',
|
||||
'Insert' => '新增',
|
||||
'Save and insert next' => '儲存並新增下一筆',
|
||||
@@ -51,13 +51,13 @@ $translations = array(
|
||||
'New item' => '新增項目',
|
||||
'Search' => '搜尋',
|
||||
'Sort' => '排序',
|
||||
'descending' => '降冪(遞減)',
|
||||
'descending' => '降冪 (遞減)',
|
||||
'Limit' => '限定',
|
||||
'No rows.' => '沒有行。',
|
||||
'No rows.' => '沒有資料行。',
|
||||
'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' => '資料表',
|
||||
@@ -73,10 +73,10 @@ $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)。',
|
||||
'None of the supported PHP extensions (%s) are available.' => '沒有任何支援的 PHP 擴充模組(%s)。',
|
||||
'Session support must be enabled.' => 'Session 必須被啟用。',
|
||||
'Session expired, please login again.' => 'Session 已過期,請重新登入。',
|
||||
'Text length' => 'Text 長度',
|
||||
@@ -85,16 +85,16 @@ $translations = array(
|
||||
'Foreign key has been created.' => '已建立外來鍵。',
|
||||
'Foreign key' => '外來鍵',
|
||||
'Target table' => '目標資料表',
|
||||
'Change' => '修改',
|
||||
'Change' => '變更',
|
||||
'Source' => '來源',
|
||||
'Target' => '目標',
|
||||
'Add column' => '新增資料列',
|
||||
'Add column' => '新增欄位',
|
||||
'Alter' => '修改',
|
||||
'Add foreign key' => '新增外來鍵',
|
||||
'ON DELETE' => 'ON DELETE',
|
||||
'ON UPDATE' => 'ON UPDATE',
|
||||
'Index Type' => '索引類型',
|
||||
'Column (length)' => '列(長度)',
|
||||
'Column (length)' => '欄位(長度)',
|
||||
'View has been dropped.' => '已刪除檢視表。',
|
||||
'View has been altered.' => '已修改檢視表。',
|
||||
'View has been created.' => '已建立檢視表。',
|
||||
@@ -105,14 +105,14 @@ $translations = array(
|
||||
'%d process(es) have been killed.' => '%d 個 Process(es) 被終止',
|
||||
'Kill' => '終止',
|
||||
'Parameter name' => '參數名稱',
|
||||
'Database schema' => '資料庫架構',
|
||||
'Database schema' => '資料庫結構',
|
||||
'Create procedure' => '建立預存程序',
|
||||
'Create function' => '建立函數',
|
||||
'Create function' => '建立函式',
|
||||
'Routine has been dropped.' => '已刪除程序。',
|
||||
'Routine has been altered.' => '已修改子程序。',
|
||||
'Routine has been created.' => '已建立子程序。',
|
||||
'Alter function' => '修改函數',
|
||||
'Alter procedure' => '修改過程',
|
||||
'Alter function' => '修改函式',
|
||||
'Alter procedure' => '修改預存程序',
|
||||
'Return type' => '回傳類型',
|
||||
'Add trigger' => '建立觸發器',
|
||||
'Trigger has been dropped.' => '已刪除觸發器。',
|
||||
@@ -122,8 +122,8 @@ $translations = array(
|
||||
'Create trigger' => '建立觸發器',
|
||||
'Time' => '時間',
|
||||
'Event' => '事件',
|
||||
'%s version: %s through PHP extension %s' => '%s版本:%s 透過PHP擴充模組 %s',
|
||||
'%d row(s)' => '%d行',
|
||||
'%s version: %s through PHP extension %s' => '%s 版本:%s 透過 PHP 擴充模組 %s',
|
||||
'%d row(s)' => '%d 行',
|
||||
'Remove' => '移除',
|
||||
'Are you sure?' => '你確定嗎?',
|
||||
'Privileges' => '權限',
|
||||
@@ -132,11 +132,11 @@ $translations = array(
|
||||
'User has been altered.' => '已修改使用者。',
|
||||
'User has been created.' => '已建立使用者。',
|
||||
'Hashed' => 'Hashed',
|
||||
'Column' => '列',
|
||||
'Column' => '欄位',
|
||||
'Routine' => '程序',
|
||||
'Grant' => '授權',
|
||||
'Revoke' => '廢除',
|
||||
'Logged as: %s' => '登錄為:%s',
|
||||
'Logged as: %s' => '登錄為: %s',
|
||||
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'POST 資料太大。減少資料或者增加 %s 的設定值。',
|
||||
'Move up' => '上移',
|
||||
'Move down' => '下移',
|
||||
@@ -147,7 +147,7 @@ $translations = array(
|
||||
'open' => '打開',
|
||||
'save' => '儲存',
|
||||
'Format' => '格式',
|
||||
'Functions' => '函數',
|
||||
'Functions' => '函式',
|
||||
'Aggregation' => '集合',
|
||||
'Event has been dropped.' => '已刪除事件。',
|
||||
'Event has been altered.' => '已修改事件。',
|
||||
@@ -182,20 +182,20 @@ $translations = array(
|
||||
'Move' => '轉移',
|
||||
'Save and continue edit' => '儲存並繼續編輯',
|
||||
'original' => '原始',
|
||||
'%d item(s) have been affected.' => '%d個項目受到影響。',
|
||||
'whole result' => '所有結果',
|
||||
'%d item(s) have been affected.' => '%d 個項目受到影響。',
|
||||
'Whole result' => '所有結果',
|
||||
'Tables have been dropped.' => '已經將資料表刪除。',
|
||||
'Clone' => '複製',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => '超過允許的字段數量的最大值。請增加%s。',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => '超過允許的字段數量的最大值。請增加 %s。',
|
||||
'Partition by' => '分區類型',
|
||||
'Partitions' => '分區',
|
||||
'Partition name' => '分區名稱',
|
||||
'Values' => '值',
|
||||
'%d row(s) have been imported.' => '已匯入%d行。',
|
||||
'%d row(s) have been imported.' => '已匯入 %d 行。',
|
||||
'anywhere' => '任意位置',
|
||||
'Import' => '匯入',
|
||||
'Stop on error' => '出錯時停止',
|
||||
'%.3f s' => '%.3f秒',
|
||||
'%.3f s' => '%.3f 秒',
|
||||
'$1-$3-$5' => '$1.$3.$5',
|
||||
'[yyyy]-mm-dd' => '[yyyy].mm.dd',
|
||||
'History' => '紀錄',
|
||||
@@ -204,7 +204,7 @@ $translations = array(
|
||||
'Relations' => '關聯',
|
||||
'Run file' => '執行檔案',
|
||||
'Clear' => '清除',
|
||||
'Maximum allowed file size is %sB.' => '允許的檔案上限大小為%sB',
|
||||
'Maximum allowed file size is %sB.' => '允許的檔案上限大小為 %sB',
|
||||
'Numbers' => '數字',
|
||||
'Date and time' => '日期時間',
|
||||
'Strings' => '字串',
|
||||
|
@@ -185,7 +185,7 @@ $translations = array(
|
||||
'Save and continue edit' => '保存并继续编辑',
|
||||
'original' => '原始',
|
||||
'%d item(s) have been affected.' => '%d 个项目受到影响。',
|
||||
'whole result' => '所有结果',
|
||||
'Whole result' => '所有结果',
|
||||
'Tables have been dropped.' => '已删除表。',
|
||||
'Clone' => '复制',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => '超过最多允许的字段数量。请增加 %s。',
|
||||
|
@@ -15,7 +15,7 @@ hidden_fields_get();
|
||||
echo "<input type='hidden' name='db' value='" . h(DB) . "'>\n";
|
||||
echo ($grant ? "" : "<input type='hidden' name='grant' value=''>\n");
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<thead><tr><th>" . lang('Username') . "<th>" . lang('Server') . "<th> </thead>\n";
|
||||
echo "<thead><tr><th>" . lang('Username') . "<th>" . lang('Server') . "<th></thead>\n";
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
echo '<tr' . odd() . '><td>' . h($row["User"]) . "<td>" . h($row["Host"]) . '<td><a href="' . h(ME . 'user=' . urlencode($row["User"]) . '&host=' . urlencode($row["Host"])) . '">' . lang('Edit') . "</a>\n";
|
||||
|
@@ -1,17 +1,18 @@
|
||||
<?php
|
||||
$PROCEDURE = $_GET["procedure"];
|
||||
$PROCEDURE = ($_GET["name"] ? $_GET["name"] : $_GET["procedure"]);
|
||||
$routine = (isset($_GET["function"]) ? "FUNCTION" : "PROCEDURE");
|
||||
$row = $_POST;
|
||||
$row["fields"] = (array) $row["fields"];
|
||||
|
||||
if ($_POST && !process_fields($row["fields"]) && !$error) {
|
||||
$orig = routine($_GET["procedure"], $routine);
|
||||
$temp_name = "$row[name]_adminer_" . uniqid();
|
||||
drop_create(
|
||||
"DROP $routine " . idf_escape($PROCEDURE),
|
||||
"DROP $routine " . routine_id($PROCEDURE, $orig),
|
||||
create_routine($routine, $row),
|
||||
"DROP $routine " . idf_escape($row["name"]),
|
||||
"DROP $routine " . routine_id($row["name"], $row),
|
||||
create_routine($routine, array("name" => $temp_name) + $row),
|
||||
"DROP $routine " . idf_escape($temp_name),
|
||||
"DROP $routine " . routine_id($temp_name, $row),
|
||||
substr(ME, 0, -1),
|
||||
lang('Routine has been dropped.'),
|
||||
lang('Routine has been altered.'),
|
||||
@@ -24,7 +25,7 @@ if ($_POST && !process_fields($row["fields"]) && !$error) {
|
||||
page_header(($PROCEDURE != "" ? (isset($_GET["function"]) ? lang('Alter function') : lang('Alter procedure')) . ": " . h($PROCEDURE) : (isset($_GET["function"]) ? lang('Create function') : lang('Create procedure'))), $error);
|
||||
|
||||
if (!$_POST && $PROCEDURE != "") {
|
||||
$row = routine($PROCEDURE, $routine);
|
||||
$row = routine($_GET["procedure"], $routine);
|
||||
$row["name"] = $PROCEDURE;
|
||||
}
|
||||
|
||||
@@ -34,21 +35,23 @@ $routine_languages = routine_languages();
|
||||
?>
|
||||
|
||||
<form action="" method="post" id="form">
|
||||
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64" autocapitalize="off">
|
||||
<?php echo ($routine_languages ? lang('Language') . ": " . html_select("language", $routine_languages, $row["language"]) : ""); ?>
|
||||
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" data-maxlength="64" autocapitalize="off">
|
||||
<?php echo ($routine_languages ? lang('Language') . ": " . html_select("language", $routine_languages, $row["language"]) . "\n" : ""); ?>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<div class="scrollable">
|
||||
<table cellspacing="0" class="nowrap">
|
||||
<?php
|
||||
edit_fields($row["fields"], $collations, $routine);
|
||||
if (isset($_GET["function"])) {
|
||||
echo "<tr><td>" . lang('Return type');
|
||||
edit_type("returns", $row["returns"], $collations);
|
||||
edit_type("returns", $row["returns"], $collations, array(), ($jush == "pgsql" ? array("void", "trigger") : array()));
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<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 ($PROCEDURE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $PROCEDURE)); ?><?php } ?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
|
@@ -13,6 +13,7 @@ page_header(lang('Process list'), $error);
|
||||
?>
|
||||
|
||||
<form action="" method="post">
|
||||
<div class="scrollable">
|
||||
<table cellspacing="0" class="nowrap checkable">
|
||||
<?php
|
||||
echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
|
||||
@@ -21,7 +22,7 @@ $i = -1;
|
||||
foreach (process_list() as $i => $row) {
|
||||
|
||||
if (!$i) {
|
||||
echo "<thead><tr lang='en'>" . (support("kill") ? "<th> " : "");
|
||||
echo "<thead><tr lang='en'>" . (support("kill") ? "<th>" : "");
|
||||
foreach ($row as $key => $val) {
|
||||
echo "<th>$key" . doc_link(array(
|
||||
'sql' => "show-processlist.html#processlist_" . strtolower($key),
|
||||
@@ -38,14 +39,14 @@ foreach (process_list() as $i => $row) {
|
||||
($jush == "pgsql" && $key == "current_query" && $val != "<IDLE>") ||
|
||||
($jush == "oracle" && $key == "sql_text" && $val != "")
|
||||
? "<code class='jush-$jush'>" . shorten_utf8($val, 100, "</code>") . ' <a href="' . h(ME . ($row["db"] != "" ? "db=" . urlencode($row["db"]) . "&" : "") . "sql=" . urlencode($val)) . '">' . lang('Clone') . '</a>'
|
||||
: nbsp($val)
|
||||
: h($val)
|
||||
);
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php echo script("tableCheck();"); ?>
|
||||
</div>
|
||||
<p>
|
||||
<?php
|
||||
if (support("kill")) {
|
||||
@@ -55,3 +56,4 @@ if (support("kill")) {
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
<?php echo script("tableCheck();"); ?>
|
||||
|
@@ -31,7 +31,7 @@ if (!$row) {
|
||||
<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(lang('Drop %s?', $_GET["ns"])) . "\n";
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
|
@@ -4,10 +4,10 @@ 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 $name => $table_status) {
|
||||
json_row("Comment-$name", nbsp($table_status["Comment"]));
|
||||
json_row("Comment-$name", h($table_status["Comment"]));
|
||||
if (!is_view($table_status)) {
|
||||
foreach (array("Engine", "Collation") as $key) {
|
||||
json_row("$key-$name", nbsp($table_status[$key]));
|
||||
json_row("$key-$name", h($table_status[$key]));
|
||||
}
|
||||
foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) {
|
||||
if ($table_status[$key] != "") {
|
||||
|
@@ -4,11 +4,7 @@ $table_status = table_status1($TABLE);
|
||||
$indexes = indexes($TABLE);
|
||||
$fields = fields($TABLE);
|
||||
$foreign_keys = column_foreign_keys($TABLE);
|
||||
$oid = "";
|
||||
if ($table_status["Oid"]) {
|
||||
$oid = ($jush == "sqlite" ? "rowid" : "oid");
|
||||
$indexes[] = array("type" => "PRIMARY", "columns" => array($oid));
|
||||
}
|
||||
$oid = $table_status["Oid"];
|
||||
parse_str($_COOKIE["adminer_import"], $adminer_import);
|
||||
|
||||
$rights = array(); // privilege => 0
|
||||
@@ -30,10 +26,6 @@ $is_group = count($group) < count($select);
|
||||
$where = $adminer->selectSearchProcess($fields, $indexes);
|
||||
$order = $adminer->selectOrderProcess($fields, $indexes);
|
||||
$limit = $adminer->selectLimitProcess();
|
||||
$from = ($select ? implode(", ", $select) : "*" . ($oid ? ", $oid" : ""))
|
||||
. convert_fields($columns, $fields, $select)
|
||||
. "\nFROM " . table($TABLE);
|
||||
$group_by = ($group && $is_group ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : "");
|
||||
|
||||
if ($_GET["val"] && is_ajax()) {
|
||||
header("Content-Type: text/plain; charset=utf-8");
|
||||
@@ -49,6 +41,24 @@ if ($_GET["val"] && is_ajax()) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$primary = $unselected = null;
|
||||
foreach ($indexes as $index) {
|
||||
if ($index["type"] == "PRIMARY") {
|
||||
$primary = array_flip($index["columns"]);
|
||||
$unselected = ($select ? $primary : array());
|
||||
foreach ($unselected as $key => $val) {
|
||||
if (in_array(idf_escape($key), $select)) {
|
||||
unset($unselected[$key]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($oid && !$primary) {
|
||||
$primary = $unselected = array($oid => 0);
|
||||
$indexes[] = array("type" => "PRIMARY", "columns" => array($oid));
|
||||
}
|
||||
|
||||
if ($_POST && !$error) {
|
||||
$where_check = $where;
|
||||
if (!$_POST["all"] && is_array($_POST["check"])) {
|
||||
@@ -59,25 +69,15 @@ if ($_POST && !$error) {
|
||||
$where_check[] = "((" . implode(") OR (", $checks) . "))";
|
||||
}
|
||||
$where_check = ($where_check ? "\nWHERE " . implode(" AND ", $where_check) : "");
|
||||
$primary = $unselected = null;
|
||||
foreach ($indexes as $index) {
|
||||
if ($index["type"] == "PRIMARY") {
|
||||
$primary = array_flip($index["columns"]);
|
||||
$unselected = ($select ? $primary : array());
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach ((array) $unselected as $key => $val) {
|
||||
if (in_array(idf_escape($key), $select)) {
|
||||
unset($unselected[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["export"]) {
|
||||
cookie("adminer_import", "output=" . urlencode($_POST["output"]) . "&format=" . urlencode($_POST["format"]));
|
||||
dump_headers($TABLE);
|
||||
$adminer->dumpTable($TABLE, "");
|
||||
if (!is_array($_POST["check"]) || $unselected === array()) {
|
||||
$from = ($select ? implode(", ", $select) : "*")
|
||||
. convert_fields($columns, $fields, $select)
|
||||
. "\nFROM " . table($TABLE);
|
||||
$group_by = ($group && $is_group ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : "");
|
||||
if (!is_array($_POST["check"]) || $primary) {
|
||||
$query = "SELECT $from$where_check$group_by";
|
||||
} else {
|
||||
$union = array();
|
||||
@@ -108,7 +108,7 @@ if ($_POST && !$error) {
|
||||
if ($_POST["clone"]) {
|
||||
$query = "INTO " . table($TABLE) . " (" . implode(", ", array_keys($set)) . ")\nSELECT " . implode(", ", $set) . "\nFROM " . table($TABLE);
|
||||
}
|
||||
if ($_POST["all"] || ($unselected === array() && is_array($_POST["check"])) || $is_group) {
|
||||
if ($_POST["all"] || ($primary && is_array($_POST["check"])) || $is_group) {
|
||||
$result = ($_POST["delete"]
|
||||
? $driver->delete($TABLE, $where_check)
|
||||
: ($_POST["clone"]
|
||||
@@ -124,8 +124,8 @@ if ($_POST && !$error) {
|
||||
$result = ($_POST["delete"]
|
||||
? $driver->delete($TABLE, $where2, 1)
|
||||
: ($_POST["clone"]
|
||||
? queries("INSERT" . limit1($query, $where2))
|
||||
: $driver->update($TABLE, $set, $where2)
|
||||
? queries("INSERT" . limit1($TABLE, $query, $where2))
|
||||
: $driver->update($TABLE, $set, $where2, 1)
|
||||
)
|
||||
);
|
||||
if (!$result) {
|
||||
@@ -165,7 +165,7 @@ if ($_POST && !$error) {
|
||||
$TABLE,
|
||||
$set,
|
||||
" WHERE " . ($where ? implode(" AND ", $where) . " AND " : "") . where_check($unique_idf, $fields),
|
||||
!($is_group || $unselected === array()),
|
||||
!$is_group && !$primary,
|
||||
" "
|
||||
);
|
||||
if (!$result) {
|
||||
@@ -184,7 +184,7 @@ if ($_POST && !$error) {
|
||||
cookie("adminer_import", "output=" . urlencode($adminer_import["output"]) . "&format=" . urlencode($_POST["separator"]));
|
||||
$result = true;
|
||||
$cols = array_keys($fields);
|
||||
preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~', $file, $matches);
|
||||
preg_match_all('~(?>"[^"]*"|[^"\r\n]+)+~', $file, $matches);
|
||||
$affected = count($matches[0]);
|
||||
$driver->begin();
|
||||
$separator = ($_POST["separator"] == "csv" ? "," : ($_POST["separator"] == "tsv" ? "\t" : ";"));
|
||||
@@ -259,17 +259,29 @@ if (!$columns && support("table")) {
|
||||
}
|
||||
|
||||
$select2 = $select;
|
||||
$group2 = $group;
|
||||
if (!$select2) {
|
||||
$select2[] = "*";
|
||||
if ($oid) {
|
||||
$select2[] = $oid;
|
||||
$convert_fields = convert_fields($columns, $fields, $select);
|
||||
if ($convert_fields) {
|
||||
$select2[] = substr($convert_fields, 2);
|
||||
}
|
||||
}
|
||||
$convert_fields = convert_fields($columns, $fields, $select);
|
||||
if ($convert_fields) {
|
||||
$select2[] = substr($convert_fields, 2);
|
||||
foreach ($select as $key => $val) {
|
||||
$field = $fields[idf_unescape($val)];
|
||||
if ($field && ($as = convert_field($field))) {
|
||||
$select2[$key] = "$as AS $val";
|
||||
}
|
||||
}
|
||||
$result = $driver->select($TABLE, $select2, $where, $group, $order, $limit, $page, true);
|
||||
if (!$is_group && $unselected) {
|
||||
foreach ($unselected as $key => $val) {
|
||||
$select2[] = idf_escape($key);
|
||||
if ($group2) {
|
||||
$group2[] = idf_escape($key);
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = $driver->select($TABLE, $select2, $where, $group2, $order, $limit, $page, true);
|
||||
|
||||
if (!$result) {
|
||||
echo "<p class='error'>" . error() . "\n";
|
||||
@@ -297,6 +309,7 @@ if (!$columns && support("table")) {
|
||||
} else {
|
||||
$backward_keys = $adminer->backwardKeys($TABLE, $table_name);
|
||||
|
||||
echo "<div class='scrollable'>";
|
||||
echo "<table id='table' cellspacing='0' class='nowrap checkable'>";
|
||||
echo script("mixin(qs('#table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true), onkeydown: editingKeydown});");
|
||||
echo "<thead><tr>" . (!$group && $select
|
||||
@@ -308,7 +321,7 @@ if (!$columns && support("table")) {
|
||||
reset($select);
|
||||
$rank = 1;
|
||||
foreach ($rows[0] as $key => $val) {
|
||||
if ($key != $oid) {
|
||||
if (!isset($unselected[$key])) {
|
||||
$val = $_GET["columns"][key($select)];
|
||||
$field = $fields[$select ? ($val ? $val["col"] : current($select)) : $key];
|
||||
$name = ($field ? $adminer->fieldName($field, $rank) : ($val["fun"] ? "*" : $key));
|
||||
@@ -357,25 +370,29 @@ if (!$columns && support("table")) {
|
||||
if (!$unique_array) {
|
||||
$unique_array = array();
|
||||
foreach ($rows[$n] as $key => $val) {
|
||||
if (!preg_match('~^(COUNT\\((\\*|(DISTINCT )?`(?:[^`]|``)+`)\\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\\(`(?:[^`]|``)+`\\))$~', $key)) { //! columns looking like functions
|
||||
if (!preg_match('~^(COUNT\((\*|(DISTINCT )?`(?:[^`]|``)+`)\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\(`(?:[^`]|``)+`\))$~', $key)) { //! columns looking like functions
|
||||
$unique_array[$key] = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
$unique_idf = "";
|
||||
foreach ($unique_array as $key => $val) {
|
||||
if (($jush == "sql" || $jush == "pgsql") && strlen($val) > 64) {
|
||||
if (($jush == "sql" || $jush == "pgsql") && preg_match('~char|text|enum|set~', $fields[$key]["type"]) && strlen($val) > 64) {
|
||||
$key = (strpos($key, '(') ? $key : idf_escape($key)); //! columns looking like functions
|
||||
$key = "MD5(" . ($jush == 'sql' && preg_match("~^utf8_~", $fields[$key]["collation"]) ? $key : "CONVERT($key USING " . charset($connection) . ")") . ")";
|
||||
$key = "MD5(" . ($jush != 'sql' || preg_match("~^utf8~", $fields[$key]["collation"]) ? $key : "CONVERT($key USING " . charset($connection) . ")") . ")";
|
||||
$val = md5($val);
|
||||
}
|
||||
$unique_idf .= "&" . ($val !== null ? 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');") . ($is_group || information_schema(DB) ? "" : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "'>" . lang('edit') . "</a>"));
|
||||
echo "<tr" . odd() . ">" . (!$group && $select ? "" : "<td>"
|
||||
. checkbox("check[]", substr($unique_idf, 1), in_array(substr($unique_idf, 1), (array) $_POST["check"]))
|
||||
. ($is_group || information_schema(DB) ? "" : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "' class='edit'>" . lang('edit') . "</a>")
|
||||
);
|
||||
|
||||
foreach ($row as $key => $val) {
|
||||
if (isset($names[$key])) {
|
||||
$field = $fields[$key];
|
||||
$val = $driver->value($val, $field);
|
||||
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
|
||||
}
|
||||
@@ -391,9 +408,9 @@ if (!$columns && support("table")) {
|
||||
foreach ($foreign_key["source"] as $i => $source) {
|
||||
$link .= where_link($i, $foreign_key["target"][$i], $rows[$n][$source]);
|
||||
}
|
||||
$link = ($foreign_key["db"] != "" ? preg_replace('~([?&]db=)[^&]+~', '\\1' . urlencode($foreign_key["db"]), ME) : ME) . 'select=' . urlencode($foreign_key["table"]) . $link; // InnoDB supports non-UNIQUE keys
|
||||
$link = ($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 ($foreign_key["ns"]) {
|
||||
$link = preg_replace('~([?&]ns=)[^&]+~', '\\1' . urlencode($foreign_key["ns"]), $link);
|
||||
$link = preg_replace('~([?&]ns=)[^&]+~', '\1' . urlencode($foreign_key["ns"]), $link);
|
||||
}
|
||||
if (count($foreign_key["source"]) == 1) {
|
||||
break;
|
||||
@@ -424,8 +441,10 @@ if (!$columns && support("table")) {
|
||||
echo "<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]'>");
|
||||
} else {
|
||||
$long = strpos($val, "<i>...</i>");
|
||||
echo "<td id='$id'>$val</td>";
|
||||
echo script("qsl('td').onclick = partialArg(selectClick, " . ($long ? 2 : ($text ? 1 : 0)) . ($editable ? "" : ", '" . h(lang('Use edit link to modify this value.')) . "'") . ");", "");
|
||||
echo "<td id='$id' data-text='" . ($long ? 2 : ($text ? 1 : 0)) . "'"
|
||||
. ($editable ? "" : " data-warning='" . h(lang('Use edit link to modify this value.')) . "'")
|
||||
. ">$val</td>"
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -441,65 +460,77 @@ if (!$columns && support("table")) {
|
||||
exit;
|
||||
}
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
if (($rows || $page) && !is_ajax()) {
|
||||
$exact_count = true;
|
||||
if ($_GET["page"] != "last") {
|
||||
if ($limit == "") {
|
||||
$found_rows = count($rows);
|
||||
} elseif ($jush != "sql" || !$is_group) {
|
||||
$found_rows = ($is_group ? false : found_rows($table_status, $where));
|
||||
if ($found_rows < max(1e4, 2 * ($page + 1) * $limit)) {
|
||||
// slow with big tables
|
||||
$found_rows = reset(slow_query(count_rows($TABLE, $where, $is_group, $group)));
|
||||
} else {
|
||||
$exact_count = false;
|
||||
if (!is_ajax()) {
|
||||
if ($rows || $page) {
|
||||
$exact_count = true;
|
||||
if ($_GET["page"] != "last") {
|
||||
if ($limit == "" || (count($rows) < $limit && ($rows || !$page))) {
|
||||
$found_rows = ($page ? $page * $limit : 0) + count($rows);
|
||||
} elseif ($jush != "sql" || !$is_group) {
|
||||
$found_rows = ($is_group ? false : found_rows($table_status, $where));
|
||||
if ($found_rows < max(1e4, 2 * ($page + 1) * $limit)) {
|
||||
// slow with big tables
|
||||
$found_rows = reset(slow_query(count_rows($TABLE, $where, $is_group, $group)));
|
||||
} else {
|
||||
$exact_count = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($limit != "" && ($found_rows === false || $found_rows > $limit || $page)) {
|
||||
echo "<p class='pages'>";
|
||||
// display first, previous 4, next 4 and last page
|
||||
$max_page = ($found_rows === false
|
||||
? $page + (count($rows) >= $limit ? 2 : 1)
|
||||
: floor(($found_rows - 1) / $limit)
|
||||
);
|
||||
if ($jush != "simpledb") {
|
||||
echo '<a href="' . h(remove_from_uri("page")) . '">' . lang('Page') . "</a>:";
|
||||
echo script("qsl('a').onclick = function () { pageClick(this.href, +prompt('" . lang('Page') . "', '" . ($page + 1) . "')); return false; };");
|
||||
echo pagination(0, $page) . ($page > 5 ? " ..." : "");
|
||||
for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) {
|
||||
echo pagination($i, $page);
|
||||
}
|
||||
if ($max_page > 0) {
|
||||
echo ($page + 5 < $max_page ? " ..." : "");
|
||||
echo ($exact_count && $found_rows !== false
|
||||
? pagination($max_page, $page)
|
||||
: " <a href='" . h(remove_from_uri("page") . "&page=last") . "' title='~$max_page'>" . lang('last') . "</a>"
|
||||
);
|
||||
}
|
||||
$pagination = ($limit != "" && ($found_rows === false || $found_rows > $limit || $page));
|
||||
if ($pagination) {
|
||||
echo (($found_rows === false ? count($rows) + 1 : $found_rows - $page * $limit) > $limit
|
||||
? ' <a href="' . h(remove_from_uri("page") . "&page=" . ($page + 1)) . '" class="loadmore">' . lang('Load more data') . '</a>'
|
||||
? '<p><a href="' . h(remove_from_uri("page") . "&page=" . ($page + 1)) . '" class="loadmore">' . lang('Load more data') . '</a>'
|
||||
. script("qsl('a').onclick = partial(selectLoadMore, " . (+$limit) . ", '" . lang('Loading') . "...');", "")
|
||||
: ''
|
||||
);
|
||||
} else {
|
||||
echo lang('Page') . ":";
|
||||
echo pagination(0, $page) . ($page > 1 ? " ..." : "");
|
||||
echo ($page ? pagination($page, $page) : "");
|
||||
echo ($max_page > $page ? pagination($page + 1, $page) . ($max_page > $page + 1 ? " ..." : "") : "");
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<div class='footer'><div>\n";
|
||||
if ($rows || $page) {
|
||||
if ($pagination) {
|
||||
// display first, previous 4, next 4 and last page
|
||||
$max_page = ($found_rows === false
|
||||
? $page + (count($rows) >= $limit ? 2 : 1)
|
||||
: floor(($found_rows - 1) / $limit)
|
||||
);
|
||||
echo "<fieldset>";
|
||||
if ($jush != "simpledb") {
|
||||
echo "<legend><a href='" . h(remove_from_uri("page")) . "'>" . lang('Page') . "</a></legend>";
|
||||
echo script("qsl('a').onclick = function () { pageClick(this.href, +prompt('" . lang('Page') . "', '" . ($page + 1) . "')); return false; };");
|
||||
echo pagination(0, $page) . ($page > 5 ? " ..." : "");
|
||||
for ($i = max(1, $page - 4); $i < min($max_page, $page + 5); $i++) {
|
||||
echo pagination($i, $page);
|
||||
}
|
||||
if ($max_page > 0) {
|
||||
echo ($page + 5 < $max_page ? " ..." : "");
|
||||
echo ($exact_count && $found_rows !== false
|
||||
? pagination($max_page, $page)
|
||||
: " <a href='" . h(remove_from_uri("page") . "&page=last") . "' title='~$max_page'>" . lang('last') . "</a>"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
echo "<legend>" . lang('Page') . "</legend>";
|
||||
echo pagination(0, $page) . ($page > 1 ? " ..." : "");
|
||||
echo ($page ? pagination($page, $page) : "");
|
||||
echo ($max_page > $page ? pagination($page + 1, $page) . ($max_page > $page + 1 ? " ..." : "") : "");
|
||||
}
|
||||
echo "</fieldset>\n";
|
||||
}
|
||||
|
||||
echo "<fieldset>";
|
||||
echo "<legend>" . lang('Whole result') . "</legend>";
|
||||
$display_rows = ($exact_count ? "" : "~ ") . $found_rows;
|
||||
echo checkbox("all", 1, 0, ($found_rows !== false ? ($exact_count ? "" : "~ ") . lang('%d row(s)', $found_rows) : ""), "var checked = formChecked(this, /check/); selectCount('selected', this.checked ? '$display_rows' : checked); selectCount('selected2', this.checked || !checked ? '$display_rows' : checked);") . "\n";
|
||||
echo "</fieldset>\n";
|
||||
|
||||
echo "<p class='count'>\n";
|
||||
echo ($found_rows !== false ? "(" . ($exact_count ? "" : "~ ") . lang('%d row(s)', $found_rows) . ") " : "");
|
||||
$display_rows = ($exact_count ? "" : "~ ") . $found_rows;
|
||||
echo checkbox("all", 1, 0, lang('whole result'), "var checked = formChecked(this, /check/); selectCount('selected', this.checked ? '$display_rows' : checked); selectCount('selected2', this.checked || !checked ? '$display_rows' : checked);") . "\n";
|
||||
|
||||
if ($adminer->selectCommandPrint()) {
|
||||
?>
|
||||
if ($adminer->selectCommandPrint()) {
|
||||
?>
|
||||
<fieldset<?php echo ($_GET["modify"] ? '' : ' class="jsonly"'); ?>><legend><?php echo lang('Modify'); ?></legend><div>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>"<?php echo ($_GET["modify"] ? '' : ' title="' . lang('Ctrl+click on a value to modify it.') . '"'); ?>>
|
||||
</div></fieldset>
|
||||
@@ -509,39 +540,45 @@ if (!$columns && support("table")) {
|
||||
<input type="submit" name="delete" value="<?php echo lang('Delete'); ?>"><?php echo confirm(); ?>
|
||||
</div></fieldset>
|
||||
<?php
|
||||
}
|
||||
|
||||
$format = $adminer->dumpFormat();
|
||||
foreach ((array) $_GET["columns"] as $column) {
|
||||
if ($column["fun"]) {
|
||||
unset($format['sql']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($format) {
|
||||
print_fieldset("export", lang('Export') . " <span id='selected2'></span>");
|
||||
$output = $adminer->dumpOutput();
|
||||
echo ($output ? html_select("output", $output, $adminer_import["output"]) . " " : "");
|
||||
echo html_select("format", $format, $adminer_import["format"]);
|
||||
echo " <input type='submit' name='export' value='" . lang('Export') . "'>\n";
|
||||
echo "</div></fieldset>\n";
|
||||
|
||||
$format = $adminer->dumpFormat();
|
||||
foreach ((array) $_GET["columns"] as $column) {
|
||||
if ($column["fun"]) {
|
||||
unset($format['sql']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($format) {
|
||||
print_fieldset("export", lang('Export') . " <span id='selected2'></span>");
|
||||
$output = $adminer->dumpOutput();
|
||||
echo ($output ? html_select("output", $output, $adminer_import["output"]) . " " : "");
|
||||
echo html_select("format", $format, $adminer_import["format"]);
|
||||
echo " <input type='submit' name='export' value='" . lang('Export') . "'>\n";
|
||||
echo "</div></fieldset>\n";
|
||||
}
|
||||
|
||||
$adminer->selectEmailPrint(array_filter($email_fields, 'strlen'), $columns);
|
||||
}
|
||||
|
||||
echo "</div></div>\n";
|
||||
|
||||
if ($adminer->selectImportPrint()) {
|
||||
echo "<div>";
|
||||
echo "<a href='#import'>" . lang('Import') . "</a>";
|
||||
echo script("qsl('a').onclick = partial(toggle, 'import');", "");
|
||||
echo "<span id='import' class='hidden'>: ";
|
||||
echo "<input type='file' name='csv_file'> ";
|
||||
echo html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;", "tsv" => "TSV"), $adminer_import["format"], 1); // 1 - select
|
||||
echo " <input type='submit' name='import' value='" . lang('Import') . "'>";
|
||||
echo "</span>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
echo "<input type='hidden' name='token' value='$token'>\n";
|
||||
echo "</form>\n";
|
||||
echo (!$group && $select ? "" : script("tableCheck();"));
|
||||
}
|
||||
|
||||
if ($adminer->selectImportPrint()) {
|
||||
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_import["format"], 1); // 1 - select
|
||||
echo " <input type='submit' name='import' value='" . lang('Import') . "'>";
|
||||
echo "</div></fieldset>\n";
|
||||
}
|
||||
|
||||
$adminer->selectEmailPrint(array_filter($email_fields, 'strlen'), $columns);
|
||||
|
||||
echo "<p><input type='hidden' name='token' value='$token'></p>\n";
|
||||
echo "</form>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,7 @@ if (!$row) {
|
||||
<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(lang('Drop %s?', $SEQUENCE)) . "\n";
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
|
@@ -21,9 +21,10 @@ if (!$error && $_POST) {
|
||||
if (!isset($_GET["import"])) {
|
||||
$query = $_POST["query"];
|
||||
} elseif ($_POST["webfile"]) {
|
||||
$fp = @fopen((file_exists("adminer.sql")
|
||||
? "adminer.sql"
|
||||
: "compress.zlib://adminer.sql.gz"
|
||||
$sql_file_path = $adminer->importServerPath();
|
||||
$fp = @fopen((file_exists($sql_file_path)
|
||||
? $sql_file_path
|
||||
: "compress.zlib://$sql_file_path.gz"
|
||||
), "rb");
|
||||
$query = ($fp ? fread($fp, 1e6) : false);
|
||||
} else {
|
||||
@@ -55,7 +56,7 @@ if (!$error && $_POST) {
|
||||
}
|
||||
$commands = 0;
|
||||
$errors = array();
|
||||
$parse = '[\'"' . ($jush == "sql" ? '`#' : ($jush == "sqlite" ? '`[' : ($jush == "mssql" ? '[' : ''))) . ']|/\\*|-- |$' . ($jush == "pgsql" ? '|\\$[^$]*\\$' : '');
|
||||
$parse = '[\'"' . ($jush == "sql" ? '`#' : ($jush == "sqlite" ? '`[' : ($jush == "mssql" ? '[' : ''))) . ']|/\*|-- |$' . ($jush == "pgsql" ? '|\$[^$]*\$' : '');
|
||||
$total_start = microtime(true);
|
||||
parse_str($_COOKIE["adminer_export"], $adminer_export);
|
||||
$dump_format = $adminer->dumpFormat();
|
||||
@@ -77,7 +78,7 @@ if (!$error && $_POST) {
|
||||
$offset = $pos + strlen($found);
|
||||
|
||||
if ($found && rtrim($found) != $delimiter) { // find matching quote or comment end
|
||||
while (preg_match('(' . ($found == '/*' ? '\\*/' : ($found == '[' ? ']' : (preg_match('~^-- |^#~', $found) ? "\n" : preg_quote($found) . "|\\\\."))) . '|$)s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES
|
||||
while (preg_match('(' . ($found == '/*' ? '\*/' : ($found == '[' ? ']' : (preg_match('~^-- |^#~', $found) ? "\n" : preg_quote($found) . "|\\\\."))) . '|$)s', $query, $match, PREG_OFFSET_CAPTURE, $offset)) { //! respect sql_mode NO_BACKSLASH_ESCAPES
|
||||
$s = $match[0][0];
|
||||
if (!$s && $fp && !feof($fp)) {
|
||||
$query .= fread($fp, 1e5);
|
||||
@@ -116,9 +117,6 @@ if (!$error && $_POST) {
|
||||
|
||||
do {
|
||||
$result = $connection->store_result();
|
||||
$time = " <span class='time'>(" . format_time($start) . ")</span>"
|
||||
. (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 ($connection->error) {
|
||||
echo ($_POST["only_errors"] ? $print : "");
|
||||
@@ -128,41 +126,54 @@ if (!$error && $_POST) {
|
||||
break 2;
|
||||
}
|
||||
|
||||
} elseif (is_object($result)) {
|
||||
$limit = $_POST["limit"];
|
||||
$orgtables = select($result, $connection2, array(), $limit);
|
||||
if (!$_POST["only_errors"]) {
|
||||
echo "<form action='' method='post'>\n";
|
||||
$num_rows = $result->num_rows;
|
||||
echo "<p>" . ($num_rows ? ($limit && $num_rows > $limit ? lang('%d / ', $limit) : "") . lang('%d row(s)', $num_rows) : "");
|
||||
echo $time;
|
||||
$id = "export-$commands";
|
||||
$export = ", <a href='#$id'>" . lang('Export') . "</a>" . script("qsl('a').onclick = partial(toggle, '$id');", "") . "<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') . "'><input type='hidden' name='token' value='$token'></span>\n"
|
||||
;
|
||||
if ($connection2 && preg_match("~^($space|\\()*+SELECT\\b~i", $q) && ($explain = explain($connection2, $q))) {
|
||||
$id = "explain-$commands";
|
||||
echo ", <a href='#$id'>EXPLAIN</a>" . script("qsl('a').onclick = partial(toggle, '$id');", "") . $export;
|
||||
echo "<div id='$id' class='hidden'>\n";
|
||||
select($explain, $connection2, $orgtables);
|
||||
echo "</div>\n";
|
||||
} else {
|
||||
echo $export;
|
||||
}
|
||||
echo "</form>\n";
|
||||
}
|
||||
|
||||
} else {
|
||||
if (preg_match("~^$space*+(CREATE|DROP|ALTER)$space++(DATABASE|SCHEMA)\\b~i", $q)) {
|
||||
restart_session();
|
||||
set_session("dbs", null); // clear cache
|
||||
stop_session();
|
||||
$time = " <span class='time'>(" . format_time($start) . ")</span>"
|
||||
. (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
|
||||
;
|
||||
$affected = $connection->affected_rows; // getting warnigns overwrites this
|
||||
$warnings = ($_POST["only_errors"] ? "" : $driver->warnings());
|
||||
$warnings_id = "warnings-$commands";
|
||||
if ($warnings) {
|
||||
$time .= ", <a href='#$warnings_id'>" . lang('Warnings') . "</a>" . script("qsl('a').onclick = partial(toggle, '$warnings_id');", "");
|
||||
}
|
||||
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";
|
||||
$explain = null;
|
||||
$explain_id = "explain-$commands";
|
||||
if (is_object($result)) {
|
||||
$limit = $_POST["limit"];
|
||||
$orgtables = select($result, $connection2, array(), $limit);
|
||||
if (!$_POST["only_errors"]) {
|
||||
echo "<form action='' method='post'>\n";
|
||||
$num_rows = $result->num_rows;
|
||||
echo "<p>" . ($num_rows ? ($limit && $num_rows > $limit ? lang('%d / ', $limit) : "") . lang('%d row(s)', $num_rows) : "");
|
||||
echo $time;
|
||||
if ($connection2 && preg_match("~^($space|\\()*+SELECT\\b~i", $q) && ($explain = explain($connection2, $q))) {
|
||||
echo ", <a href='#$explain_id'>Explain</a>" . script("qsl('a').onclick = partial(toggle, '$explain_id');", "");
|
||||
}
|
||||
$id = "export-$commands";
|
||||
echo ", <a href='#$id'>" . lang('Export') . "</a>" . script("qsl('a').onclick = partial(toggle, '$id');", "") . "<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') . "'><input type='hidden' name='token' value='$token'></span>\n"
|
||||
. "</form>\n"
|
||||
;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (preg_match("~^$space*+(CREATE|DROP|ALTER)$space++(DATABASE|SCHEMA)\\b~i", $q)) {
|
||||
restart_session();
|
||||
set_session("dbs", null); // clear cache
|
||||
stop_session();
|
||||
}
|
||||
if (!$_POST["only_errors"]) {
|
||||
echo "<p class='message' title='" . h($connection->info) . "'>" . lang('Query executed OK, %d row(s) affected.', $affected) . "$time\n";
|
||||
}
|
||||
}
|
||||
echo ($warnings ? "<div id='$warnings_id' class='hidden'>\n$warnings</div>\n" : "");
|
||||
if ($explain) {
|
||||
echo "<div id='$explain_id' class='hidden'>\n";
|
||||
select($explain, $connection2, $orgtables);
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,21 +219,25 @@ if (!isset($_GET["import"])) {
|
||||
}
|
||||
echo "<p>";
|
||||
textarea("query", $q, 20);
|
||||
echo ($_POST ? "" : script("qs('textarea').focus();"));
|
||||
echo script(($_POST ? "" : "qs('textarea').focus();\n") . "qs('#form').onsubmit = partial(sqlSubmit, qs('#form'), '" . remove_from_uri("sql|limit|error_stops|only_errors") . "');");
|
||||
echo "<p>$execute\n";
|
||||
echo lang('Limit rows') . ": <input type='number' name='limit' class='size' value='" . h($_POST ? $_POST["limit"] : $_GET["limit"]) . "'>\n";
|
||||
|
||||
} else {
|
||||
echo "<fieldset><legend>" . lang('File upload') . "</legend><div>";
|
||||
$gz = (extension_loaded("zlib") ? "[.gz]" : "");
|
||||
echo (ini_bool("file_uploads")
|
||||
? "SQL (< " . ini_get("upload_max_filesize") . "B): <input type='file' name='sql_file[]' multiple>\n$execute" // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
|
||||
? "SQL$gz (< " . ini_get("upload_max_filesize") . "B): <input type='file' name='sql_file[]' multiple>\n$execute" // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
|
||||
: lang('File uploads are disabled.')
|
||||
);
|
||||
echo "</div></fieldset>\n";
|
||||
echo "<fieldset><legend>" . lang('From server') . "</legend><div>";
|
||||
echo lang('Webserver file %s', "<code>adminer.sql" . (extension_loaded("zlib") ? "[.gz]" : "") . "</code>");
|
||||
echo ' <input type="submit" name="webfile" value="' . lang('Run file') . '">';
|
||||
echo "</div></fieldset>\n";
|
||||
$importServerPath = $adminer->importServerPath();
|
||||
if ($importServerPath) {
|
||||
echo "<fieldset><legend>" . lang('From server') . "</legend><div>";
|
||||
echo lang('Webserver file %s', "<code>" . h($importServerPath) . "$gz</code>");
|
||||
echo ' <input type="submit" name="webfile" value="' . lang('Run file') . '">';
|
||||
echo "</div></fieldset>\n";
|
||||
}
|
||||
echo "<p>";
|
||||
}
|
||||
|
||||
|
@@ -1,8 +1,11 @@
|
||||
<?php
|
||||
function adminer_object() {
|
||||
include_once "../plugins/plugin.php";
|
||||
include_once "../plugins/login-sqlite.php";
|
||||
return new AdminerPlugin(array(new AdminerLoginSqlite("admin", password_hash("", PASSWORD_DEFAULT))));
|
||||
include_once "../plugins/login-password-less.php";
|
||||
return new AdminerPlugin(array(
|
||||
// TODO: inline the result of password_hash() so that the password is not visible in source codes
|
||||
new AdminerLoginPasswordLess(password_hash("YOUR_PASSWORD_HERE", PASSWORD_DEFAULT)),
|
||||
));
|
||||
}
|
||||
|
||||
include "./index.php";
|
||||
|
@@ -14,7 +14,7 @@ table { margin: 1em 20px 0 0; border-collapse: collapse; font-size: 90%; }
|
||||
td, th { border: 1px solid #999; padding: .2em .3em; }
|
||||
th { background: #eee; text-align: left; }
|
||||
thead th { text-align: center; padding: .2em .5em; }
|
||||
thead td, thead th { background: #ddf; }
|
||||
thead td, thead th { background: #ddf; } /* position: sticky; causes Firefox to lose borders */
|
||||
fieldset { display: inline; vertical-align: top; padding: .5em .8em; margin: .8em .5em 0 0; border: 1px solid #999; }
|
||||
p { margin: .8em 20px 0 0; }
|
||||
img { vertical-align: middle; border: 0; }
|
||||
@@ -23,7 +23,7 @@ code { background: #eee; }
|
||||
tbody tr:hover td, tbody tr:hover th { background: #eee; }
|
||||
pre { margin: 1em 0 0; }
|
||||
pre, textarea { font: 100%/1.25 monospace; }
|
||||
input[type=image] { vertical-align: middle; }
|
||||
input { vertical-align: middle; }
|
||||
input.default { box-shadow: 1px 1px 1px #777; }
|
||||
input.required { box-shadow: 1px 1px 1px red; }
|
||||
input.maxlength { box-shadow: 1px 1px 1px red; }
|
||||
@@ -32,11 +32,13 @@ input.wayoff { left: -1000px; position: absolute; }
|
||||
.version { color: #777; font-size: 67%; }
|
||||
.js .hidden, .nojs .jsonly { display: none; }
|
||||
.js .column { position: absolute; background: #ddf; padding: .27em 1ex .3em 0; margin-top: -.27em; }
|
||||
.nowrap td, .nowrap th, td.nowrap { white-space: pre; }
|
||||
.scrollable { overflow-x: auto; }
|
||||
.nowrap td, .nowrap th, td.nowrap, p.nowrap { white-space: pre; }
|
||||
.wrap td { white-space: normal; }
|
||||
.error { color: red; background: #fee; }
|
||||
.error b { background: #fff; font-weight: normal; }
|
||||
.message { color: green; background: #efe; }
|
||||
.message table { color: #000; background: #fff; }
|
||||
.error, .message { padding: .5em .8em; margin: 1em 20px 0 0; }
|
||||
.char { color: #007F00; }
|
||||
.date { color: #7F007F; }
|
||||
@@ -57,10 +59,13 @@ input.wayoff { left: -1000px; position: absolute; }
|
||||
.icon:hover { background-color: red; }
|
||||
.size { width: 6ex; }
|
||||
.help { cursor: help; }
|
||||
.pages { position: fixed; bottom: 0; left: 21em; padding: 5px; background: #ddf; border: 1px solid #999; }
|
||||
.footer { position: sticky; bottom: 0; margin-right: -20px; border-top: 20px solid rgba(255, 255, 255, .7); border-image: linear-gradient(rgba(255, 255, 255, .2), #fff) 100% 0; }
|
||||
.footer > div { background: #fff; padding: 0 0 .5em; }
|
||||
.footer fieldset { margin-top: 0; }
|
||||
.links a { white-space: nowrap; margin-right: 20px; }
|
||||
.logout { margin-top: .5em; position: absolute; top: 0; right: 0; }
|
||||
.loadmore { margin-left: 1ex; }
|
||||
/* .edit used in designs */
|
||||
#menu { position: absolute; margin: 10px 0 0; padding: 0 0 30px 0; top: 2em; left: 0; width: 19em; }
|
||||
#menu p, #tables { padding: .8em 1em; margin: 0; border-bottom: 1px solid #ccc; }
|
||||
#tables li{ list-style: none; }
|
||||
|
@@ -2,18 +2,28 @@
|
||||
|
||||
/** Load syntax highlighting
|
||||
* @param string first three characters of database system version
|
||||
* @param [boolean]
|
||||
*/
|
||||
function bodyLoad(version) {
|
||||
function bodyLoad(version, maria) {
|
||||
if (window.jush) {
|
||||
jush.create_links = ' target="_blank" rel="noreferrer"';
|
||||
jush.create_links = ' target="_blank" rel="noreferrer noopener"';
|
||||
if (version) {
|
||||
for (var key in jush.urls) {
|
||||
var obj = jush.urls;
|
||||
if (typeof obj[key] != 'string') {
|
||||
obj = obj[key];
|
||||
key = 0;
|
||||
if (maria) {
|
||||
for (var i = 1; i < obj.length; i++) {
|
||||
obj[i] = obj[i]
|
||||
.replace(/\.html/, '/')
|
||||
.replace(/(numeric)(-type-overview)/, (maria ? '$1-data$2' : '$&')) // MariaDB
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
obj[key] = obj[key]
|
||||
.replace(/dev\.mysql\.com\/doc\/mysql\/en\//, (maria ? 'mariadb.com/kb/en/library/' : '$&')) // MariaDB
|
||||
.replace(/\/doc\/mysql/, '/doc/refman/' + version) // MySQL
|
||||
.replace(/\/docs\/current/, '/docs/' + version) // PostgreSQL
|
||||
;
|
||||
@@ -181,6 +191,52 @@ function idfEscape(s) {
|
||||
return s.replace(/`/, '``');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Handle clicks on fields editing
|
||||
* @param MouseEvent
|
||||
* @return boolean false to cancel action
|
||||
*/
|
||||
function editingClick(event) {
|
||||
var el = getTarget(event);
|
||||
if (!isTag(el, 'input')) {
|
||||
el = parentTag(target, 'label');
|
||||
el = el && qs('input', el);
|
||||
}
|
||||
if (el) {
|
||||
var name = el.name;
|
||||
if (/^add\[/.test(name)) {
|
||||
editingAddRow.call(el, 1);
|
||||
} else if (/^up\[/.test(name)) {
|
||||
editingMoveRow.call(el, 1);
|
||||
} else if (/^down\[/.test(name)) {
|
||||
editingMoveRow.call(el);
|
||||
} else if (/^drop_col\[/.test(name)) {
|
||||
editingRemoveRow.call(el, 'fields\$1[field]');
|
||||
} else {
|
||||
if (name == 'auto_increment_col') {
|
||||
var field = el.form['fields[' + el.value + '][field]'];
|
||||
if (!field.value) {
|
||||
field.value = 'id';
|
||||
field.oninput();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/** Handle input on fields editing
|
||||
* @param InputEvent
|
||||
*/
|
||||
function editingInput(event) {
|
||||
var el = getTarget(event);
|
||||
if (/\[default\]$/.test(el.name)) {
|
||||
el.previousSibling.checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
/** Detect foreign key
|
||||
* @this HTMLInputElement
|
||||
*/
|
||||
@@ -262,7 +318,7 @@ function editingAddRow(focus) {
|
||||
}
|
||||
|
||||
/** Remove table row for field
|
||||
* @param string
|
||||
* @param string regular expression replacement
|
||||
* @return boolean false
|
||||
* @this HTMLInputElement
|
||||
*/
|
||||
@@ -274,16 +330,16 @@ function editingRemoveRow(name) {
|
||||
}
|
||||
|
||||
/** Move table row for field
|
||||
* @param boolean direction to move row, true for up or false for down
|
||||
* @param [boolean]
|
||||
* @return boolean false for success
|
||||
* @this HTMLInputElement
|
||||
*/
|
||||
function editingMoveRow(dir){
|
||||
function editingMoveRow(up){
|
||||
var row = parentTag(this, 'tr');
|
||||
if (!('nextElementSibling' in row)) {
|
||||
return true;
|
||||
}
|
||||
row.parentNode.insertBefore(row, dir
|
||||
row.parentNode.insertBefore(row, up
|
||||
? row.previousElementSibling
|
||||
: row.nextElementSibling ? row.nextElementSibling.nextElementSibling : row.parentNode.firstChild);
|
||||
return false;
|
||||
@@ -316,7 +372,7 @@ function editingTypeChange() {
|
||||
alterClass(el, 'hidden', !/(char|text|enum|set)$/.test(text));
|
||||
}
|
||||
if (el.name == name + '[unsigned]') {
|
||||
alterClass(el, 'hidden', !/((^|[^o])int|float|double|decimal)$/.test(text));
|
||||
alterClass(el, 'hidden', !/(^|[^o])int(?!er)|numeric|real|float|double|decimal|money/.test(text));
|
||||
}
|
||||
if (el.name == name + '[on_update]') {
|
||||
alterClass(el, 'hidden', !/timestamp|datetime/.test(text)); // MySQL supports datetime since 5.6.5
|
||||
@@ -342,8 +398,7 @@ function editingLengthFocus() {
|
||||
var td = this.parentNode;
|
||||
if (/(enum|set)$/.test(selectValue(td.previousSibling.firstChild))) {
|
||||
var edit = qs('#enum-edit');
|
||||
var val = this.value;
|
||||
edit.value = (/^'.+'$/.test(val) ? val.substr(1, val.length - 2).replace(/','/g, "\n").replace(/''/g, "'") : val); //! doesn't handle 'a'',''b' correctly
|
||||
edit.value = enumValues(this.value);
|
||||
td.appendChild(edit);
|
||||
this.style.display = 'none';
|
||||
edit.style.display = 'inline';
|
||||
@@ -351,13 +406,32 @@ function editingLengthFocus() {
|
||||
}
|
||||
}
|
||||
|
||||
/** Get enum values
|
||||
* @param string
|
||||
* @return string values separated by newlines
|
||||
*/
|
||||
function enumValues(s) {
|
||||
var re = /(^|,)\s*'(([^\\']|\\.|'')*)'\s*/g;
|
||||
var result = [];
|
||||
var offset = 0;
|
||||
var match;
|
||||
while (match = re.exec(s)) {
|
||||
if (offset != match.index) {
|
||||
break;
|
||||
}
|
||||
result.push(match[2].replace(/'(')|\\(.)/g, '$1$2'));
|
||||
offset += match[0].length;
|
||||
}
|
||||
return (offset == s.length ? result.join('\n') : s);
|
||||
}
|
||||
|
||||
/** Finish editing of enum or set
|
||||
* @this HTMLTextAreaElement
|
||||
*/
|
||||
function editingLengthBlur() {
|
||||
var field = this.parentNode.firstChild;
|
||||
var val = this.value;
|
||||
field.value = (/^'[^\n]+'$/.test(val) ? val : val && "'" + val.replace(/\n+$/, '').replace(/'/g, "''").replace(/\n/g, "','") + "'");
|
||||
field.value = (/^'[^\n]+'$/.test(val) ? val : val && "'" + val.replace(/\n+$/, '').replace(/'/g, "''").replace(/\\/g, '\\\\').replace(/\n/g, "','") + "'");
|
||||
field.style.display = 'inline';
|
||||
this.style.display = 'none';
|
||||
}
|
||||
@@ -378,7 +452,6 @@ function columnShow(checked, column) {
|
||||
function editingHideDefaults() {
|
||||
if (innerWidth < document.documentElement.scrollWidth) {
|
||||
qs('#form')['defaults'].checked = false;
|
||||
columnShow(false, 5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,14 +475,45 @@ function partitionNameChange() {
|
||||
this.oninput = function () {};
|
||||
}
|
||||
|
||||
/** Show or hide comment fields
|
||||
* @param [boolean] whether to focus Comment if checked
|
||||
* @this HTMLInputElement
|
||||
*/
|
||||
function editingCommentsClick(focus) {
|
||||
var comment = this.form['Comment'];
|
||||
columnShow(this.checked, 6);
|
||||
alterClass(comment, 'hidden', !this.checked);
|
||||
if (focus && this.checked) {
|
||||
comment.focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Uncheck 'all' checkbox
|
||||
* @param MouseEvent
|
||||
* @this HTMLTableElement
|
||||
*/
|
||||
function dumpClick(event) {
|
||||
var el = parentTag(getTarget(event), 'label');
|
||||
if (el) {
|
||||
el = qs('input', el);
|
||||
var match = /(.+)\[\]$/.exec(el.name);
|
||||
if (match) {
|
||||
checkboxClick.call(el, event);
|
||||
formUncheck('check-' + match[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Add row for foreign key
|
||||
* @this HTMLSelectElement
|
||||
*/
|
||||
function foreignAddRow() {
|
||||
this.onchange = function () { };
|
||||
var row = cloneNode(parentTag(this, 'tr'));
|
||||
this.onchange = function () { };
|
||||
var selects = qsa('select', row);
|
||||
for (var i=0; i < selects.length; i++) {
|
||||
selects[i].name = selects[i].name.replace(/\]/, '1$&');
|
||||
@@ -424,8 +528,8 @@ function foreignAddRow() {
|
||||
* @this HTMLSelectElement
|
||||
*/
|
||||
function indexesAddRow() {
|
||||
this.onchange = function () { };
|
||||
var row = cloneNode(parentTag(this, 'tr'));
|
||||
this.onchange = function () { };
|
||||
var selects = qsa('select', row);
|
||||
for (var i=0; i < selects.length; i++) {
|
||||
selects[i].name = selects[i].name.replace(/indexes\[\d+/, '$&1');
|
||||
@@ -494,6 +598,23 @@ function indexesAddColumn(prefix) {
|
||||
|
||||
|
||||
|
||||
/** Updates the form action
|
||||
* @param HTMLFormElement
|
||||
* @param string
|
||||
*/
|
||||
function sqlSubmit(form, root) {
|
||||
if (encodeURIComponent(form['query'].value).length < 2e3) {
|
||||
form.action = root
|
||||
+ '&sql=' + encodeURIComponent(form['query'].value)
|
||||
+ (form['limit'].value ? '&limit=' + +form['limit'].value : '')
|
||||
+ (form['error_stops'].checked ? '&error_stops=1' : '')
|
||||
+ (form['only_errors'].checked ? '&only_errors=1' : '')
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Handle changing trigger time or event
|
||||
* @param RegExp
|
||||
* @param string
|
||||
|
@@ -1,10 +1,11 @@
|
||||
|
||||
/** Get first element by selector
|
||||
* @param string
|
||||
* @param [HTMLElement] defaults to document
|
||||
* @return HTMLElement
|
||||
*/
|
||||
function qs(selector) {
|
||||
return document.querySelector(selector);
|
||||
function qs(selector, context) {
|
||||
return (context || document).querySelector(selector);
|
||||
}
|
||||
|
||||
/** Get last element by selector
|
||||
@@ -95,8 +96,10 @@ function cookie(assign, days) {
|
||||
|
||||
/** Verify current Adminer version
|
||||
* @param string
|
||||
* @param string own URL base
|
||||
* @param string
|
||||
*/
|
||||
function verifyVersion(current) {
|
||||
function verifyVersion(current, url, token) {
|
||||
cookie('adminer_version=0', 1);
|
||||
var iframe = document.createElement('iframe');
|
||||
iframe.src = 'https://www.adminer.org/version/?current=' + current;
|
||||
@@ -112,6 +115,8 @@ function verifyVersion(current) {
|
||||
var match = /version=(.+)/.exec(event.data);
|
||||
if (match) {
|
||||
cookie('adminer_version=' + match[1], 1);
|
||||
ajax(url + 'script=version', function () {
|
||||
}, event.data + '&token=' + token);
|
||||
}
|
||||
}
|
||||
}, false);
|
||||
@@ -138,7 +143,7 @@ function selectValue(select) {
|
||||
*/
|
||||
function isTag(el, tag) {
|
||||
var re = new RegExp('^(' + tag + ')$', 'i');
|
||||
return re.test(el.tagName);
|
||||
return el && re.test(el.tagName);
|
||||
}
|
||||
|
||||
/** Get parent node with specified tag name
|
||||
@@ -167,9 +172,10 @@ function trCheck(el) {
|
||||
/** Fill number of selected items
|
||||
* @param string
|
||||
* @param string
|
||||
* @uses thousandsSeparator
|
||||
*/
|
||||
function selectCount(id, count) {
|
||||
setHtml(id, (count === '' ? '' : '(' + (count + '').replace(/\B(?=(\d{3})+$)/g, ' ') + ')'));
|
||||
setHtml(id, (count === '' ? '' : '(' + (count + '').replace(/\B(?=(\d{3})+$)/g, thousandsSeparator) + ')'));
|
||||
var el = qs('#' + id);
|
||||
if (el) {
|
||||
var inputs = qsa('input', el.parentNode.parentNode);
|
||||
@@ -199,14 +205,9 @@ function formCheck(name) {
|
||||
/** Check all rows in <table class="checkable">
|
||||
*/
|
||||
function tableCheck() {
|
||||
var tables = qsa('table', document);
|
||||
for (var i=0; i < tables.length; i++) {
|
||||
if (/(^|\s)checkable(\s|$)/.test(tables[i].className)) {
|
||||
var trs = qsa('tr', tables[i]);
|
||||
for (var j=0; j < trs.length; j++) {
|
||||
trCheck(trs[j].firstChild.firstChild);
|
||||
}
|
||||
}
|
||||
var inputs = qsa('table.checkable td:first-child input', document);
|
||||
for (var i=0; i < inputs.length; i++) {
|
||||
trCheck(inputs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,6 +241,13 @@ function formChecked(el, name) {
|
||||
* @param [boolean] force click
|
||||
*/
|
||||
function tableClick(event, click) {
|
||||
var td = parentTag(getTarget(event), 'td');
|
||||
var text;
|
||||
if (td && (text = td.getAttribute('data-text'))) {
|
||||
if (selectClick.call(td, event, +text, td.getAttribute('data-warning'))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
click = (click || !window.getSelection || getSelection().isCollapsed);
|
||||
var el = getTarget(event);
|
||||
while (!isTag(el, 'tr')) {
|
||||
@@ -260,6 +268,13 @@ function tableClick(event, click) {
|
||||
el.checked = !el.checked;
|
||||
el.onclick && el.onclick();
|
||||
}
|
||||
if (el.name == 'check[]') {
|
||||
el.form['all'].checked = false;
|
||||
formUncheck('all-page');
|
||||
}
|
||||
if (/^(tables|views)\[\]$/.test(el.name)) {
|
||||
formUncheck('check-all');
|
||||
}
|
||||
trCheck(el);
|
||||
}
|
||||
|
||||
@@ -299,13 +314,13 @@ function checkboxClick(event) {
|
||||
|
||||
/** Set HTML code of an element
|
||||
* @param string
|
||||
* @param string undefined to set parentNode to
|
||||
* @param string undefined to set parentNode to empty string
|
||||
*/
|
||||
function setHtml(id, html) {
|
||||
var el = qs('#' + id);
|
||||
var el = qs('[id="' + id.replace(/[\\"]/g, '\\$&') + '"]'); // database name is used as ID
|
||||
if (el) {
|
||||
if (html == null) {
|
||||
el.parentNode.innerHTML = ' ';
|
||||
el.parentNode.innerHTML = '';
|
||||
} else {
|
||||
el.innerHTML = html;
|
||||
}
|
||||
@@ -437,7 +452,7 @@ function selectSearch(name) {
|
||||
div.firstChild.value = name;
|
||||
div.firstChild.onchange();
|
||||
}
|
||||
div.lastChild.focus();
|
||||
qs('[name$="[val]"]', div).focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -476,6 +491,9 @@ function bodyKeydown(event, button) {
|
||||
if (button) {
|
||||
target.form[button].click();
|
||||
} else {
|
||||
if (target.form.onsubmit) {
|
||||
target.form.onsubmit();
|
||||
}
|
||||
target.form.submit();
|
||||
}
|
||||
target.focus();
|
||||
@@ -525,20 +543,22 @@ function editingKeydown(event) {
|
||||
*/
|
||||
function functionChange() {
|
||||
var input = this.form[this.name.replace(/^function/, 'fields')];
|
||||
if (selectValue(this)) {
|
||||
if (input.origType === undefined) {
|
||||
input.origType = input.type;
|
||||
input.origMaxLength = input.getAttribute('data-maxlength');
|
||||
}
|
||||
input.removeAttribute('data-maxlength');
|
||||
input.type = 'text';
|
||||
} else if (input.origType) {
|
||||
input.type = input.origType;
|
||||
if (input.origMaxLength >= 0) {
|
||||
input.setAttribute('data-maxlength', input.origMaxLength);
|
||||
if (input) { // undefined with the set data type
|
||||
if (selectValue(this)) {
|
||||
if (input.origType === undefined) {
|
||||
input.origType = input.type;
|
||||
input.origMaxLength = input.getAttribute('data-maxlength');
|
||||
}
|
||||
input.removeAttribute('data-maxlength');
|
||||
input.type = 'text';
|
||||
} else if (input.origType) {
|
||||
input.type = input.origType;
|
||||
if (input.origMaxLength >= 0) {
|
||||
input.setAttribute('data-maxlength', input.origMaxLength);
|
||||
}
|
||||
}
|
||||
oninput({target: input});
|
||||
}
|
||||
oninput({target: input});
|
||||
helpClose();
|
||||
}
|
||||
|
||||
@@ -575,6 +595,7 @@ function fieldChange() {
|
||||
* @param [string]
|
||||
* @param [string]
|
||||
* @return XMLHttpRequest or false in case of an error
|
||||
* @uses offlineMessage
|
||||
*/
|
||||
function ajax(url, callback, data, message) {
|
||||
var request = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false));
|
||||
@@ -659,7 +680,8 @@ function ajaxForm(form, message, button) {
|
||||
/** Display edit field
|
||||
* @param MouseEvent
|
||||
* @param number display textarea instead of input, 2 - load long text
|
||||
* @param string warning to display
|
||||
* @param [string] warning to display
|
||||
* @return boolean
|
||||
* @this HTMLElement
|
||||
*/
|
||||
function selectClick(event, text, warning) {
|
||||
@@ -669,7 +691,8 @@ function selectClick(event, text, warning) {
|
||||
return;
|
||||
}
|
||||
if (warning) {
|
||||
return alert(warning);
|
||||
alert(warning);
|
||||
return true;
|
||||
}
|
||||
var original = td.innerHTML;
|
||||
text = text || /\n/.test(original);
|
||||
@@ -684,7 +707,7 @@ function selectClick(event, text, warning) {
|
||||
}
|
||||
};
|
||||
var pos = event.rangeOffset;
|
||||
var value = td.firstChild.alt || td.textContent || td.innerText;
|
||||
var value = (td.firstChild && td.firstChild.alt) || td.textContent || td.innerText;
|
||||
input.style.width = Math.max(td.clientWidth - 14, 20) + 'px'; // 14 = 2 * (td.border + td.padding + input.border)
|
||||
if (text) {
|
||||
var rows = 1;
|
||||
@@ -693,7 +716,7 @@ function selectClick(event, text, warning) {
|
||||
});
|
||||
input.rows = rows;
|
||||
}
|
||||
if (value == '\u00A0' || qsa('i', td).length) { // or i - NULL
|
||||
if (qsa('i', td).length) { // <i> - NULL
|
||||
value = '';
|
||||
}
|
||||
if (document.selection) {
|
||||
@@ -725,6 +748,7 @@ function selectClick(event, text, warning) {
|
||||
range.moveEnd('character', -input.value.length + pos);
|
||||
range.select();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -823,6 +847,9 @@ function findDefaultSubmit(el) {
|
||||
if (el.jushTextarea) {
|
||||
el = el.jushTextarea;
|
||||
}
|
||||
if (!el.form) {
|
||||
return null;
|
||||
}
|
||||
var inputs = qsa('input', el.form);
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
var input = inputs[i];
|
||||
|
@@ -5,13 +5,14 @@ if (!$fields) {
|
||||
$error = error();
|
||||
}
|
||||
$table_status = table_status1($TABLE, true);
|
||||
$name = $adminer->tableName($table_status);
|
||||
|
||||
page_header(($fields && is_view($table_status) ? $table_status['Engine'] == 'materialized view' ? lang('Materialized view') : lang('View') : lang('Table')) . ": " . h($TABLE), $error);
|
||||
page_header(($fields && is_view($table_status) ? $table_status['Engine'] == 'materialized view' ? lang('Materialized view') : lang('View') : lang('Table')) . ": " . ($name != "" ? $name : h($TABLE)), $error);
|
||||
|
||||
$adminer->selectLinks($table_status);
|
||||
$comment = $table_status["Comment"];
|
||||
if ($comment != "") {
|
||||
echo "<p>" . lang('Comment') . ": " . h($comment) . "\n";
|
||||
echo "<p class='nowrap'>" . lang('Comment') . ": " . h($comment) . "\n";
|
||||
}
|
||||
|
||||
if ($fields) {
|
||||
@@ -33,7 +34,7 @@ if (!is_view($table_status)) {
|
||||
$foreign_keys = foreign_keys($TABLE);
|
||||
if ($foreign_keys) {
|
||||
echo "<table cellspacing='0'>\n";
|
||||
echo "<thead><tr><th>" . lang('Source') . "<td>" . lang('Target') . "<td>" . lang('ON DELETE') . "<td>" . lang('ON UPDATE') . "<td> </thead>\n";
|
||||
echo "<thead><tr><th>" . lang('Source') . "<td>" . lang('Target') . "<td>" . lang('ON DELETE') . "<td>" . lang('ON UPDATE') . "<td></thead>\n";
|
||||
foreach ($foreign_keys as $name => $foreign_key) {
|
||||
echo "<tr title='" . h($name) . "'>";
|
||||
echo "<th><i>" . implode("</i>, <i>", array_map('h', $foreign_key["source"])) . "</i>";
|
||||
@@ -42,8 +43,8 @@ if (!is_view($table_status)) {
|
||||
. "</a>"
|
||||
;
|
||||
echo "(<i>" . implode("</i>, <i>", array_map('h', $foreign_key["target"])) . "</i>)";
|
||||
echo "<td>" . nbsp($foreign_key["on_delete"]) . "\n";
|
||||
echo "<td>" . nbsp($foreign_key["on_update"]) . "\n";
|
||||
echo "<td>" . h($foreign_key["on_delete"]) . "\n";
|
||||
echo "<td>" . h($foreign_key["on_update"]) . "\n";
|
||||
echo '<td><a href="' . h(ME . 'foreign=' . urlencode($TABLE) . '&name=' . urlencode($name)) . '">' . lang('Alter') . '</a>';
|
||||
}
|
||||
echo "</table>\n";
|
||||
|
@@ -33,17 +33,17 @@ page_header(($name != "" ? lang('Alter trigger') . ": " . h($name) : lang('Creat
|
||||
?>
|
||||
|
||||
<form action="" method="post" id="form">
|
||||
<table cellspacing="0">
|
||||
<table cellspacing="0" class="layout">
|
||||
<tr><th><?php echo lang('Time'); ?><td><?php echo html_select("Timing", $trigger_options["Timing"], $row["Timing"], "triggerChange(/^" . preg_quote($TABLE, "/") . "_[ba][iud]$/, '" . js_escape($TABLE) . "', this.form);"); ?>
|
||||
<tr><th><?php echo lang('Event'); ?><td><?php echo html_select("Event", $trigger_options["Event"], $row["Event"], "this.form['Timing'].onchange();"); ?>
|
||||
<?php echo (in_array("UPDATE OF", $trigger_options["Event"]) ? " <input name='Of' value='" . h($row["Of"]) . "' class='hidden'>": ""); ?>
|
||||
<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" autocapitalize="off">
|
||||
<p><?php echo lang('Name'); ?>: <input name="Trigger" value="<?php echo h($row["Trigger"]); ?>" data-maxlength="64" autocapitalize="off">
|
||||
<?php echo script("qs('#form')['Timing'].onchange();"); ?>
|
||||
<p><?php textarea("Statement", $row["Statement"]); ?>
|
||||
<p>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<?php if ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(); ?><?php } ?>
|
||||
<?php if ($name != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $name)); ?><?php } ?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
|
@@ -22,7 +22,7 @@ if (!$row) {
|
||||
<p>
|
||||
<?php
|
||||
if ($TYPE != "") {
|
||||
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm() . "\n";
|
||||
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm(lang('Drop %s?', $TYPE)) . "\n";
|
||||
} else {
|
||||
echo "<input name='name' value='" . h($row['name']) . "' autocapitalize='off'>\n";
|
||||
textarea("as", $row["as"]);
|
||||
|
@@ -29,7 +29,7 @@ $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
|
||||
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
|
||||
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) {
|
||||
if ($val[1] != "USAGE") {
|
||||
$grants["$match[2]$val[2]"][$val[1]] = true;
|
||||
@@ -61,7 +61,7 @@ if ($_POST && !$error) {
|
||||
$created = false;
|
||||
if (!$error) {
|
||||
if ($old_user != $new_user) {
|
||||
$created = queries(($connection->server_info < 5 ? "GRANT USAGE ON *.* TO" : "CREATE USER") . " $new_user IDENTIFIED BY PASSWORD " . q($pass));
|
||||
$created = queries((min_version(5) ? "CREATE USER" : "GRANT USAGE ON *.* TO") . " $new_user IDENTIFIED BY PASSWORD " . q($pass));
|
||||
$error = !$created;
|
||||
} elseif ($pass != $old_pass) {
|
||||
queries("SET PASSWORD FOR $new_user = " . q($pass));
|
||||
@@ -84,7 +84,7 @@ if ($_POST && !$error) {
|
||||
$grant = array_diff($grant, $old_grant);
|
||||
unset($grants[$object]);
|
||||
}
|
||||
if (preg_match('~^(.+)\\s*(\\(.*\\))?$~U', $object, $match) && (
|
||||
if (preg_match('~^(.+)\s*(\(.*\))?$~U', $object, $match) && (
|
||||
!grant("REVOKE", $revoke, $match[2], " ON $match[1] FROM $new_user") //! SQL injection
|
||||
|| !grant("GRANT", $grant, $match[2], " ON $match[1] TO $new_user")
|
||||
)) {
|
||||
@@ -99,7 +99,7 @@ if ($_POST && !$error) {
|
||||
queries("DROP USER $old_user");
|
||||
} elseif (!isset($_GET["grant"])) {
|
||||
foreach ($grants as $object => $revoke) {
|
||||
if (preg_match('~^(.+)(\\(.*\\))?$~U', $object, $match)) {
|
||||
if (preg_match('~^(.+)(\(.*\))?$~U', $object, $match)) {
|
||||
grant("REVOKE", array_keys($revoke), $match[2], " ON $match[1] FROM $new_user");
|
||||
}
|
||||
}
|
||||
@@ -131,10 +131,10 @@ if ($_POST) {
|
||||
|
||||
?>
|
||||
<form action="" method="post">
|
||||
<table cellspacing="0">
|
||||
<tr><th><?php echo lang('Server'); ?><td><input name="host" maxlength="60" value="<?php echo h($row["host"]); ?>" autocapitalize="off">
|
||||
<tr><th><?php echo lang('Username'); ?><td><input name="user" maxlength="16" value="<?php echo h($row["user"]); ?>" autocapitalize="off">
|
||||
<tr><th><?php echo lang('Password'); ?><td><input name="pass" id="pass" value="<?php echo h($row["pass"]); ?>">
|
||||
<table cellspacing="0" class="layout">
|
||||
<tr><th><?php echo lang('Server'); ?><td><input name="host" data-maxlength="60" value="<?php echo h($row["host"]); ?>" autocapitalize="off">
|
||||
<tr><th><?php echo lang('Username'); ?><td><input name="user" data-maxlength="80" value="<?php echo h($row["user"]); ?>" autocapitalize="off">
|
||||
<tr><th><?php echo lang('Password'); ?><td><input name="pass" id="pass" value="<?php echo h($row["pass"]); ?>" autocomplete="new-password">
|
||||
<?php if (!$row["hashed"]) { echo script("typePassword(qs('#pass'));"); } ?>
|
||||
<?php echo checkbox("hashed", 1, $row["hashed"], lang('Hashed'), "typePassword(this.form['pass'], this.checked);"); ?>
|
||||
</table>
|
||||
@@ -165,7 +165,7 @@ foreach (array(
|
||||
$name = "'grants[$i][" . h(strtoupper($privilege)) . "]'";
|
||||
$value = $grant[strtoupper($privilege)];
|
||||
if ($context == "Server Admin" && $object != (isset($grants["*.*"]) ? "*.*" : ".*")) {
|
||||
echo "<td> ";
|
||||
echo "<td>";
|
||||
} elseif (isset($_GET["grant"])) {
|
||||
echo "<td><select name=$name><option><option value='1'" . ($value ? " selected" : "") . ">" . lang('Grant') . "<option value='0'" . ($value == "0" ? " selected" : "") . ">" . lang('Revoke') . "</select>";
|
||||
} else {
|
||||
@@ -184,6 +184,6 @@ 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 } ?>
|
||||
<?php if (isset($_GET["host"])) { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', "$USER@$_GET[host]")); ?><?php } ?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
|
@@ -10,7 +10,7 @@ if (!$variables) {
|
||||
foreach ($variables as $key => $val) {
|
||||
echo "<tr>";
|
||||
echo "<th><code class='jush-" . $jush . ($status ? "status" : "set") . "'>" . h($key) . "</code>";
|
||||
echo "<td>" . nbsp($val);
|
||||
echo "<td>" . h($val);
|
||||
}
|
||||
echo "</table>\n";
|
||||
}
|
||||
|
@@ -48,11 +48,11 @@ page_header(($TABLE != "" ? lang('Alter view') : lang('Create view')), $error, a
|
||||
?>
|
||||
|
||||
<form action="" method="post">
|
||||
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" maxlength="64" autocapitalize="off">
|
||||
<p><?php echo lang('Name'); ?>: <input name="name" value="<?php echo h($row["name"]); ?>" data-maxlength="64" autocapitalize="off">
|
||||
<?php echo (support("materializedview") ? " " . checkbox("materialized", 1, $row["materialized"], lang('Materialized view')) : ""); ?>
|
||||
<p><?php textarea("select", $row["select"]); ?>
|
||||
<p>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<?php if ($_GET["view"] != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(); ?><?php } ?>
|
||||
<?php if ($TABLE != "") { ?><input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $TABLE)); ?><?php } ?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
|
110
changes.txt
110
changes.txt
@@ -1,3 +1,113 @@
|
||||
Adminer 4.7.0 (released 2018-11-24):
|
||||
Simplify storing executed SQL queries to bookmarks
|
||||
Warn when using password with leading or trailing spaces
|
||||
Hide import from server if importServerPath() returns an empty string
|
||||
Fix inline editing of empty cells (regression from 4.6.3)
|
||||
Allow adding more than two indexes and forign key columns at a time (regression from 4.4.0)
|
||||
Avoid overwriting existing tables when copying tables (bug #642)
|
||||
Fix function change with set data type
|
||||
Increase username maxlength to 80 (bug #623)
|
||||
Make maxlength in all fields a soft limit
|
||||
Make tables horizontally scrollable
|
||||
MySQL: Support foreign keys created with ANSI quotes (bug #620)
|
||||
MySQL: Recognize ON UPDATE current_timestamp() (bug #632, bug #638)
|
||||
MySQL: Descending indexes in MySQL 8 (bug #643)
|
||||
PostgreSQL: Quote array values in export (bug #621)
|
||||
PostgreSQL: Export DESC indexes (bug #639)
|
||||
PostgreSQL: Support GENERATED BY DEFAULT AS IDENTITY in PostgreSQL 10
|
||||
MS SQL: Pass database when connecting
|
||||
ClickHouse: Connect, databases list, tables list, select, SQL command
|
||||
Georgian translation
|
||||
|
||||
Adminer 4.6.3 (released 2018-06-28):
|
||||
Disallow using password-less databases
|
||||
Copy triggers when copying table
|
||||
Stop session before connecting
|
||||
Simplify running slow queries
|
||||
Decrease timeout for running slow queries from 5 seconds to 2 seconds
|
||||
Fix displaying info about non-alphabetical objects (bug #599)
|
||||
Use secure cookies on HTTP if session.cookie_secure is set
|
||||
PDO: Support binary fields download
|
||||
MySQL: Disallow LOAD DATA LOCAL INFILE
|
||||
MySQL: Use CONVERT() only when searching for non-ASCII (bug #603)
|
||||
MySQL: Order database names in MySQL 8 (bug #613)
|
||||
PostgreSQL: Fix editing data in views (bug #605, regression from 4.6.0)
|
||||
PostgreSQL: Do not cast date/time/number/uuid searches to text (bug #608)
|
||||
PostgreSQL: Export false as 0 in PDO (bug #619)
|
||||
MS SQL: Support port with sqlsrv
|
||||
Editor: Do not check boolean checkboxes with false in PostgreSQL (bug #607)
|
||||
|
||||
Adminer 4.6.2 (released 2018-02-20):
|
||||
Semi-transparent border on table actions
|
||||
Shorten JSON values in select (bug #594)
|
||||
Speed up alter table form (regression from 4.4.0)
|
||||
Store current version without authentication and in Editor
|
||||
PostgreSQL: Fix exporting string default values
|
||||
PostgreSQL: Fix exporting sequences in PostgreSQL 10
|
||||
PostgreSQL: Add IF EXISTS to DROP SEQUENCE in export (bug #595)
|
||||
Editor: Fix displaying of true boolean values (regression from 4.5.0)
|
||||
|
||||
Adminer 4.6.1 (released 2018-02-09):
|
||||
Sticky position of table actions
|
||||
Speed up rendering of long tables (regression from 4.4.0)
|
||||
Display notification about performing action after relogin
|
||||
Add system tables help links
|
||||
MySQL: Support non-utf8 charset in search in column
|
||||
MySQL: Support geometry in MySQL 8 (bug #574)
|
||||
MariaDB: Links to documentation
|
||||
SQLite: Allow deleting PRIMARY KEY from tables with auto increment
|
||||
PostgreSQL: Support binary files in bytea fields
|
||||
PostgreSQL: Don't treat interval type as number (bug #474)
|
||||
PostgreSQL: Cast to string when searching using LIKE (bug #325)
|
||||
PostgreSQL: Fix condition for selecting no rows
|
||||
PostgreSQL: Support TRUNCATE+INSERT export
|
||||
Customization: Support connecting to MySQL via SSL
|
||||
Customization: Allow specifying server name displayed in breadcrumbs
|
||||
|
||||
Adminer 4.6.0 (released 2018-02-05):
|
||||
Fix counting selected rows after going back to select page
|
||||
PHP <5.3 compatibility even with Elasticsearch enabled
|
||||
Fully support functions in default values
|
||||
Stop redirecting links via adminer.org
|
||||
Support X-Forwarded-Prefix
|
||||
Display options for timestamp columns when creating a new table
|
||||
Disable autocompleting password on create user page
|
||||
Use primary key to edit rows even if not selected
|
||||
MySQL, PostgreSQL: Display warnings
|
||||
MySQL: Add floor and ceil select functions
|
||||
MySQL: Add FIND_IN_SET search operator
|
||||
MariaDB: Support JSON since MariaDB 10.2
|
||||
SQLite, PostgreSQL: Limit rows in data manipulation without unique key
|
||||
PostgreSQL: Support routines
|
||||
PostgreSQL: Allow editing views with uppercase letters (bug #467)
|
||||
PostgreSQL: Allow now() as default value (bug #525)
|
||||
SimpleDB: Document that allow_url_fopen is required
|
||||
Malay translation
|
||||
|
||||
Adminer 4.5.0 (released 2018-01-24):
|
||||
Display name of the object in confirmation when dropping it
|
||||
Display newlines in column comments (bug #573)
|
||||
Support current_timestamp() as default of time fields (bug #572)
|
||||
Hide window.opener from pages opened in a new window (bug #561)
|
||||
Display error when getting row to edit
|
||||
Store current Adminer version server-side to avoid excessive requests
|
||||
Adminer: Fix Search data in tables (regression from 4.4.0)
|
||||
CSP: Allow any styles, images, media and fonts, disallow base-uri
|
||||
MySQL: Support geometry in MySQL 8 (bug #574)
|
||||
MySQL: Support routines with comments in parameters (bug #460)
|
||||
MariaDB: Support fulltext and spatial indexes in InnoDB (bug #583)
|
||||
SQLite: Enable foreign key checks
|
||||
PostgreSQL: Respect NULL default value
|
||||
PostgreSQL: Display foreign tables (bug #576)
|
||||
PostgreSQL: Do not export triggers if not requested
|
||||
PostgreSQL: Export DROP SEQUENCE if dropping table
|
||||
PostgreSQL: Display boolean values as code (bug #562)
|
||||
MS SQL: Support freetds
|
||||
non-MySQL: Avoid CONVERT() (bug #509)
|
||||
Elasticsearch: Insert, update, delete
|
||||
MongoDB: Support mongodb PHP extension
|
||||
Editor: Fix displaying of false values in PostgreSQL (bug #568)
|
||||
|
||||
Adminer 4.4.0 (released 2018-01-17):
|
||||
Add Content Security Policy
|
||||
Disallow scripts without nonce
|
||||
|
66
compile.php
66
compile.php
@@ -21,7 +21,7 @@ function remove_lang($match) {
|
||||
$idf = strtr($match[2], array("\\'" => "'", "\\\\" => "\\"));
|
||||
$s = ($translations[$idf] ? $translations[$idf] : $idf);
|
||||
if ($match[3] == ",") { // lang() has parameters
|
||||
return "$match[1]" . (is_array($s) ? "lang(array('" . implode("', '", array_map('add_apo_slashes', $s)) . "')," : "sprintf('" . add_apo_slashes($s) . "',");
|
||||
return $match[1] . (is_array($s) ? "lang(array('" . implode("', '", array_map('add_apo_slashes', $s)) . "')," : "sprintf('" . add_apo_slashes($s) . "',");
|
||||
}
|
||||
return ($match[1] && $match[4] ? $s : "$match[1]'" . add_apo_slashes($s) . "'$match[4]");
|
||||
}
|
||||
@@ -36,11 +36,26 @@ function lang_ids($match) {
|
||||
}
|
||||
|
||||
function put_file($match) {
|
||||
global $project;
|
||||
global $project, $VERSION;
|
||||
if (basename($match[2]) == '$LANG.inc.php') {
|
||||
return $match[0]; // processed later
|
||||
}
|
||||
$return = file_get_contents(dirname(__FILE__) . "/$project/$match[2]");
|
||||
if (basename($match[2]) == "file.inc.php") {
|
||||
$return = str_replace("\n// caching headers added in compile.php", (preg_match('~-dev$~', $VERSION) ? '' : '
|
||||
if ($_SERVER["HTTP_IF_MODIFIED_SINCE"]) {
|
||||
header("HTTP/1.1 304 Not Modified");
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 365*24*60*60) . " GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Cache-Control: immutable");
|
||||
'), $return, $count);
|
||||
if (!$count) {
|
||||
echo "adminer/file.inc.php: Caching headers placeholder not found\n";
|
||||
}
|
||||
}
|
||||
if (basename($match[2]) != "lang.inc.php" || !$_SESSION["lang"]) {
|
||||
if (basename($match[2]) == "lang.inc.php") {
|
||||
$return = str_replace('function lang($idf, $number = null) {', 'function lang($idf, $number = null) {
|
||||
@@ -57,7 +72,7 @@ function put_file($match) {
|
||||
}
|
||||
$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 = (.+\n).+;)~sU', $return, $match2)) {
|
||||
} elseif (preg_match('~\s*(\$pos = (.+\n).+;)~sU', $return, $match2)) {
|
||||
// single language lang() is used for plural
|
||||
return "function get_lang() {
|
||||
return '$_SESSION[lang]';
|
||||
@@ -275,7 +290,7 @@ function php_shrink($input) {
|
||||
}
|
||||
|
||||
function minify_css($file) {
|
||||
return lzw_compress(preg_replace('~\\s*([:;{},])\\s*~', '\\1', preg_replace('~/\\*.*\\*/~sU', '', $file)));
|
||||
return lzw_compress(preg_replace('~\s*([:;{},])\s*~', '\1', preg_replace('~/\*.*\*/~sU', '', $file)));
|
||||
}
|
||||
|
||||
function minify_js($file) {
|
||||
@@ -300,6 +315,14 @@ function compile_file($match) {
|
||||
return '"' . add_quo_slashes($file) . '"';
|
||||
}
|
||||
|
||||
function min_version() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function number_type() {
|
||||
return '';
|
||||
}
|
||||
|
||||
$project = "adminer";
|
||||
if ($_SERVER["argv"][1] == "editor") {
|
||||
$project = "editor";
|
||||
@@ -327,10 +350,12 @@ if ($_SERVER["argv"][1]) {
|
||||
}
|
||||
|
||||
// check function definition in drivers
|
||||
$filename = dirname(__FILE__) . "/adminer/drivers/mysql.inc.php";
|
||||
preg_match_all('~\\bfunction ([^(]+)~', file_get_contents($filename), $matches); //! respect context (extension, class)
|
||||
$file = file_get_contents(dirname(__FILE__) . "/adminer/drivers/mysql.inc.php");
|
||||
$file = preg_replace('~class Min_Driver.*\n\t}~sU', '', $file);
|
||||
preg_match_all('~\bfunction ([^(]+)~', $file, $matches); //! respect context (extension, class)
|
||||
$functions = array_combine($matches[1], $matches[0]);
|
||||
unset($functions["__destruct"], $functions["Min_DB"], $functions["Min_Result"], $functions["Min_Driver"]);
|
||||
//! do not warn about functions without declared support()
|
||||
unset($functions["__construct"], $functions["__destruct"], $functions["set_charset"]);
|
||||
foreach (glob(dirname(__FILE__) . "/adminer/drivers/" . ($driver ? $driver : "*") . ".inc.php") as $filename) {
|
||||
if ($filename != "mysql.inc.php") {
|
||||
$file = file_get_contents($filename);
|
||||
@@ -348,7 +373,6 @@ $features = array("call" => "routine", "dump", "event", "privileges", "procedure
|
||||
$lang_ids = array(); // global variable simplifies usage in a callback function
|
||||
$file = file_get_contents(dirname(__FILE__) . "/$project/index.php");
|
||||
if ($driver) {
|
||||
$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 $key => $feature) {
|
||||
@@ -363,12 +387,12 @@ if ($driver) {
|
||||
$file = str_replace("if (isset(\$_GET[\"callf\"])) {\n\t\$_GET[\"call\"] = \$_GET[\"callf\"];\n}\nif (isset(\$_GET[\"function\"])) {\n\t\$_GET[\"procedure\"] = \$_GET[\"function\"];\n}\n", "", $file);
|
||||
}
|
||||
}
|
||||
$file = preg_replace_callback('~\\b(include|require) "([^"]*)";~', 'put_file', $file);
|
||||
$file = preg_replace_callback('~\b(include|require) "([^"]*)";~', 'put_file', $file);
|
||||
$file = str_replace('include "../adminer/include/coverage.inc.php";', '', $file);
|
||||
if ($driver) {
|
||||
$file = preg_replace('(include "../adminer/drivers/(?!' . preg_quote($driver) . '\.).*\\s*)', '', $file);
|
||||
$file = preg_replace('(include "../adminer/drivers/(?!' . preg_quote($driver) . '\.).*\s*)', '', $file);
|
||||
}
|
||||
$file = preg_replace_callback('~\\b(include|require) "([^"]*)";~', 'put_file', $file); // bootstrap.inc.php
|
||||
$file = preg_replace_callback('~\b(include|require) "([^"]*)";~', 'put_file', $file); // bootstrap.inc.php
|
||||
if ($driver) {
|
||||
foreach ($features as $feature) {
|
||||
if (!support($feature)) {
|
||||
@@ -376,16 +400,16 @@ if ($driver) {
|
||||
}
|
||||
}
|
||||
if (count($drivers) == 1) {
|
||||
$file = str_replace('<?php echo html_select("auth[driver]", $drivers, DRIVER); ?>', "<input type='hidden' name='auth[driver]' value='" . ($driver == "mysql" ? "server" : $driver) . "'>" . reset($drivers), $file);
|
||||
$file = str_replace('<?php echo html_select("auth[driver]", $drivers, DRIVER) . "\n"; ?>', "<input type='hidden' name='auth[driver]' value='" . ($driver == "mysql" ? "server" : $driver) . "'>" . reset($drivers), $file);
|
||||
}
|
||||
$file = preg_replace('(;../externals/jush/modules/jush-(?!textarea\.|txt\.|js\.|' . preg_quote($driver == "mysql" ? "sql" : $driver) . '\.)[^.]+.js)', '', $file);
|
||||
}
|
||||
if ($project == "editor") {
|
||||
$file = preg_replace('~;../externals/jush/jush.css~', '', $file);
|
||||
$file = preg_replace('~;?../externals/jush/modules/jush[^.]*.js~', '', $file);
|
||||
$file = preg_replace('~;.\.\/externals/jush/jush\.css~', '', $file);
|
||||
$file = preg_replace('~compile_file\(\'\.\./(externals/jush/modules/jush\.js|adminer/static/[^.]+\.gif)[^)]+\)~', "''", $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 = preg_replace_callback('~\b(include|require) "([^"]*\$LANG.inc.php)";~', 'put_file_lang', $file);
|
||||
$file = str_replace("\r", "", $file);
|
||||
if ($_SESSION["lang"]) {
|
||||
// single language version
|
||||
@@ -394,14 +418,14 @@ if ($_SESSION["lang"]) {
|
||||
$file = str_replace('<?php echo $LANG; ?>', $_SESSION["lang"], $file);
|
||||
}
|
||||
$file = str_replace('<?php echo script_src("static/editing.js"); ?>' . "\n", "", $file);
|
||||
$file = preg_replace('~\\s+echo script_src\\("\\.\\./externals/jush/modules/jush-(textarea|txt|js|\\$jush)\\.js"\\);~', '', $file);
|
||||
$file = preg_replace('~\s+echo script_src\("\.\./externals/jush/modules/jush-(textarea|txt|js|\$jush)\.js"\);~', '', $file);
|
||||
$file = str_replace('<link rel="stylesheet" type="text/css" href="../externals/jush/jush.css">' . "\n", "", $file);
|
||||
$file = preg_replace_callback("~compile_file\\('([^']+)'(?:, '([^']*)')?\\)~", 'compile_file', $file); // integrate static files
|
||||
$replace = 'preg_replace("~\\\\\\\\?.*~", "", ME) . "?file=\\1&version=' . $VERSION . ($driver ? '&driver=' . $driver : '') . '"';
|
||||
$file = preg_replace('~\\.\\./adminer/static/(default\\.css|favicon\\.ico)~', '<?php echo h(' . $replace . '); ?>', $file);
|
||||
$file = preg_replace('~"\\.\\./adminer/static/(functions\\.js)"~', $replace, $file);
|
||||
$file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . h(' . $replace . ') . "', $file);
|
||||
$file = preg_replace('~"\\.\\./externals/jush/modules/(jush\\.js)"~', $replace, $file);
|
||||
$replace = 'preg_replace("~\\\\\\\\?.*~", "", ME) . "?file=\1&version=' . $VERSION . '"';
|
||||
$file = preg_replace('~\.\./adminer/static/(default\.css|favicon\.ico)~', '<?php echo h(' . $replace . '); ?>', $file);
|
||||
$file = preg_replace('~"\.\./adminer/static/(functions\.js)"~', $replace, $file);
|
||||
$file = preg_replace('~\.\./adminer/static/([^\'"]*)~', '" . h(' . $replace . ') . "', $file);
|
||||
$file = preg_replace('~"\.\./externals/jush/modules/(jush\.js)"~', $replace, $file);
|
||||
$file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
|
||||
$file = php_shrink($file);
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"license": [
|
||||
"Apache-2.0",
|
||||
"GPL-2.0"
|
||||
"GPL-2.0-only"
|
||||
],
|
||||
"scripts": {
|
||||
"compile": "php compile.php"
|
||||
|
@@ -47,7 +47,7 @@ border:5px solid #ccc;margin:0}
|
||||
#menu a.h1,#menu a.h1:hover{display:block;height:0;width:175px;padding:40px 0 0 0;overflow:hidden;float:left;border:0;margin:0;
|
||||
outline:0;background:url(//www.bradezone.com/random/adminer_logo.gif) no-repeat;line-height:32px}
|
||||
#menu p,#tables{white-space:nowrap;border:0;padding:0 0 4px 0;margin:0 0 4px 0}
|
||||
#breadcrumb{background:#333;color:#fff;position:fixed;top:0;left:320px;width:100%;line-height:40px;padding:0;z-index:1;margin:0}
|
||||
#breadcrumb{background:#333;color:#fff;position:fixed;top:0;left:320px;line-height:40px;padding:0;z-index:1;margin:0}
|
||||
#breadcrumb a{color:#ff9}
|
||||
#breadcrumb a:hover{background:transparent;color:#ff9;border-color:#ff9}
|
||||
#schema .table{padding:4px 8px;background:#f3f3f3}
|
||||
|
261
designs/esterka/adminer.css
Normal file
261
designs/esterka/adminer.css
Normal file
@@ -0,0 +1,261 @@
|
||||
* {
|
||||
font: 11px/1.25 Verdana, 'Geneva CE', lucida, sans-serif;
|
||||
color:#333333;
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
}
|
||||
|
||||
a,a:visited {
|
||||
color:#0033ff;
|
||||
text-decoration:none;
|
||||
padding:3px 1px;
|
||||
}
|
||||
|
||||
#content table thead span, #content table thead a {
|
||||
font-weight:bold;
|
||||
color:black;
|
||||
}
|
||||
|
||||
#content table thead a:hover {
|
||||
background:none;
|
||||
text-decoration:underline;
|
||||
color:black;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color:white;
|
||||
background:#0033ff;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size:1.5em;
|
||||
line-height: 2em;
|
||||
font-weight:bold;
|
||||
background:white;
|
||||
color:#1e5eb6;
|
||||
border-bottom:1px solid #f4f4f4;
|
||||
|
||||
padding:20px;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
#menu h1 {
|
||||
padding:0px 0px 5px 20px;
|
||||
background:none;
|
||||
}
|
||||
|
||||
h2,h3 {
|
||||
font-size:1.5em;
|
||||
font-weight:normal;
|
||||
background:white;
|
||||
color:#A0522D;
|
||||
border-bottom:1px solid #f4f4f4;
|
||||
padding:5px 0px;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
padding:5px;
|
||||
border:1px solid #d0cdc4;
|
||||
background:#fcfaf5;
|
||||
}
|
||||
|
||||
input,select,textarea {
|
||||
border:1px solid #e5e5e5;
|
||||
margin:1px;
|
||||
padding:3px;
|
||||
}
|
||||
|
||||
input[type=submit] {
|
||||
color:white;
|
||||
background:#A0522D;
|
||||
padding:3px 10px;
|
||||
cursor:pointer;
|
||||
border:0px solid;
|
||||
}
|
||||
|
||||
input[type=submit]:hover{
|
||||
background:blue;
|
||||
}
|
||||
|
||||
input[type=checkbox]{
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
input[type=image] {
|
||||
border:1px solid #d0cdc4;
|
||||
}
|
||||
|
||||
input[type=checkbox],input[type=radio]{
|
||||
border:1px solid #e5e5e5;
|
||||
padding:2px 5px;
|
||||
}
|
||||
|
||||
code{
|
||||
background:#f0ffe1;
|
||||
border:1px dashed #d5f1b9;
|
||||
padding:2px 4px;
|
||||
font-family:"Courier New";
|
||||
}
|
||||
code a:hover{background:transparent}
|
||||
|
||||
table{
|
||||
margin:10px 0px;
|
||||
border:1px solid #d0cdc4;
|
||||
border-collapse:collapse;
|
||||
}
|
||||
|
||||
tbody tr:hover td,tbody tr:hover th{
|
||||
background:#edf4ff
|
||||
}
|
||||
|
||||
thead th, thead td {
|
||||
text-align:center;
|
||||
vertical-align:middle;
|
||||
font-weight:bold;
|
||||
white-space:nowrap;
|
||||
background:#f2eee1;
|
||||
color:#808080;
|
||||
}
|
||||
|
||||
th,td{
|
||||
border:1px solid #d0cdc4;
|
||||
padding:1px 4px;
|
||||
vertical-align:middle;
|
||||
}
|
||||
|
||||
th a {
|
||||
font-weight:bold;
|
||||
padding-bottom:0px;
|
||||
}
|
||||
|
||||
th {
|
||||
background:white;
|
||||
}
|
||||
|
||||
tr.odd td {
|
||||
background:#fcfaf5;
|
||||
}
|
||||
|
||||
#content tbody tr.checked td, tr.checked.odd td {
|
||||
background:#fbe2e2;
|
||||
color:red;
|
||||
}
|
||||
|
||||
.hidden{
|
||||
display:none
|
||||
}
|
||||
|
||||
.error,.message{
|
||||
padding:0px;
|
||||
background:transparent;
|
||||
font-weight:bold
|
||||
}
|
||||
|
||||
.error{
|
||||
color:#c00
|
||||
}
|
||||
|
||||
.message{
|
||||
color:#090
|
||||
}
|
||||
|
||||
#content{
|
||||
margin:0px 0px 0px 255px;
|
||||
padding:50px 20px 40px 0px;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
#lang {
|
||||
background:#f2eee1;
|
||||
color:#808080;
|
||||
position:fixed;
|
||||
top:0px;
|
||||
left:0px;
|
||||
width:100%;
|
||||
padding:10px 20px;
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
#breadcrumb {
|
||||
position:fixed;
|
||||
top:0px;
|
||||
left:260px;
|
||||
background:#f2eee1;
|
||||
z-index:2;
|
||||
width:100%;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
#menu {
|
||||
background:#fcfaf5;
|
||||
position:fixed;
|
||||
top:-10px;
|
||||
padding:0px;
|
||||
padding-top:10px;
|
||||
bottom:0px;
|
||||
overflow:auto;
|
||||
left:0px;
|
||||
width:240px;
|
||||
border-right:5px solid #f2eee1;
|
||||
}
|
||||
|
||||
#schema .table {
|
||||
padding:5px;
|
||||
background:#fcfaf5;
|
||||
border:1px solid #d0cdc4;
|
||||
}
|
||||
|
||||
#schema .table b {
|
||||
color:#0033ff;
|
||||
font-weight:bold;
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
#schema .table b:hover {
|
||||
color:white;
|
||||
}
|
||||
|
||||
input[name=logout] {
|
||||
color:#fce2e2;
|
||||
background:#d73e3e;
|
||||
}
|
||||
|
||||
input[name=logout]:hover {
|
||||
background:#ea0202;
|
||||
}
|
||||
|
||||
#logins a, #tables a {
|
||||
background:none;
|
||||
}
|
||||
|
||||
#logins a:hover, #tables a:hover {
|
||||
background:#A0522D;
|
||||
color:white;
|
||||
}
|
||||
|
||||
#logout {
|
||||
color:#0033ff;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
#logout:hover {
|
||||
color:white;
|
||||
background:#0033ff;
|
||||
}
|
||||
|
||||
.js .column {
|
||||
background:#f2eee1;
|
||||
}
|
||||
|
||||
#content table thead a.text:hover {
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
#version, .version {
|
||||
font-size:50%;
|
||||
}
|
||||
|
||||
#h1:hover {
|
||||
color:white;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user