mirror of
https://github.com/vrana/adminer.git
synced 2025-08-30 17:50:00 +02:00
Compare commits
538 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1cfc8451ef | ||
|
62a9cf3e3f | ||
|
e707c7a5f4 | ||
|
c92b127b56 | ||
|
cf52c4c0a8 | ||
|
5f7fb62803 | ||
|
9b0acfa7c9 | ||
|
45d61803c4 | ||
|
48160f2cd7 | ||
|
61f2b370df | ||
|
e13910b5c5 | ||
|
de86789bfc | ||
|
ebcf4feeb2 | ||
|
d881f51deb | ||
|
b9c39e77fc | ||
|
c734deca84 | ||
|
1466051402 | ||
|
36e55a3f55 | ||
|
155668906d | ||
|
70ce02a798 | ||
|
de3220acc7 | ||
|
1030e84904 | ||
|
f4ca974623 | ||
|
af627e7116 | ||
|
0c5bba47da | ||
|
e340a2973e | ||
|
be2afb49c5 | ||
|
c8fa515ed5 | ||
|
3dad86d279 | ||
|
d9c1ac00f3 | ||
|
2a4d2cfb39 | ||
|
67a64c8d72 | ||
|
d59d6c4075 | ||
|
dbec3a1b92 | ||
|
a93f0003ae | ||
|
29a31c6b9c | ||
|
a04823f4c4 | ||
|
82c544514d | ||
|
7185d7854f | ||
|
d845d4b358 | ||
|
92ce506243 | ||
|
6d6998c3d3 | ||
|
45799f4605 | ||
|
b999f123c8 | ||
|
7642b00877 | ||
|
45be56e4e1 | ||
|
e1b92f73aa | ||
|
63850ebf19 | ||
|
49fd96f8b9 | ||
|
fcae403f60 | ||
|
7dc152b732 | ||
|
29f7b2df96 | ||
|
3466ab730b | ||
|
9235cb8350 | ||
|
020285772b | ||
|
8238838285 | ||
|
a165d4ed81 | ||
|
f5b42eae55 | ||
|
460a24ea2d | ||
|
4646298015 | ||
|
cde6b9008c | ||
|
8783f4d3ac | ||
|
3d2395fc59 | ||
|
3a73815ba4 | ||
|
d0a2de53ef | ||
|
982233d7e5 | ||
|
cedfe97f40 | ||
|
9beb72edc2 | ||
|
9555c96d6a | ||
|
a3d0bbba8f | ||
|
a9bcde334f | ||
|
a735b795b2 | ||
|
008cd33058 | ||
|
036ce4f1c5 | ||
|
5867b0724f | ||
|
71f2578af6 | ||
|
c809216a56 | ||
|
eb43ea3025 | ||
|
2ba833409a | ||
|
5eaaa498d3 | ||
|
746c0a7b0b | ||
|
b30526213d | ||
|
6819815b88 | ||
|
a83626c8af | ||
|
d4ddbc0639 | ||
|
a6cb91f0d2 | ||
|
78d3ce830d | ||
|
88099b7dd7 | ||
|
8bce359fae | ||
|
8ca7066625 | ||
|
51bcc2a064 | ||
|
588af652d4 | ||
|
b0c345f9be | ||
|
b2677187f1 | ||
|
52ee085ca7 | ||
|
00459b302a | ||
|
17598c7ab3 | ||
|
b489cec651 | ||
|
6da8bb670a | ||
|
e601a3d8ce | ||
|
efde7fcc6c | ||
|
91b3526e8d | ||
|
a3ddd59015 | ||
|
7908d86c9f | ||
|
0cb41c63c7 | ||
|
50de50571d | ||
|
de38cb65b6 | ||
|
e6cc8bf91e | ||
|
be6cf07d26 | ||
|
3f979793f7 | ||
|
c8878d1652 | ||
|
bf24198e68 | ||
|
e33ead15e5 | ||
|
1087d55913 | ||
|
38bdd0a961 | ||
|
3dd040abd1 | ||
|
3e455a4787 | ||
|
95f14bca56 | ||
|
121b77e866 | ||
|
41c71f8854 | ||
|
b0e5c1d6e4 | ||
|
7d3d46e509 | ||
|
9bd23b1395 | ||
|
93f8a0e7ed | ||
|
e6810258bd | ||
|
aac223e279 | ||
|
75f9aa9e7d | ||
|
05170899dc | ||
|
69890ffc48 | ||
|
025d77c7c6 | ||
|
de95807eaf | ||
|
833fa22e3f | ||
|
9e0aa1b91a | ||
|
f2e1243fb7 | ||
|
0d683fd57c | ||
|
9683342792 | ||
|
cdd8448908 | ||
|
3578517e15 | ||
|
2d853b633a | ||
|
089093d4b1 | ||
|
39b977bd80 | ||
|
0aff6e06a6 | ||
|
b36bd12291 | ||
|
fb32c10f94 | ||
|
7ff1d82903 | ||
|
cca943015f | ||
|
48f82b3454 | ||
|
91d43b574b | ||
|
6258c975c1 | ||
|
e12d12524f | ||
|
a43a9fbd52 | ||
|
79ae6d8541 | ||
|
60ea595cdc | ||
|
ebd2e4f5b4 | ||
|
806efe5e2d | ||
|
54d3239cfb | ||
|
7198ad5229 | ||
|
01d8fe112c | ||
|
510cd2e068 | ||
|
7dbd929600 | ||
|
6c9ac63508 | ||
|
ab0dc19c9f | ||
|
4aa7647a55 | ||
|
db2709d15a | ||
|
5f5d114dac | ||
|
dadaa02b52 | ||
|
e277d05162 | ||
|
ef3946ee52 | ||
|
57f6d296fb | ||
|
bd35de5a6b | ||
|
64816a3d7a | ||
|
6e8c89ee71 | ||
|
3f6136205d | ||
|
1500a3f2c8 | ||
|
63236ea5d1 | ||
|
c6398736ac | ||
|
dc25ccec0d | ||
|
364d18f166 | ||
|
e7c2d09fa8 | ||
|
646af54e7b | ||
|
96191587cc | ||
|
dea16493ff | ||
|
d7c14b16b1 | ||
|
986433dd3a | ||
|
a70089f8ce | ||
|
49eefa2585 | ||
|
3693992650 | ||
|
30847c97eb | ||
|
9b179bca21 | ||
|
ce03585210 | ||
|
22dc4ff444 | ||
|
2b6a262d56 | ||
|
5fdcfd0978 | ||
|
5b7dfbec11 | ||
|
76dd19b69f | ||
|
104edc75fa | ||
|
bd85f19a44 | ||
|
2db83e9b8f | ||
|
5e3990e473 | ||
|
3e9d47ad08 | ||
|
04ed73be26 | ||
|
01ea001f22 | ||
|
634b0aaacf | ||
|
06469660e8 | ||
|
e0629c6445 | ||
|
1f58f664ae | ||
|
d9956c8a5c | ||
|
a03b05ceb4 | ||
|
b386463dcf | ||
|
954cc17312 | ||
|
45a68bd6f7 | ||
|
9ec24b9244 | ||
|
717f0b0e10 | ||
|
a27f0953a6 | ||
|
177429d59f | ||
|
9f3f3b9515 | ||
|
595c228175 | ||
|
058a9ec2ce | ||
|
7f6ae00b0d | ||
|
cfde891ea4 | ||
|
63ab8561be | ||
|
5b095e9f4e | ||
|
b2fb3587fd | ||
|
5cfd3f422c | ||
|
eb6b23e014 | ||
|
10bc856ebe | ||
|
7dd214a03c | ||
|
2504ea23c4 | ||
|
e6c0c8ab6b | ||
|
366342985d | ||
|
27c688b902 | ||
|
41964badb0 | ||
|
c76b4f1805 | ||
|
1b52d3a975 | ||
|
695ce8c4da | ||
|
30a8c4caca | ||
|
21347e6ef5 | ||
|
f2871266ad | ||
|
79bebe77ba | ||
|
007c97d0d2 | ||
|
b50d19629f | ||
|
016c1b2357 | ||
|
c05b1ac048 | ||
|
c64ee3d907 | ||
|
b64c80acc9 | ||
|
fa22df0d7f | ||
|
a93e4cb694 | ||
|
7ee6f4f7ac | ||
|
992561f75e | ||
|
65fd673d05 | ||
|
4b262ededa | ||
|
0d67bd9eb8 | ||
|
9b6943d5af | ||
|
291ae7f1ac | ||
|
712d96b22c | ||
|
168ea5ae6d | ||
|
845445baad | ||
|
87f149ce1d | ||
|
79f5280f3d | ||
|
82450b1ad2 | ||
|
eeb13253a8 | ||
|
6a3161cd49 | ||
|
141db3cb8d | ||
|
fd1661d811 | ||
|
6ea34e3b9a | ||
|
e4ed78ff7a | ||
|
262366b120 | ||
|
79fbf9c58a | ||
|
6cf3d5d2b8 | ||
|
5b329ae720 | ||
|
225b6671c7 | ||
|
cec6db144f | ||
|
aceb4ce7a5 | ||
|
1f88485a3c | ||
|
4e1e638f98 | ||
|
03d0daff5c | ||
|
1eb7538e8c | ||
|
29339c5223 | ||
|
d5bba383ea | ||
|
d59830c7b2 | ||
|
ff37ac1d35 | ||
|
75c94cec6b | ||
|
65d97caeb9 | ||
|
3cfae4b8f4 | ||
|
e219ef9ad1 | ||
|
74457f0895 | ||
|
f6d311457e | ||
|
adab18da78 | ||
|
508baa8c6b | ||
|
f0920af6b7 | ||
|
06f0a926dd | ||
|
81c5ae33ab | ||
|
4cbe50fd49 | ||
|
2396397b75 | ||
|
bd823716fc | ||
|
7a19fa67fd | ||
|
195341d075 | ||
|
46f6a96c95 | ||
|
dc38a7ded3 | ||
|
c7140c2158 | ||
|
c2c8992dd0 | ||
|
a691bcbf15 | ||
|
e3a4a214e6 | ||
|
a9143ccbdc | ||
|
c169c55d70 | ||
|
54f3437a6a | ||
|
96178b83ad | ||
|
b948f77af4 | ||
|
54f8d731b3 | ||
|
ab4208dcb8 | ||
|
5e88dae4e2 | ||
|
45c045382a | ||
|
641ee4ff26 | ||
|
69073d9d54 | ||
|
911f3b71b7 | ||
|
3bde36b68e | ||
|
d47d3cb4c5 | ||
|
0cdc18d22c | ||
|
47c533db4d | ||
|
feaed0497a | ||
|
104132de36 | ||
|
4d22e8fd4e | ||
|
a2ff6a7fb1 | ||
|
b23bf6c055 | ||
|
e2deed9a02 | ||
|
0578b5c490 | ||
|
81ae16bce1 | ||
|
806aa51f48 | ||
|
8f2a829b2e | ||
|
36b44248aa | ||
|
23f5d64d75 | ||
|
584d04b5b3 | ||
|
d3b53d9d9c | ||
|
c96894ecd4 | ||
|
c78299a3f6 | ||
|
53d5e7b60a | ||
|
d77ed18842 | ||
|
309fdb0d86 | ||
|
7e5757f8b4 | ||
|
d39cc24c61 | ||
|
3de9b23156 | ||
|
63c258a7f9 | ||
|
f75f0aacfe | ||
|
a60e00bf72 | ||
|
109b0df6de | ||
|
6e7158537f | ||
|
c5f87110ff | ||
|
1a2ae0e29e | ||
|
1b8a428d2f | ||
|
d3be21e000 | ||
|
012562571a | ||
|
41aad5bc37 | ||
|
cd5ccddd22 | ||
|
cccc784da4 | ||
|
cd207238b7 | ||
|
67fa4c2a6f | ||
|
eac7d042ed | ||
|
a2077070af | ||
|
26adca1003 | ||
|
76d810faca | ||
|
db0e44221b | ||
|
01e2fe4234 | ||
|
4d2b5144b1 | ||
|
2ee325183b | ||
|
26aa48122f | ||
|
19b7358452 | ||
|
a1080ea8dc | ||
|
9b1b779dbd | ||
|
4bbbea2fbe | ||
|
16e49d27cb | ||
|
190d91a0f9 | ||
|
2c72b879e9 | ||
|
001f5ac21a | ||
|
b13c76149f | ||
|
27a5aeea86 | ||
|
5a1be8ae65 | ||
|
5dea23a07a | ||
|
99a0949d2a | ||
|
1cf5a91d98 | ||
|
dcde78eef2 | ||
|
88821a5780 | ||
|
078a8b3d6b | ||
|
4df205d4ec | ||
|
a50395c275 | ||
|
8b93d51c68 | ||
|
50cdbbe415 | ||
|
f5d23a8cad | ||
|
3bc675b0fc | ||
|
b86a9cb5fb | ||
|
cd53c54b6a | ||
|
99163feefb | ||
|
84e4971b1e | ||
|
d22b1091f1 | ||
|
b349830758 | ||
|
b8eb0ad8f5 | ||
|
c47590bb0d | ||
|
486f164247 | ||
|
edce93ca80 | ||
|
858c914a50 | ||
|
9fd9a1fc8d | ||
|
60555c5736 | ||
|
8cec1bd611 | ||
|
9b84908b99 | ||
|
3dd1b41472 | ||
|
b89f628e40 | ||
|
708646156a | ||
|
9e52f0fa2e | ||
|
3cd50c9a02 | ||
|
f5ecb18896 | ||
|
0501846743 | ||
|
8db8b7a10d | ||
|
d6a417fa58 | ||
|
4477f95426 | ||
|
6a64c7771b | ||
|
c32e4f82fe | ||
|
19bb320e7a | ||
|
fb47ba6bbb | ||
|
03ff0bbc04 | ||
|
e8055329a6 | ||
|
9142e7e8a5 | ||
|
e975e546e1 | ||
|
1b59b10f62 | ||
|
f1a8bd9ef8 | ||
|
204176b33b | ||
|
cf436d7317 | ||
|
7eb92d9601 | ||
|
8da9239279 | ||
|
e0dde9034f | ||
|
9b162e8291 | ||
|
359fdf3d07 | ||
|
00b7056147 | ||
|
db829fd463 | ||
|
359d153130 | ||
|
ab44927442 | ||
|
01a6af8b70 | ||
|
3f2eec9b92 | ||
|
aaca1eee8e | ||
|
26db8596aa | ||
|
5aedb33fb6 | ||
|
7fca87dfd7 | ||
|
711f41d05b | ||
|
f7b20b5f6f | ||
|
719c1e7067 | ||
|
83a8b18c85 | ||
|
4d082d4fcd | ||
|
a705be7a94 | ||
|
a2586e7265 | ||
|
f38bbff5bf | ||
|
09720b31f1 | ||
|
0e28daac55 | ||
|
3eb478b65a | ||
|
192ce41bd3 | ||
|
bcd5164e2f | ||
|
cd686c7a1e | ||
|
e9feb1587a | ||
|
1f5a7fa717 | ||
|
3c310ddfaf | ||
|
6d4896e03c | ||
|
5ef77ec399 | ||
|
62c18efbd5 | ||
|
101229043e | ||
|
0e21106e48 | ||
|
f16a6d415a | ||
|
11699223df | ||
|
7c75d3f86c | ||
|
287667d631 | ||
|
ef4c340cc2 | ||
|
f2a5d5127a | ||
|
889ffe28c7 | ||
|
5f6aa1e267 | ||
|
def9e07831 | ||
|
c73bd1233e | ||
|
e6ead2d12c | ||
|
4802389ce6 | ||
|
7845b70d7d | ||
|
9f8344e53c | ||
|
2dd32cf534 | ||
|
0b063262ee | ||
|
458d07122f | ||
|
740a4b8b1c | ||
|
6be1e1c069 | ||
|
b861500910 | ||
|
eca176f362 | ||
|
8f489da2bd | ||
|
3138b1de88 | ||
|
e723158bbf | ||
|
feed6e4488 | ||
|
9b345fbafb | ||
|
ca30d04575 | ||
|
b4e41f5e4b | ||
|
8979baca28 | ||
|
8019b9ae4d | ||
|
7fec2992d9 | ||
|
df98f2453d | ||
|
eb1d8d5468 | ||
|
ea3da56b6d | ||
|
41dabfb4f2 | ||
|
ff0fe92c00 | ||
|
06c15aa263 | ||
|
8a64fb16cd | ||
|
bda53f0734 | ||
|
bc9de24d77 | ||
|
9cfea02e19 | ||
|
eeb78d7e48 | ||
|
751405e006 | ||
|
3fb6cac361 | ||
|
8613f97948 | ||
|
249807fc48 | ||
|
6e76454f59 | ||
|
655cca0872 | ||
|
16989a736c | ||
|
a3d1ab34bb | ||
|
b2f904c64f | ||
|
05d27a132d | ||
|
4861c88cc6 | ||
|
1424a42b1f | ||
|
1c5a192cb5 | ||
|
336fdaf09c | ||
|
57e6c2651c | ||
|
693dc5b8a7 | ||
|
753642630b | ||
|
8fed1523ec | ||
|
ebb31bdac8 | ||
|
5069e5a400 | ||
|
33b69ed82b | ||
|
4e4f280061 | ||
|
841f76fb00 | ||
|
73e7e00c77 | ||
|
29f954069d | ||
|
c1eccc9cdd | ||
|
430cdaeb3a | ||
|
e395fe583a | ||
|
19313a8dab | ||
|
17c0960e7f | ||
|
a9b020452e | ||
|
e1f0fded69 | ||
|
91f9980267 | ||
|
5f3fac4b48 |
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,3 +1,3 @@
|
||||
github: vrana
|
||||
patreon: jakubvrana
|
||||
custom: ["https://www.paypal.com/donate/?item_name=Donation+to+Adminer&business=jakub%40vrana.cz"]
|
||||
custom: ["https://www.paypal.com/donate/?hosted_button_id=6PK5VNUCFT3FG"]
|
||||
|
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -8,7 +8,11 @@ assignees: ''
|
||||
---
|
||||
|
||||
**Adminer version:** please use latest published or Git
|
||||
**Compiled:** single file / single language / source codes / custom compilation
|
||||
**Driver:** e.g. MySQLi
|
||||
**Database version:** e.g. 10.2.12-MariaDB
|
||||
**Plugins used:**
|
||||
|
||||
Please provide reproducible steps including a SQL dump (with no personal information) if applicable.
|
||||
_Please provide reproducible steps including a SQL dump (with no personal information) if applicable.
|
||||
Also please include a screenshot.
|
||||
Report issues with Adminer Docker image at https://github.com/TimWolla/docker-adminer._
|
||||
|
17
.github/workflows/ci.yml
vendored
Normal file
17
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: php-actions/composer@v6
|
||||
- uses: php-actions/phpcs@v1
|
||||
with:
|
||||
path: adminer/
|
||||
standard: phpcs.xml
|
8
.gitignore
vendored
8
.gitignore
vendored
@@ -1,4 +1,12 @@
|
||||
/adminer/adminer.css
|
||||
/adminer/adminer-dark.css
|
||||
/editor/adminer.css
|
||||
/editor/adminer-dark.css
|
||||
/adminer*.php
|
||||
/editor*.php
|
||||
/tests/pdo-*.html
|
||||
/tests/screenshots/
|
||||
/tests/cropped/
|
||||
/vendor/
|
||||
adminer-plugins/
|
||||
adminer-plugins.php
|
||||
|
13
.travis.yml
13
.travis.yml
@@ -1,13 +0,0 @@
|
||||
language: php
|
||||
php:
|
||||
- 5.6
|
||||
- 7.1
|
||||
- 7.2
|
||||
- 7.3
|
||||
- 7.4
|
||||
- 8.0
|
||||
- 8.1
|
||||
- 8.2
|
||||
- 8.3
|
||||
- 8.4
|
||||
script: git diff --name-only $TRAVIS_COMMIT_RANGE | grep '\.php$' | xargs -n1 -P8 php -l | grep -v 'No syntax errors'; test $? -eq 1
|
1210
CHANGELOG.md
Normal file
1210
CHANGELOG.md
Normal file
File diff suppressed because it is too large
Load Diff
3
CONTRIBUTING.md
Normal file
3
CONTRIBUTING.md
Normal file
@@ -0,0 +1,3 @@
|
||||
- Reproducible [bug reports](https://github.com/vrana/adminer/issues/new?template=bug_report.md) are warmly welcomed.
|
||||
- [Feature requests](https://github.com/vrana/adminer/issues/new?template=BLANK_ISSUE) are also fine, but I'm quite picky about what to accept into Adminer. Please don't be offended if I close the issue as "Not Planned," especially if it can be achieved with a plugin.
|
||||
- [Pull requests](https://github.com/vrana/adminer/pulls) for both bug fixes and simple features are welcome. Before working on anything more complicated, get familiar with the [Adminer philosophy](https://github.com/vrana/adminer/blob/master/developing.md).
|
26
README.md
Normal file
26
README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Adminer
|
||||
**Adminer** is a full-featured database management tool written in PHP. It consists of a single file ready to deploy to the target server.
|
||||
**Adminer Editor** offers data manipulation for end-users.
|
||||
|
||||
[Official Website](https://www.adminer.org/)
|
||||
|
||||
## Features
|
||||
- **Supports:** MySQL, MariaDB, PostgreSQL, CockroachDB, SQLite, MS SQL, Oracle
|
||||
- **Plugins for:** Elasticsearch, SimpleDB, MongoDB, Firebird, ClickHouse, IMAP
|
||||
- **Requirements:** PHP 5.3+ (compiled file), PHP 7.4+ (source codes)
|
||||
|
||||
## Screenshot
|
||||

|
||||
|
||||
## Installation
|
||||
If downloaded from Git then run: `git submodule update --init`
|
||||
|
||||
- `adminer/index.php` - Run development version of Adminer
|
||||
- `editor/index.php` - Run development version of Adminer Editor
|
||||
- `editor/example.php` - Example customization
|
||||
- `compile.php` - Create a single file version
|
||||
- `lang.php` - Update translations
|
||||
- `tests/*.html` - Katalon Recorder test suites
|
||||
|
||||
## Plugins
|
||||
There are several plugins distributed with Adminer, as well as many user-contributed plugins listed on the [Adminer Plugins page](https://www.adminer.org/plugins/).
|
@@ -2,10 +2,10 @@
|
||||
|
||||
## Supported Versions
|
||||
|
||||
I support only the last published version and the last development version (last commit).
|
||||
Only the latest published version and the latest development version (last commit) are supported.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
To report a vulnerability, add a new draft security advisory at https://github.com/vrana/adminer/security/advisories/new.
|
||||
To report a vulnerability, create a new draft security advisory at [GitHub Security Advisories](https://github.com/vrana/adminer/security/advisories/new).
|
||||
|
||||
I handle security issues with top priority. If you don't hear from me in a week then please ping the bug. Once I accept the bug, the fix should be available and new version released within days. I will mark the bug as public after releasing a new version or declining the bug.
|
||||
Security issues are handled with top priority. If you don't receive a response within a week, please follow up on the report. Once a vulnerability is acknowledged, a fix should be available and a new version released within a few days. The issue will be made public after the fix is released or if the report is declined.
|
||||
|
@@ -8,7 +8,7 @@ $routine = routine($_GET["call"], (isset($_GET["callf"]) ? "FUNCTION" : "PROCEDU
|
||||
$in = array();
|
||||
$out = array();
|
||||
foreach ($routine["fields"] as $i => $field) {
|
||||
if (substr($field["inout"], -3) == "OUT") {
|
||||
if (substr($field["inout"], -3) == "OUT" && JUSH == 'sql') {
|
||||
$out[$i] = "@" . idf_escape($field["field"]) . " AS " . idf_escape($field["field"]);
|
||||
}
|
||||
if (!$field["inout"] || substr($field["inout"], 0, 2) == "IN") {
|
||||
@@ -19,45 +19,50 @@ foreach ($routine["fields"] as $i => $field) {
|
||||
if (!$error && $_POST) {
|
||||
$call = array();
|
||||
foreach ($routine["fields"] as $key => $field) {
|
||||
$val = "";
|
||||
if (in_array($key, $in)) {
|
||||
$val = process_input($field);
|
||||
if ($val === false) {
|
||||
$val = "''";
|
||||
}
|
||||
if (isset($out[$key])) {
|
||||
$connection->query("SET @" . idf_escape($field["field"]) . " = $val");
|
||||
connection()->query("SET @" . idf_escape($field["field"]) . " = $val");
|
||||
}
|
||||
}
|
||||
$call[] = (isset($out[$key]) ? "@" . idf_escape($field["field"]) : $val);
|
||||
if (isset($out[$key])) {
|
||||
$call[] = "@" . idf_escape($field["field"]);
|
||||
} elseif (in_array($key, $in)) {
|
||||
$call[] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . table($PROCEDURE) . "(" . implode(", ", $call) . ")";
|
||||
$start = microtime(true);
|
||||
$result = $connection->multi_query($query);
|
||||
$affected = $connection->affected_rows; // getting warnings overwrites this
|
||||
echo $adminer->selectQuery($query, $start, !$result);
|
||||
$result = connection()->multi_query($query);
|
||||
$affected = connection()->affected_rows; // getting warnings overwrites this
|
||||
echo adminer()->selectQuery($query, $start, !$result);
|
||||
|
||||
if (!$result) {
|
||||
echo "<p class='error'>" . error() . "\n";
|
||||
} else {
|
||||
$connection2 = connect($adminer->credentials());
|
||||
if (is_object($connection2)) {
|
||||
$connection2 = connect();
|
||||
if ($connection2) {
|
||||
$connection2->select_db(DB);
|
||||
}
|
||||
|
||||
do {
|
||||
$result = $connection->store_result();
|
||||
$result = connection()->store_result();
|
||||
if (is_object($result)) {
|
||||
select($result, $connection2);
|
||||
print_select_result($result, $connection2);
|
||||
} else {
|
||||
echo "<p class='message'>" . lang('Routine has been called, %d row(s) affected.', $affected)
|
||||
. " <span class='time'>" . @date("H:i:s") . "</span>\n" // @ - time zone may be not set
|
||||
;
|
||||
}
|
||||
} while ($connection->next_result());
|
||||
} while (connection()->next_result());
|
||||
|
||||
if ($out) {
|
||||
select($connection->query("SELECT " . implode(", ", $out)));
|
||||
print_select_result(connection()->query("SELECT " . implode(", ", $out)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,14 +75,14 @@ if ($in) {
|
||||
foreach ($in as $key) {
|
||||
$field = $routine["fields"][$key];
|
||||
$name = $field["field"];
|
||||
echo "<tr><th>" . $adminer->fieldName($field);
|
||||
$value = $_POST["fields"][$name];
|
||||
echo "<tr><th>" . adminer()->fieldName($field);
|
||||
$value = idx($_POST["fields"], $name);
|
||||
if ($value != "") {
|
||||
if ($field["type"] == "set") {
|
||||
$value = implode(",", $value);
|
||||
}
|
||||
}
|
||||
input($field, $value, (string) $_POST["function"][$name]); // param name can be empty
|
||||
input($field, $value, idx($_POST["function"], $name, "")); // param name can be empty
|
||||
echo "\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
@@ -85,14 +90,18 @@ if ($in) {
|
||||
?>
|
||||
<p>
|
||||
<input type="submit" value="<?php echo lang('Call'); ?>">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
<?php echo input_token(); ?>
|
||||
</form>
|
||||
|
||||
<pre>
|
||||
<?php
|
||||
function pre_tr($s) {
|
||||
/** Format string as table row
|
||||
* @return string HTML
|
||||
*/
|
||||
function pre_tr(string $s): string {
|
||||
return preg_replace('~^~m', '<tr>', preg_replace('~\|~', '<td>', preg_replace('~\|$~m', "", rtrim($s))));
|
||||
}
|
||||
|
||||
$table = '(\+--[-+]+\+\n)';
|
||||
$row = '(\| .* \|\n)';
|
||||
echo preg_replace_callback(
|
||||
|
@@ -7,7 +7,7 @@ $row = $_POST;
|
||||
|
||||
if ($row && !$error) {
|
||||
if (JUSH == "sqlite") {
|
||||
$result = recreate_table($TABLE, $TABLE, array(), array(), array(), 0, array(), $name, ($row["drop"] ? "" : $row["clause"]));
|
||||
$result = recreate_table($TABLE, $TABLE, array(), array(), array(), "", array(), "$name", ($row["drop"] ? "" : $row["clause"]));
|
||||
} else {
|
||||
$result = ($name == "" || queries("ALTER TABLE " . table($TABLE) . " DROP CONSTRAINT " . idf_escape($name)));
|
||||
if (!$row["drop"]) {
|
||||
@@ -24,7 +24,7 @@ if ($row && !$error) {
|
||||
page_header(($name != "" ? lang('Alter check') . ": " . h($name) : lang('Create check')), $error, array("table" => $TABLE));
|
||||
|
||||
if (!$row) {
|
||||
$checks = $driver->checkConstraints($TABLE);
|
||||
$checks = driver()->checkConstraints($TABLE);
|
||||
$row = array("name" => $name, "clause" => $checks[$name]);
|
||||
}
|
||||
?>
|
||||
@@ -47,5 +47,5 @@ echo doc_link(array(
|
||||
<?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; ?>">
|
||||
<?php echo input_token(); ?>
|
||||
</form>
|
||||
|
@@ -2,10 +2,8 @@
|
||||
namespace Adminer;
|
||||
|
||||
$TABLE = $_GET["create"];
|
||||
$partition_by = array();
|
||||
foreach (array('HASH', 'LINEAR HASH', 'KEY', 'LINEAR KEY', 'RANGE', 'LIST') as $key) {
|
||||
$partition_by[$key] = $key;
|
||||
}
|
||||
$partition_by = driver()->partitionBy;
|
||||
$partitions_info = driver()->partitionsInfo($TABLE);
|
||||
|
||||
$referencable_primary = referencable_primary($TABLE);
|
||||
$foreign_keys = array();
|
||||
@@ -17,8 +15,8 @@ $orig_fields = array();
|
||||
$table_status = array();
|
||||
if ($TABLE != "") {
|
||||
$orig_fields = fields($TABLE);
|
||||
$table_status = table_status($TABLE);
|
||||
if (!$table_status) {
|
||||
$table_status = table_status1($TABLE);
|
||||
if (count($table_status) < 2) { // there's only the Name field
|
||||
$error = lang('No tables.');
|
||||
}
|
||||
}
|
||||
@@ -80,40 +78,26 @@ if ($_POST && !process_fields($row["fields"]) && !$error) {
|
||||
}
|
||||
}
|
||||
|
||||
$partitioning = "";
|
||||
if (support("partitioning")) {
|
||||
if (isset($partition_by[$row["partition_by"]])) {
|
||||
$params = array();
|
||||
foreach ($row as $key => $val) {
|
||||
if (preg_match('~^partition~', $key)) {
|
||||
$params[$key] = $val;
|
||||
}
|
||||
$partitioning = array();
|
||||
if (in_array($row["partition_by"], $partition_by)) {
|
||||
foreach ($row as $key => $val) {
|
||||
if (preg_match('~^partition~', $key)) {
|
||||
$partitioning[$key] = $val;
|
||||
}
|
||||
foreach ($params["partition_names"] as $key => $name) {
|
||||
if ($name == "") {
|
||||
unset($params["partition_names"][$key]);
|
||||
unset($params["partition_values"][$key]);
|
||||
}
|
||||
}
|
||||
if ($params != get_partitions_info($TABLE)) {
|
||||
$partitions = array();
|
||||
if ($params["partition_by"] == 'RANGE' || $params["partition_by"] == 'LIST') {
|
||||
foreach ($params["partition_names"] as $key => $name) {
|
||||
$value = $params["partition_values"][$key];
|
||||
$partitions[] = "\n PARTITION " . idf_escape($name) . " VALUES " . ($params["partition_by"] == 'RANGE' ? "LESS THAN" : "IN") . ($value != "" ? " ($value)" : " MAXVALUE"); //! SQL injection
|
||||
}
|
||||
}
|
||||
// $params["partition"] can be expression, not only column
|
||||
$partitioning .= "\nPARTITION BY $params[partition_by]($params[partition])";
|
||||
if ($partitions) {
|
||||
$partitioning .= " (" . implode(",", $partitions) . "\n)";
|
||||
} elseif ($params["partitions"]) {
|
||||
$partitioning .= " PARTITIONS " . (+$params["partitions"]);
|
||||
}
|
||||
}
|
||||
} elseif (preg_match("~partitioned~", $table_status["Create_options"])) {
|
||||
$partitioning .= "\nREMOVE PARTITIONING";
|
||||
}
|
||||
foreach ($partitioning["partition_names"] as $key => $name) {
|
||||
if ($name == "") {
|
||||
unset($partitioning["partition_names"][$key]);
|
||||
unset($partitioning["partition_values"][$key]);
|
||||
}
|
||||
}
|
||||
$partitioning["partition_names"] = array_values($partitioning["partition_names"]);
|
||||
$partitioning["partition_values"] = array_values($partitioning["partition_values"]);
|
||||
if ($partitioning == $partitions_info) {
|
||||
$partitioning = array();
|
||||
}
|
||||
} elseif (preg_match("~partitioned~", $table_status["Create_options"])) {
|
||||
$partitioning = null;
|
||||
}
|
||||
|
||||
$message = lang('Table has been altered.');
|
||||
@@ -140,7 +124,7 @@ if ($_POST && !process_fields($row["fields"]) && !$error) {
|
||||
page_header(($TABLE != "" ? lang('Alter table') : lang('Create table')), $error, array("table" => $TABLE), h($TABLE));
|
||||
|
||||
if (!$_POST) {
|
||||
$types = $driver->types();
|
||||
$types = driver()->types();
|
||||
$row = array(
|
||||
"Engine" => $_COOKIE["adminer_engine"],
|
||||
"fields" => array(array("field" => "", "type" => (isset($types["int"]) ? "int" : (isset($types["integer"]) ? "integer" : "")), "on_update" => "")),
|
||||
@@ -159,8 +143,8 @@ if (!$_POST) {
|
||||
$row["fields"][] = $field;
|
||||
}
|
||||
|
||||
if (support("partitioning")) {
|
||||
$row += get_partitions_info($TABLE);
|
||||
if ($partition_by) {
|
||||
$row += $partitions_info;
|
||||
$row["partition_names"][] = "";
|
||||
$row["partition_values"][] = "";
|
||||
}
|
||||
@@ -168,7 +152,10 @@ if (!$_POST) {
|
||||
}
|
||||
|
||||
$collations = collations();
|
||||
$engines = engines();
|
||||
if (is_array(reset($collations))) {
|
||||
$collations = call_user_func_array('array_merge', array_values($collations));
|
||||
}
|
||||
$engines = driver()->engines();
|
||||
// case of engine may differ
|
||||
foreach ($engines as $engine) {
|
||||
if (!strcasecmp($engine, $row["Engine"])) {
|
||||
@@ -182,11 +169,11 @@ foreach ($engines as $engine) {
|
||||
<p>
|
||||
<?php
|
||||
if (support("columns") || $TABLE == "") {
|
||||
echo lang('Table name') . "<input name='name'" . ($TABLE == "" && !$_POST ? " autofocus" : "") . " data-maxlength='64' value='" . h($row["name"]) . "' autocapitalize='off'>\n";
|
||||
echo ($engines ? html_select("Engine", array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . on_help("getTarget(event).value", 1) . script("qsl('select').onchange = helpClose;") . "\n" : "");
|
||||
echo lang('Table name') . ": <input name='name'" . ($TABLE == "" && !$_POST ? " autofocus" : "") . " data-maxlength='64' value='" . h($row["name"]) . "' autocapitalize='off'>\n";
|
||||
echo ($engines ? html_select("Engine", array("" => "(" . lang('engine') . ")") + $engines, $row["Engine"]) . on_help("event.target.value", 1) . script("qsl('select').onchange = helpClose;") . "\n" : "");
|
||||
if ($collations) {
|
||||
echo "<datalist id='collations'>" . optionlist($collations) . "</datalist>";
|
||||
echo (preg_match("~sqlite|mssql~", JUSH) ? "" : "<input list='collations' name='Collation' value='" . h($row["Collation"]) . "' placeholder='(" . lang('collation') . ")'>");
|
||||
echo "<datalist id='collations'>" . optionlist($collations) . "</datalist>\n";
|
||||
echo (preg_match("~sqlite|mssql~", JUSH) ? "" : "<input list='collations' name='Collation' value='" . h($row["Collation"]) . "' placeholder='(" . lang('collation') . ")'>\n");
|
||||
}
|
||||
echo "<input type='submit' value='" . lang('Save') . "'>\n";
|
||||
}
|
||||
@@ -218,10 +205,10 @@ if (support("columns")) {
|
||||
<input type="submit" name="drop" value="<?php echo lang('Drop'); ?>"><?php echo confirm(lang('Drop %s?', $TABLE)); ?>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if (support("partitioning")) {
|
||||
if ($partition_by && (JUSH == 'sql' || $TABLE == "")) {
|
||||
$partition_table = preg_match('~RANGE|LIST~', $row["partition_by"]);
|
||||
print_fieldset("partition", lang('Partition by'), $row["partition_by"]);
|
||||
echo "<p>" . html_select("partition_by", array("" => "") + $partition_by, $row["partition_by"]) . on_help("getTarget(event).value.replace(/./, 'PARTITION BY \$&')", 1) . script("qsl('select').onchange = partitionByChange;");
|
||||
echo "<p>" . html_select("partition_by", array_merge(array(""), $partition_by), $row["partition_by"]) . on_help("event.target.value.replace(/./, 'PARTITION BY \$&')", 1) . script("qsl('select').onchange = partitionByChange;");
|
||||
echo "(<input name='partition' value='" . h($row["partition"]) . "'>)\n";
|
||||
echo lang('Partitions') . ": <input type='number' name='partitions' class='size" . ($partition_table || !$row["partition_by"] ? " hidden" : "") . "' value='" . h($row["partitions"]) . "'>\n";
|
||||
echo "<table id='partition-table'" . ($partition_table ? "" : " class='hidden'") . ">\n";
|
||||
@@ -230,10 +217,10 @@ if (support("partitioning")) {
|
||||
echo '<tr>';
|
||||
echo '<td><input name="partition_names[]" value="' . h($val) . '" autocapitalize="off">';
|
||||
echo ($key == count($row["partition_names"]) - 1 ? script("qsl('input').oninput = partitionNameChange;") : '');
|
||||
echo '<td><input name="partition_values[]" value="' . h($row["partition_values"][$key]) . '">';
|
||||
echo '<td><input name="partition_values[]" value="' . h(idx($row["partition_values"], $key)) . '">';
|
||||
}
|
||||
echo "</table>\n</div></fieldset>\n";
|
||||
}
|
||||
echo input_token();
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
|
@@ -3,7 +3,7 @@ namespace Adminer;
|
||||
|
||||
$row = $_POST;
|
||||
|
||||
if ($_POST && !$error && !isset($_POST["add_x"])) { // add is an image and PHP changes add.x to add_x
|
||||
if ($_POST && !$error && !$_POST["add"]) {
|
||||
$name = trim($row["name"]);
|
||||
if ($_POST["drop"]) {
|
||||
$_GET["db"] = ""; // to save in global history
|
||||
@@ -60,7 +60,7 @@ if ($_POST) {
|
||||
<form action="" method="post">
|
||||
<p>
|
||||
<?php
|
||||
echo ($_POST["add_x"] || strpos($name, "\n")
|
||||
echo ($_POST["add"] || strpos($name, "\n")
|
||||
? '<textarea autofocus name="name" rows="10" cols="40">' . h($name) . '</textarea><br>'
|
||||
: '<input name="name" autofocus value="' . h($name) . '" data-maxlength="64" autocapitalize="off">'
|
||||
) . "\n" . ($collations ? html_select("collation", array("" => "(" . lang('collation') . ")") + $collations, $row["collation"]) . doc_link(array(
|
||||
@@ -73,9 +73,9 @@ echo ($_POST["add_x"] || strpos($name, "\n")
|
||||
<?php
|
||||
if (DB != "") {
|
||||
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";
|
||||
} elseif (!$_POST["add"] && $_GET["db"] == "") {
|
||||
echo icon("plus", "add[0]", "+", lang('Add next')) . "\n";
|
||||
}
|
||||
echo input_token();
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
|
@@ -54,7 +54,7 @@ if ($tables_views && !$error && !$_POST["search"]) {
|
||||
|
||||
page_header(($_GET["ns"] == "" ? lang('Database') . ": " . h(DB) : lang('Schema') . ": " . h($_GET["ns"])), $error, true);
|
||||
|
||||
if ($adminer->homepage()) {
|
||||
if (adminer()->homepage()) {
|
||||
if ($_GET["ns"] !== "") {
|
||||
echo "<h3 id='tables-views'>" . lang('Tables and views') . "</h3>\n";
|
||||
$tables_list = tables_list();
|
||||
@@ -69,7 +69,7 @@ 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"] = $driver->convertOperator("LIKE %%");
|
||||
$_GET["where"][0]["op"] = driver()->convertOperator("LIKE %%");
|
||||
search_tables();
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ if ($adminer->homepage()) {
|
||||
foreach ($tables_list as $name => $type) {
|
||||
$view = ($type !== null && !preg_match('~table|sequence~i', $type));
|
||||
$id = h("Table-" . $name);
|
||||
echo '<tr><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array($name, $tables_views, true), "", "", "", $id);
|
||||
echo '<tr><td>' . checkbox(($view ? "views[]" : "tables[]"), $name, in_array("$name", $tables_views, true), "", "", "", $id); // "$name" to check numeric table names
|
||||
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>';
|
||||
@@ -146,18 +146,18 @@ if ($adminer->homepage()) {
|
||||
: "")))
|
||||
. "<input type='submit' name='truncate' value='" . lang('Truncate') . "'> " . on_help(JUSH == "sqlite" ? "'DELETE'" : "'TRUNCATE" . (JUSH == "pgsql" ? "'" : " TABLE'")) . confirm()
|
||||
. "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . on_help("'DROP TABLE'") . confirm() . "\n";
|
||||
$databases = (support("scheme") ? $adminer->schemas() : $adminer->databases());
|
||||
$databases = (support("scheme") ? adminer()->schemas() : adminer()->databases());
|
||||
if (count($databases) != 1 && JUSH != "sqlite") {
|
||||
$db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));
|
||||
echo "<p>" . lang('Move to other database') . ": ";
|
||||
echo "<p><label>" . lang('Move to other database') . ": ";
|
||||
echo ($databases ? html_select("target", $databases, $db) : '<input name="target" value="' . h($db) . '" autocapitalize="off">');
|
||||
echo " <input type='submit' name='move' value='" . lang('Move') . "'>";
|
||||
echo "</label> <input type='submit' name='move' value='" . lang('Move') . "'>";
|
||||
echo (support("copy") ? " <input type='submit' name='copy' value='" . lang('Copy') . "'> " . checkbox("overwrite", 1, $_POST["overwrite"], lang('overwrite')) : "");
|
||||
echo "\n";
|
||||
}
|
||||
echo "<input type='hidden' name='all' value=''>"; // used by trCheck()
|
||||
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 input_token();
|
||||
echo "</div></fieldset>\n";
|
||||
echo "</div></div>\n";
|
||||
}
|
||||
@@ -165,8 +165,8 @@ if ($adminer->homepage()) {
|
||||
echo script("tableCheck();");
|
||||
}
|
||||
|
||||
echo '<p class="links"><a href="' . h(ME) . 'create=">' . lang('Create table') . "</a>\n";
|
||||
echo (support("view") ? '<a href="' . h(ME) . 'view=">' . lang('Create view') . "</a>\n" : "");
|
||||
echo "<p class='links'><a href='" . h(ME) . "create='>" . lang('Create table') . "</a>\n";
|
||||
echo (support("view") ? "<a href='" . h(ME) . "view='>" . lang('Create view') . "</a>\n" : "");
|
||||
|
||||
if (support("routine")) {
|
||||
echo "<h3 id='routines'>" . lang('Routines') . "</h3>\n";
|
||||
|
@@ -1,17 +1,11 @@
|
||||
<?php
|
||||
function adminer_object() {
|
||||
include_once "../plugins/plugin.php";
|
||||
include_once "../plugins/designs.php";
|
||||
$designs = array();
|
||||
foreach (glob("../designs/*", GLOB_ONLYDIR) as $dirname) {
|
||||
foreach (array("", "-dark") as $mode) {
|
||||
$filename = "$dirname/adminer$mode.css";
|
||||
if (file_exists($filename)) {
|
||||
$designs[$filename] = basename($dirname);
|
||||
}
|
||||
}
|
||||
foreach (glob("../designs/*/*.css") as $filename) {
|
||||
$designs[$filename] = basename(dirname($filename));
|
||||
}
|
||||
return new AdminerPlugin(array(
|
||||
return new Adminer\Plugins(array(
|
||||
new AdminerDesigns($designs),
|
||||
));
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ $fields = fields($TABLE);
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment; filename=" . friendly_url("$TABLE-" . implode("_", $_GET["where"])) . "." . friendly_url($_GET["field"]));
|
||||
$select = array(idf_escape($_GET["field"]));
|
||||
$result = $driver->select($TABLE, $select, array(where($_GET, $fields)), $select);
|
||||
$result = driver()->select($TABLE, $select, array(where($_GET, $fields)), $select);
|
||||
$row = ($result ? $result->fetch_row() : array());
|
||||
echo $driver->value($row[0], $fields[$_GET["field"]]);
|
||||
echo driver()->value($row[0], $fields[$_GET["field"]]);
|
||||
exit; // don't output footer
|
||||
|
@@ -7,13 +7,14 @@
|
||||
|
||||
namespace Adminer;
|
||||
|
||||
$drivers["mssql"] = "MS SQL";
|
||||
add_driver("mssql", "MS SQL");
|
||||
|
||||
if (isset($_GET["mssql"])) {
|
||||
define('Adminer\DRIVER', "mssql");
|
||||
if (extension_loaded("sqlsrv")) {
|
||||
class Db {
|
||||
public $extension = "sqlsrv", $server_info, $affected_rows, $errno, $error;
|
||||
|
||||
if (extension_loaded("sqlsrv") && $_GET["ext"] != "pdo") {
|
||||
class Db extends SqlDb {
|
||||
public $extension = "sqlsrv";
|
||||
private $link, $result;
|
||||
|
||||
private function get_error() {
|
||||
@@ -25,17 +26,16 @@ if (isset($_GET["mssql"])) {
|
||||
$this->error = rtrim($this->error);
|
||||
}
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
global $adminer;
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
$connection_info = array("UID" => $username, "PWD" => $password, "CharacterSet" => "UTF-8");
|
||||
$ssl = $adminer->connectSsl();
|
||||
$ssl = adminer()->connectSsl();
|
||||
if (isset($ssl["Encrypt"])) {
|
||||
$connection_info["Encrypt"] = $ssl["Encrypt"];
|
||||
}
|
||||
if (isset($ssl["TrustServerCertificate"])) {
|
||||
$connection_info["TrustServerCertificate"] = $ssl["TrustServerCertificate"];
|
||||
}
|
||||
$db = $adminer->database();
|
||||
$db = adminer()->database();
|
||||
if ($db != "") {
|
||||
$connection_info["Database"] = $db;
|
||||
}
|
||||
@@ -46,19 +46,19 @@ if (isset($_GET["mssql"])) {
|
||||
} else {
|
||||
$this->get_error();
|
||||
}
|
||||
return (bool) $this->link;
|
||||
return ($this->link ? '' : $this->error);
|
||||
}
|
||||
|
||||
function quote($string) {
|
||||
function quote(string $string): string {
|
||||
$unicode = strlen($string) != strlen(utf8_decode($string));
|
||||
return ($unicode ? "N" : "") . "'" . str_replace("'", "''", $string) . "'";
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
function select_db(string $database) {
|
||||
return $this->query(use_sql($database));
|
||||
}
|
||||
|
||||
function query($query, $unbuffered = false) {
|
||||
function query(string $query, bool $unbuffered = false) {
|
||||
$result = sqlsrv_query($this->link, $query); //! , array(), ($unbuffered ? array() : array("Scrollable" => "keyset"))
|
||||
$this->error = "";
|
||||
if (!$result) {
|
||||
@@ -68,7 +68,7 @@ if (isset($_GET["mssql"])) {
|
||||
return $this->store_result($result);
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
function multi_query(string $query) {
|
||||
$this->result = sqlsrv_query($this->link, $query);
|
||||
$this->error = "";
|
||||
if (!$this->result) {
|
||||
@@ -92,17 +92,8 @@ if (isset($_GET["mssql"])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function next_result() {
|
||||
return $this->result ? sqlsrv_next_result($this->result) : null;
|
||||
}
|
||||
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
if (!is_object($result)) {
|
||||
return false;
|
||||
}
|
||||
$row = $result->fetch_row();
|
||||
return $row[$field];
|
||||
function next_result(): bool {
|
||||
return $this->result ? !!sqlsrv_next_result($this->result) : false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,15 +124,15 @@ if (isset($_GET["mssql"])) {
|
||||
return $this->convert(sqlsrv_fetch_array($this->result, SQLSRV_FETCH_NUMERIC));
|
||||
}
|
||||
|
||||
function fetch_field() {
|
||||
function fetch_field(): \stdClass {
|
||||
if (!$this->fields) {
|
||||
$this->fields = sqlsrv_field_metadata($this->result);
|
||||
}
|
||||
$field = $this->fields[$this->offset++];
|
||||
$return = new \stdClass;
|
||||
$return->name = $field["Name"];
|
||||
$return->orgname = $field["Name"];
|
||||
$return->type = ($field["Type"] == 1 ? 254 : 0);
|
||||
$return->type = ($field["Type"] == 1 ? 254 : 15);
|
||||
$return->charsetnr = 0;
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -156,57 +147,81 @@ if (isset($_GET["mssql"])) {
|
||||
}
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_sqlsrv")) {
|
||||
class Db extends PdoDb {
|
||||
public $extension = "PDO_SQLSRV";
|
||||
function last_id($result) {
|
||||
return get_val("SELECT SCOPE_IDENTITY()"); // @@IDENTITY can return trigger INSERT
|
||||
}
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
$this->dsn("sqlsrv:Server=" . str_replace(":", ",", $server), $username, $password);
|
||||
return true;
|
||||
}
|
||||
function explain($connection, $query) {
|
||||
$connection->query("SET SHOWPLAN_ALL ON");
|
||||
$return = $connection->query($query);
|
||||
$connection->query("SET SHOWPLAN_ALL OFF"); // connection is used also for indexes
|
||||
return $return;
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
} else {
|
||||
abstract class MssqlDb extends PdoDb {
|
||||
function select_db(string $database) {
|
||||
// database selection is separated from the connection so dbname in DSN can't be used
|
||||
return $this->query(use_sql($database));
|
||||
}
|
||||
|
||||
function lastInsertId() {
|
||||
return $this->pdo->lastInsertId();
|
||||
}
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_dblib")) {
|
||||
class Db extends PdoDb {
|
||||
public $extension = "PDO_DBLIB";
|
||||
function last_id($result) {
|
||||
return connection()->lastInsertId();
|
||||
}
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
$this->dsn("dblib:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\d)~', ';port=\1', $server)), $username, $password);
|
||||
return true;
|
||||
function explain($connection, $query) {
|
||||
}
|
||||
|
||||
if (extension_loaded("pdo_sqlsrv")) {
|
||||
class Db extends MssqlDb {
|
||||
public $extension = "PDO_SQLSRV";
|
||||
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
return $this->dsn("sqlsrv:Server=" . str_replace(":", ",", $server), $username, $password);
|
||||
}
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
return $this->query(use_sql($database));
|
||||
} elseif (extension_loaded("pdo_dblib")) {
|
||||
class Db extends MssqlDb {
|
||||
public $extension = "PDO_DBLIB";
|
||||
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
return $this->dsn("dblib:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\d)~', ';port=\1', $server)), $username, $password);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Driver extends SqlDriver {
|
||||
static $possibleDrivers = array("SQLSRV", "PDO_SQLSRV", "PDO_DBLIB");
|
||||
static $extensions = array("SQLSRV", "PDO_SQLSRV", "PDO_DBLIB");
|
||||
static $jush = "mssql";
|
||||
|
||||
public $insertFunctions = array("date|time" => "getdate");
|
||||
public $editFunctions = array(
|
||||
array(
|
||||
"date|time" => "getdate",
|
||||
), array(
|
||||
"int|decimal|real|float|money|datetime" => "+/-",
|
||||
"char|text" => "+",
|
||||
)
|
||||
"int|decimal|real|float|money|datetime" => "+/-",
|
||||
"char|text" => "+",
|
||||
);
|
||||
|
||||
public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL");
|
||||
public $functions = array("len", "lower", "round", "upper");
|
||||
public $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
|
||||
public $onActions = "NO ACTION|CASCADE|SET NULL|SET DEFAULT";
|
||||
public $generated = array("PERSISTED", "VIRTUAL");
|
||||
public $onActions = "NO ACTION|CASCADE|SET NULL|SET DEFAULT";
|
||||
|
||||
function __construct($connection) {
|
||||
static function connect(?string $server, string $username, string $password) {
|
||||
if ($server == "") {
|
||||
$server = "localhost:1433";
|
||||
}
|
||||
return parent::connect($server, $username, $password);
|
||||
}
|
||||
|
||||
function __construct(Db $connection) {
|
||||
parent::__construct($connection);
|
||||
$this->types = array( //! use sys.types
|
||||
lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "int" => 10, "bigint" => 20, "bit" => 1, "decimal" => 0, "real" => 12, "float" => 53, "smallmoney" => 10, "money" => 20),
|
||||
@@ -216,7 +231,7 @@ if (isset($_GET["mssql"])) {
|
||||
);
|
||||
}
|
||||
|
||||
function insertUpdate($table, $rows, $primary) {
|
||||
function insertUpdate(string $table, array $rows, array $primary) {
|
||||
$fields = fields($table);
|
||||
$update = array();
|
||||
$where = array();
|
||||
@@ -260,7 +275,7 @@ if (isset($_GET["mssql"])) {
|
||||
return queries("BEGIN TRANSACTION");
|
||||
}
|
||||
|
||||
function tableHelp($name, $is_view = false) {
|
||||
function tableHelp(string $name, bool $is_view = false) {
|
||||
$links = array(
|
||||
"sys" => "catalog-views/sys-",
|
||||
"INFORMATION_SCHEMA" => "information-schema-views/",
|
||||
@@ -282,23 +297,12 @@ if (isset($_GET["mssql"])) {
|
||||
return ($_GET["ns"] != "" ? idf_escape($_GET["ns"]) . "." : "") . idf_escape($idf);
|
||||
}
|
||||
|
||||
function connect($credentials) {
|
||||
$connection = new Db;
|
||||
if ($credentials[0] == "") {
|
||||
$credentials[0] = "localhost:1433";
|
||||
}
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
return $connection;
|
||||
}
|
||||
return $connection->error;
|
||||
}
|
||||
|
||||
function get_databases() {
|
||||
function get_databases($flush) {
|
||||
return get_vals("SELECT name FROM sys.databases WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb')");
|
||||
}
|
||||
|
||||
function limit($query, $where, $limit, $offset = 0, $separator = " ") {
|
||||
return ($limit !== null ? " TOP (" . ($limit + $offset) . ")" : "") . " $query$where"; // seek later
|
||||
return ($limit ? " TOP (" . ($limit + $offset) . ")" : "") . " $query$where"; // seek later
|
||||
}
|
||||
|
||||
function limit1($table, $query, $where, $separator = "\n") {
|
||||
@@ -309,10 +313,6 @@ if (isset($_GET["mssql"])) {
|
||||
return get_val("SELECT collation_name FROM sys.databases WHERE name = " . q($db));
|
||||
}
|
||||
|
||||
function engines() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function logged_user() {
|
||||
return get_val("SELECT SUSER_NAME()");
|
||||
}
|
||||
@@ -322,10 +322,9 @@ if (isset($_GET["mssql"])) {
|
||||
}
|
||||
|
||||
function count_tables($databases) {
|
||||
global $connection;
|
||||
$return = array();
|
||||
foreach ($databases as $db) {
|
||||
$connection->select_db($db);
|
||||
connection()->select_db($db);
|
||||
$return[$db] = get_val("SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES");
|
||||
}
|
||||
return $return;
|
||||
@@ -338,9 +337,6 @@ if (isset($_GET["mssql"])) {
|
||||
FROM sys.all_objects AS ao
|
||||
WHERE schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND type IN ('S', 'U', 'V') " . ($name != "" ? "AND name = " . q($name) : "ORDER BY name")) as $row
|
||||
) {
|
||||
if ($name != "") {
|
||||
return $row;
|
||||
}
|
||||
$return[$row["Name"]] = $row;
|
||||
}
|
||||
return $return;
|
||||
@@ -359,7 +355,7 @@ WHERE schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND type IN ('S', 'U', 'V')
|
||||
$return = array();
|
||||
$table_id = get_val("SELECT object_id FROM sys.all_objects WHERE schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND type IN ('S', 'U', 'V') AND name = " . q($table));
|
||||
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], d.name default_constraint, i.is_primary_key
|
||||
get_rows("SELECT c.max_length, c.precision, c.scale, c.name, c.is_nullable, c.is_identity, c.collation_name, t.name type, d.definition [default], d.name default_constraint, i.is_primary_key
|
||||
FROM sys.all_columns c
|
||||
JOIN sys.types t ON c.user_type_id = t.user_type_id
|
||||
LEFT JOIN sys.default_constraints d ON c.default_object_id = d.object_id
|
||||
@@ -369,7 +365,7 @@ WHERE c.object_id = " . q($table_id)) as $row
|
||||
) {
|
||||
$type = $row["type"];
|
||||
$length = (preg_match("~char|binary~", $type)
|
||||
? $row["max_length"] / ($type[0] == 'n' ? 2 : 1)
|
||||
? intval($row["max_length"]) / ($type[0] == 'n' ? 2 : 1)
|
||||
: ($type == "decimal" ? "$row[precision],$row[scale]" : "")
|
||||
);
|
||||
$return[$row["name"]] = array(
|
||||
@@ -430,8 +426,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table), $connection2) as $row
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -547,17 +542,6 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table), $connection2) as $row
|
||||
;
|
||||
}
|
||||
|
||||
function last_id() {
|
||||
return get_val("SELECT SCOPE_IDENTITY()"); // @@IDENTITY can return trigger INSERT
|
||||
}
|
||||
|
||||
function explain($connection, $query) {
|
||||
$connection->query("SET SHOWPLAN_ALL ON");
|
||||
$return = $connection->query($query);
|
||||
$connection->query("SET SHOWPLAN_ALL OFF"); // connection is used also for indexes
|
||||
return $return;
|
||||
}
|
||||
|
||||
function found_rows($table_status, $where) {
|
||||
}
|
||||
|
||||
@@ -593,7 +577,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table), $connection2) as $row
|
||||
return apply_queries("ALTER SCHEMA " . idf_escape($target) . " TRANSFER", array_merge($tables, $views));
|
||||
}
|
||||
|
||||
function trigger($name) {
|
||||
function trigger($name, $table) {
|
||||
if ($name == "") {
|
||||
return array();
|
||||
}
|
||||
@@ -653,8 +637,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)) as $row
|
||||
}
|
||||
|
||||
function create_sql($table, $auto_increment, $style) {
|
||||
global $driver;
|
||||
if (is_view(table_status($table))) {
|
||||
if (is_view(table_status1($table))) {
|
||||
$view = view($table);
|
||||
return "CREATE VIEW " . table($table) . " AS $view[select]";
|
||||
}
|
||||
@@ -677,7 +660,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)) as $row
|
||||
$fields[] = ($index["type"] == "INDEX" ? "INDEX $name" : "CONSTRAINT $name " . ($index["type"] == "UNIQUE" ? "UNIQUE" : "PRIMARY KEY")) . " (" . implode(", ", $columns) . ")";
|
||||
}
|
||||
}
|
||||
foreach ($driver->checkConstraints($table) as $name => $check) {
|
||||
foreach (driver()->checkConstraints($table) as $name => $check) {
|
||||
$fields[] = "CONSTRAINT " . idf_escape($name) . " CHECK ($check)";
|
||||
}
|
||||
return "CREATE TABLE " . table($table) . " (\n\t" . implode(",\n\t", $fields) . "\n)";
|
||||
@@ -702,7 +685,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)) as $row
|
||||
function trigger_sql($table) {
|
||||
$return = "";
|
||||
foreach (triggers($table) as $name => $trigger) {
|
||||
$return .= create_trigger(" ON " . table($table), trigger($name)) . ";";
|
||||
$return .= create_trigger(" ON " . table($table), trigger($name, $table)) . ";";
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,16 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$drivers["oracle"] = "Oracle (beta)";
|
||||
add_driver("oracle", "Oracle (beta)");
|
||||
|
||||
if (isset($_GET["oracle"])) {
|
||||
define('Adminer\DRIVER', "oracle");
|
||||
if (extension_loaded("oci8")) {
|
||||
class Db {
|
||||
public $extension = "oci8", $server_info, $affected_rows, $errno, $error;
|
||||
|
||||
if (extension_loaded("oci8") && $_GET["ext"] != "pdo") {
|
||||
class Db extends SqlDb {
|
||||
public $extension = "oci8";
|
||||
public $_current_db;
|
||||
private $link, $result;
|
||||
private $link;
|
||||
|
||||
function _error($errno, $error) {
|
||||
if (ini_bool("html_errors")) {
|
||||
@@ -19,27 +20,26 @@ if (isset($_GET["oracle"])) {
|
||||
$this->error = $error;
|
||||
}
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
$this->link = @oci_new_connect($username, $password, $server, "AL32UTF8");
|
||||
if ($this->link) {
|
||||
$this->server_info = oci_server_version($this->link);
|
||||
return true;
|
||||
return '';
|
||||
}
|
||||
$error = oci_error();
|
||||
$this->error = $error["message"];
|
||||
return false;
|
||||
return $error["message"];
|
||||
}
|
||||
|
||||
function quote($string) {
|
||||
function quote(string $string): string {
|
||||
return "'" . str_replace("'", "''", $string) . "'";
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
function select_db(string $database) {
|
||||
$this->_current_db = $database;
|
||||
return true;
|
||||
}
|
||||
|
||||
function query($query, $unbuffered = false) {
|
||||
function query(string $query, bool $unbuffered = false) {
|
||||
$result = oci_parse($this->link, $query);
|
||||
$this->error = "";
|
||||
if (!$result) {
|
||||
@@ -60,23 +60,6 @@ if (isset($_GET["oracle"])) {
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
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 (is_object($result) ? $result->fetch_column($field) : false);
|
||||
}
|
||||
}
|
||||
|
||||
class Result {
|
||||
@@ -89,7 +72,7 @@ if (isset($_GET["oracle"])) {
|
||||
|
||||
private function convert($row) {
|
||||
foreach ((array) $row as $key => $val) {
|
||||
if (is_a($val, 'OCI-Lob')) {
|
||||
if (is_a($val, 'OCILob') || is_a($val, 'OCI-Lob')) {
|
||||
$row[$key] = $val->load();
|
||||
}
|
||||
}
|
||||
@@ -104,16 +87,11 @@ if (isset($_GET["oracle"])) {
|
||||
return $this->convert(oci_fetch_row($this->result));
|
||||
}
|
||||
|
||||
function fetch_column($field) {
|
||||
return (oci_fetch($this->result) ? oci_result($this->result, $field + 1) : false);
|
||||
}
|
||||
|
||||
function fetch_field() {
|
||||
function fetch_field(): \stdClass {
|
||||
$column = $this->offset++;
|
||||
$return = new \stdClass;
|
||||
$return->name = oci_field_name($this->result, $column);
|
||||
$return->orgname = $return->name;
|
||||
$return->type = oci_field_type($this->result, $column);
|
||||
$return->type = oci_field_type($this->result, $column); //! map to MySQL numbers
|
||||
$return->charsetnr = (preg_match("~raw|blob|bfile~", $return->type) ? 63 : 0); // 63 - binary
|
||||
return $return;
|
||||
}
|
||||
@@ -128,12 +106,11 @@ if (isset($_GET["oracle"])) {
|
||||
public $extension = "PDO_OCI";
|
||||
public $_current_db;
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
$this->dsn("oci:dbname=//$server;charset=AL32UTF8", $username, $password);
|
||||
return true;
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
return $this->dsn("oci:dbname=//$server;charset=AL32UTF8", $username, $password);
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
function select_db(string $database) {
|
||||
$this->_current_db = $database;
|
||||
return true;
|
||||
}
|
||||
@@ -144,25 +121,24 @@ if (isset($_GET["oracle"])) {
|
||||
|
||||
|
||||
class Driver extends SqlDriver {
|
||||
static $possibleDrivers = array("OCI8", "PDO_OCI");
|
||||
static $extensions = array("OCI8", "PDO_OCI");
|
||||
static $jush = "oracle";
|
||||
|
||||
public $insertFunctions = array( //! no parentheses
|
||||
"date" => "current_date",
|
||||
"timestamp" => "current_timestamp",
|
||||
);
|
||||
public $editFunctions = array(
|
||||
array( //! no parentheses
|
||||
"date" => "current_date",
|
||||
"timestamp" => "current_timestamp",
|
||||
), array(
|
||||
"number|float|double" => "+/-",
|
||||
"date|timestamp" => "+ interval/- interval",
|
||||
"char|clob" => "||",
|
||||
)
|
||||
"number|float|double" => "+/-",
|
||||
"date|timestamp" => "+ interval/- interval",
|
||||
"char|clob" => "||",
|
||||
);
|
||||
|
||||
public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL");
|
||||
public $functions = array("length", "lower", "round", "upper");
|
||||
public $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
|
||||
|
||||
function __construct($connection) {
|
||||
function __construct(Db $connection) {
|
||||
parent::__construct($connection);
|
||||
$this->types = array(
|
||||
lang('Numbers') => array("number" => 38, "binary_float" => 12, "binary_double" => 21),
|
||||
@@ -178,8 +154,7 @@ if (isset($_GET["oracle"])) {
|
||||
return true; // automatic start
|
||||
}
|
||||
|
||||
function insertUpdate($table, $rows, $primary) {
|
||||
global $connection;
|
||||
function insertUpdate(string $table, array $rows, array $primary) {
|
||||
foreach ($rows as $set) {
|
||||
$update = array();
|
||||
$where = array();
|
||||
@@ -190,7 +165,7 @@ if (isset($_GET["oracle"])) {
|
||||
}
|
||||
}
|
||||
if (
|
||||
!(($where && queries("UPDATE " . table($table) . " SET " . implode(", ", $update) . " WHERE " . implode(" AND ", $where)) && $connection->affected_rows)
|
||||
!(($where && queries("UPDATE " . table($table) . " SET " . implode(", ", $update) . " WHERE " . implode(" AND ", $where)) && connection()->affected_rows)
|
||||
|| queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")"))
|
||||
) {
|
||||
return false;
|
||||
@@ -199,7 +174,7 @@ if (isset($_GET["oracle"])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function hasCStyleEscapes() {
|
||||
function hasCStyleEscapes(): bool {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -214,15 +189,7 @@ if (isset($_GET["oracle"])) {
|
||||
return idf_escape($idf);
|
||||
}
|
||||
|
||||
function connect($credentials) {
|
||||
$connection = new Db;
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
return $connection;
|
||||
}
|
||||
return $connection->error;
|
||||
}
|
||||
|
||||
function get_databases() {
|
||||
function get_databases($flush) {
|
||||
return get_vals(
|
||||
"SELECT DISTINCT tablespace_name FROM (
|
||||
SELECT tablespace_name FROM user_tablespaces
|
||||
@@ -234,7 +201,7 @@ ORDER BY 1"
|
||||
|
||||
function limit($query, $where, $limit, $offset = 0, $separator = " ") {
|
||||
return ($offset ? " * FROM (SELECT t.*, rownum AS rnum FROM (SELECT $query$where) t WHERE rownum <= " . ($limit + $offset) . ") WHERE rnum > $offset"
|
||||
: ($limit !== null ? " * FROM (SELECT $query$where) WHERE rownum <= " . ($limit + $offset)
|
||||
: ($limit ? " * FROM (SELECT $query$where) WHERE rownum <= " . ($limit + $offset)
|
||||
: " $query$where"
|
||||
));
|
||||
}
|
||||
@@ -247,18 +214,13 @@ ORDER BY 1"
|
||||
return get_val("SELECT value FROM nls_database_parameters WHERE parameter = 'NLS_CHARACTERSET'"); //! respect $db
|
||||
}
|
||||
|
||||
function engines() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function logged_user() {
|
||||
return get_val("SELECT USER FROM DUAL");
|
||||
}
|
||||
|
||||
function get_current_db() {
|
||||
global $connection;
|
||||
$db = $connection->_current_db ?: DB;
|
||||
unset($connection->_current_db);
|
||||
$db = connection()->_current_db ?: DB;
|
||||
unset(connection()->_current_db);
|
||||
return $db;
|
||||
}
|
||||
|
||||
@@ -303,9 +265,6 @@ ORDER BY 1"
|
||||
UNION SELECT view_name, 'view', 0, 0 FROM $view" . ($name != "" ? " WHERE view_name = $search" : "") . "
|
||||
ORDER BY 1") as $row
|
||||
) {
|
||||
if ($name != "") {
|
||||
return $row;
|
||||
}
|
||||
$return[$row["Name"]] = $row;
|
||||
}
|
||||
return $return;
|
||||
@@ -382,8 +341,7 @@ ORDER BY ac.constraint_type, aic.column_position", $connection2) as $row
|
||||
}
|
||||
|
||||
function error() {
|
||||
global $connection;
|
||||
return h($connection->error); //! highlight sqltext from offset
|
||||
return h(connection()->error); //! highlight sqltext from offset
|
||||
}
|
||||
|
||||
function explain($connection, $query) {
|
||||
@@ -433,7 +391,6 @@ ORDER BY ac.constraint_type, aic.column_position", $connection2) as $row
|
||||
$queries = array();
|
||||
foreach ($alter as $val) {
|
||||
if ($val[0] != "INDEX") {
|
||||
//! descending UNIQUE indexes results in syntax error
|
||||
$val[2] = preg_replace('~ DESC$~', '', $val[2]);
|
||||
$create = ($val[2] == "DROP"
|
||||
? "\nDROP CONSTRAINT " . idf_escape($val[1])
|
||||
@@ -495,7 +452,7 @@ AND c_src.TABLE_NAME = " . q($table);
|
||||
return apply_queries("DROP TABLE", $tables);
|
||||
}
|
||||
|
||||
function last_id() {
|
||||
function last_id($result) {
|
||||
return 0; //!
|
||||
}
|
||||
|
||||
@@ -509,15 +466,23 @@ AND c_src.TABLE_NAME = " . q($table);
|
||||
}
|
||||
|
||||
function set_schema($scheme, $connection2 = null) {
|
||||
global $connection;
|
||||
if (!$connection2) {
|
||||
$connection2 = $connection;
|
||||
$connection2 = connection();
|
||||
}
|
||||
return $connection2->query("ALTER SESSION SET CURRENT_SCHEMA = " . idf_escape($scheme));
|
||||
}
|
||||
|
||||
function show_variables() {
|
||||
return get_key_vals('SELECT name, display_value FROM v$parameter');
|
||||
return get_rows('SELECT name, display_value FROM v$parameter');
|
||||
}
|
||||
|
||||
function show_status() {
|
||||
$return = array();
|
||||
$rows = get_rows('SELECT * FROM v$instance');
|
||||
foreach (reset($rows) as $key => $val) {
|
||||
$return[] = array($key, $val);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function process_list() {
|
||||
@@ -538,11 +503,6 @@ ORDER BY PROCESS
|
||||
');
|
||||
}
|
||||
|
||||
function show_status() {
|
||||
$rows = get_rows('SELECT * FROM v$instance');
|
||||
return reset($rows);
|
||||
}
|
||||
|
||||
function convert_field($field) {
|
||||
}
|
||||
|
||||
|
@@ -1,14 +1,16 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$drivers["pgsql"] = "PostgreSQL";
|
||||
add_driver("pgsql", "PostgreSQL");
|
||||
|
||||
if (isset($_GET["pgsql"])) {
|
||||
define('Adminer\DRIVER', "pgsql");
|
||||
if (extension_loaded("pgsql")) {
|
||||
class Db {
|
||||
public $extension = "PgSQL", $server_info, $affected_rows, $error, $timeout;
|
||||
private $link, $result, $string, $database = true;
|
||||
|
||||
if (extension_loaded("pgsql") && $_GET["ext"] != "pdo") {
|
||||
class PgsqlDb extends SqlDb {
|
||||
public $extension = "PgSQL";
|
||||
public $timeout = 0;
|
||||
private $link, $string, $database = true;
|
||||
|
||||
function _error($errno, $error) {
|
||||
if (ini_bool("html_errors")) {
|
||||
@@ -18,12 +20,11 @@ if (isset($_GET["pgsql"])) {
|
||||
$this->error = $error;
|
||||
}
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
global $adminer;
|
||||
$db = $adminer->database();
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
$db = adminer()->database();
|
||||
set_error_handler(array($this, '_error'));
|
||||
$this->string = "host='" . str_replace(":", "' port='", addcslashes($server, "'\\")) . "' user='" . addcslashes($username, "'\\") . "' password='" . addcslashes($password, "'\\") . "'";
|
||||
$ssl = $adminer->connectSsl();
|
||||
$ssl = adminer()->connectSsl();
|
||||
if (isset($ssl["mode"])) {
|
||||
$this->string .= " sslmode='" . $ssl["mode"] . "'";
|
||||
}
|
||||
@@ -35,27 +36,24 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
restore_error_handler();
|
||||
if ($this->link) {
|
||||
$version = pg_version($this->link);
|
||||
$this->server_info = $version["server"];
|
||||
pg_set_client_encoding($this->link, "UTF8");
|
||||
}
|
||||
return (bool) $this->link;
|
||||
return ($this->link ? '' : $this->error);
|
||||
}
|
||||
|
||||
function quote($string) {
|
||||
function quote(string $string): string {
|
||||
return (function_exists('pg_escape_literal')
|
||||
? pg_escape_literal($this->link, $string) // available since PHP 5.4.4
|
||||
: "'" . pg_escape_string($this->link, $string) . "'"
|
||||
);
|
||||
}
|
||||
|
||||
function value($val, $field) {
|
||||
function value(?string $val, array $field): ?string {
|
||||
return ($field["type"] == "bytea" && $val !== null ? pg_unescape_bytea($val) : $val);
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
global $adminer;
|
||||
if ($database == $adminer->database()) {
|
||||
function select_db(string $database) {
|
||||
if ($database == adminer()->database()) {
|
||||
return $this->database;
|
||||
}
|
||||
$return = @pg_connect("$this->string dbname='" . addcslashes($database, "'\\") . "'", PGSQL_CONNECT_FORCE_NEW);
|
||||
@@ -69,7 +67,7 @@ if (isset($_GET["pgsql"])) {
|
||||
$this->link = @pg_connect("$this->string dbname='postgres'");
|
||||
}
|
||||
|
||||
function query($query, $unbuffered = false) {
|
||||
function query(string $query, bool $unbuffered = false) {
|
||||
$result = @pg_query($this->link, $query);
|
||||
$this->error = "";
|
||||
if (!$result) {
|
||||
@@ -88,27 +86,23 @@ if (isset($_GET["pgsql"])) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
return $this->result = $this->query($query);
|
||||
}
|
||||
|
||||
function store_result() {
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
function next_result() {
|
||||
// PgSQL extension doesn't support multiple results
|
||||
return false;
|
||||
}
|
||||
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
return ($result ? $result->fetch_column($field) : false);
|
||||
}
|
||||
|
||||
function warnings() {
|
||||
return h(pg_last_notice($this->link)); // second parameter is available since PHP 7.1.0
|
||||
}
|
||||
|
||||
/** Copy from array into a table
|
||||
* @param list<string> $rows
|
||||
*/
|
||||
function copyFrom(string $table, array $rows): bool {
|
||||
$this->error = '';
|
||||
set_error_handler(function (int $errno, string $error): bool {
|
||||
$this->error = (ini_bool('html_errors') ? html_entity_decode($error) : $error);
|
||||
return true;
|
||||
});
|
||||
$return = pg_copy_from($this->link, $table, $rows);
|
||||
restore_error_handler();
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
class Result {
|
||||
@@ -128,20 +122,14 @@ if (isset($_GET["pgsql"])) {
|
||||
return pg_fetch_row($this->result);
|
||||
}
|
||||
|
||||
function fetch_column($field) {
|
||||
return ($this->num_rows ? pg_fetch_result($this->result, 0, $field) : false);
|
||||
}
|
||||
|
||||
function fetch_field() {
|
||||
function fetch_field(): \stdClass {
|
||||
$column = $this->offset++;
|
||||
$return = new \stdClass;
|
||||
if (function_exists('pg_field_table')) {
|
||||
$return->orgtable = pg_field_table($this->result, $column);
|
||||
}
|
||||
$return->orgtable = pg_field_table($this->result, $column);
|
||||
$return->name = pg_field_name($this->result, $column);
|
||||
$return->orgname = $return->name;
|
||||
$return->type = pg_field_type($this->result, $column);
|
||||
$return->charsetnr = ($return->type == "bytea" ? 63 : 0); // 63 - binary
|
||||
$type = pg_field_type($this->result, $column);
|
||||
$return->type = (preg_match(number_type(), $type) ? 0 : 15);
|
||||
$return->charsetnr = ($type == "bytea" ? 63 : 0); // 63 - binary
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -151,28 +139,26 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_pgsql")) {
|
||||
class Db extends PdoDb {
|
||||
public $extension = "PDO_PgSQL", $timeout;
|
||||
class PgsqlDb extends PdoDb {
|
||||
public $extension = "PDO_PgSQL";
|
||||
public $timeout = 0;
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
global $adminer;
|
||||
$db = $adminer->database();
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
$db = adminer()->database();
|
||||
//! client_encoding is supported since 9.1, but we can't yet use min_version here
|
||||
$dsn = "pgsql:host='" . str_replace(":", "' port='", addcslashes($server, "'\\")) . "' client_encoding=utf8 dbname='" . ($db != "" ? addcslashes($db, "'\\") : "postgres") . "'";
|
||||
$ssl = $adminer->connectSsl();
|
||||
$ssl = adminer()->connectSsl();
|
||||
if (isset($ssl["mode"])) {
|
||||
$dsn .= " sslmode='" . $ssl["mode"] . "'";
|
||||
}
|
||||
$this->dsn($dsn, $username, $password);
|
||||
return true;
|
||||
return $this->dsn($dsn, $username, $password);
|
||||
}
|
||||
|
||||
function select_db($database) {
|
||||
global $adminer;
|
||||
return ($adminer->database() == $database);
|
||||
function select_db(string $database) {
|
||||
return (adminer()->database() == $database);
|
||||
}
|
||||
|
||||
function query($query, $unbuffered = false) {
|
||||
function query(string $query, bool $unbuffered = false) {
|
||||
$return = parent::query($query, $unbuffered);
|
||||
if ($this->timeout) {
|
||||
$this->timeout = 0;
|
||||
@@ -182,7 +168,13 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
|
||||
function warnings() {
|
||||
return ''; // not implemented in PDO_PgSQL as of PHP 7.2.1
|
||||
// not implemented in PDO_PgSQL as of PHP 7.2.1
|
||||
}
|
||||
|
||||
function copyFrom(string $table, array $rows): bool {
|
||||
$return = $this->pdo->pgsqlCopyFromArray($table, $rows);
|
||||
$this->error = idx($this->pdo->errorInfo(), 2) ?: '';
|
||||
return $return;
|
||||
}
|
||||
|
||||
function close() {
|
||||
@@ -193,15 +185,49 @@ if (isset($_GET["pgsql"])) {
|
||||
|
||||
|
||||
|
||||
if (class_exists('Adminer\PgsqlDb')) {
|
||||
class Db extends PgsqlDb {
|
||||
function multi_query(string $query) {
|
||||
if (preg_match('~\bCOPY\s+(.+?)\s+FROM\s+stdin;\n?(.*)\n\\\\\.$~is', str_replace("\r\n", "\n", $query), $match)) { // no ^ to allow leading comments
|
||||
$rows = explode("\n", $match[2]);
|
||||
$this->affected_rows = count($rows);
|
||||
return $this->copyFrom($match[1], $rows);
|
||||
}
|
||||
return parent::multi_query($query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Driver extends SqlDriver {
|
||||
static $possibleDrivers = array("PgSQL", "PDO_PgSQL");
|
||||
static $extensions = array("PgSQL", "PDO_PgSQL");
|
||||
static $jush = "pgsql";
|
||||
|
||||
public $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF
|
||||
public $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT ILIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF
|
||||
public $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
|
||||
public $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
|
||||
|
||||
function __construct($connection) {
|
||||
public string $nsOid = "(SELECT oid FROM pg_namespace WHERE nspname = current_schema())";
|
||||
|
||||
static function connect(?string $server, string $username, string $password) {
|
||||
$connection = parent::connect($server, $username, $password);
|
||||
if (is_string($connection)) {
|
||||
return $connection;
|
||||
}
|
||||
$version = get_val("SELECT version()", 0, $connection);
|
||||
$connection->flavor = (preg_match('~CockroachDB~', $version) ? 'cockroach' : '');
|
||||
$connection->server_info = preg_replace('~^\D*([\d.]+[-\w]*).*~', '\1', $version);
|
||||
if (min_version(9, 0, $connection)) {
|
||||
$connection->query("SET application_name = 'Adminer'");
|
||||
}
|
||||
if ($connection->flavor == 'cockroach') { // we don't use "PostgreSQL / CockroachDB" by default because it's too long
|
||||
add_driver(DRIVER, "CockroachDB");
|
||||
}
|
||||
return $connection;
|
||||
}
|
||||
|
||||
function __construct(Db $connection) {
|
||||
parent::__construct($connection);
|
||||
$this->types = array( //! arrays
|
||||
lang('Numbers') => array("smallint" => 5, "integer" => 10, "bigint" => 19, "boolean" => 1, "numeric" => 0, "real" => 7, "double precision" => 16, "money" => 20),
|
||||
@@ -217,22 +243,25 @@ if (isset($_GET["pgsql"])) {
|
||||
$this->types[lang('Strings')]["jsonb"] = 4294967295;
|
||||
}
|
||||
}
|
||||
$this->insertFunctions = array(
|
||||
"char" => "md5",
|
||||
"date|time" => "now",
|
||||
);
|
||||
$this->editFunctions = array(
|
||||
array(
|
||||
"char" => "md5",
|
||||
"date|time" => "now",
|
||||
), array(
|
||||
number_type() => "+/-",
|
||||
"date|time" => "+ interval/- interval", //! escape
|
||||
"char|text" => "||",
|
||||
)
|
||||
number_type() => "+/-",
|
||||
"date|time" => "+ interval/- interval", //! escape
|
||||
"char|text" => "||",
|
||||
);
|
||||
if (min_version(12, 0, $connection)) {
|
||||
$this->generated = array("STORED");
|
||||
}
|
||||
$this->partitionBy = array("RANGE", "LIST");
|
||||
if (!$connection->flavor) {
|
||||
$this->partitionBy[] = "HASH";
|
||||
}
|
||||
}
|
||||
|
||||
function enumLength($field) {
|
||||
function enumLength(array $field) {
|
||||
$enum = $this->types[lang('User types')][$field["type"]];
|
||||
return ($enum ? type_values($enum) : "");
|
||||
}
|
||||
@@ -241,8 +270,14 @@ if (isset($_GET["pgsql"])) {
|
||||
$this->types[lang('User types')] = array_flip($types);
|
||||
}
|
||||
|
||||
function insertUpdate($table, $rows, $primary) {
|
||||
global $connection;
|
||||
function insertReturning(string $table): string {
|
||||
$auto_increment = array_filter(fields($table), function ($field) {
|
||||
return $field['auto_increment'];
|
||||
});
|
||||
return (count($auto_increment) == 1 ? " RETURNING " . idf_escape(key($auto_increment)) : "");
|
||||
}
|
||||
|
||||
function insertUpdate(string $table, array $rows, array $primary) {
|
||||
foreach ($rows as $set) {
|
||||
$update = array();
|
||||
$where = array();
|
||||
@@ -253,7 +288,7 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
}
|
||||
if (
|
||||
!(($where && queries("UPDATE " . table($table) . " SET " . implode(", ", $update) . " WHERE " . implode(" AND ", $where)) && $connection->affected_rows)
|
||||
!(($where && queries("UPDATE " . table($table) . " SET " . implode(", ", $update) . " WHERE " . implode(" AND ", $where)) && connection()->affected_rows)
|
||||
|| queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")"))
|
||||
) {
|
||||
return false;
|
||||
@@ -262,13 +297,13 @@ if (isset($_GET["pgsql"])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function slowQuery($query, $timeout) {
|
||||
function slowQuery(string $query, int $timeout) {
|
||||
$this->conn->query("SET statement_timeout = " . (1000 * $timeout));
|
||||
$this->conn->timeout = 1000 * $timeout;
|
||||
return $query;
|
||||
}
|
||||
|
||||
function convertSearch($idf, $val, $field) {
|
||||
function convertSearch(string $idf, array $val, array $field): string {
|
||||
$textTypes = "char|text";
|
||||
if (strpos($val["op"], "LIKE") === false) {
|
||||
$textTypes .= "|date|time(stamp)?|boolean|uuid|inet|cidr|macaddr|" . number_type();
|
||||
@@ -277,7 +312,7 @@ if (isset($_GET["pgsql"])) {
|
||||
return (preg_match("~$textTypes~", $field["type"]) ? $idf : "CAST($idf AS text)");
|
||||
}
|
||||
|
||||
function quoteBinary($s) {
|
||||
function quoteBinary(string $s): string {
|
||||
return "'\\x" . bin2hex($s) . "'"; // available since PostgreSQL 8.1
|
||||
}
|
||||
|
||||
@@ -285,7 +320,7 @@ if (isset($_GET["pgsql"])) {
|
||||
return $this->conn->warnings();
|
||||
}
|
||||
|
||||
function tableHelp($name, $is_view = false) {
|
||||
function tableHelp(string $name, bool $is_view = false) {
|
||||
$links = array(
|
||||
"information_schema" => "infoschema",
|
||||
"pg_catalog" => ($is_view ? "view" : "catalog"),
|
||||
@@ -296,15 +331,48 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
}
|
||||
|
||||
function supportsIndex($table_status) {
|
||||
function inheritsFrom(string $table): array {
|
||||
return get_vals("SELECT relname FROM pg_class JOIN pg_inherits ON inhparent = oid WHERE inhrelid = " . $this->tableOid($table) . " ORDER BY 1");
|
||||
}
|
||||
|
||||
function inheritedTables(string $table): array {
|
||||
return get_vals("SELECT relname FROM pg_inherits JOIN pg_class ON inhrelid = oid WHERE inhparent = " . $this->tableOid($table) . " ORDER BY 1");
|
||||
}
|
||||
|
||||
function partitionsInfo(string $table): array {
|
||||
$row = connection()->query("SELECT * FROM pg_partitioned_table WHERE partrelid = " . driver()->tableOid($table))->fetch_assoc();
|
||||
if ($row) {
|
||||
$attrs = get_vals("SELECT attname FROM pg_attribute WHERE attrelid = $row[partrelid] AND attnum IN (" . str_replace(" ", ", ", $row["partattrs"]) . ")"); //! ordering
|
||||
$by = array('h' => 'HASH', 'l' => 'LIST', 'r' => 'RANGE');
|
||||
return array(
|
||||
"partition_by" => $by[$row["partstrat"]],
|
||||
"partition" => implode(", ", array_map('Adminer\idf_escape', $attrs)),
|
||||
);
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
function tableOid(string $table): string {
|
||||
return "(SELECT oid FROM pg_class WHERE relnamespace = $this->nsOid AND relname = " . q($table) . " AND relkind IN ('r', 'm', 'v', 'f', 'p'))";
|
||||
}
|
||||
|
||||
function indexAlgorithms(array $tableStatus): array {
|
||||
static $return = array();
|
||||
if (!$return) {
|
||||
$return = get_vals("SELECT amname FROM pg_am" . (min_version(9.6) ? " WHERE amtype = 'i'" : "") . " ORDER BY amname = 'btree' DESC, amname");
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function supportsIndex(array $table_status): bool {
|
||||
// returns true for "materialized view"
|
||||
return $table_status["Engine"] != "view";
|
||||
}
|
||||
|
||||
function hasCStyleEscapes() {
|
||||
function hasCStyleEscapes(): bool {
|
||||
static $c_style;
|
||||
if ($c_style === null) {
|
||||
$c_style = ($this->conn->result("SHOW standard_conforming_strings") == "off");
|
||||
$c_style = (get_val("SHOW standard_conforming_strings", 0, $this->conn) == "off");
|
||||
}
|
||||
return $c_style;
|
||||
}
|
||||
@@ -320,32 +388,14 @@ if (isset($_GET["pgsql"])) {
|
||||
return idf_escape($idf);
|
||||
}
|
||||
|
||||
function connect($credentials) {
|
||||
global $drivers;
|
||||
$connection = new Db;
|
||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||
if (min_version(9, 0, $connection)) {
|
||||
$connection->query("SET application_name = 'Adminer'");
|
||||
}
|
||||
$crdb_version = $connection->result("SHOW crdb_version");
|
||||
$connection->server_info .= ($crdb_version ? "-" . preg_replace('~ \(.*~', '', $crdb_version) : "");
|
||||
$connection->cockroach = preg_match('~CockroachDB~', $connection->server_info);
|
||||
if ($connection->cockroach) { // we don't use "PostgreSQL / CockroachDB" by default because it's too long
|
||||
$drivers[DRIVER] = "CockroachDB";
|
||||
}
|
||||
return $connection;
|
||||
}
|
||||
return $connection->error;
|
||||
}
|
||||
|
||||
function get_databases() {
|
||||
function get_databases($flush) {
|
||||
return get_vals("SELECT datname FROM pg_database
|
||||
WHERE datallowconn = TRUE AND has_database_privilege(datname, 'CONNECT')
|
||||
ORDER BY datname");
|
||||
}
|
||||
|
||||
function limit($query, $where, $limit, $offset = 0, $separator = " ") {
|
||||
return " $query$where" . ($limit !== null ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
||||
return " $query$where" . ($limit ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
||||
}
|
||||
|
||||
function limit1($table, $query, $where, $separator = "\n") {
|
||||
@@ -359,10 +409,6 @@ ORDER BY datname");
|
||||
return get_val("SELECT datcollate FROM pg_database WHERE datname = " . q($db));
|
||||
}
|
||||
|
||||
function engines() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function logged_user() {
|
||||
return get_val("SELECT user");
|
||||
}
|
||||
@@ -382,10 +428,9 @@ ORDER BY 1";
|
||||
}
|
||||
|
||||
function count_tables($databases) {
|
||||
global $connection;
|
||||
$return = array();
|
||||
foreach ($databases as $db) {
|
||||
if ($connection->select_db($db)) {
|
||||
if (connection()->select_db($db)) {
|
||||
$return[$db] = count(tables_list());
|
||||
}
|
||||
}
|
||||
@@ -401,22 +446,24 @@ ORDER BY 1";
|
||||
$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\"" . ($has_size ? ",
|
||||
pg_table_size(c.oid) AS \"Data_length\",
|
||||
pg_indexes_size(c.oid) AS \"Index_length\"" : "") . ",
|
||||
obj_description(c.oid, 'pg_class') AS \"Comment\",
|
||||
" . (min_version(12) ? "''" : "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)
|
||||
relname AS \"Name\",
|
||||
CASE relkind WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' ELSE 'table' END AS \"Engine\"" . ($has_size ? ",
|
||||
pg_table_size(oid) AS \"Data_length\",
|
||||
pg_indexes_size(oid) AS \"Index_length\"" : "") . ",
|
||||
obj_description(oid, 'pg_class') AS \"Comment\",
|
||||
" . (min_version(12) ? "''" : "CASE WHEN relhasoids THEN 'oid' ELSE '' END") . " AS \"Oid\",
|
||||
reltuples as \"Rows\",
|
||||
inhparent AS inherited,
|
||||
current_schema() AS nspname
|
||||
FROM pg_class
|
||||
LEFT JOIN pg_inherits ON inhrelid = oid
|
||||
WHERE relkind IN ('r', 'm', 'v', 'f', 'p')
|
||||
" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname")) as $row //! Index_length, Auto_increment
|
||||
AND relnamespace = " . driver()->nsOid . "
|
||||
" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname")) as $row //! Auto_increment
|
||||
) {
|
||||
$return[$row["Name"]] = $row;
|
||||
}
|
||||
return ($name != "" ? $return[$name] : $return);
|
||||
return $return;
|
||||
}
|
||||
|
||||
function is_view($table_status) {
|
||||
@@ -439,15 +486,12 @@ WHERE relkind IN ('r', 'm', 'v', 'f', 'p')
|
||||
format_type(a.atttypid, a.atttypmod) AS full_type,
|
||||
pg_get_expr(d.adbin, d.adrelid) AS default,
|
||||
a.attnotnull::int,
|
||||
col_description(c.oid, a.attnum) AS comment" . (min_version(10) ? ",
|
||||
col_description(a.attrelid, a.attnum) AS comment" . (min_version(10) ? ",
|
||||
a.attidentity" . (min_version(12) ? ",
|
||||
a.attgenerated" : "") : "") . "
|
||||
FROM pg_class c
|
||||
JOIN pg_namespace n ON c.relnamespace = n.oid
|
||||
JOIN pg_attribute a ON c.oid = a.attrelid
|
||||
LEFT JOIN pg_attrdef d ON c.oid = d.adrelid AND a.attnum = d.adnum
|
||||
WHERE c.relname = " . q($table) . "
|
||||
AND n.nspname = current_schema()
|
||||
FROM pg_attribute a
|
||||
LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
|
||||
WHERE a.attrelid = " . driver()->tableOid($table) . "
|
||||
AND NOT a.attisdropped
|
||||
AND a.attnum > 0
|
||||
ORDER BY a.attnum") as $row
|
||||
@@ -481,29 +525,30 @@ ORDER BY a.attnum") as $row
|
||||
}
|
||||
|
||||
function indexes($table, $connection2 = null) {
|
||||
global $connection;
|
||||
if (!is_object($connection2)) {
|
||||
$connection2 = $connection;
|
||||
}
|
||||
$connection2 = connection($connection2);
|
||||
$return = array();
|
||||
$table_oid = $connection2->result("SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = " . q($table));
|
||||
$table_oid = driver()->tableOid($table);
|
||||
$columns = get_key_vals("SELECT attnum, attname FROM pg_attribute WHERE attrelid = $table_oid AND attnum > 0", $connection2);
|
||||
foreach (
|
||||
get_rows("SELECT relname, indisunique::int, indisprimary::int, indkey, indoption, (indpred IS NOT NULL)::int as indispartial
|
||||
FROM pg_index i, pg_class ci
|
||||
WHERE i.indrelid = $table_oid AND ci.oid = i.indexrelid
|
||||
get_rows("SELECT relname, indisunique::int, indisprimary::int, indkey, indoption, (indpred IS NOT NULL)::int as indispartial, pg_am.amname as algorithm, pg_get_expr(pg_index.indpred, pg_index.indrelid, true) AS partial
|
||||
FROM pg_index
|
||||
JOIN pg_class ON indexrelid = oid
|
||||
JOIN pg_am ON pg_am.oid = pg_class.relam
|
||||
WHERE indrelid = $table_oid
|
||||
ORDER BY indisprimary DESC, indisunique DESC", $connection2) as $row
|
||||
) {
|
||||
$relname = $row["relname"];
|
||||
$return[$relname]["type"] = ($row["indispartial"] ? "INDEX" : ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX")));
|
||||
$return[$relname]["columns"] = array();
|
||||
$return[$relname]["descs"] = array();
|
||||
$return[$relname]["algorithm"] = $row["algorithm"];
|
||||
$return[$relname]["partial"] = $row["partial"];
|
||||
if ($row["indkey"]) {
|
||||
foreach (explode(" ", $row["indkey"]) as $indkey) {
|
||||
$return[$relname]["columns"][] = $columns[$indkey];
|
||||
}
|
||||
foreach (explode(" ", $row["indoption"]) as $indoption) {
|
||||
$return[$relname]["descs"][] = ($indoption & 1 ? '1' : null); // 1 - INDOPTION_DESC
|
||||
$return[$relname]["descs"][] = (intval($indoption) & 1 ? '1' : null); // 1 - INDOPTION_DESC
|
||||
}
|
||||
}
|
||||
$return[$relname]["lengths"] = array();
|
||||
@@ -512,12 +557,11 @@ ORDER BY indisprimary DESC, indisunique DESC", $connection2) as $row
|
||||
}
|
||||
|
||||
function foreign_keys($table) {
|
||||
global $driver;
|
||||
$return = array();
|
||||
foreach (
|
||||
get_rows("SELECT conname, condeferrable::int AS deferrable, pg_get_constraintdef(oid) AS definition
|
||||
FROM pg_constraint
|
||||
WHERE conrelid = (SELECT pc.oid FROM pg_class AS pc INNER JOIN pg_namespace AS pn ON (pn.oid = pc.relnamespace) WHERE pc.relname = " . q($table) . " AND pn.nspname = current_schema())
|
||||
WHERE conrelid = " . driver()->tableOid($table) . "
|
||||
AND contype = 'f'::char
|
||||
ORDER BY conkey, conname") as $row
|
||||
) {
|
||||
@@ -528,8 +572,8 @@ ORDER BY conkey, conname") as $row
|
||||
$row['table'] = idf_unescape($match2[4]);
|
||||
}
|
||||
$row['target'] = array_map('Adminer\idf_unescape', array_map('trim', explode(',', $match[3])));
|
||||
$row['on_delete'] = (preg_match("~ON DELETE ($driver->onActions)~", $match[4], $match2) ? $match2[1] : 'NO ACTION');
|
||||
$row['on_update'] = (preg_match("~ON UPDATE ($driver->onActions)~", $match[4], $match2) ? $match2[1] : 'NO ACTION');
|
||||
$row['on_delete'] = (preg_match("~ON DELETE (" . driver()->onActions . ")~", $match[4], $match2) ? $match2[1] : 'NO ACTION');
|
||||
$row['on_update'] = (preg_match("~ON UPDATE (" . driver()->onActions . ")~", $match[4], $match2) ? $match2[1] : 'NO ACTION');
|
||||
$return[$row['conname']] = $row;
|
||||
}
|
||||
}
|
||||
@@ -537,7 +581,7 @@ ORDER BY conkey, conname") as $row
|
||||
}
|
||||
|
||||
function view($name) {
|
||||
return array("select" => trim(get_val("SELECT pg_get_viewdef(" . get_val("SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = " . q($name)) . ")")));
|
||||
return array("select" => trim(get_val("SELECT pg_get_viewdef(" . driver()->tableOid($name) . ")")));
|
||||
}
|
||||
|
||||
function collations() {
|
||||
@@ -550,8 +594,7 @@ ORDER BY conkey, conname") as $row
|
||||
}
|
||||
|
||||
function error() {
|
||||
global $connection;
|
||||
$return = h($connection->error);
|
||||
$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];
|
||||
}
|
||||
@@ -563,14 +606,12 @@ ORDER BY conkey, conname") as $row
|
||||
}
|
||||
|
||||
function drop_databases($databases) {
|
||||
global $connection;
|
||||
$connection->close();
|
||||
connection()->close();
|
||||
return apply_queries("DROP DATABASE", $databases, 'Adminer\idf_escape');
|
||||
}
|
||||
|
||||
function rename_database($name, $collation) {
|
||||
global $connection;
|
||||
$connection->close();
|
||||
connection()->close();
|
||||
return queries("ALTER DATABASE " . idf_escape(DB) . " RENAME TO " . idf_escape($name));
|
||||
}
|
||||
|
||||
@@ -623,7 +664,31 @@ ORDER BY conkey, conname") as $row
|
||||
}
|
||||
$alter = array_merge($alter, $foreign);
|
||||
if ($table == "") {
|
||||
array_unshift($queries, "CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)");
|
||||
$status = "";
|
||||
if ($partitioning) {
|
||||
$cockroach = (connection()->flavor == 'cockroach');
|
||||
$status = " PARTITION BY $partitioning[partition_by]($partitioning[partition])";
|
||||
if ($partitioning["partition_by"] == 'HASH') {
|
||||
$partitions = +$partitioning["partitions"];
|
||||
for ($i=0; $i < $partitions; $i++) {
|
||||
$queries[] = "CREATE TABLE " . idf_escape($name . "_$i") . " PARTITION OF " . idf_escape($name) . " FOR VALUES WITH (MODULUS $partitions, REMAINDER $i)";
|
||||
}
|
||||
} else {
|
||||
$prev = "MINVALUE";
|
||||
foreach ($partitioning["partition_names"] as $i => $val) {
|
||||
$value = $partitioning["partition_values"][$i];
|
||||
$partition = " VALUES " . ($partitioning["partition_by"] == 'LIST' ? "IN ($value)" : "FROM ($prev) TO ($value)");
|
||||
if ($cockroach) {
|
||||
$status .= ($i ? "," : " (") . "\n PARTITION " . (preg_match('~^DEFAULT$~i', $val) ? $val : idf_escape($val)) . "$partition";
|
||||
} else {
|
||||
$queries[] = "CREATE TABLE " . idf_escape($name . "_$val") . " PARTITION OF " . idf_escape($name) . " FOR$partition";
|
||||
}
|
||||
$prev = $value;
|
||||
}
|
||||
$status .= ($cockroach ? "\n)" : "");
|
||||
}
|
||||
}
|
||||
array_unshift($queries, "CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)$status");
|
||||
} elseif ($alter) {
|
||||
array_unshift($queries, "ALTER TABLE " . table($table) . "\n" . implode(",\n", $alter));
|
||||
}
|
||||
@@ -650,7 +715,7 @@ ORDER BY conkey, conname") as $row
|
||||
$queries = array();
|
||||
foreach ($alter as $val) {
|
||||
if ($val[0] != "INDEX") {
|
||||
//! descending UNIQUE indexes results in syntax error
|
||||
//! descending UNIQUE indexes result in syntax error
|
||||
$create[] = ($val[2] == "DROP"
|
||||
? "\nDROP CONSTRAINT " . idf_escape($val[1])
|
||||
: "\nADD" . ($val[1] != "" ? " CONSTRAINT " . idf_escape($val[1]) : "") . " $val[0] " . ($val[0] == "PRIMARY" ? "KEY " : "") . "(" . implode(", ", $val[2]) . ")"
|
||||
@@ -658,7 +723,12 @@ ORDER BY conkey, conname") as $row
|
||||
} elseif ($val[2] == "DROP") {
|
||||
$drop[] = idf_escape($val[1]);
|
||||
} else {
|
||||
$queries[] = "CREATE INDEX " . idf_escape($val[1] != "" ? $val[1] : uniqid($table . "_")) . " ON " . table($table) . " (" . implode(", ", $val[2]) . ")";
|
||||
$queries[] = "CREATE INDEX " . idf_escape($val[1] != "" ? $val[1] : uniqid($table . "_"))
|
||||
. " ON " . table($table)
|
||||
. ($val[3] ? " USING $val[3]" : "")
|
||||
. " (" . implode(", ", $val[2]) . ")"
|
||||
. ($val[4] ? " WHERE $val[4]" : "")
|
||||
;
|
||||
}
|
||||
}
|
||||
if ($create) {
|
||||
@@ -685,7 +755,7 @@ ORDER BY conkey, conname") as $row
|
||||
|
||||
function drop_tables($tables) {
|
||||
foreach ($tables as $table) {
|
||||
$status = table_status($table);
|
||||
$status = table_status1($table);
|
||||
if (!queries("DROP " . strtoupper($status["Engine"]) . " " . table($table))) {
|
||||
return false;
|
||||
}
|
||||
@@ -695,7 +765,7 @@ ORDER BY conkey, conname") as $row
|
||||
|
||||
function move_tables($tables, $views, $target) {
|
||||
foreach (array_merge($tables, $views) as $table) {
|
||||
$status = table_status($table);
|
||||
$status = table_status1($table);
|
||||
if (!queries("ALTER " . strtoupper($status["Engine"]) . " " . table($table) . " SET SCHEMA " . idf_escape($target))) {
|
||||
return false;
|
||||
}
|
||||
@@ -752,7 +822,7 @@ ORDER BY event_manipulation DESC") as $row
|
||||
$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 = idx($rows, 0, array());
|
||||
$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
|
||||
@@ -775,13 +845,15 @@ ORDER BY SPECIFIC_NAME');
|
||||
function routine_id($name, $row) {
|
||||
$return = array();
|
||||
foreach ($row["fields"] as $field) {
|
||||
$return[] = $field["type"];
|
||||
$length = $field["length"];
|
||||
$return[] = $field["type"] . ($length ? "($length)" : "");
|
||||
}
|
||||
return idf_escape($name) . "(" . implode(", ", $return) . ")";
|
||||
}
|
||||
|
||||
function last_id() {
|
||||
return 0; // there can be several sequences
|
||||
function last_id($result) {
|
||||
$row = (is_object($result) ? $result->fetch_row() : array());
|
||||
return ($row ? $row[0] : 0);
|
||||
}
|
||||
|
||||
function explain($connection, $query) {
|
||||
@@ -792,14 +864,13 @@ ORDER BY SPECIFIC_NAME');
|
||||
if (preg_match("~ rows=([0-9]+)~", get_val("EXPLAIN SELECT * FROM " . idf_escape($table_status["Name"]) . ($where ? " WHERE " . implode(" AND ", $where) : "")), $regs)) {
|
||||
return $regs[1];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function types() {
|
||||
function types(): array {
|
||||
return get_key_vals(
|
||||
"SELECT oid, typname
|
||||
FROM pg_type
|
||||
WHERE typnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())
|
||||
WHERE typnamespace = " . driver()->nsOid . "
|
||||
AND typtype IN ('b','d','e')
|
||||
AND typelem = 0"
|
||||
);
|
||||
@@ -820,12 +891,11 @@ AND typelem = 0"
|
||||
}
|
||||
|
||||
function set_schema($schema, $connection2 = null) {
|
||||
global $connection, $driver;
|
||||
if (!$connection2) {
|
||||
$connection2 = $connection;
|
||||
$connection2 = connection();
|
||||
}
|
||||
$return = $connection2->query("SET search_path TO " . idf_escape($schema));
|
||||
$driver->setUserTypes(types()); //! get types from current_schemas('t')
|
||||
driver()->setUserTypes(types()); //! get types from current_schemas('t')
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -835,7 +905,7 @@ AND typelem = 0"
|
||||
function foreign_keys_sql($table) {
|
||||
$return = "";
|
||||
|
||||
$status = table_status($table);
|
||||
$status = table_status1($table);
|
||||
$fkeys = foreign_keys($table);
|
||||
ksort($fkeys);
|
||||
|
||||
@@ -847,18 +917,17 @@ AND typelem = 0"
|
||||
}
|
||||
|
||||
function create_sql($table, $auto_increment, $style) {
|
||||
global $driver;
|
||||
$return_parts = array();
|
||||
$sequences = array();
|
||||
|
||||
$status = table_status($table);
|
||||
$status = table_status1($table);
|
||||
if (is_view($status)) {
|
||||
$view = view($table);
|
||||
return rtrim("CREATE VIEW " . idf_escape($table) . " AS $view[select]", ";");
|
||||
}
|
||||
$fields = fields($table);
|
||||
|
||||
if (!$status || empty($fields)) {
|
||||
if (count($status) < 2 || empty($fields)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -868,13 +937,13 @@ AND typelem = 0"
|
||||
foreach ($fields as $field) {
|
||||
$part = idf_escape($field['field']) . ' ' . $field['full_type']
|
||||
. default_value($field)
|
||||
. ($field['attnotnull'] ? " NOT NULL" : "");
|
||||
. ($field['null'] ? "" : " NOT NULL");
|
||||
$return_parts[] = $part;
|
||||
|
||||
// sequences for fields
|
||||
if (preg_match('~nextval\(\'([^\']+)\'\)~', $field['default'], $matches)) {
|
||||
$sequence_name = $matches[1];
|
||||
$sq = reset(get_rows((min_version(10)
|
||||
$sq = first(get_rows((min_version(10)
|
||||
? "SELECT *, cache_size AS cache_value FROM pg_sequences WHERE schemaname = current_schema() AND sequencename = " . q(idf_unescape($sequence_name))
|
||||
: "SELECT * FROM $sequence_name"
|
||||
), null, "-- "));
|
||||
@@ -899,11 +968,19 @@ AND typelem = 0"
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($driver->checkConstraints($table) as $conname => $consrc) {
|
||||
foreach (driver()->checkConstraints($table) as $conname => $consrc) {
|
||||
$return_parts[] = "CONSTRAINT " . idf_escape($conname) . " CHECK $consrc";
|
||||
}
|
||||
$return .= implode(",\n ", $return_parts) . "\n)";
|
||||
|
||||
$return .= implode(",\n ", $return_parts) . "\n) WITH (oids = " . ($status['Oid'] ? 'true' : 'false') . ");";
|
||||
$partition = driver()->partitionsInfo($status['Name']);
|
||||
if ($partition) {
|
||||
$return .= "\nPARTITION BY $partition[partition_by]($partition[partition])";
|
||||
}
|
||||
//! parse pg_class.relpartbound to create PARTITION OF
|
||||
//! don't insert partitioned data twice
|
||||
|
||||
$return .= "\nWITH (oids = " . ($status['Oid'] ? 'true' : 'false') . ");";
|
||||
|
||||
// comments for table & fields
|
||||
if ($status['Comment']) {
|
||||
@@ -928,7 +1005,7 @@ AND typelem = 0"
|
||||
}
|
||||
|
||||
function trigger_sql($table) {
|
||||
$status = table_status($table);
|
||||
$status = table_status1($table);
|
||||
$return = "";
|
||||
foreach (triggers($table) as $trg_id => $trg) {
|
||||
$trigger = trigger($trg_id, $status['Name']);
|
||||
@@ -943,7 +1020,7 @@ AND typelem = 0"
|
||||
}
|
||||
|
||||
function show_variables() {
|
||||
return get_key_vals("SHOW ALL");
|
||||
return get_rows("SHOW ALL");
|
||||
}
|
||||
|
||||
function process_list() {
|
||||
@@ -958,10 +1035,11 @@ AND typelem = 0"
|
||||
}
|
||||
|
||||
function support($feature) {
|
||||
global $connection;
|
||||
return preg_match('~^(check|database|table|columns|sql|indexes|descidx|comment|view|' . (min_version(9.3) ? 'materializedview|' : '') . 'scheme|routine|sequence|trigger|type|variables|drop_col'
|
||||
. ($connection->cockroach ? '' : '|processlist') // https://github.com/cockroachdb/cockroach/issues/24745
|
||||
. '|kill|dump)$~', $feature)
|
||||
return preg_match('~^(check|columns|comment|database|drop_col|dump|descidx|indexes|kill|partial_indexes|routine|scheme|sequence|sql|table|trigger|type|variables|view'
|
||||
. (min_version(9.3) ? '|materializedview' : '')
|
||||
. (min_version(11) ? '|procedure' : '')
|
||||
. (connection()->flavor == 'cockroach' ? '' : '|processlist') // https://github.com/cockroachdb/cockroach/issues/24745
|
||||
. ')$~', $feature)
|
||||
;
|
||||
}
|
||||
|
||||
|
@@ -1,23 +1,24 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$drivers["sqlite"] = "SQLite";
|
||||
add_driver("sqlite", "SQLite");
|
||||
|
||||
if (isset($_GET["sqlite"])) {
|
||||
define('Adminer\DRIVER', "sqlite");
|
||||
if (class_exists("SQLite3")) {
|
||||
|
||||
class SqliteDb {
|
||||
public $extension = "SQLite3", $server_info, $affected_rows, $errno, $error;
|
||||
if (class_exists("SQLite3") && $_GET["ext"] != "pdo") {
|
||||
abstract class SqliteDb extends SqlDb {
|
||||
public $extension = "SQLite3";
|
||||
private $link;
|
||||
|
||||
function __construct($filename) {
|
||||
function attach(?string $filename, string $username, string $password): string {
|
||||
$this->link = new \SQLite3($filename);
|
||||
$version = $this->link->version();
|
||||
$this->server_info = $version["versionString"];
|
||||
return '';
|
||||
}
|
||||
|
||||
function query($query) {
|
||||
function query(string $query, bool $unbuffered = false) {
|
||||
$result = @$this->link->query($query);
|
||||
$this->error = "";
|
||||
if (!$result) {
|
||||
@@ -31,25 +32,12 @@ if (isset($_GET["sqlite"])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function quote($string) {
|
||||
function quote(string $string): string {
|
||||
return (is_utf8($string)
|
||||
? "'" . $this->link->escapeString($string) . "'"
|
||||
: "x'" . reset(unpack('H*', $string)) . "'"
|
||||
: "x'" . first(unpack('H*', $string)) . "'"
|
||||
);
|
||||
}
|
||||
|
||||
function store_result() {
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
if (!is_object($result)) {
|
||||
return false;
|
||||
}
|
||||
$row = $result->fetch_row();
|
||||
return $row ? $row[$field] : false;
|
||||
}
|
||||
}
|
||||
|
||||
class Result {
|
||||
@@ -68,31 +56,30 @@ if (isset($_GET["sqlite"])) {
|
||||
return $this->result->fetchArray(SQLITE3_NUM);
|
||||
}
|
||||
|
||||
function fetch_field() {
|
||||
function fetch_field(): \stdClass {
|
||||
$column = $this->offset++;
|
||||
$type = $this->result->columnType($column);
|
||||
return (object) array(
|
||||
"name" => $this->result->columnName($column),
|
||||
"type" => $type,
|
||||
"type" => ($type == SQLITE3_TEXT ? 15 : 0),
|
||||
"charsetnr" => ($type == SQLITE3_BLOB ? 63 : 0), // 63 - binary
|
||||
);
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
return $this->result->finalize();
|
||||
$this->result->finalize();
|
||||
}
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_sqlite")) {
|
||||
class SqliteDb extends PdoDb {
|
||||
abstract class SqliteDb extends PdoDb {
|
||||
public $extension = "PDO_SQLite";
|
||||
|
||||
function __construct($filename) {
|
||||
function attach(?string $filename, string $username, string $password): string {
|
||||
$this->dsn(DRIVER . ":$filename", "", "");
|
||||
}
|
||||
|
||||
function select_db($db) {
|
||||
return false;
|
||||
$this->query("PRAGMA foreign_keys = 1");
|
||||
$this->query("PRAGMA busy_timeout = 500");
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,66 +87,60 @@ if (isset($_GET["sqlite"])) {
|
||||
|
||||
if (class_exists('Adminer\SqliteDb')) {
|
||||
class Db extends SqliteDb {
|
||||
|
||||
function __construct() {
|
||||
parent::__construct(":memory:");
|
||||
function attach(?string $filename, string $username, string $password): string {
|
||||
parent::attach($filename, $username, $password);
|
||||
$this->query("PRAGMA foreign_keys = 1");
|
||||
$this->query("PRAGMA busy_timeout = 500");
|
||||
return '';
|
||||
}
|
||||
|
||||
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");
|
||||
$this->query("PRAGMA busy_timeout = 500");
|
||||
return true;
|
||||
function select_db(string $filename): bool {
|
||||
if (is_readable($filename) && $this->query("ATTACH " . $this->quote(preg_match("~(^[/\\\\]|:)~", $filename) ? $filename : dirname($_SERVER["SCRIPT_FILENAME"]) . "/$filename") . " AS a")) {
|
||||
return !self::attach($filename, '', '');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
return $this->result = $this->query($query);
|
||||
}
|
||||
|
||||
function next_result() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class Driver extends SqlDriver {
|
||||
static $possibleDrivers = array("SQLite3", "PDO_SQLite");
|
||||
static $extensions = array("SQLite3", "PDO_SQLite");
|
||||
static $jush = "sqlite";
|
||||
|
||||
protected $types = array(array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0));
|
||||
|
||||
public $insertFunctions = array(); // "text" => "date('now')/time('now')/datetime('now')",
|
||||
public $editFunctions = array(
|
||||
array(
|
||||
// "text" => "date('now')/time('now')/datetime('now')",
|
||||
), array(
|
||||
"integer|real|numeric" => "+/-",
|
||||
// "text" => "date/time/datetime",
|
||||
"text" => "||",
|
||||
)
|
||||
"integer|real|numeric" => "+/-",
|
||||
// "text" => "date/time/datetime",
|
||||
"text" => "||",
|
||||
);
|
||||
|
||||
public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); // REGEXP can be user defined function
|
||||
public $functions = array("hex", "length", "lower", "round", "unixepoch", "upper");
|
||||
public $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
|
||||
|
||||
function __construct($connection) {
|
||||
static function connect(?string $server, string $username, string $password) {
|
||||
if ($password != "") {
|
||||
return lang('Database does not support password.');
|
||||
}
|
||||
return parent::connect(":memory:", "", "");
|
||||
}
|
||||
|
||||
function __construct(Db $connection) {
|
||||
parent::__construct($connection);
|
||||
if (min_version(3.31, 0, $connection)) {
|
||||
$this->generated = array("STORED", "VIRTUAL");
|
||||
}
|
||||
}
|
||||
|
||||
function structuredTypes() {
|
||||
function structuredTypes(): array {
|
||||
return array_keys($this->types[0]);
|
||||
}
|
||||
|
||||
function insertUpdate($table, $rows, $primary) {
|
||||
function insertUpdate(string $table, array $rows, array $primary) {
|
||||
$values = array();
|
||||
foreach ($rows as $set) {
|
||||
$values[] = "(" . implode(", ", $set) . ")";
|
||||
@@ -167,7 +148,7 @@ if (isset($_GET["sqlite"])) {
|
||||
return queries("REPLACE INTO " . table($table) . " (" . implode(", ", array_keys(reset($rows))) . ") VALUES\n" . implode(",\n", $values));
|
||||
}
|
||||
|
||||
function tableHelp($name, $is_view = false) {
|
||||
function tableHelp(string $name, bool $is_view = false) {
|
||||
if ($name == "sqlite_sequence") {
|
||||
return "fileformat2.html#seqtab";
|
||||
}
|
||||
@@ -176,10 +157,20 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
}
|
||||
|
||||
function checkConstraints($table) {
|
||||
preg_match_all('~ CHECK *(\( *(((?>[^()]*[^() ])|(?1))*) *\))~', $this->conn->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . q($table)), $matches); //! could be inside a comment
|
||||
function checkConstraints(string $table): array {
|
||||
preg_match_all('~ CHECK *(\( *(((?>[^()]*[^() ])|(?1))*) *\))~', get_val("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . q($table), 0, $this->conn), $matches); //! could be inside a comment
|
||||
return array_combine($matches[2], $matches[2]);
|
||||
}
|
||||
|
||||
function allFields(): array {
|
||||
$return = array();
|
||||
foreach (tables_list() as $table => $type) {
|
||||
foreach (fields($table) as $field) {
|
||||
$return[$table][] = $field;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -192,20 +183,12 @@ if (isset($_GET["sqlite"])) {
|
||||
return idf_escape($idf);
|
||||
}
|
||||
|
||||
function connect($credentials) {
|
||||
list(, , $password) = $credentials;
|
||||
if ($password != "") {
|
||||
return lang('Database does not support password.');
|
||||
}
|
||||
return new Db;
|
||||
}
|
||||
|
||||
function get_databases() {
|
||||
function get_databases($flush) {
|
||||
return array();
|
||||
}
|
||||
|
||||
function limit($query, $where, $limit, $offset = 0, $separator = " ") {
|
||||
return " $query$where" . ($limit !== null ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
||||
return " $query$where" . ($limit ? $separator . "LIMIT $limit" . ($offset ? " OFFSET $offset" : "") : "");
|
||||
}
|
||||
|
||||
function limit1($table, $query, $where, $separator = "\n") {
|
||||
@@ -219,10 +202,6 @@ if (isset($_GET["sqlite"])) {
|
||||
return get_val("PRAGMA encoding"); // there is no database list so $db == DB
|
||||
}
|
||||
|
||||
function engines() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function logged_user() {
|
||||
return get_current_user(); // should return effective user
|
||||
}
|
||||
@@ -241,10 +220,10 @@ if (isset($_GET["sqlite"])) {
|
||||
$row["Rows"] = get_val("SELECT COUNT(*) FROM " . idf_escape($row["Name"]));
|
||||
$return[$row["Name"]] = $row;
|
||||
}
|
||||
foreach (get_rows("SELECT * FROM sqlite_sequence", null, "") as $row) {
|
||||
foreach (get_rows("SELECT * FROM sqlite_sequence" . ($name != "" ? " WHERE name = " . q($name) : ""), null, "") as $row) {
|
||||
$return[$row["name"]]["Auto_increment"] = $row["seq"];
|
||||
}
|
||||
return ($name != "" ? $return[$name] : $return);
|
||||
return $return;
|
||||
}
|
||||
|
||||
function is_view($table_status) {
|
||||
@@ -299,12 +278,9 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
|
||||
function indexes($table, $connection2 = null) {
|
||||
global $connection;
|
||||
if (!is_object($connection2)) {
|
||||
$connection2 = $connection;
|
||||
}
|
||||
$connection2 = connection($connection2);
|
||||
$return = array();
|
||||
$sql = $connection2->result("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . q($table));
|
||||
$sql = get_val("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = " . q($table), 0, $connection2);
|
||||
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);
|
||||
@@ -371,34 +347,32 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
|
||||
function error() {
|
||||
global $connection;
|
||||
return h($connection->error);
|
||||
return h(connection()->error);
|
||||
}
|
||||
|
||||
function check_sqlite_name($name) {
|
||||
// avoid creating PHP files on unsecured servers
|
||||
global $connection;
|
||||
$extensions = "db|sdb|sqlite";
|
||||
if (!preg_match("~^[^\\0]*\\.($extensions)\$~", $name)) {
|
||||
$connection->error = lang('Please use one of the extensions %s.', str_replace("|", ", ", $extensions));
|
||||
connection()->error = lang('Please use one of the extensions %s.', str_replace("|", ", ", $extensions));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function create_database($db, $collation) {
|
||||
global $connection;
|
||||
if (file_exists($db)) {
|
||||
$connection->error = lang('File exists.');
|
||||
connection()->error = lang('File exists.');
|
||||
return false;
|
||||
}
|
||||
if (!check_sqlite_name($db)) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
$link = new SqliteDb($db);
|
||||
} catch (Exception $ex) {
|
||||
$connection->error = $ex->getMessage();
|
||||
$link = new Db();
|
||||
$link->attach($db, '', '');
|
||||
} catch (\Exception $ex) {
|
||||
connection()->error = $ex->getMessage();
|
||||
return false;
|
||||
}
|
||||
$link->query('PRAGMA encoding = "UTF-8"');
|
||||
@@ -408,11 +382,10 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
|
||||
function drop_databases($databases) {
|
||||
global $connection;
|
||||
$connection->__construct(":memory:"); // to unlock file, doesn't work in PDO on Windows
|
||||
connection()->attach(":memory:", '', ''); // to unlock file, doesn't work in PDO on Windows
|
||||
foreach ($databases as $db) {
|
||||
if (!@unlink($db)) {
|
||||
$connection->error = lang('File exists.');
|
||||
connection()->error = lang('File exists.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -420,12 +393,11 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
|
||||
function rename_database($name, $collation) {
|
||||
global $connection;
|
||||
if (!check_sqlite_name($name)) {
|
||||
return false;
|
||||
}
|
||||
$connection->__construct(":memory:");
|
||||
$connection->error = lang('File exists.');
|
||||
connection()->attach(":memory:", '', '');
|
||||
connection()->error = lang('File exists.');
|
||||
return @rename(DB, $name);
|
||||
}
|
||||
|
||||
@@ -434,7 +406,6 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
|
||||
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
|
||||
global $connection;
|
||||
$use_all_fields = ($table == "" || $foreign);
|
||||
foreach ($fields as $field) {
|
||||
if ($field[0] != "" || !$field[1] || $field[2]) {
|
||||
@@ -467,7 +438,7 @@ if (isset($_GET["sqlite"])) {
|
||||
if ($auto_increment) {
|
||||
queries("BEGIN");
|
||||
queries("UPDATE sqlite_sequence SET seq = $auto_increment WHERE name = " . q($name)); // ignores error
|
||||
if (!$connection->affected_rows) {
|
||||
if (!connection()->affected_rows) {
|
||||
queries("INSERT INTO sqlite_sequence (name, seq) VALUES (" . q($name) . ", $auto_increment)");
|
||||
}
|
||||
queries("COMMIT");
|
||||
@@ -476,19 +447,17 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
|
||||
/** Recreate table
|
||||
* @param string original name
|
||||
* @param string new name
|
||||
* @param array [process_field()], empty to preserve
|
||||
* @param array [$original => idf_escape($new_column)], empty to preserve
|
||||
* @param string [format_foreign_key()], empty to preserve
|
||||
* @param int set auto_increment to this value, 0 to preserve
|
||||
* @param array [[$type, $name, $columns]], empty to preserve
|
||||
* @param string CHECK constraint to drop
|
||||
* @param string CHECK constraint to add
|
||||
* @return bool
|
||||
* @param string $table original name
|
||||
* @param string $name new name
|
||||
* @param list<list<string>> $fields [process_field()], empty to preserve
|
||||
* @param string[] $originals [$original => idf_escape($new_column)], empty to preserve
|
||||
* @param string[] $foreign [format_foreign_key()], empty to preserve
|
||||
* @param numeric-string $auto_increment set auto_increment to this value, "" to preserve
|
||||
* @param list<array{string, string, list<string>|'DROP'}> $indexes [[$type, $name, $columns]], empty to preserve
|
||||
* @param string $drop_check CHECK constraint to drop
|
||||
* @param string $add_check CHECK constraint to add
|
||||
*/
|
||||
function recreate_table($table, $name, $fields, $originals, $foreign, $auto_increment = 0, $indexes = array(), $drop_check = "", $add_check = "") {
|
||||
global $driver;
|
||||
function recreate_table(string $table, string $name, array $fields, array $originals, array $foreign, string $auto_increment = "", $indexes = array(), string $drop_check = "", string $add_check = ""): bool {
|
||||
if ($table != "") {
|
||||
if (!$fields) {
|
||||
foreach (fields($table) as $key => $field) {
|
||||
@@ -545,24 +514,25 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
queries("BEGIN");
|
||||
}
|
||||
foreach ($fields as $key => $field) {
|
||||
$changes = array();
|
||||
foreach ($fields as $field) {
|
||||
if (preg_match('~GENERATED~', $field[3])) {
|
||||
unset($originals[array_search($field[0], $originals)]);
|
||||
}
|
||||
$fields[$key] = " " . implode($field);
|
||||
$changes[] = " " . implode($field);
|
||||
}
|
||||
$fields = array_merge($fields, array_filter($foreign));
|
||||
foreach ($driver->checkConstraints($table) as $check) {
|
||||
$changes = array_merge($changes, array_filter($foreign));
|
||||
foreach (driver()->checkConstraints($table) as $check) {
|
||||
if ($check != $drop_check) {
|
||||
$fields[] = " CHECK ($check)";
|
||||
$changes[] = " CHECK ($check)";
|
||||
}
|
||||
}
|
||||
if ($add_check) {
|
||||
$fields[] = " CHECK ($add_check)";
|
||||
$changes[] = " CHECK ($add_check)";
|
||||
}
|
||||
$temp_name = ($table == $name ? "adminer_$name" : $name);
|
||||
if (!queries("CREATE TABLE " . table($temp_name) . " (\n" . implode(",\n", $fields) . "\n)")) {
|
||||
// implicit ROLLBACK to not overwrite $connection->error
|
||||
if (!queries("CREATE TABLE " . table($temp_name) . " (\n" . implode(",\n", $changes) . "\n)")) {
|
||||
// implicit ROLLBACK to not overwrite connection()->error
|
||||
return false;
|
||||
}
|
||||
if ($table != "") {
|
||||
@@ -571,10 +541,10 @@ if (isset($_GET["sqlite"])) {
|
||||
}
|
||||
$triggers = array();
|
||||
foreach (triggers($table) as $trigger_name => $timing_event) {
|
||||
$trigger = trigger($trigger_name);
|
||||
$trigger = trigger($trigger_name, $table);
|
||||
$triggers[] = "CREATE TRIGGER " . idf_escape($trigger_name) . " " . implode(" ", $timing_event) . " ON " . table($name) . "\n$trigger[Statement]";
|
||||
}
|
||||
$auto_increment = $auto_increment ? 0 : get_val("SELECT seq FROM sqlite_sequence WHERE name = " . q($table)); // if $auto_increment is set then it will be updated later
|
||||
$auto_increment = $auto_increment ? "" : get_val("SELECT seq FROM sqlite_sequence WHERE name = " . q($table)); // if $auto_increment is set then it will be updated later
|
||||
if (
|
||||
!queries("DROP TABLE " . table($table)) // drop before creating indexes and triggers to allow using old names
|
||||
|| ($table == $name && !queries("ALTER TABLE " . table($temp_name) . " RENAME TO " . table($name)))
|
||||
@@ -606,7 +576,7 @@ if (isset($_GET["sqlite"])) {
|
||||
function alter_indexes($table, $alter) {
|
||||
foreach ($alter as $primary) {
|
||||
if ($primary[0] == "PRIMARY") {
|
||||
return recreate_table($table, $table, array(), array(), array(), 0, $alter);
|
||||
return recreate_table($table, $table, array(), array(), array(), "", $alter);
|
||||
}
|
||||
}
|
||||
foreach (array_reverse($alter) as $val) {
|
||||
@@ -637,7 +607,7 @@ if (isset($_GET["sqlite"])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function trigger($name) {
|
||||
function trigger($name, $table) {
|
||||
if ($name == "") {
|
||||
return array("Statement" => "BEGIN\n\t;\nEND");
|
||||
}
|
||||
@@ -680,7 +650,7 @@ if (isset($_GET["sqlite"])) {
|
||||
return queries("BEGIN");
|
||||
}
|
||||
|
||||
function last_id() {
|
||||
function last_id($result) {
|
||||
return get_val("SELECT LAST_INSERT_ROWID()");
|
||||
}
|
||||
|
||||
@@ -691,7 +661,7 @@ if (isset($_GET["sqlite"])) {
|
||||
function found_rows($table_status, $where) {
|
||||
}
|
||||
|
||||
function types() {
|
||||
function types(): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
@@ -722,8 +692,9 @@ if (isset($_GET["sqlite"])) {
|
||||
foreach (get_rows("PRAGMA pragma_list") as $row) {
|
||||
$name = $row["name"];
|
||||
if ($name != "pragma_list" && $name != "compile_options") {
|
||||
$return[$name] = array($name, '');
|
||||
foreach (get_rows("PRAGMA $name") as $row) {
|
||||
$return[$name] .= implode(", ", $row) . "\n";
|
||||
$return[$name][1] .= implode(", ", $row) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -733,8 +704,7 @@ if (isset($_GET["sqlite"])) {
|
||||
function show_status() {
|
||||
$return = array();
|
||||
foreach (get_vals("PRAGMA compile_options") as $option) {
|
||||
list($key, $val) = explode("=", $option, 2);
|
||||
$return[$key] = $val;
|
||||
$return[] = explode("=", $option, 2) + array('', '');
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ if ($_POST && !$error) {
|
||||
$is_sql = preg_match('~sql~', $_POST["format"]);
|
||||
|
||||
if ($is_sql) {
|
||||
echo "-- Adminer $VERSION " . $drivers[DRIVER] . " " . str_replace("\n", " ", $connection->server_info) . " dump\n\n";
|
||||
echo "-- Adminer " . VERSION . " " . get_driver(DRIVER) . " " . str_replace("\n", " ", connection()->server_info) . " dump\n\n";
|
||||
if (JUSH == "sql") {
|
||||
echo "SET NAMES utf8;
|
||||
SET time_zone = '+00:00';
|
||||
@@ -24,8 +24,8 @@ SET foreign_key_checks = 0;
|
||||
" . ($_POST["data_style"] ? "SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
|
||||
" : "") . "
|
||||
";
|
||||
$connection->query("SET time_zone = '+00:00'");
|
||||
$connection->query("SET sql_mode = ''");
|
||||
connection()->query("SET time_zone = '+00:00'");
|
||||
connection()->query("SET sql_mode = ''");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ SET foreign_key_checks = 0;
|
||||
}
|
||||
|
||||
foreach ((array) $databases as $db) {
|
||||
$adminer->dumpDatabase($db);
|
||||
if ($connection->select_db($db)) {
|
||||
adminer()->dumpDatabase($db);
|
||||
if (connection()->select_db($db)) {
|
||||
if ($is_sql && preg_match('~CREATE~', $style) && ($create = get_val("SHOW CREATE DATABASE " . idf_escape($db), 1))) {
|
||||
set_utf8mb4($create);
|
||||
if ($style == "DROP+CREATE") {
|
||||
@@ -93,17 +93,18 @@ SET foreign_key_checks = 0;
|
||||
$table = (DB == "" || in_array($name, (array) $_POST["tables"]));
|
||||
$data = (DB == "" || in_array($name, (array) $_POST["data"]));
|
||||
if ($table || $data) {
|
||||
$tmp_file = null;
|
||||
if ($ext == "tar") {
|
||||
$tmp_file = new TmpFile;
|
||||
ob_start(array($tmp_file, 'write'), 1e5);
|
||||
}
|
||||
|
||||
$adminer->dumpTable($name, ($table ? $_POST["table_style"] : ""), (is_view($table_status) ? 2 : 0));
|
||||
adminer()->dumpTable($name, ($table ? $_POST["table_style"] : ""), (is_view($table_status) ? 2 : 0));
|
||||
if (is_view($table_status)) {
|
||||
$views[] = $name;
|
||||
} elseif ($data) {
|
||||
$fields = fields($name);
|
||||
$adminer->dumpData($name, $_POST["data_style"], "SELECT *" . convert_fields($fields, $fields) . " FROM " . table($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))) {
|
||||
echo "\nDELIMITER ;;\n$triggers\nDELIMITER ;\n";
|
||||
@@ -129,7 +130,7 @@ SET foreign_key_checks = 0;
|
||||
}
|
||||
|
||||
foreach ($views as $view) {
|
||||
$adminer->dumpTable($view, $_POST["table_style"], 1);
|
||||
adminer()->dumpTable($view, $_POST["table_style"], 1);
|
||||
}
|
||||
|
||||
if ($ext == "tar") {
|
||||
@@ -139,7 +140,7 @@ SET foreign_key_checks = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$adminer->dumpFooter();
|
||||
adminer()->dumpFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -164,9 +165,9 @@ if (!isset($row["events"])) { // backwards compatibility
|
||||
$row["triggers"] = $row["table_style"];
|
||||
}
|
||||
|
||||
echo "<tr><th>" . lang('Output') . "<td>" . html_radios("output", $adminer->dumpOutput(), $row["output"]) . "\n";
|
||||
echo "<tr><th>" . lang('Output') . "<td>" . html_radios("output", adminer()->dumpOutput(), $row["output"]) . "\n";
|
||||
|
||||
echo "<tr><th>" . lang('Format') . "<td>" . html_radios("format", $adminer->dumpFormat(), $row["format"]) . "\n";
|
||||
echo "<tr><th>" . lang('Format') . "<td>" . html_radios("format", adminer()->dumpFormat(), $row["format"]) . "\n";
|
||||
|
||||
echo (JUSH == "sqlite" ? "" : "<tr><th>" . lang('Database') . "<td>" . html_select('db_style', $db_style, $row["db_style"])
|
||||
. (support("type") ? checkbox("types", 1, $row["types"], lang('User types')) : "")
|
||||
@@ -183,7 +184,7 @@ echo "<tr><th>" . lang('Data') . "<td>" . html_select('data_style', $data_style,
|
||||
?>
|
||||
</table>
|
||||
<p><input type="submit" value="<?php echo lang('Export'); ?>">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
<?php echo input_token(); ?>
|
||||
|
||||
<table>
|
||||
<?php
|
||||
@@ -220,7 +221,7 @@ if (DB != "") {
|
||||
echo "<label class='block'><input type='checkbox' id='check-databases'" . ($TABLE == "" ? " checked" : "") . ">" . lang('Database') . "</label>";
|
||||
echo script("qs('#check-databases').onclick = partial(formCheck, /^databases\\[/);", "");
|
||||
echo "</thead>\n";
|
||||
$databases = $adminer->databases();
|
||||
$databases = adminer()->databases();
|
||||
if ($databases) {
|
||||
foreach ($databases as $db) {
|
||||
if (!information_schema($db)) {
|
||||
|
@@ -3,10 +3,13 @@ namespace Adminer;
|
||||
|
||||
$TABLE = $_GET["edit"];
|
||||
$fields = fields($TABLE);
|
||||
$where = (isset($_GET["select"]) ? ($_POST["check"] && count($_POST["check"]) == 1 ? where_check($_POST["check"][0], $fields) : "") : where($_GET, $fields));
|
||||
$where = (isset($_GET["select"])
|
||||
? ($_POST["check"] && count($_POST["check"]) == 1 ? where_check($_POST["check"][0], $fields) : "")
|
||||
: where($_GET, $fields)
|
||||
);
|
||||
$update = (isset($_GET["select"]) ? $_POST["edit"] : $where);
|
||||
foreach ($fields as $name => $field) {
|
||||
if (!isset($field["privileges"][$update ? "update" : "insert"]) || $adminer->fieldName($field) == "" || $field["generated"]) {
|
||||
if (!isset($field["privileges"][$update ? "update" : "insert"]) || adminer()->fieldName($field) == "" || $field["generated"]) {
|
||||
unset($fields[$name]);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +30,7 @@ if ($_POST && !$error && !isset($_GET["select"])) {
|
||||
queries_redirect(
|
||||
$location,
|
||||
lang('Item has been deleted.'),
|
||||
$driver->delete($TABLE, $query_where, !$unique_array)
|
||||
driver()->delete($TABLE, $query_where, $unique_array ? 0 : 1)
|
||||
);
|
||||
|
||||
} else {
|
||||
@@ -46,7 +49,7 @@ if ($_POST && !$error && !isset($_GET["select"])) {
|
||||
queries_redirect(
|
||||
$location,
|
||||
lang('Item has been updated.'),
|
||||
$driver->update($TABLE, $set, $query_where, !$unique_array)
|
||||
driver()->update($TABLE, $set, $query_where, $unique_array ? 0 : 1)
|
||||
);
|
||||
if (is_ajax()) {
|
||||
page_headers();
|
||||
@@ -54,8 +57,8 @@ if ($_POST && !$error && !isset($_GET["select"])) {
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$result = $driver->insert($TABLE, $set);
|
||||
$last_id = ($result ? last_id() : 0);
|
||||
$result = driver()->insert($TABLE, $set);
|
||||
$last_id = ($result ? last_id($result) : 0);
|
||||
queries_redirect($location, lang('Item%s has been inserted.', ($last_id ? " $last_id" : "")), $result); //! link
|
||||
}
|
||||
}
|
||||
@@ -77,7 +80,7 @@ if ($_POST["save"]) {
|
||||
$select = array("*");
|
||||
}
|
||||
if ($select) {
|
||||
$result = $driver->select($TABLE, $select, array($where), $select, array(), (isset($_GET["select"]) ? 2 : 1));
|
||||
$result = driver()->select($TABLE, $select, array($where), $select, array(), (isset($_GET["select"]) ? 2 : 1));
|
||||
if (!$result) {
|
||||
$error = error();
|
||||
} else {
|
||||
@@ -92,12 +95,12 @@ if ($_POST["save"]) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!support("table") && !$fields) {
|
||||
if (!support("table") && !$fields) { // used by Mongo and SimpleDB
|
||||
if (!$where) { // insert
|
||||
$result = $driver->select($TABLE, array("*"), $where, array("*"));
|
||||
$result = driver()->select($TABLE, array("*"), array(), array("*"));
|
||||
$row = ($result ? $result->fetch_assoc() : false);
|
||||
if (!$row) {
|
||||
$row = array($driver->primary => "");
|
||||
$row = array(driver()->primary => "");
|
||||
}
|
||||
}
|
||||
if ($row) {
|
||||
@@ -105,9 +108,9 @@ if (!support("table") && !$fields) {
|
||||
if (!$where) {
|
||||
$row[$key] = null;
|
||||
}
|
||||
$fields[$key] = array("field" => $key, "null" => ($key != $driver->primary), "auto_increment" => ($key == $driver->primary));
|
||||
$fields[$key] = array("field" => $key, "null" => ($key != driver()->primary), "auto_increment" => ($key == driver()->primary));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
edit_form($TABLE, $fields, $row, $update);
|
||||
edit_form($TABLE, $fields, $row, $update, $error);
|
||||
|
@@ -2,10 +2,9 @@
|
||||
// To create Adminer just for Elasticsearch, run `../compile.php elastic`.
|
||||
|
||||
function adminer_object() {
|
||||
include_once "../plugins/plugin.php";
|
||||
include_once "../plugins/login-password-less.php";
|
||||
include_once "../plugins/drivers/elastic.php";
|
||||
return new AdminerPlugin(array(
|
||||
return new Adminer\Plugins(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)),
|
||||
));
|
||||
|
@@ -56,5 +56,5 @@ if (!$row && $EVENT != "") {
|
||||
<?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; ?>">
|
||||
<?php echo input_token(); ?>
|
||||
</form>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
if (substr($VERSION, -4) != '-dev') {
|
||||
if (substr(VERSION, -4) != '-dev') {
|
||||
if ($_SERVER["HTTP_IF_MODIFIED_SINCE"]) {
|
||||
header("HTTP/1.1 304 Not Modified");
|
||||
exit;
|
||||
@@ -11,10 +11,9 @@ if (substr($VERSION, -4) != '-dev') {
|
||||
header("Cache-Control: immutable");
|
||||
}
|
||||
|
||||
if ($_GET["file"] == "favicon.ico") {
|
||||
header("Content-Type: image/x-icon");
|
||||
echo lzw_decompress(compile_file('../adminer/static/favicon.ico', 'lzw_compress'));
|
||||
} elseif ($_GET["file"] == "default.css") {
|
||||
@ini_set("zlib.output_compression", '1'); // @ - may be disabled
|
||||
|
||||
if ($_GET["file"] == "default.css") {
|
||||
header("Content-Type: text/css; charset=utf-8");
|
||||
echo lzw_decompress(compile_file('../adminer/static/default.css;../externals/jush/jush.css', 'minify_css'));
|
||||
} elseif ($_GET["file"] == "dark.css") {
|
||||
@@ -26,6 +25,7 @@ if ($_GET["file"] == "favicon.ico") {
|
||||
} elseif ($_GET["file"] == "jush.js") {
|
||||
header("Content-Type: text/javascript; charset=utf-8");
|
||||
echo lzw_decompress(compile_file('../externals/jush/modules/jush.js;
|
||||
../externals/jush/modules/jush-autocomplete-sql.js;
|
||||
../externals/jush/modules/jush-textarea.js;
|
||||
../externals/jush/modules/jush-txt.js;
|
||||
../externals/jush/modules/jush-js.js;
|
||||
@@ -35,24 +35,8 @@ if ($_GET["file"] == "favicon.ico") {
|
||||
../externals/jush/modules/jush-mssql.js;
|
||||
../externals/jush/modules/jush-oracle.js;
|
||||
../externals/jush/modules/jush-simpledb.js', 'minify_js'));
|
||||
} else {
|
||||
header("Content-Type: image/gif");
|
||||
switch ($_GET["file"]) {
|
||||
case "plus.gif":
|
||||
echo compile_file('../adminer/static/plus.gif');
|
||||
break;
|
||||
case "cross.gif":
|
||||
echo compile_file('../adminer/static/cross.gif');
|
||||
break;
|
||||
case "up.gif":
|
||||
echo compile_file('../adminer/static/up.gif');
|
||||
break;
|
||||
case "down.gif":
|
||||
echo compile_file('../adminer/static/down.gif');
|
||||
break;
|
||||
case "arrow.gif":
|
||||
echo compile_file('../adminer/static/arrow.gif');
|
||||
break;
|
||||
}
|
||||
} elseif ($_GET["file"] == "logo.png") {
|
||||
header("Content-Type: image/png");
|
||||
echo compile_file('../adminer/static/logo.png');
|
||||
}
|
||||
exit;
|
||||
|
@@ -31,7 +31,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-
|
||||
$result
|
||||
);
|
||||
if (!$row["drop"]) {
|
||||
$error = "$error<br>" . lang('Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.'); //! no partitioning
|
||||
$error = lang('Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.'); //! no partitioning
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ if ($_POST) {
|
||||
<?php
|
||||
$source = array_keys(fields($TABLE)); //! no text and blob
|
||||
if ($row["db"] != "") {
|
||||
$connection->select_db($row["db"]);
|
||||
connection()->select_db($row["db"]);
|
||||
}
|
||||
if ($row["ns"] != "") {
|
||||
$orig_schema = get_schema();
|
||||
@@ -67,26 +67,26 @@ if ($row["ns"] != "") {
|
||||
$referencable = array_keys(array_filter(table_status('', true), 'Adminer\fk_support'));
|
||||
$target = array_keys(fields(in_array($row["table"], $referencable) ? $row["table"] : reset($referencable)));
|
||||
$onchange = "this.form['change-js'].value = '1'; this.form.submit();";
|
||||
echo "<p>" . lang('Target table') . ": " . html_select("table", $referencable, $row["table"], $onchange) . "\n";
|
||||
echo "<p><label>" . lang('Target table') . ": " . html_select("table", $referencable, $row["table"], $onchange) . "</label>\n";
|
||||
if (support("scheme")) {
|
||||
$schemas = array_filter($adminer->schemas(), function ($schema) {
|
||||
$schemas = array_filter(adminer()->schemas(), function ($schema) {
|
||||
return !preg_match('~^information_schema$~i', $schema);
|
||||
});
|
||||
echo lang('Schema') . ": " . html_select("ns", $schemas, $row["ns"] != "" ? $row["ns"] : $_GET["ns"], $onchange);
|
||||
echo "<label>" . lang('Schema') . ": " . html_select("ns", $schemas, $row["ns"] != "" ? $row["ns"] : $_GET["ns"], $onchange) . "</label>";
|
||||
if ($row["ns"] != "") {
|
||||
set_schema($orig_schema);
|
||||
}
|
||||
} elseif (JUSH != "sqlite") {
|
||||
$dbs = array();
|
||||
foreach ($adminer->databases() as $db) {
|
||||
foreach (adminer()->databases() as $db) {
|
||||
if (!information_schema($db)) {
|
||||
$dbs[] = $db;
|
||||
}
|
||||
}
|
||||
echo lang('DB') . ": " . html_select("db", $dbs, $row["db"] != "" ? $row["db"] : $_GET["db"], $onchange);
|
||||
echo "<label>" . lang('DB') . ": " . html_select("db", $dbs, $row["db"] != "" ? $row["db"] : $_GET["db"], $onchange) . "</label>";
|
||||
}
|
||||
echo input_hidden("change-js");
|
||||
?>
|
||||
<input type="hidden" name="change-js" value="">
|
||||
<noscript><p><input type="submit" name="change" value="<?php echo lang('Change'); ?>"></noscript>
|
||||
<table>
|
||||
<thead><tr><th id="label-source"><?php echo lang('Source'); ?><th id="label-target"><?php echo lang('Target'); ?></thead>
|
||||
@@ -95,14 +95,14 @@ $j = 0;
|
||||
foreach ($row["source"] as $key => $val) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . html_select("source[" . (+$key) . "]", array(-1 => "") + $source, $val, ($j == count($row["source"]) - 1 ? "foreignAddRow.call(this);" : ""), "label-source");
|
||||
echo "<td>" . html_select("target[" . (+$key) . "]", $target, $row["target"][$key], "", "label-target");
|
||||
echo "<td>" . html_select("target[" . (+$key) . "]", $target, idx($row["target"], $key), "", "label-target");
|
||||
$j++;
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<p>
|
||||
<?php echo lang('ON DELETE'); ?>: <?php echo html_select("on_delete", array(-1 => "") + explode("|", $driver->onActions), $row["on_delete"]); ?>
|
||||
<?php echo lang('ON UPDATE'); ?>: <?php echo html_select("on_update", array(-1 => "") + explode("|", $driver->onActions), $row["on_update"]); ?>
|
||||
<label><?php echo lang('ON DELETE'); ?>: <?php echo html_select("on_delete", array(-1 => "") + explode("|", driver()->onActions), $row["on_delete"]); ?></label>
|
||||
<label><?php echo lang('ON UPDATE'); ?>: <?php echo html_select("on_update", array(-1 => "") + explode("|", driver()->onActions), $row["on_update"]); ?></label>
|
||||
<?php echo doc_link(array(
|
||||
'sql' => "innodb-foreign-key-constraints.html",
|
||||
'mariadb' => "foreign-keys/",
|
||||
@@ -116,5 +116,5 @@ foreach ($row["source"] as $key => $val) {
|
||||
<?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; ?>">
|
||||
<?php echo input_token(); ?>
|
||||
</form>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,6 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$connection = '';
|
||||
|
||||
$has_token = $_SESSION["token"];
|
||||
if (!$has_token) {
|
||||
$_SESSION["token"] = rand(1, 1e6); // defense against cross-site request forgery
|
||||
}
|
||||
$token = get_token(); ///< @var string CSRF protection
|
||||
|
||||
$permanent = array();
|
||||
if ($_COOKIE["adminer_permanent"]) {
|
||||
foreach (explode(" ", $_COOKIE["adminer_permanent"]) as $val) {
|
||||
@@ -17,8 +9,7 @@ if ($_COOKIE["adminer_permanent"]) {
|
||||
}
|
||||
}
|
||||
|
||||
function add_invalid_login() {
|
||||
global $adminer;
|
||||
function add_invalid_login(): void {
|
||||
$base = get_temp_dir() . "/adminer.invalid";
|
||||
// adminer.invalid may not be writable by us, try the files with random suffixes
|
||||
foreach (glob("$base*") ?: array($base) as $filename) {
|
||||
@@ -42,7 +33,7 @@ function add_invalid_login() {
|
||||
}
|
||||
}
|
||||
}
|
||||
$invalid = &$invalids[$adminer->bruteForceKey()];
|
||||
$invalid = &$invalids[adminer()->bruteForceKey()];
|
||||
if (!$invalid) {
|
||||
$invalid = array($time + 30*60, 0); // active for 30 minutes
|
||||
}
|
||||
@@ -50,8 +41,8 @@ function add_invalid_login() {
|
||||
file_write_unlock($fp, serialize($invalids));
|
||||
}
|
||||
|
||||
function check_invalid_login() {
|
||||
global $adminer;
|
||||
/** @param string[] $permanent */
|
||||
function check_invalid_login(array &$permanent): void {
|
||||
$invalids = array();
|
||||
foreach (glob(get_temp_dir() . "/adminer.invalid*") as $filename) {
|
||||
$fp = file_open_lock($filename);
|
||||
@@ -61,10 +52,11 @@ function check_invalid_login() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$invalid = ($invalids ? $invalids[$adminer->bruteForceKey()] : array());
|
||||
/** @var array{int, int} */
|
||||
$invalid = idx($invalids, adminer()->bruteForceKey(), array());
|
||||
$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)));
|
||||
auth_error(lang('Too many unsuccessful logins, try again in %d minute(s).', ceil($next_attempt / 60)), $permanent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +72,7 @@ if ($auth) {
|
||||
$_SESSION["db"][$vendor][$server][$username][$db] = true;
|
||||
if ($auth["permanent"]) {
|
||||
$key = implode("-", array_map('base64_encode', array($vendor, $server, $username, $db)));
|
||||
$private = $adminer->permanentLogin(true);
|
||||
$private = adminer()->permanentLogin(true);
|
||||
$permanent[$key] = "$key:" . base64_encode($private ? encrypt_string($password, $private) : "");
|
||||
cookie("adminer_permanent", implode(" ", $permanent));
|
||||
}
|
||||
@@ -94,16 +86,16 @@ if ($auth) {
|
||||
redirect(auth_url($vendor, $server, $username, $db));
|
||||
}
|
||||
|
||||
} elseif ($_POST["logout"] && (!$has_token || verify_token())) {
|
||||
} elseif ($_POST["logout"] && (!$_SESSION["token"] || verify_token())) {
|
||||
foreach (array("pwds", "db", "dbs", "queries") as $key) {
|
||||
set_session($key, null);
|
||||
}
|
||||
unset_permanent();
|
||||
unset_permanent($permanent);
|
||||
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"]) {
|
||||
session_regenerate_id();
|
||||
$private = $adminer->permanentLogin();
|
||||
$private = adminer()->permanentLogin();
|
||||
foreach ($permanent as $key => $val) {
|
||||
list(, $cipher) = explode(":", $val);
|
||||
list($vendor, $server, $username, $db) = array_map('base64_decode', explode("-", $key));
|
||||
@@ -112,8 +104,10 @@ if ($auth) {
|
||||
}
|
||||
}
|
||||
|
||||
function unset_permanent() {
|
||||
global $permanent;
|
||||
/** Remove credentials from permanent login
|
||||
* @param string[] $permanent
|
||||
*/
|
||||
function unset_permanent(array &$permanent): void {
|
||||
foreach ($permanent as $key => $val) {
|
||||
list($vendor, $server, $username, $db) = array_map('base64_decode', explode("-", $key));
|
||||
if ($vendor == DRIVER && $server == SERVER && $username == $_GET["username"] && $db == DB) {
|
||||
@@ -123,16 +117,16 @@ function unset_permanent() {
|
||||
cookie("adminer_permanent", implode(" ", $permanent));
|
||||
}
|
||||
|
||||
/** Renders an error message and a login form
|
||||
* @param string plain text
|
||||
* @return null exits
|
||||
/** Render an error message and a login form
|
||||
* @param string $error plain text
|
||||
* @param string[] $permanent
|
||||
* @return never
|
||||
*/
|
||||
function auth_error($error) {
|
||||
global $adminer, $has_token;
|
||||
function auth_error(string $error, array &$permanent) {
|
||||
$session_name = session_name();
|
||||
if (isset($_GET["username"])) {
|
||||
header("HTTP/1.1 403 Forbidden"); // 401 requires sending WWW-Authenticate header
|
||||
if (($_COOKIE[$session_name] || $_GET[$session_name]) && !$has_token) {
|
||||
if (($_COOKIE[$session_name] || $_GET[$session_name]) && !$_SESSION["token"]) {
|
||||
$error = lang('Session expired, please login again.');
|
||||
} else {
|
||||
restart_session();
|
||||
@@ -144,7 +138,7 @@ function auth_error($error) {
|
||||
}
|
||||
set_password(DRIVER, SERVER, $_GET["username"], null);
|
||||
}
|
||||
unset_permanent();
|
||||
unset_permanent($permanent);
|
||||
}
|
||||
}
|
||||
if (!$_COOKIE[$session_name] && $_GET[$session_name] && ini_bool("session.use_only_cookies")) {
|
||||
@@ -152,6 +146,9 @@ function auth_error($error) {
|
||||
}
|
||||
$params = session_get_cookie_params();
|
||||
cookie("adminer_key", ($_COOKIE["adminer_key"] ?: rand_string()), $params["lifetime"]);
|
||||
if (!$_SESSION["token"]) {
|
||||
$_SESSION["token"] = rand(1, 1e6); // this is for next attempt
|
||||
}
|
||||
page_header(lang('Login'), $error, null);
|
||||
echo "<form action='' method='post'>\n";
|
||||
echo "<div>";
|
||||
@@ -159,7 +156,7 @@ function auth_error($error) {
|
||||
echo "<p class='message'>" . lang('The action will be performed after successful login with the same credentials.') . "\n";
|
||||
}
|
||||
echo "</div>\n";
|
||||
$adminer->loginForm();
|
||||
adminer()->loginForm();
|
||||
echo "</form>\n";
|
||||
page_footer("auth");
|
||||
exit;
|
||||
@@ -167,46 +164,49 @@ function auth_error($error) {
|
||||
|
||||
if (isset($_GET["username"]) && !class_exists('Adminer\Db')) {
|
||||
unset($_SESSION["pwds"][DRIVER]);
|
||||
unset_permanent();
|
||||
page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", Driver::$possibleDrivers)), false);
|
||||
unset_permanent($permanent);
|
||||
page_header(lang('No extension'), lang('None of the supported PHP extensions (%s) are available.', implode(", ", Driver::$extensions)), false);
|
||||
page_footer("auth");
|
||||
exit;
|
||||
}
|
||||
|
||||
stop_session(true);
|
||||
|
||||
$connection = '';
|
||||
if (isset($_GET["username"]) && is_string(get_password())) {
|
||||
list($host, $port) = explode(":", SERVER, 2);
|
||||
if (preg_match('~^\s*([-+]?\d+)~', $port, $match) && ($match[1] < 1024 || $match[1] > 65535)) { // is_numeric('80#') would still connect to port 80
|
||||
auth_error(lang('Connecting to privileged ports is not allowed.'));
|
||||
auth_error(lang('Connecting to privileged ports is not allowed.'), $permanent);
|
||||
}
|
||||
check_invalid_login();
|
||||
$connection = connect($adminer->credentials());
|
||||
check_invalid_login($permanent);
|
||||
$credentials = adminer()->credentials();
|
||||
$connection = Driver::connect($credentials[0], $credentials[1], $credentials[2]);
|
||||
if (is_object($connection)) {
|
||||
$driver = new Driver($connection);
|
||||
if ($adminer->operators === null) {
|
||||
$adminer->operators = $driver->operators;
|
||||
}
|
||||
if (isset($connection->maria) || $connection->cockroach) {
|
||||
save_settings(array("vendor-" . SERVER => $drivers[DRIVER]));
|
||||
Db::$instance = $connection;
|
||||
Driver::$instance = new Driver($connection);
|
||||
if ($connection->flavor) {
|
||||
save_settings(array("vendor-" . DRIVER . "-" . SERVER => get_driver(DRIVER)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$login = null;
|
||||
if (!is_object($connection) || ($login = $adminer->login($_GET["username"], get_password())) !== true) {
|
||||
$error = (is_string($connection) ? nl_br(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 (!is_object($connection) || ($login = adminer()->login($_GET["username"], get_password())) !== true) {
|
||||
$error = (is_string($connection) ? nl_br(h($connection)) : (is_string($login) ? $login : lang('Invalid credentials.')))
|
||||
. (preg_match('~^ | $~', get_password()) ? '<br>' . lang('There is a space in the input password which might be the cause.') : '');
|
||||
auth_error($error, $permanent);
|
||||
}
|
||||
|
||||
if ($_POST["logout"] && $has_token && !verify_token()) {
|
||||
if ($_POST["logout"] && $_SESSION["token"] && !verify_token()) {
|
||||
page_header(lang('Logout'), lang('Invalid CSRF token. Send the form again.'));
|
||||
page_footer("db");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$_SESSION["token"]) {
|
||||
$_SESSION["token"] = rand(1, 1e6); // defense against cross-site request forgery
|
||||
}
|
||||
stop_session(true);
|
||||
if ($auth && $_POST["token"]) {
|
||||
$_POST["token"] = $token; // reset token after explicit login
|
||||
$_POST["token"] = get_token(); // reset token after explicit login
|
||||
}
|
||||
|
||||
$error = ''; ///< @var string
|
||||
|
@@ -31,7 +31,7 @@ if (isset($_GET["file"])) {
|
||||
|
||||
if ($_GET["script"] == "version") {
|
||||
$filename = get_temp_dir() . "/adminer.version";
|
||||
unlink($filename); // it may not be writable by us
|
||||
@unlink($filename); // it may not be writable by us, @ - it may not exist
|
||||
$fp = file_open_lock($filename);
|
||||
if ($fp) {
|
||||
file_write_unlock($fp, serialize(array("signature" => $_POST["signature"], "version" => $_POST["version"])));
|
||||
@@ -39,7 +39,7 @@ if ($_GET["script"] == "version") {
|
||||
exit;
|
||||
}
|
||||
|
||||
global $adminer, $connection, $driver, $drivers, $error, $HTTPS, $LANG, $langs, $permanent, $has_token, $token, $translations, $VERSION; // allows including Adminer inside a function
|
||||
// Adminer doesn't use any global variables; they used to be declared here
|
||||
|
||||
if (!$_SERVER["REQUEST_URI"]) { // IIS 5 compatibility
|
||||
$_SERVER["REQUEST_URI"] = $_SERVER["ORIG_PATH_INFO"];
|
||||
@@ -50,13 +50,13 @@ if (!strpos($_SERVER["REQUEST_URI"], '?') && $_SERVER["QUERY_STRING"] != "") { /
|
||||
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
|
||||
define('Adminer\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
|
||||
@ini_set("session.use_trans_sid", '0'); // 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
|
||||
session_set_cookie_params(0, preg_replace('~\?.*~', '', $_SERVER["REQUEST_URI"]), "", $HTTPS, true); // ini_set() may be disabled
|
||||
session_set_cookie_params(0, preg_replace('~\?.*~', '', $_SERVER["REQUEST_URI"]), "", HTTPS, true); // ini_set() may be disabled
|
||||
session_start();
|
||||
}
|
||||
|
||||
@@ -66,10 +66,11 @@ if (function_exists("get_magic_quotes_runtime") && get_magic_quotes_runtime()) {
|
||||
set_magic_quotes_runtime(false);
|
||||
}
|
||||
@set_time_limit(0); // @ - can be disabled
|
||||
@ini_set("precision", 15); // @ - can be disabled, 15 - internal PHP precision
|
||||
@ini_set("precision", '15'); // @ - can be disabled, 15 - internal PHP precision
|
||||
|
||||
include "../adminer/include/lang.inc.php";
|
||||
include "../adminer/lang/$LANG.inc.php";
|
||||
include "../adminer/lang/" . LANG . ".inc.php";
|
||||
include "../adminer/include/db.inc.php";
|
||||
include "../adminer/include/pdo.inc.php";
|
||||
include "../adminer/include/driver.inc.php";
|
||||
include "../adminer/drivers/sqlite.inc.php";
|
||||
@@ -77,18 +78,27 @@ include "../adminer/drivers/pgsql.inc.php";
|
||||
include "../adminer/drivers/oracle.inc.php";
|
||||
include "../adminer/drivers/mssql.inc.php";
|
||||
include "./include/adminer.inc.php";
|
||||
$adminer = (function_exists('adminer_object') ? adminer_object() : new Adminer);
|
||||
include "../adminer/include/plugins.inc.php";
|
||||
include "../adminer/include/plugin.inc.php";
|
||||
|
||||
Adminer::$instance =
|
||||
(function_exists('adminer_object') ? adminer_object() :
|
||||
(is_dir("adminer-plugins") || file_exists("adminer-plugins.php") ? new Plugins(null) :
|
||||
new Adminer
|
||||
));
|
||||
|
||||
// this is matched by compile.php
|
||||
include "../adminer/drivers/mysql.inc.php"; // must be included as last driver
|
||||
|
||||
define('Adminer\JUSH', Driver::$jush);
|
||||
define('Adminer\SERVER', $_GET[DRIVER]); // read from pgsql=localhost
|
||||
define('Adminer\SERVER', $_GET[DRIVER]); // read from pgsql=localhost, '' means default server, null means no server
|
||||
define('Adminer\DB', $_GET["db"]); // for the sake of speed and size
|
||||
define(
|
||||
'Adminer\ME',
|
||||
preg_replace('~\?.*~', '', relative_uri()) . '?'
|
||||
. (sid() ? SID . '&' : '')
|
||||
. (SERVER !== null ? DRIVER . "=" . urlencode(SERVER) . '&' : '')
|
||||
. ($_GET["ext"] ? "ext=" . urlencode($_GET["ext"]) . '&' : '')
|
||||
. (isset($_GET["username"]) ? "username=" . urlencode($_GET["username"]) . '&' : '')
|
||||
. (DB != "" ? 'db=' . urlencode(DB) . '&' . (isset($_GET["ns"]) ? "ns=" . urlencode($_GET["ns"]) . "&" : "") : '')
|
||||
);
|
||||
|
@@ -10,7 +10,7 @@ if (isset($_GET["import"])) {
|
||||
|
||||
if (
|
||||
!(DB != ""
|
||||
? $connection->select_db(DB)
|
||||
? connection()->select_db(DB)
|
||||
: isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]) || isset($_GET["processlist"]) || isset($_GET["privileges"]) || isset($_GET["user"]) || isset($_GET["variables"])
|
||||
|| $_GET["script"] == "connect" || $_GET["script"] == "kill"
|
||||
)
|
||||
@@ -42,9 +42,10 @@ if (
|
||||
echo "<a href='" . h(ME) . "$key='>$val</a>\n";
|
||||
}
|
||||
}
|
||||
echo "<p>" . lang('%s version: %s through PHP extension %s', $drivers[DRIVER], "<b>" . h($connection->server_info) . "</b>", "<b>$connection->extension</b>") . "\n";
|
||||
echo "<p>" . lang('%s version: %s through PHP extension %s', get_driver(DRIVER), "<b>" . h(connection()->server_info) . "</b>", "<b>" . connection()->extension . "</b>") . "\n";
|
||||
echo "<p>" . lang('Logged as: %s', "<b>" . h(logged_user()) . "</b>") . "\n";
|
||||
$databases = $adminer->databases();
|
||||
|
||||
$databases = adminer()->databases();
|
||||
if ($databases) {
|
||||
$scheme = support("scheme");
|
||||
$collations = collations();
|
||||
@@ -61,7 +62,6 @@ if (
|
||||
;
|
||||
|
||||
$databases = ($_GET["dbsize"] ? count_tables($databases) : array_flip($databases));
|
||||
|
||||
foreach ($databases as $db => $tables) {
|
||||
$root = h(ME) . "db=" . urlencode($db);
|
||||
$id = h("Db-" . $db);
|
||||
@@ -78,16 +78,39 @@ if (
|
||||
echo (support("database")
|
||||
? "<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_hidden("all") . 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 "<input type='hidden' name='token' value='$token'>\n";
|
||||
echo input_token();
|
||||
echo "</form>\n";
|
||||
echo script("tableCheck();");
|
||||
}
|
||||
|
||||
if (!empty(adminer()->plugins)) {
|
||||
echo "<div class='plugins'>\n";
|
||||
echo "<h3>" . lang('Loaded plugins') . "</h3>\n<ul>\n";
|
||||
foreach (adminer()->plugins as $plugin) {
|
||||
$description = (method_exists($plugin, 'description') ? $plugin->description() : "");
|
||||
if (!$description) {
|
||||
$reflection = new \ReflectionObject($plugin);
|
||||
if (preg_match('~^/[\s*]+(.+)~', $reflection->getDocComment(), $match)) {
|
||||
$description = $match[1];
|
||||
}
|
||||
}
|
||||
$screenshot = (method_exists($plugin, 'screenshot') ? $plugin->screenshot() : "");
|
||||
echo "<li><b>" . get_class($plugin) . "</b>"
|
||||
. h($description ? ": $description" : "")
|
||||
. ($screenshot ? " (<a href='" . h($screenshot) . "'" . target_blank() . ">" . lang('screenshot') . "</a>)" : "")
|
||||
. "\n"
|
||||
;
|
||||
}
|
||||
echo "</ul>\n";
|
||||
adminer()->pluginsLinks();
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
page_footer("db");
|
||||
|
@@ -3,12 +3,12 @@ namespace Adminer;
|
||||
|
||||
// coverage is used in tests and removed in compilation
|
||||
if (extension_loaded("xdebug") && file_exists(sys_get_temp_dir() . "/adminer.coverage")) {
|
||||
function save_coverage() {
|
||||
function save_coverage(): void {
|
||||
$coverage_filename = sys_get_temp_dir() . "/adminer.coverage";
|
||||
$coverage = unserialize(file_get_contents($coverage_filename));
|
||||
foreach (xdebug_get_code_coverage() as $filename => $lines) {
|
||||
foreach ($lines as $l => $val) {
|
||||
if (!$coverage[$filename][$l] || $val > 0) {
|
||||
if (!idx($coverage[$filename], $l) || $val > 0) {
|
||||
$coverage[$filename][$l] = $val;
|
||||
}
|
||||
}
|
||||
|
56
adminer/include/db.inc.php
Normal file
56
adminer/include/db.inc.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
// this could be interface when "Db extends \mysqli" can have compatible type declarations (PHP 7)
|
||||
// interfaces can include properties only since PHP 8.4
|
||||
abstract class SqlDb {
|
||||
/** @var Db */ static $instance;
|
||||
|
||||
/** @var string */ public $extension; // extension name
|
||||
/** @var string */ public $flavor = ''; // different vendor with the same API, e.g. MariaDB; usually stays empty
|
||||
/** @var string */ public $server_info; // server version
|
||||
/** @var int */ public $affected_rows = 0; // number of affected rows
|
||||
/** @var string */ public $info = ''; // see https://php.net/mysql_info
|
||||
/** @var int */ public $errno = 0; // last error code
|
||||
/** @var string */ public $error = ''; // last error message
|
||||
/** @var Result|bool */ protected $multi; // used for multiquery
|
||||
|
||||
/** Connect to server
|
||||
* @return string error message
|
||||
*/
|
||||
abstract function attach(?string $server, string $username, string $password): string;
|
||||
|
||||
/** Quote string to use in SQL
|
||||
* @return string escaped string enclosed in '
|
||||
*/
|
||||
abstract function quote(string $string): string;
|
||||
|
||||
/** Select database
|
||||
* @return bool boolish
|
||||
*/
|
||||
abstract function select_db(string $database);
|
||||
|
||||
/** Send query
|
||||
* @return Result|bool
|
||||
*/
|
||||
abstract function query(string $query, bool $unbuffered = false);
|
||||
|
||||
/** Send query with more resultsets
|
||||
* @return Result|bool
|
||||
*/
|
||||
function multi_query(string $query) {
|
||||
return $this->multi = $this->query($query);
|
||||
}
|
||||
|
||||
/** Get current resultset
|
||||
* @return Result|bool
|
||||
*/
|
||||
function store_result() {
|
||||
return $this->multi;
|
||||
}
|
||||
|
||||
/** Fetch next resultset */
|
||||
function next_result(): bool {
|
||||
return false;
|
||||
}
|
||||
}
|
@@ -1,52 +1,66 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
if (!ob_get_level()) {
|
||||
ob_start(null, 4096);
|
||||
}
|
||||
|
||||
/** Print HTML header
|
||||
* @param string used in title, breadcrumb and heading, should be HTML escaped
|
||||
* @param string
|
||||
* @param mixed ["key" => "link", "key2" => ["link", "desc"]], null for nothing, false for driver only, true for driver and server
|
||||
* @param string used after colon in title and heading, should be HTML escaped
|
||||
* @return null
|
||||
* @param string $title used in title, breadcrumb and heading, should be HTML escaped
|
||||
* @param mixed $breadcrumb ["key" => "link", "key2" => ["link", "desc"]], null for nothing, false for driver only, true for driver and server
|
||||
* @param string $title2 used after colon in title and heading, should be HTML escaped
|
||||
*/
|
||||
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
||||
global $LANG, $VERSION, $adminer, $drivers;
|
||||
function page_header(string $title, string $error = "", $breadcrumb = array(), string $title2 = ""): void {
|
||||
page_headers();
|
||||
if (is_ajax() && $error) {
|
||||
page_messages($error);
|
||||
exit;
|
||||
}
|
||||
if (!ob_get_level()) {
|
||||
ob_start('ob_gzhandler', 4096);
|
||||
}
|
||||
$title_all = $title . ($title2 != "" ? ": $title2" : "");
|
||||
$title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name());
|
||||
$title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . adminer()->name());
|
||||
// initial-scale=1 is the default but Chrome 134 on iOS is not able to zoom out without it
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
|
||||
<html lang="<?php echo LANG; ?>" dir="<?php echo lang('ltr'); ?>">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title><?php echo $title_page; ?></title>
|
||||
<link rel="stylesheet" href="../adminer/static/default.css">
|
||||
<?php
|
||||
$css = $adminer->css();
|
||||
$dark = (count($css) == 1 ? !!preg_match('~-dark~', $css[0]) : null);
|
||||
|
||||
$css = adminer()->css();
|
||||
if (is_int(key($css))) { // legacy return value
|
||||
$css = array_fill_keys($css, 'light');
|
||||
}
|
||||
$has_light = in_array('light', $css) || in_array('', $css);
|
||||
$has_dark = in_array('dark', $css) || in_array('', $css);
|
||||
$dark = ($has_light
|
||||
? ($has_dark ? null : false) // both styles - autoswitching, only adminer.css - light
|
||||
: ($has_dark ?: null) // only adminer-dark.css - dark, neither - autoswitching
|
||||
);
|
||||
$media = " media='(prefers-color-scheme: dark)'";
|
||||
if ($dark !== false) {
|
||||
echo "<link rel='stylesheet'" . ($dark ? "" : " media='(prefers-color-scheme: dark)'") . " href='../adminer/static/dark.css'>\n";
|
||||
echo "<link rel='stylesheet'" . ($dark ? "" : $media) . " href='../adminer/static/dark.css'>\n";
|
||||
}
|
||||
echo "<meta name='color-scheme' content='" . ($dark === null ? "light dark" : ($dark ? "dark" : "light")) . "'>\n";
|
||||
|
||||
// this is matched by compile.php
|
||||
echo script_src("../adminer/static/functions.js");
|
||||
echo script_src("static/editing.js");
|
||||
if ($adminer->head($dark)) {
|
||||
echo "<link rel='shortcut icon' type='image/x-icon' href='../adminer/static/favicon.ico'>\n";
|
||||
echo "<link rel='apple-touch-icon' href='../adminer/static/favicon.ico'>\n";
|
||||
if (adminer()->head($dark)) {
|
||||
echo "<link rel='icon' href='data:image/gif;base64,R0lGODlhEAAQAJEAAAQCBPz+/PwCBAROZCH5BAEAAAAALAAAAAAQABAAAAI2hI+pGO1rmghihiUdvUBnZ3XBQA7f05mOak1RWXrNq5nQWHMKvuoJ37BhVEEfYxQzHjWQ5qIAADs='>\n";
|
||||
echo "<link rel='apple-touch-icon' href='../adminer/static/logo.png'>\n";
|
||||
}
|
||||
foreach ($css as $val) {
|
||||
echo "<link rel='stylesheet'" . (preg_match('~-dark~', $val) && !$dark ? " media='(prefers-color-scheme: dark)'" : "") . " href='" . h($val) . "'>\n";
|
||||
foreach ($css as $url => $mode) {
|
||||
$attrs = ($mode == 'dark' && !$dark
|
||||
? $media
|
||||
: ($mode == 'light' && $has_dark ? " media='(prefers-color-scheme: light)'" : "")
|
||||
);
|
||||
echo "<link rel='stylesheet'$attrs href='" . h($url) . "'>\n";
|
||||
}
|
||||
echo "\n<body class='" . lang('ltr') . " nojs'>\n";
|
||||
echo "\n<body class='" . lang('ltr') . " nojs";
|
||||
adminer()->bodyClass();
|
||||
echo "'>\n";
|
||||
$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));
|
||||
@@ -65,20 +79,21 @@ fQIDAQAB
|
||||
}
|
||||
}
|
||||
echo script("mixin(document.body, {onkeydown: bodyKeydown, onclick: bodyClick"
|
||||
. (isset($_COOKIE["adminer_version"]) ? "" : ", onload: partial(verifyVersion, '$VERSION', '" . js_escape(ME) . "', '" . get_token() . "')") // $token may be empty in auth.inc.php
|
||||
. (isset($_COOKIE["adminer_version"]) ? "" : ", onload: partial(verifyVersion, '" . VERSION . "', '" . js_escape(ME) . "', '" . get_token() . "')")
|
||||
. "});
|
||||
document.body.className = document.body.className.replace(/ nojs/, ' js');
|
||||
var offlineMessage = '" . js_escape(lang('You are offline.')) . "';
|
||||
var thousandsSeparator = '" . js_escape(lang(',')) . "';")
|
||||
document.body.classList.replace('nojs', 'js');
|
||||
const offlineMessage = '" . js_escape(lang('You are offline.')) . "';
|
||||
const thousandsSeparator = '" . js_escape(lang(',')) . "';")
|
||||
;
|
||||
echo "<div id='help' class='jush-" . JUSH . " jsonly hidden'></div>\n";
|
||||
echo script("mixin(qs('#help'), {onmouseover: function () { helpOpen = 1; }, onmouseout: helpMouseout});");
|
||||
echo script("mixin(qs('#help'), {onmouseover: () => { helpOpen = 1; }, onmouseout: helpMouseout});");
|
||||
echo "<div id='content'>\n";
|
||||
echo "<span id='menuopen' class='jsonly'>" . icon("move", "", "menu", "") . "</span>" . script("qs('#menuopen').onclick = event => { qs('#foot').classList.toggle('foot'); event.stopPropagation(); }");
|
||||
if ($breadcrumb !== null) {
|
||||
$link = substr(preg_replace('~\b(username|db|ns)=[^&]*&~', '', ME), 0, -1);
|
||||
echo '<p id="breadcrumb"><a href="' . h($link ?: ".") . '">' . $drivers[DRIVER] . '</a> » ';
|
||||
echo '<p id="breadcrumb"><a href="' . h($link ?: ".") . '">' . get_driver(DRIVER) . '</a> » ';
|
||||
$link = substr(preg_replace('~\b(db|ns)=[^&]*&~', '', ME), 0, -1);
|
||||
$server = $adminer->serverName(SERVER);
|
||||
$server = adminer()->serverName(SERVER);
|
||||
$server = ($server != "" ? $server : lang('Server'));
|
||||
if ($breadcrumb === false) {
|
||||
echo "$server\n";
|
||||
@@ -113,31 +128,28 @@ var thousandsSeparator = '" . js_escape(lang(',')) . "';")
|
||||
define('Adminer\PAGE_HEADER', 1);
|
||||
}
|
||||
|
||||
/** Send HTTP headers
|
||||
* @return null
|
||||
*/
|
||||
function page_headers() {
|
||||
global $adminer;
|
||||
/** Send HTTP headers */
|
||||
function page_headers(): void {
|
||||
header("Content-Type: text/html; charset=utf-8");
|
||||
header("Cache-Control: no-cache");
|
||||
header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox 3.6.9
|
||||
header("X-XSS-Protection: 0"); // prevents introducing XSS in IE8 by removing safe parts of the page
|
||||
header("X-Content-Type-Options: nosniff");
|
||||
header("Referrer-Policy: origin-when-cross-origin");
|
||||
foreach ($adminer->csp() as $csp) {
|
||||
foreach (adminer()->csp(csp()) as $csp) {
|
||||
$header = array();
|
||||
foreach ($csp as $key => $val) {
|
||||
$header[] = "$key $val";
|
||||
}
|
||||
header("Content-Security-Policy: " . implode("; ", $header));
|
||||
}
|
||||
$adminer->headers();
|
||||
adminer()->headers();
|
||||
}
|
||||
|
||||
/** Get Content Security Policy headers
|
||||
* @return array of arrays with directive name in key, allowed sources in value
|
||||
* @return list<string[]> of arrays with directive name in key, allowed sources in value
|
||||
*/
|
||||
function csp() {
|
||||
function csp(): array {
|
||||
return array(
|
||||
array(
|
||||
"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-'
|
||||
@@ -153,7 +165,7 @@ function csp() {
|
||||
/** Get a CSP nonce
|
||||
* @return string Base64 value
|
||||
*/
|
||||
function get_nonce() {
|
||||
function get_nonce(): string {
|
||||
static $nonce;
|
||||
if (!$nonce) {
|
||||
$nonce = base64_encode(rand_string());
|
||||
@@ -161,13 +173,10 @@ function get_nonce() {
|
||||
return $nonce;
|
||||
}
|
||||
|
||||
/** Print flash and error messages
|
||||
* @param string
|
||||
* @return null
|
||||
*/
|
||||
function page_messages($error) {
|
||||
/** Print flash and error messages */
|
||||
function page_messages(string $error): void {
|
||||
$uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]);
|
||||
$messages = $_SESSION["messages"][$uri];
|
||||
$messages = idx($_SESSION["messages"], $uri);
|
||||
if ($messages) {
|
||||
echo "<div class='message'>" . implode("</div>\n<div class='message'>", $messages) . "</div>" . script("messagesPrint();");
|
||||
unset($_SESSION["messages"][$uri]);
|
||||
@@ -175,30 +184,28 @@ function page_messages($error) {
|
||||
if ($error) {
|
||||
echo "<div class='error'>$error</div>\n";
|
||||
}
|
||||
if (adminer()->error) { // separate <div>
|
||||
echo "<div class='error'>" . adminer()->error . "</div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
/** Print HTML footer
|
||||
* @param string "auth", "db", "ns"
|
||||
* @return null
|
||||
* @param ''|'auth'|'db'|'ns' $missing
|
||||
*/
|
||||
function page_footer($missing = "") {
|
||||
global $adminer, $token;
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div id="menu">
|
||||
<?php $adminer->navigation($missing); ?>
|
||||
</div>
|
||||
|
||||
<?php if ($missing != "auth") { ?>
|
||||
function page_footer(string $missing = ""): void {
|
||||
echo "</div>\n\n<div id='foot' class='foot'>\n<div id='menu'>\n";
|
||||
adminer()->navigation($missing);
|
||||
echo "</div>\n";
|
||||
if ($missing != "auth") {
|
||||
?>
|
||||
<form action="" method="post">
|
||||
<p class="logout">
|
||||
<span><?php echo h($_GET["username"]) . "\n"; ?></span>
|
||||
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>" id="logout">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</p>
|
||||
<?php echo input_token(); ?>
|
||||
</form>
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
echo "</div>\n\n";
|
||||
echo script("setupSubmitHighlight(document);");
|
||||
}
|
||||
|
@@ -1,98 +1,95 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$drivers = array();
|
||||
|
||||
/** Add a driver
|
||||
* @param string
|
||||
* @param string
|
||||
* @return null
|
||||
*/
|
||||
function add_driver($id, $name) {
|
||||
global $drivers;
|
||||
$drivers[$id] = $name;
|
||||
/** Add or overwrite a driver */
|
||||
function add_driver(string $id, string $name): void {
|
||||
SqlDriver::$drivers[$id] = $name;
|
||||
}
|
||||
|
||||
/** Get driver name
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function get_driver($id) {
|
||||
global $drivers;
|
||||
return $drivers[$id];
|
||||
/** Get driver name */
|
||||
function get_driver(string $id): ?string {
|
||||
return SqlDriver::$drivers[$id];
|
||||
}
|
||||
|
||||
abstract class SqlDriver {
|
||||
static $possibleDrivers = array();
|
||||
static $jush; ///< @var string JUSH identifier
|
||||
/** @var Driver */ static $instance;
|
||||
/** @var string[] */ static $drivers = array(); // all available drivers
|
||||
/** @var list<string> */ static $extensions = array(); // possible extensions in the current driver
|
||||
/** @var string */ static $jush; // JUSH identifier
|
||||
|
||||
protected $conn;
|
||||
protected $types = array(); ///< @var array [$description => [$type => $maximum_unsigned_length, ...], ...]
|
||||
public $editFunctions = array(); ///< @var array of ["$type|$type2" => "$function/$function2"] functions used in editing, [0] - edit and insert, [1] - edit only
|
||||
public $unsigned = array(); ///< @var array number variants
|
||||
public $operators = array(); ///< @var array operators used in select
|
||||
public $functions = array(); ///< @var array functions used in select
|
||||
public $grouping = array(); ///< @var array grouping functions used in select
|
||||
public $onActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT"; ///< @var string used in foreign_keys()
|
||||
public $inout = "IN|OUT|INOUT"; ///< @var string used in routines
|
||||
public $enumLength = "'(?:''|[^'\\\\]|\\\\.)*'"; ///< @var string regular expression for parsing enum lengths
|
||||
public $generated = array(); ///< @var array allowed types of generated columns
|
||||
/** @var Db */ protected $conn;
|
||||
/** @var int[][] */ protected $types = array(); // [$group => [$type => $maximum_unsigned_length, ...], ...]
|
||||
/** @var string[] */ public $insertFunctions = array(); // ["$type|$type2" => "$function/$function2"] functions used in edit and insert
|
||||
/** @var string[] */ public $editFunctions = array(); // ["$type|$type2" => "$function/$function2"] functions used in edit only
|
||||
/** @var list<string> */ public $unsigned = array(); // number variants
|
||||
/** @var list<string> */ public $operators = array(); // operators used in select
|
||||
/** @var list<string> */ public $functions = array(); // functions used in select
|
||||
/** @var list<string> */ public $grouping = array(); // grouping functions used in select
|
||||
/** @var string */ public $onActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT"; // used in foreign_keys()
|
||||
/** @var list<string> */ public $partitionBy = array(); // supported partitioning types
|
||||
/** @var string */ public $inout = "IN|OUT|INOUT"; // used in routines
|
||||
/** @var string */ public $enumLength = "'(?:''|[^'\\\\]|\\\\.)*'"; // regular expression for parsing enum lengths
|
||||
/** @var list<string> */ public $generated = array(); // allowed types of generated columns
|
||||
|
||||
/** Create object for performing database operations
|
||||
* @param Db
|
||||
/** Connect to the database
|
||||
* @return Db|string string for error
|
||||
*/
|
||||
function __construct($connection) {
|
||||
static function connect(?string $server, string $username, string $password) {
|
||||
$connection = new Db;
|
||||
return ($connection->attach($server, $username, $password) ?: $connection);
|
||||
}
|
||||
|
||||
/** Create object for performing database operations */
|
||||
function __construct(Db $connection) {
|
||||
$this->conn = $connection;
|
||||
}
|
||||
|
||||
/** Get all types
|
||||
* @return array [$type => $maximum_unsigned_length, ...]
|
||||
* @return int[] [$type => $maximum_unsigned_length, ...]
|
||||
*/
|
||||
function types() {
|
||||
function types(): array {
|
||||
return call_user_func_array('array_merge', array_values($this->types));
|
||||
}
|
||||
|
||||
/** Get structured types
|
||||
* @return array [$description => [$type, ...], ...]
|
||||
* @return list<string>[]|list<string> [$description => [$type, ...], ...]
|
||||
*/
|
||||
function structuredTypes() {
|
||||
function structuredTypes(): array {
|
||||
return array_map('array_keys', $this->types);
|
||||
}
|
||||
|
||||
/** Get enum values
|
||||
* @param array
|
||||
* @return string or null
|
||||
* @param Field $field
|
||||
* @return string|void
|
||||
*/
|
||||
function enumLength($field) {
|
||||
function enumLength(array $field) {
|
||||
}
|
||||
|
||||
/** Function used to convert the value inputted by user
|
||||
* @param array
|
||||
* @return string or null
|
||||
* @param Field $field
|
||||
* @return string|void
|
||||
*/
|
||||
function unconvertFunction($field) {
|
||||
function unconvertFunction(array $field) {
|
||||
}
|
||||
|
||||
/** Select data from table
|
||||
* @param string
|
||||
* @param array result of $adminer->selectColumnsProcess()[0]
|
||||
* @param array result of $adminer->selectSearchProcess()
|
||||
* @param array result of $adminer->selectColumnsProcess()[1]
|
||||
* @param array result of $adminer->selectOrderProcess()
|
||||
* @param int result of $adminer->selectLimitProcess()
|
||||
* @param int index of page starting at zero
|
||||
* @param bool whether to print the query
|
||||
* @return Result
|
||||
* @param list<string> $select result of adminer()->selectColumnsProcess()[0]
|
||||
* @param list<string> $where result of adminer()->selectSearchProcess()
|
||||
* @param list<string> $group result of adminer()->selectColumnsProcess()[1]
|
||||
* @param list<string> $order result of adminer()->selectOrderProcess()
|
||||
* @param int $limit result of adminer()->selectLimitProcess()
|
||||
* @param int $page index of page starting at zero
|
||||
* @param bool $print whether to print the query
|
||||
* @return Result|false
|
||||
*/
|
||||
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
|
||||
global $adminer;
|
||||
function select(string $table, array $select, array $where, array $group, array $order = array(), int $limit = 1, ?int $page = 0, bool $print = false) {
|
||||
$is_group = (count($group) < count($select));
|
||||
$query = $adminer->selectQueryBuild($select, $where, $group, $order, $limit, $page);
|
||||
$query = adminer()->selectQueryBuild($select, $where, $group, $order, $limit, $page);
|
||||
if (!$query) {
|
||||
$query = "SELECT" . limit(
|
||||
($_GET["page"] != "last" && $limit != "" && $group && $is_group && JUSH == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) . "\nFROM " . table($table),
|
||||
($_GET["page"] != "last" && $limit && $group && $is_group && JUSH == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) . "\nFROM " . table($table),
|
||||
($where ? "\nWHERE " . implode(" AND ", $where) : "") . ($group && $is_group ? "\nGROUP BY " . implode(", ", $group) : "") . ($order ? "\nORDER BY " . implode(", ", $order) : ""),
|
||||
($limit != "" ? +$limit : null),
|
||||
$limit,
|
||||
($page ? $limit * $page : 0),
|
||||
"\n"
|
||||
);
|
||||
@@ -100,31 +97,28 @@ abstract class SqlDriver {
|
||||
$start = microtime(true);
|
||||
$return = $this->conn->query($query);
|
||||
if ($print) {
|
||||
echo $adminer->selectQuery($query, $start, !$return);
|
||||
echo adminer()->selectQuery($query, $start, !$return);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Delete data from table
|
||||
* @param string
|
||||
* @param string " WHERE ..."
|
||||
* @param int 0 or 1
|
||||
* @return bool
|
||||
* @param string $queryWhere " WHERE ..."
|
||||
* @param int $limit 0 or 1
|
||||
* @return Result|bool
|
||||
*/
|
||||
function delete($table, $queryWhere, $limit = 0) {
|
||||
function delete(string $table, string $queryWhere, int $limit = 0) {
|
||||
$query = "FROM " . table($table);
|
||||
return queries("DELETE" . ($limit ? limit1($table, $query, $queryWhere) : " $query$queryWhere"));
|
||||
}
|
||||
|
||||
/** Update data in table
|
||||
* @param string
|
||||
* @param array escaped columns in keys, quoted data in values
|
||||
* @param string " WHERE ..."
|
||||
* @param int 0 or 1
|
||||
* @param string
|
||||
* @return bool
|
||||
* @param string[] $set escaped columns in keys, quoted data in values
|
||||
* @param string $queryWhere " WHERE ..."
|
||||
* @param int $limit 0 or 1
|
||||
* @return Result|bool
|
||||
*/
|
||||
function update($table, $set, $queryWhere, $limit = 0, $separator = "\n") {
|
||||
function update(string $table, array $set, string $queryWhere, int $limit = 0, string $separator = "\n") {
|
||||
$values = array();
|
||||
foreach ($set as $key => $val) {
|
||||
$values[] = "$key = $val";
|
||||
@@ -134,135 +128,174 @@ abstract class SqlDriver {
|
||||
}
|
||||
|
||||
/** Insert data into table
|
||||
* @param string
|
||||
* @param array escaped columns in keys, quoted data in values
|
||||
* @return bool
|
||||
* @param string[] $set escaped columns in keys, quoted data in values
|
||||
* @return Result|bool
|
||||
*/
|
||||
function insert($table, $set) {
|
||||
function insert(string $table, array $set) {
|
||||
return queries("INSERT INTO " . table($table) . ($set
|
||||
? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")"
|
||||
: " DEFAULT VALUES"
|
||||
));
|
||||
) . $this->insertReturning($table));
|
||||
}
|
||||
|
||||
/** Get RETURNING clause for INSERT queries (PostgreSQL specific) */
|
||||
function insertReturning(string $table): string {
|
||||
return "";
|
||||
}
|
||||
|
||||
/** Insert or update data in table
|
||||
* @param string
|
||||
* @param array
|
||||
* @param array of arrays with escaped columns in keys and quoted data in values
|
||||
* @return bool
|
||||
* @param list<string[]> $rows of arrays with escaped columns in keys and quoted data in values
|
||||
* @param int[] $primary column names in keys
|
||||
* @return Result|bool
|
||||
*/
|
||||
function insertUpdate($table, $rows, $primary) {
|
||||
function insertUpdate(string $table, array $rows, array $primary) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Begin transaction
|
||||
* @return bool
|
||||
* @return Result|bool
|
||||
*/
|
||||
function begin() {
|
||||
return queries("BEGIN");
|
||||
}
|
||||
|
||||
/** Commit transaction
|
||||
* @return bool
|
||||
* @return Result|bool
|
||||
*/
|
||||
function commit() {
|
||||
return queries("COMMIT");
|
||||
}
|
||||
|
||||
/** Rollback transaction
|
||||
* @return bool
|
||||
* @return Result|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
|
||||
* @param int $timeout seconds
|
||||
* @return string|void null if the driver doesn't support query timeouts
|
||||
*/
|
||||
function slowQuery($query, $timeout) {
|
||||
function slowQuery(string $query, int $timeout) {
|
||||
}
|
||||
|
||||
/** Convert column to be searchable
|
||||
* @param string escaped column name
|
||||
* @param array ["op" => , "val" => ]
|
||||
* @param array
|
||||
* @return string
|
||||
* @param string $idf escaped column name
|
||||
* @param array{op:string, val:string} $val
|
||||
* @param Field $field
|
||||
*/
|
||||
function convertSearch($idf, $val, $field) {
|
||||
function convertSearch(string $idf, array $val, array $field): string {
|
||||
return $idf;
|
||||
}
|
||||
|
||||
/** Convert operator so it can be used in search
|
||||
* @param string $operator
|
||||
* @return string
|
||||
*/
|
||||
function convertOperator($operator) {
|
||||
/** Convert operator so it can be used in search */
|
||||
function convertOperator(string $operator): string {
|
||||
return $operator;
|
||||
}
|
||||
|
||||
/** Convert value returned by database to actual value
|
||||
* @param string
|
||||
* @param array
|
||||
* @return string
|
||||
* @param Field $field
|
||||
*/
|
||||
function value($val, $field) {
|
||||
return (method_exists($this->conn, 'value')
|
||||
? $this->conn->value($val, $field)
|
||||
: (is_resource($val) ? stream_get_contents($val) : $val)
|
||||
);
|
||||
function value(?string $val, array $field): ?string {
|
||||
return (method_exists($this->conn, 'value') ? $this->conn->value($val, $field) : $val);
|
||||
}
|
||||
|
||||
/** Quote binary string
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function quoteBinary($s) {
|
||||
/** Quote binary string */
|
||||
function quoteBinary(string $s): string {
|
||||
return q($s);
|
||||
}
|
||||
|
||||
/** Get warnings about the last command
|
||||
* @return string HTML
|
||||
* @return string|void HTML
|
||||
*/
|
||||
function warnings() {
|
||||
return '';
|
||||
}
|
||||
|
||||
/** Get help link for table
|
||||
* @param string
|
||||
* @param bool
|
||||
* @return string relative URL or null
|
||||
* @return string|void relative URL
|
||||
*/
|
||||
function tableHelp($name, $is_view = false) {
|
||||
function tableHelp(string $name, bool $is_view = false) {
|
||||
}
|
||||
|
||||
/** Check if C-style escapes are supported
|
||||
* @return bool
|
||||
/** Get tables this table inherits from
|
||||
* @return list<string>
|
||||
*/
|
||||
function hasCStyleEscapes() {
|
||||
function inheritsFrom(string $table): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
/** Get inherited tables
|
||||
* @return list<string>
|
||||
*/
|
||||
function inheritedTables(string $table): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
/** Get partitions info
|
||||
* @return Partitions
|
||||
*/
|
||||
function partitionsInfo(string $table): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
/** Check if C-style escapes are supported */
|
||||
function hasCStyleEscapes(): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Check whether table supports indexes
|
||||
* @param array result of table_status()
|
||||
* @return bool
|
||||
/** Get supported engines
|
||||
* @return list<string>
|
||||
*/
|
||||
function supportsIndex($table_status) {
|
||||
function engines(): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
/** Check whether table supports indexes
|
||||
* @param TableStatus $table_status
|
||||
*/
|
||||
function supportsIndex(array $table_status): bool {
|
||||
return !is_view($table_status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of supported index algorithms, first one is default
|
||||
* @param TableStatus $tableStatus
|
||||
* @return list<string>
|
||||
*/
|
||||
function indexAlgorithms(array $tableStatus): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
/** Get defined check constraints
|
||||
* @param string
|
||||
* @return array [$name => $clause]
|
||||
* @return string[] [$name => $clause]
|
||||
*/
|
||||
function checkConstraints($table) {
|
||||
function checkConstraints(string $table): array {
|
||||
// MariaDB contains CHECK_CONSTRAINTS.TABLE_NAME, MySQL and PostrgreSQL not
|
||||
return get_key_vals("SELECT c.CONSTRAINT_NAME, CHECK_CLAUSE
|
||||
FROM INFORMATION_SCHEMA.CHECK_CONSTRAINTS c
|
||||
JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS t ON c.CONSTRAINT_SCHEMA = t.CONSTRAINT_SCHEMA AND c.CONSTRAINT_NAME = t.CONSTRAINT_NAME
|
||||
WHERE c.CONSTRAINT_SCHEMA = " . q($_GET["ns"] != "" ? $_GET["ns"] : DB) . "
|
||||
AND t.TABLE_NAME = " . q($table) . "
|
||||
AND CHECK_CLAUSE NOT LIKE '% IS NOT NULL'"); // ignore default IS NOT NULL checks in PostrgreSQL
|
||||
AND CHECK_CLAUSE NOT LIKE '% IS NOT NULL'", $this->conn); // ignore default IS NOT NULL checks in PostrgreSQL
|
||||
}
|
||||
|
||||
/** Get all fields in the current schema
|
||||
* @return array<list<array{field:string, null:bool, type:string, length:?numeric-string, primary?:numeric-string}>>
|
||||
*/
|
||||
function allFields(): array {
|
||||
$return = array();
|
||||
if (DB != "") {
|
||||
foreach (
|
||||
get_rows("SELECT TABLE_NAME AS tab, COLUMN_NAME AS field, IS_NULLABLE AS nullable, DATA_TYPE AS type, CHARACTER_MAXIMUM_LENGTH AS length" . (JUSH == 'sql' ? ", COLUMN_KEY = 'PRI' AS `primary`" : "") . "
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA = " . q($_GET["ns"] != "" ? $_GET["ns"] : DB) . "
|
||||
ORDER BY TABLE_NAME, ORDINAL_POSITION", $this->conn) as $row
|
||||
) {
|
||||
$row["null"] = ($row["nullable"] == "YES");
|
||||
$return[$row["tab"]][] = $row;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
@@ -4,13 +4,12 @@ namespace Adminer;
|
||||
// This file is not used in Adminer Editor.
|
||||
|
||||
/** Print select result
|
||||
* @param Result
|
||||
* @param Db connection to examine indexes
|
||||
* @param array
|
||||
* @param int
|
||||
* @return array $orgtables
|
||||
* @param Result $result
|
||||
* @param string[] $orgtables
|
||||
* @param int|numeric-string $limit
|
||||
* @return string[] $orgtables
|
||||
*/
|
||||
function select($result, $connection2 = null, $orgtables = array(), $limit = 0) {
|
||||
function print_select_result($result, ?Db $connection2 = null, array $orgtables = array(), $limit = 0): array {
|
||||
$links = array(); // colno => orgtable - create links from these columns
|
||||
$indexes = array(); // orgtable => array(column => colno) - primary keys
|
||||
$columns = array(); // orgtable => array(column => ) - not selected columns in primary key
|
||||
@@ -25,12 +24,14 @@ function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
|
||||
for ($j=0; $j < count($row); $j++) {
|
||||
$field = $result->fetch_field();
|
||||
$name = $field->name;
|
||||
$orgtable = $field->orgtable;
|
||||
$orgname = $field->orgname;
|
||||
$return[$field->table] = $orgtable;
|
||||
$orgtable = (isset($field->orgtable) ? $field->orgtable : "");
|
||||
$orgname = (isset($field->orgname) ? $field->orgname : $name);
|
||||
if ($orgtables && JUSH == "sql") { // MySQL EXPLAIN
|
||||
$links[$j] = ($name == "table" ? "table=" : ($name == "possible_keys" ? "indexes=" : null));
|
||||
} elseif ($orgtable != "") {
|
||||
if (isset($field->table)) {
|
||||
$return[$field->table] = $orgtable;
|
||||
}
|
||||
if (!isset($indexes[$orgtable])) {
|
||||
// find primary key in each table
|
||||
$indexes[$orgtable] = array();
|
||||
@@ -99,10 +100,9 @@ function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
|
||||
}
|
||||
|
||||
/** Get referencable tables with single column primary key except self
|
||||
* @param string
|
||||
* @return array [$table_name => $field]
|
||||
* @return array<string, Field> [$table_name => $field]
|
||||
*/
|
||||
function referencable_primary($self) {
|
||||
function referencable_primary(string $self): array {
|
||||
$return = array(); // table_name => field
|
||||
foreach (table_status('', true) as $table_name => $table) {
|
||||
if ($table_name != $self && fk_support($table)) {
|
||||
@@ -121,13 +121,9 @@ function referencable_primary($self) {
|
||||
}
|
||||
|
||||
/** Print SQL <textarea> tag
|
||||
* @param string
|
||||
* @param string or array in which case [0] of every element is used
|
||||
* @param int
|
||||
* @param int
|
||||
* @return null
|
||||
* @param string|list<array{string}> $value
|
||||
*/
|
||||
function textarea($name, $value, $rows = 10, $cols = 80) {
|
||||
function textarea(string $name, $value, int $rows = 10, int $cols = 80): void {
|
||||
echo "<textarea name='" . h($name) . "' rows='$rows' cols='$cols' class='sqlarea jush-" . JUSH . "' spellcheck='false' wrap='off'>";
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $val) { // not implode() to save memory
|
||||
@@ -140,14 +136,9 @@ function textarea($name, $value, $rows = 10, $cols = 80) {
|
||||
}
|
||||
|
||||
/** Generate HTML <select> or <input> if $options are empty
|
||||
* @param string
|
||||
* @param array
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @return string
|
||||
* @param string[] $options
|
||||
*/
|
||||
function select_input($attrs, $options, $value = "", $onchange = "", $placeholder = "") {
|
||||
function select_input(string $attrs, array $options, ?string $value = "", string $onchange = "", string $placeholder = ""): string {
|
||||
$tag = ($options ? "select" : "input");
|
||||
return "<$tag$attrs" . ($options
|
||||
? "><option value=''>$placeholder" . optionlist($options, $value, true) . "</select>"
|
||||
@@ -156,11 +147,10 @@ function select_input($attrs, $options, $value = "", $onchange = "", $placeholde
|
||||
}
|
||||
|
||||
/** Print one row in JSON object
|
||||
* @param string or "" to close the object
|
||||
* @param string
|
||||
* @return null
|
||||
* @param string $key or "" to close the object
|
||||
* @param string|int $val
|
||||
*/
|
||||
function json_row($key, $val = null) {
|
||||
function json_row(string $key, $val = null): void {
|
||||
static $first = true;
|
||||
if ($first) {
|
||||
echo "{";
|
||||
@@ -175,21 +165,18 @@ function json_row($key, $val = null) {
|
||||
}
|
||||
|
||||
/** Print table columns for type edit
|
||||
* @param string
|
||||
* @param array
|
||||
* @param array
|
||||
* @param array returned by referencable_primary()
|
||||
* @param array extra types to prepend
|
||||
* @return null
|
||||
* @param Field $field
|
||||
* @param list<string> $collations
|
||||
* @param string[] $foreign_keys
|
||||
* @param list<string> $extra_types extra types to prepend
|
||||
*/
|
||||
function edit_type($key, $field, $collations, $foreign_keys = array(), $extra_types = array()) {
|
||||
global $driver;
|
||||
function edit_type(string $key, array $field, array $collations, array $foreign_keys = array(), array $extra_types = array()): void {
|
||||
$type = $field["type"];
|
||||
echo "<td><select name='" . h($key) . "[type]' class='type' aria-labelledby='label-type'>";
|
||||
if ($type && !array_key_exists($type, $driver->types()) && !isset($foreign_keys[$type]) && !in_array($type, $extra_types)) {
|
||||
if ($type && !array_key_exists($type, driver()->types()) && !isset($foreign_keys[$type]) && !in_array($type, $extra_types)) {
|
||||
$extra_types[] = $type;
|
||||
}
|
||||
$structured_types = $driver->structuredTypes();
|
||||
$structured_types = driver()->structuredTypes();
|
||||
if ($foreign_keys) {
|
||||
$structured_types[lang('Foreign keys')] = $foreign_keys;
|
||||
}
|
||||
@@ -203,40 +190,20 @@ function edit_type($key, $field, $collations, $foreign_keys = array(), $extra_ty
|
||||
? "<input list='collations' name='" . h($key) . "[collation]'" . (preg_match('~(char|text|enum|set)$~', $type) ? "" : " class='hidden'") . " value='" . h($field["collation"]) . "' placeholder='(" . lang('collation') . ")'>"
|
||||
: ''
|
||||
);
|
||||
echo ($driver->unsigned ? "<select name='" . h($key) . "[unsigned]'" . (!$type || preg_match(number_type(), $type) ? "" : " class='hidden'") . '><option>' . optionlist($driver->unsigned, $field["unsigned"]) . '</select>' : '');
|
||||
echo (driver()->unsigned ? "<select name='" . h($key) . "[unsigned]'" . (!$type || preg_match(number_type(), $type) ? "" : " class='hidden'") . '><option>' . optionlist(driver()->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("|", $driver->onActions), $field["on_delete"]) . "</select> "
|
||||
? "<select name='" . h($key) . "[on_delete]'" . (preg_match("~`~", $type) ? "" : " class='hidden'") . "><option value=''>(" . lang('ON DELETE') . ")" . optionlist(explode("|", driver()->onActions), $field["on_delete"]) . "</select> "
|
||||
: " " // space for IE
|
||||
);
|
||||
}
|
||||
|
||||
/** Get partition info
|
||||
* @param string
|
||||
* @return array
|
||||
*/
|
||||
function get_partitions_info($table) {
|
||||
global $connection;
|
||||
$from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . q(DB) . " AND TABLE_NAME = " . q($table);
|
||||
$result = $connection->query("SELECT PARTITION_METHOD, PARTITION_EXPRESSION, PARTITION_ORDINAL_POSITION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
|
||||
$return = array();
|
||||
list($return["partition_by"], $return["partition"], $return["partitions"]) = $result->fetch_row();
|
||||
$partitions = get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $from AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");
|
||||
$return["partition_names"] = array_keys($partitions);
|
||||
$return["partition_values"] = array_values($partitions);
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Filter length value including enums
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function process_length($length) {
|
||||
global $driver;
|
||||
$enum_length = $driver->enumLength;
|
||||
/** Filter length value including enums */
|
||||
function process_length(?string $length): string {
|
||||
$enum_length = driver()->enumLength;
|
||||
return (preg_match("~^\\s*\\(?\\s*$enum_length(?:\\s*,\\s*$enum_length)*+\\s*\\)?\\s*\$~", $length) && preg_match_all("~$enum_length~", $length, $matches)
|
||||
? "(" . implode(",", $matches[0]) . ")"
|
||||
: preg_replace('~^[0-9].*~', '(\0)', preg_replace('~[^-0-9,+()[\]]~', '', $length))
|
||||
@@ -244,25 +211,22 @@ function process_length($length) {
|
||||
}
|
||||
|
||||
/** Create SQL string from field type
|
||||
* @param array
|
||||
* @param string
|
||||
* @return string
|
||||
* @param FieldType $field
|
||||
*/
|
||||
function process_type($field, $collate = "COLLATE") {
|
||||
global $driver;
|
||||
function process_type(array $field, string $collate = "COLLATE"): string {
|
||||
return " $field[type]"
|
||||
. process_length($field["length"])
|
||||
. (preg_match(number_type(), $field["type"]) && in_array($field["unsigned"], $driver->unsigned) ? " $field[unsigned]" : "")
|
||||
. (preg_match(number_type(), $field["type"]) && in_array($field["unsigned"], driver()->unsigned) ? " $field[unsigned]" : "")
|
||||
. (preg_match('~char|text|enum|set~', $field["type"]) && $field["collation"] ? " $collate " . (JUSH == "mssql" ? $field["collation"] : q($field["collation"])) : "")
|
||||
;
|
||||
}
|
||||
|
||||
/** Create SQL string from field
|
||||
* @param array basic field information
|
||||
* @param array information about field type
|
||||
* @return array ["field", "type", "NULL", "DEFAULT", "ON UPDATE", "COMMENT", "AUTO_INCREMENT"]
|
||||
* @param Field $field basic field information
|
||||
* @param Field $type_field information about field type
|
||||
* @return list<string> ["field", "type", "NULL", "DEFAULT", "ON UPDATE", "COMMENT", "AUTO_INCREMENT"]
|
||||
*/
|
||||
function process_field($field, $type_field) {
|
||||
function process_field(array $field, array $type_field): array {
|
||||
// MariaDB exports CURRENT_TIMESTAMP as a function.
|
||||
if ($field["on_update"]) {
|
||||
$field["on_update"] = str_ireplace("current_timestamp()", "CURRENT_TIMESTAMP", $field["on_update"]);
|
||||
@@ -279,14 +243,12 @@ function process_field($field, $type_field) {
|
||||
}
|
||||
|
||||
/** Get default value clause
|
||||
* @param array
|
||||
* @return string
|
||||
* @param Field $field
|
||||
*/
|
||||
function default_value($field) {
|
||||
global $driver;
|
||||
function default_value(array $field): string {
|
||||
$default = $field["default"];
|
||||
$generated = $field["generated"];
|
||||
return ($default === null ? "" : (in_array($generated, $driver->generated)
|
||||
return ($default === null ? "" : (in_array($generated, driver()->generated)
|
||||
? (JUSH == "mssql" ? " AS ($default)" . ($generated == "VIRTUAL" ? "" : " $generated") . "" : " GENERATED ALWAYS AS ($default) $generated")
|
||||
: " DEFAULT " . (!preg_match('~^GENERATED ~i', $default) && (preg_match('~char|binary|text|json|enum|set~', $field["type"]) || preg_match('~^(?![a-z])~i', $default))
|
||||
? (JUSH == "sql" && preg_match('~text|json~', $field["type"]) ? "(" . q($default) . ")" : q($default)) // MySQL requires () around default value of text column
|
||||
@@ -296,10 +258,9 @@ function default_value($field) {
|
||||
}
|
||||
|
||||
/** Get type class to use in CSS
|
||||
* @param string
|
||||
* @return string class=''
|
||||
* @return string|void class=''
|
||||
*/
|
||||
function type_class($type) {
|
||||
function type_class(string $type) {
|
||||
foreach (
|
||||
array(
|
||||
'char' => 'text',
|
||||
@@ -315,25 +276,21 @@ function type_class($type) {
|
||||
}
|
||||
|
||||
/** Print table interior for fields editing
|
||||
* @param array
|
||||
* @param array
|
||||
* @param string TABLE or PROCEDURE
|
||||
* @param array returned by referencable_primary()
|
||||
* @return null
|
||||
* @param (Field|RoutineField)[] $fields
|
||||
* @param list<string> $collations
|
||||
* @param 'TABLE'|'PROCEDURE' $type
|
||||
* @param string[] $foreign_keys
|
||||
*/
|
||||
function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = array()) {
|
||||
global $driver;
|
||||
function edit_fields(array $fields, array $collations, $type = "TABLE", array $foreign_keys = array()): void {
|
||||
$fields = array_values($fields);
|
||||
$default_class = (($_POST ? $_POST["defaults"] : get_setting("defaults")) ? "" : " class='hidden'");
|
||||
$comment_class = (($_POST ? $_POST["comments"] : get_setting("comments")) ? "" : " class='hidden'");
|
||||
?>
|
||||
<thead><tr>
|
||||
<?php echo ($type == "PROCEDURE" ? "<td>" : ""); ?>
|
||||
<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'); ?>
|
||||
<td><?php
|
||||
echo lang('Options'); // no label required, options have their own label
|
||||
echo "<thead><tr>\n";
|
||||
echo ($type == "PROCEDURE" ? "<td>" : "");
|
||||
echo "<th id='label-name'>" . ($type == "TABLE" ? lang('Column name') : lang('Parameter name'));
|
||||
echo "<td id='label-type'>" . lang('Type') . "<textarea id='enum-edit' rows='4' cols='12' wrap='off' style='display: none;'></textarea>" . script("qs('#enum-edit').onblur = editingLengthBlur;");
|
||||
echo "<td id='label-length'>" . lang('Length');
|
||||
echo "<td>" . lang('Options'); // no label required, options have their own label
|
||||
if ($type == "TABLE") {
|
||||
echo "<td id='label-null'>NULL\n";
|
||||
echo "<td><input type='radio' name='auto_increment_col' value=''><abbr id='label-ai' title='" . lang('Auto Increment') . "'>AI</abbr>";
|
||||
@@ -347,25 +304,25 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
|
||||
echo "<td id='label-default'$default_class>" . lang('Default value');
|
||||
echo (support("comment") ? "<td id='label-comment'$comment_class>" . lang('Comment') : "");
|
||||
}
|
||||
echo "<td><input type='image' class='icon' name='add[" . (support("move_col") ? 0 : count($fields)) . "]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>" . script("row_count = " . count($fields) . ";");
|
||||
echo "<td>" . icon("plus", "add[" . (support("move_col") ? 0 : count($fields)) . "]", "+", lang('Add next'));
|
||||
echo "</thead>\n<tbody>\n";
|
||||
echo script("mixin(qsl('tbody'), {onclick: editingClick, onkeydown: editingKeydown, oninput: editingInput});");
|
||||
foreach ($fields as $i => $field) {
|
||||
$i++;
|
||||
$orig = $field[($_POST ? "orig" : "field")];
|
||||
$display = (isset($_POST["add"][$i-1]) || (isset($field["field"]) && !$_POST["drop_col"][$i])) && (support("drop_col") || $orig == "");
|
||||
$display = (isset($_POST["add"][$i-1]) || (isset($field["field"]) && !idx($_POST["drop_col"], $i))) && (support("drop_col") || $orig == "");
|
||||
echo "<tr" . ($display ? "" : " style='display: none;'") . ">\n";
|
||||
echo ($type == "PROCEDURE" ? "<td>" . html_select("fields[$i][inout]", explode("|", $driver->inout), $field["inout"]) : "") . "<th>";
|
||||
echo ($type == "PROCEDURE" ? "<td>" . html_select("fields[$i][inout]", explode("|", driver()->inout), $field["inout"]) : "") . "<th>";
|
||||
if ($display) {
|
||||
echo "<input name='fields[$i][field]' value='" . h($field["field"]) . "' data-maxlength='64' autocapitalize='off' aria-labelledby='label-name'>\n";
|
||||
echo "<input name='fields[$i][field]' value='" . h($field["field"]) . "' data-maxlength='64' autocapitalize='off' aria-labelledby='label-name'>";
|
||||
}
|
||||
echo "<input type='hidden' name='fields[$i][orig]' value='" . h($orig) . "'>";
|
||||
echo input_hidden("fields[$i][orig]", $orig);
|
||||
edit_type("fields[$i]", $field, $collations, $foreign_keys);
|
||||
if ($type == "TABLE") {
|
||||
echo "<td>" . checkbox("fields[$i][null]", 1, $field["null"], "", "", "block", "label-null");
|
||||
echo "<td><label class='block'><input type='radio' name='auto_increment_col' value='$i'" . ($field["auto_increment"] ? " checked" : "") . " aria-labelledby='label-ai'></label>";
|
||||
echo "<td$default_class>" . ($driver->generated
|
||||
? html_select("fields[$i][generated]", array_merge(array("", "DEFAULT"), $driver->generated), $field["generated"]) . " "
|
||||
echo "<td$default_class>" . (driver()->generated
|
||||
? html_select("fields[$i][generated]", array_merge(array("", "DEFAULT"), driver()->generated), $field["generated"]) . " "
|
||||
: checkbox("fields[$i][generated]", 1, $field["generated"], "", "", "", "label-default")
|
||||
);
|
||||
echo "<input name='fields[$i][default]' value='" . h($field["default"]) . "' aria-labelledby='label-default'>";
|
||||
@@ -373,19 +330,18 @@ function edit_fields($fields, $collations, $type = "TABLE", $foreign_keys = arra
|
||||
}
|
||||
echo "<td>";
|
||||
echo (support("move_col") ?
|
||||
"<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') . "'> "
|
||||
icon("plus", "add[$i]", "+", lang('Add next')) . " "
|
||||
. icon("up", "up[$i]", "↑", lang('Move up')) . " "
|
||||
. icon("down", "down[$i]", "↓", 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') . "'>" : "");
|
||||
echo ($orig == "" || support("drop_col") ? icon("cross", "drop_col[$i]", "x", lang('Remove')) : "");
|
||||
}
|
||||
}
|
||||
|
||||
/** Move fields up and down or add field
|
||||
* @param array
|
||||
* @return bool
|
||||
* @param Field[] $fields
|
||||
*/
|
||||
function process_fields(&$fields) {
|
||||
function process_fields(array &$fields): bool {
|
||||
$offset = 0;
|
||||
if ($_POST["up"]) {
|
||||
$last = 0;
|
||||
@@ -423,21 +379,19 @@ function process_fields(&$fields) {
|
||||
}
|
||||
|
||||
/** Callback used in routine()
|
||||
* @param array
|
||||
* @return string
|
||||
* @param list<string> $match
|
||||
*/
|
||||
function normalize_enum($match) {
|
||||
return "'" . str_replace("'", "''", addcslashes(stripcslashes(str_replace($match[0][0] . $match[0][0], $match[0][0], substr($match[0], 1, -1))), '\\')) . "'";
|
||||
function normalize_enum(array $match): string {
|
||||
$val = $match[0];
|
||||
return "'" . str_replace("'", "''", addcslashes(stripcslashes(str_replace($val[0] . $val[0], $val[0], substr($val, 1, -1))), '\\')) . "'";
|
||||
}
|
||||
|
||||
/** Issue grant or revoke commands
|
||||
* @param string GRANT or REVOKE
|
||||
* @param array
|
||||
* @param string
|
||||
* @param string
|
||||
* @return bool
|
||||
* @param 'GRANT'|'REVOKE' $grant
|
||||
* @param list<string> $privileges
|
||||
* @return Result|bool
|
||||
*/
|
||||
function grant($grant, $privileges, $columns, $on) {
|
||||
function grant(string $grant, array $privileges, ?string $columns, string $on) {
|
||||
if (!$privileges) {
|
||||
return true;
|
||||
}
|
||||
@@ -452,20 +406,14 @@ function grant($grant, $privileges, $columns, $on) {
|
||||
}
|
||||
|
||||
/** Drop old object and create a new one
|
||||
* @param string drop old object query
|
||||
* @param string create new object query
|
||||
* @param string drop new object query
|
||||
* @param string create test object query
|
||||
* @param string drop test object query
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @return null redirect in success
|
||||
* @param string $drop drop old object query
|
||||
* @param string $create create new object query
|
||||
* @param string $drop_created drop new object query
|
||||
* @param string $test create test object query
|
||||
* @param string $drop_test drop test object query
|
||||
* @return void redirect on success
|
||||
*/
|
||||
function drop_create($drop, $create, $drop_created, $test, $drop_test, $location, $message_drop, $message_alter, $message_create, $old_name, $new_name) {
|
||||
function drop_create(string $drop, string $create, string $drop_created, string $test, string $drop_test, string $location, string $message_drop, string $message_alter, string $message_create, string $old_name, string $new_name): void {
|
||||
if ($_POST["drop"]) {
|
||||
query_redirect($drop, $location, $message_drop);
|
||||
} elseif ($old_name == "") {
|
||||
@@ -486,11 +434,9 @@ function drop_create($drop, $create, $drop_created, $test, $drop_test, $location
|
||||
}
|
||||
|
||||
/** Generate SQL query for creating trigger
|
||||
* @param string
|
||||
* @param array result of trigger()
|
||||
* @return string
|
||||
* @param Trigger $row
|
||||
*/
|
||||
function create_trigger($on, $row) {
|
||||
function create_trigger(string $on, array $row): string {
|
||||
$timing_event = " $row[Timing] $row[Event]" . (preg_match('~ OF~', $row["Event"]) ? " $row[Of]" : ""); // SQL injection
|
||||
return "CREATE TRIGGER "
|
||||
. idf_escape($row["Trigger"])
|
||||
@@ -501,18 +447,16 @@ function create_trigger($on, $row) {
|
||||
}
|
||||
|
||||
/** Generate SQL query for creating routine
|
||||
* @param string "PROCEDURE" or "FUNCTION"
|
||||
* @param array result of routine()
|
||||
* @return string
|
||||
* @param 'PROCEDURE'|'FUNCTION' $routine
|
||||
* @param Routine $row
|
||||
*/
|
||||
function create_routine($routine, $row) {
|
||||
global $driver;
|
||||
function create_routine($routine, array $row): string {
|
||||
$set = array();
|
||||
$fields = (array) $row["fields"];
|
||||
ksort($fields); // enforce fields order
|
||||
foreach ($fields as $field) {
|
||||
if ($field["field"] != "") {
|
||||
$set[] = (preg_match("~^($driver->inout)\$~", $field["inout"]) ? "$field[inout] " : "") . idf_escape($field["field"]) . process_type($field, "CHARACTER SET");
|
||||
$set[] = (preg_match("~^(" . driver()->inout . ")\$~", $field["inout"]) ? "$field[inout] " : "") . idf_escape($field["field"]) . process_type($field, "CHARACTER SET");
|
||||
}
|
||||
}
|
||||
$definition = rtrim($row["definition"], ";");
|
||||
@@ -525,20 +469,15 @@ function create_routine($routine, $row) {
|
||||
;
|
||||
}
|
||||
|
||||
/** Remove current user definer from SQL command
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function remove_definer($query) {
|
||||
/** Remove current user definer from SQL command */
|
||||
function remove_definer(string $query): string {
|
||||
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
|
||||
* @param array ["db" => string, "ns" => string, "table" => string, "source" => array, "target" => array, "on_delete" => one of $on_actions, "on_update" => one of $on_actions]
|
||||
* @return string
|
||||
* @param ForeignKey $foreign_key
|
||||
*/
|
||||
function format_foreign_key($foreign_key) {
|
||||
global $driver;
|
||||
function format_foreign_key(array $foreign_key): string {
|
||||
$db = $foreign_key["db"];
|
||||
$ns = $foreign_key["ns"];
|
||||
return " FOREIGN KEY (" . implode(", ", array_map('Adminer\idf_escape', $foreign_key["source"])) . ") REFERENCES "
|
||||
@@ -546,17 +485,16 @@ function format_foreign_key($foreign_key) {
|
||||
. ($ns != "" && $ns != $_GET["ns"] ? idf_escape($ns) . "." : "")
|
||||
. idf_escape($foreign_key["table"])
|
||||
. " (" . implode(", ", array_map('Adminer\idf_escape', $foreign_key["target"])) . ")" //! reuse $name - check in older MySQL versions
|
||||
. (preg_match("~^($driver->onActions)\$~", $foreign_key["on_delete"]) ? " ON DELETE $foreign_key[on_delete]" : "")
|
||||
. (preg_match("~^($driver->onActions)\$~", $foreign_key["on_update"]) ? " ON UPDATE $foreign_key[on_update]" : "")
|
||||
. (preg_match("~^(" . driver()->onActions . ")\$~", $foreign_key["on_delete"]) ? " ON DELETE $foreign_key[on_delete]" : "")
|
||||
. (preg_match("~^(" . driver()->onActions . ")\$~", $foreign_key["on_update"]) ? " ON UPDATE $foreign_key[on_update]" : "")
|
||||
;
|
||||
}
|
||||
|
||||
/** Add a file to TAR
|
||||
* @param string
|
||||
* @param TmpFile
|
||||
* @return null prints the output
|
||||
* @param TmpFile $tmp_file
|
||||
* @return void prints the output
|
||||
*/
|
||||
function tar_file($filename, $tmp_file) {
|
||||
function tar_file(string $filename, $tmp_file): void {
|
||||
$return = pack("a100a8a8a8a12a12", $filename, 644, 0, 0, decoct($tmp_file->size), decoct(time()));
|
||||
$checksum = 8*32; // space for checksum itself
|
||||
for ($i=0; $i < strlen($return); $i++) {
|
||||
@@ -569,11 +507,8 @@ function tar_file($filename, $tmp_file) {
|
||||
echo str_repeat("\0", 511 - ($tmp_file->size + 511) % 512);
|
||||
}
|
||||
|
||||
/** Get INI bytes value
|
||||
* @param string
|
||||
* @return int
|
||||
*/
|
||||
function ini_bytes($ini) {
|
||||
/** Get INI bytes value */
|
||||
function ini_bytes(string $ini): int {
|
||||
$val = ini_get($ini);
|
||||
switch (strtolower(substr($val, -1))) {
|
||||
case 'g':
|
||||
@@ -587,22 +522,21 @@ function ini_bytes($ini) {
|
||||
}
|
||||
|
||||
/** Create link to database documentation
|
||||
* @param array JUSH => $path
|
||||
* @param string HTML code
|
||||
* @param string[] $paths JUSH => $path
|
||||
* @param string $text HTML code
|
||||
* @return string HTML code
|
||||
*/
|
||||
function doc_link($paths, $text = "<sup>?</sup>") {
|
||||
global $connection;
|
||||
$server_info = $connection->server_info;
|
||||
function doc_link(array $paths, string $text = "<sup>?</sup>"): string {
|
||||
$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/$version/en/",
|
||||
'sqlite' => "https://www.sqlite.org/",
|
||||
'pgsql' => "https://www.postgresql.org/docs/$version/",
|
||||
'pgsql' => "https://www.postgresql.org/docs/" . (connection()->flavor == 'cockroach' ? "current" : $version) . "/",
|
||||
'mssql' => "https://learn.microsoft.com/en-us/sql/",
|
||||
'oracle' => "https://www.oracle.com/pls/topic/lookup?ctx=db" . preg_replace('~^.* (\d+)\.(\d+)\.\d+\.\d+\.\d+.*~s', '\1\2', $server_info) . "&id=",
|
||||
);
|
||||
if ($connection->maria) {
|
||||
if (connection()->flavor == 'maria') {
|
||||
$urls['sql'] = "https://mariadb.com/kb/en/";
|
||||
$paths['sql'] = (isset($paths['mariadb']) ? $paths['mariadb'] : str_replace(".html", "/", $paths['sql']));
|
||||
}
|
||||
@@ -610,12 +544,10 @@ function doc_link($paths, $text = "<sup>?</sup>") {
|
||||
}
|
||||
|
||||
/** Compute size of database
|
||||
* @param string
|
||||
* @return string formatted
|
||||
*/
|
||||
function db_size($db) {
|
||||
global $connection;
|
||||
if (!$connection->select_db($db)) {
|
||||
function db_size(string $db): string {
|
||||
if (!connection()->select_db($db)) {
|
||||
return "?";
|
||||
}
|
||||
$return = 0;
|
||||
@@ -625,15 +557,11 @@ function db_size($db) {
|
||||
return format_number($return);
|
||||
}
|
||||
|
||||
/** Print SET NAMES if utf8mb4 might be needed
|
||||
* @param string
|
||||
* @return null
|
||||
*/
|
||||
function set_utf8mb4($create) {
|
||||
global $connection;
|
||||
/** Print SET NAMES if utf8mb4 might be needed */
|
||||
function set_utf8mb4(string $create): void {
|
||||
static $set = false;
|
||||
if (!$set && preg_match('~\butf8mb4~i', $create)) { // possible false positive
|
||||
$set = true;
|
||||
echo "SET NAMES " . charset($connection) . ";\n\n";
|
||||
echo "SET NAMES " . charset(connection()) . ";\n\n";
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
error_reporting(6135); // errors and warnings
|
||||
error_reporting(24575); // all but E_DEPRECATED (overriding mysqli methods without types is deprecated)
|
||||
set_error_handler(function ($errno, $errstr) {
|
||||
return !!preg_match('~^(Trying to access array offset on( value of type)? null|Undefined (array key|property))~', $errstr);
|
||||
}, E_WARNING);
|
||||
// "Undefined array key" mutes $_GET["q"] if there's no ?q=
|
||||
// "Undefined offset" and "Undefined index" are older messages for the same thing
|
||||
return !!preg_match('~^Undefined (array key|offset|index)~', $errstr);
|
||||
}, E_WARNING | E_NOTICE); // warning since PHP 8.0
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,64 +1,55 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
/** Return <script> element
|
||||
* @param string
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function script($source, $trailing = "\n") {
|
||||
/** Return <script> element */
|
||||
function script(string $source, string $trailing = "\n"): string {
|
||||
return "<script" . nonce() . ">$source</script>$trailing";
|
||||
}
|
||||
|
||||
/** Return <script src> element
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function script_src($url) {
|
||||
return "<script src='" . h($url) . "'" . nonce() . "></script>\n";
|
||||
/** Return <script src> element */
|
||||
function script_src(string $url, bool $defer = false): string {
|
||||
return "<script src='" . h($url) . "'" . nonce() . ($defer ? " defer" : "") . "></script>\n";
|
||||
}
|
||||
|
||||
/** Get a nonce="" attribute with CSP nonce
|
||||
* @return string
|
||||
*/
|
||||
function nonce() {
|
||||
/** Get a nonce="" attribute with CSP nonce */
|
||||
function nonce(): string {
|
||||
return ' nonce="' . get_nonce() . '"';
|
||||
}
|
||||
|
||||
/** Get a target="_blank" attribute
|
||||
* @return string
|
||||
/** Get <input type="hidden">
|
||||
* @param string|int $value
|
||||
* @return string HTML
|
||||
*/
|
||||
function target_blank() {
|
||||
function input_hidden(string $name, $value = ""): string {
|
||||
return "<input type='hidden' name='" . h($name) . "' value='" . h($value) . "'>\n";
|
||||
}
|
||||
|
||||
/** Get CSRF <input type="hidden" name="token">
|
||||
* @return string HTML
|
||||
*/
|
||||
function input_token(): string {
|
||||
return input_hidden("token", get_token());
|
||||
}
|
||||
|
||||
/** Get a target="_blank" attribute */
|
||||
function target_blank(): string {
|
||||
return ' target="_blank" rel="noreferrer noopener"';
|
||||
}
|
||||
|
||||
/** Escape for HTML
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function h($string) {
|
||||
/** Escape for HTML */
|
||||
function h(?string $string): string {
|
||||
return str_replace("\0", "�", htmlspecialchars($string, ENT_QUOTES, 'utf-8'));
|
||||
}
|
||||
|
||||
/** Convert \n to <br>
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function nl_br($string) {
|
||||
/** Convert \n to <br> */
|
||||
function nl_br(string $string): string {
|
||||
return str_replace("\n", "<br>", $string); // nl2br() uses XHTML before PHP 5.3
|
||||
}
|
||||
|
||||
/** Generate HTML checkbox
|
||||
* @param string
|
||||
* @param string
|
||||
* @param bool
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @return string
|
||||
* @param string|int $value
|
||||
*/
|
||||
function checkbox($name, $value, $checked, $label = "", $onclick = "", $class = "", $labelled_by = "") {
|
||||
function checkbox(string $name, $value, ?bool $checked, string $label = "", string $onclick = "", string $class = "", string $labelled_by = ""): string {
|
||||
$return = "<input type='checkbox' name='$name' value='" . h($value) . "'"
|
||||
. ($checked ? " checked" : "")
|
||||
. ($labelled_by ? " aria-labelledby='$labelled_by'" : "")
|
||||
@@ -69,12 +60,11 @@ function checkbox($name, $value, $checked, $label = "", $onclick = "", $class =
|
||||
}
|
||||
|
||||
/** Generate list of HTML options
|
||||
* @param array array of strings or arrays (creates optgroup)
|
||||
* @param mixed
|
||||
* @param bool always use array keys for value="", otherwise only string keys are used
|
||||
* @return string
|
||||
* @param string[]|string[][] $options array of strings or arrays (creates optgroup)
|
||||
* @param mixed $selected
|
||||
* @param bool $use_keys always use array keys for value="", otherwise only string keys are used
|
||||
*/
|
||||
function optionlist($options, $selected = null, $use_keys = false) {
|
||||
function optionlist($options, $selected = null, bool $use_keys = false): string {
|
||||
$return = "";
|
||||
foreach ($options as $k => $v) {
|
||||
$opts = array($k => $v);
|
||||
@@ -97,51 +87,44 @@ function optionlist($options, $selected = null, $use_keys = false) {
|
||||
}
|
||||
|
||||
/** Generate HTML <select>
|
||||
* @param string
|
||||
* @param array
|
||||
* @param string
|
||||
* @param string
|
||||
* @param string
|
||||
* @return string
|
||||
* @param string[] $options
|
||||
*/
|
||||
function html_select($name, $options, $value = "", $onchange = "", $labelled_by = "") {
|
||||
function html_select(string $name, array $options, ?string $value = "", string $onchange = "", string $labelled_by = ""): string {
|
||||
static $label = 0;
|
||||
$label_option = "";
|
||||
if (!$labelled_by && substr($options[""], 0, 1) == "(") {
|
||||
$label++;
|
||||
$labelled_by = "label-$label";
|
||||
$label_option = "<option value='' id='$labelled_by'>" . h($options[""]);
|
||||
unset($options[""]);
|
||||
}
|
||||
return "<select name='" . h($name) . "'"
|
||||
. ($labelled_by ? " aria-labelledby='$labelled_by'" : "")
|
||||
. ">" . optionlist($options, $value) . "</select>"
|
||||
. ">" . $label_option . optionlist($options, $value) . "</select>"
|
||||
. ($onchange ? script("qsl('select').onchange = function () { $onchange };", "") : "")
|
||||
;
|
||||
}
|
||||
|
||||
/** Generate HTML radio list
|
||||
* @param string
|
||||
* @param array
|
||||
* @param string
|
||||
* @return string
|
||||
* @param string[] $options
|
||||
*/
|
||||
function html_radios($name, $options, $value = "") {
|
||||
function html_radios(string $name, array $options, ?string $value = "", string $separator = ""): string {
|
||||
$return = "";
|
||||
foreach ($options as $key => $val) {
|
||||
$return .= "<label><input type='radio' name='" . h($name) . "' value='" . h($key) . "'" . ($key == $value ? " checked" : "") . ">" . h($val) . "</label>";
|
||||
$return .= "<label><input type='radio' name='" . h($name) . "' value='" . h($key) . "'" . ($key == $value ? " checked" : "") . ">" . h($val) . "</label>$separator";
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Get onclick confirmation
|
||||
* @param string
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function confirm($message = "", $selector = "qsl('input')") {
|
||||
return script("$selector.onclick = function () { return confirm('" . ($message ? js_escape($message) : lang('Are you sure?')) . "'); };", "");
|
||||
/** Get onclick confirmation */
|
||||
function confirm(string $message = "", string $selector = "qsl('input')"): string {
|
||||
return script("$selector.onclick = () => confirm('" . ($message ? js_escape($message) : lang('Are you sure?')) . "');", "");
|
||||
}
|
||||
|
||||
/** Print header for hidden fieldset (close by </div></fieldset>)
|
||||
* @param string
|
||||
* @param string
|
||||
* @param bool
|
||||
* @return null
|
||||
* @param bool $visible
|
||||
*/
|
||||
function print_fieldset($id, $legend, $visible = false) {
|
||||
function print_fieldset(string $id, string $legend, $visible = false): void {
|
||||
echo "<fieldset><legend>";
|
||||
echo "<a href='#fieldset-$id'>$legend</a>";
|
||||
echo script("qsl('a').onclick = partial(toggle, 'fieldset-$id');", "");
|
||||
@@ -149,29 +132,18 @@ function print_fieldset($id, $legend, $visible = false) {
|
||||
echo "<div id='fieldset-$id'" . ($visible ? "" : " class='hidden'") . ">\n";
|
||||
}
|
||||
|
||||
/** Return class='active' if $bold is true
|
||||
* @param bool
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function bold($bold, $class = "") {
|
||||
/** Return class='active' if $bold is true */
|
||||
function bold(bool $bold, string $class = ""): string {
|
||||
return ($bold ? " class='active $class'" : ($class ? " class='$class'" : ""));
|
||||
}
|
||||
|
||||
/** Escape string for JavaScript apostrophes
|
||||
* @param string
|
||||
* @return string
|
||||
*/
|
||||
function js_escape($string) {
|
||||
/** Escape string for JavaScript apostrophes */
|
||||
function js_escape(string $string): string {
|
||||
return addcslashes($string, "\r\n'\\/"); // slash for <script>
|
||||
}
|
||||
|
||||
/** Generate page number for pagination
|
||||
* @param int
|
||||
* @param int
|
||||
* @return string
|
||||
*/
|
||||
function pagination($page, $current) {
|
||||
/** Generate page number for pagination */
|
||||
function pagination(int $page, ?int $current): string {
|
||||
return " " . ($page == $current
|
||||
? $page + 1
|
||||
: '<a href="' . h(remove_from_uri("page") . ($page ? "&page=$page" . ($_GET["next"] ? "&next=" . urlencode($_GET["next"]) : "") : "")) . '">' . ($page + 1) . "</a>"
|
||||
@@ -179,12 +151,10 @@ function pagination($page, $current) {
|
||||
}
|
||||
|
||||
/** Print hidden fields
|
||||
* @param array
|
||||
* @param array
|
||||
* @param string
|
||||
* @return bool
|
||||
* @param mixed[] $process
|
||||
* @param list<string> $ignore
|
||||
*/
|
||||
function hidden_fields($process, $ignore = array(), $prefix = '') {
|
||||
function hidden_fields(array $process, array $ignore = array(), string $prefix = ''): bool {
|
||||
$return = false;
|
||||
foreach ($process as $key => $val) {
|
||||
if (!in_array($key, $ignore)) {
|
||||
@@ -192,81 +162,72 @@ function hidden_fields($process, $ignore = array(), $prefix = '') {
|
||||
hidden_fields($val, array(), $key);
|
||||
} else {
|
||||
$return = true;
|
||||
echo '<input type="hidden" name="' . h($prefix ? $prefix . "[$key]" : $key) . '" value="' . h($val) . '">';
|
||||
echo input_hidden(($prefix ? $prefix . "[$key]" : $key), $val);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Print hidden fields for GET forms
|
||||
* @return null
|
||||
*/
|
||||
function hidden_fields_get() {
|
||||
echo (sid() ? '<input type="hidden" name="' . session_name() . '" value="' . h(session_id()) . '">' : '');
|
||||
echo (SERVER !== null ? '<input type="hidden" name="' . DRIVER . '" value="' . h(SERVER) . '">' : "");
|
||||
echo '<input type="hidden" name="username" value="' . h($_GET["username"]) . '">';
|
||||
/** Print hidden fields for GET forms */
|
||||
function hidden_fields_get(): void {
|
||||
echo (sid() ? input_hidden(session_name(), session_id()) : '');
|
||||
echo (SERVER !== null ? input_hidden(DRIVER, SERVER) : "");
|
||||
echo input_hidden("username", $_GET["username"]);
|
||||
}
|
||||
|
||||
/** Print enum input field
|
||||
* @param string "radio"|"checkbox"
|
||||
* @param string
|
||||
* @param array
|
||||
* @param mixed string|array
|
||||
* @param string
|
||||
* @return null
|
||||
/** Print enum or set input field
|
||||
* @param 'radio'|'checkbox' $type
|
||||
* @param Field $field
|
||||
* @param mixed $value string|array
|
||||
*/
|
||||
function enum_input($type, $attrs, $field, $value, $empty = null) {
|
||||
global $adminer;
|
||||
function enum_input(string $type, string $attrs, array $field, $value, ?string $empty = null): string {
|
||||
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
|
||||
$return = ($empty !== null ? "<label><input type='$type'$attrs value='$empty'" . ((is_array($value) ? in_array($empty, $value) : $value === $empty) ? " checked" : "") . "><i>" . lang('empty') . "</i></label>" : "");
|
||||
foreach ($matches[1] as $i => $val) {
|
||||
$val = stripcslashes(str_replace("''", "'", $val));
|
||||
$checked = (is_array($value) ? in_array($val, $value) : $value === $val);
|
||||
$return .= " <label><input type='$type'$attrs value='" . h($val) . "'" . ($checked ? ' checked' : '') . '>' . h($adminer->editVal($val, $field)) . '</label>';
|
||||
$return .= " <label><input type='$type'$attrs value='" . h($val) . "'" . ($checked ? ' checked' : '') . '>' . h(adminer()->editVal($val, $field)) . '</label>';
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Print edit input field
|
||||
* @param array one field from fields()
|
||||
* @param mixed
|
||||
* @param string
|
||||
* @param bool
|
||||
* @return null
|
||||
* @param Field|RoutineField $field
|
||||
* @param mixed $value
|
||||
*/
|
||||
function input($field, $value, $function, $autofocus = false) {
|
||||
global $driver, $adminer;
|
||||
function input(array $field, $value, ?string $function, ?bool $autofocus = false): void {
|
||||
$name = h(bracket_escape($field["field"]));
|
||||
echo "<td class='function'>";
|
||||
if (is_array($value) && !$function) {
|
||||
$value = json_encode($value, 128); // 128 - JSON_PRETTY_PRINT available since PHP 5.4
|
||||
$value = json_encode($value, 128 | 64 | 256); // 128 - JSON_PRETTY_PRINT, 64 - JSON_UNESCAPED_SLASHES, 256 - JSON_UNESCAPED_UNICODE available since PHP 5.4
|
||||
$function = "json";
|
||||
}
|
||||
$reset = (JUSH == "mssql" && $field["auto_increment"]);
|
||||
if ($reset && !$_POST["save"]) {
|
||||
$function = null;
|
||||
}
|
||||
$functions = (isset($_GET["select"]) || $reset ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
|
||||
$functions = (isset($_GET["select"]) || $reset ? array("orig" => lang('original')) : array()) + adminer()->editFunctions($field);
|
||||
$disabled = stripos($field["default"], "GENERATED ALWAYS AS ") === 0 ? " disabled=''" : "";
|
||||
$attrs = " name='fields[$name]'$disabled" . ($autofocus ? " autofocus" : "");
|
||||
$enums = $driver->enumLength($field);
|
||||
$enums = driver()->enumLength($field);
|
||||
if ($enums) {
|
||||
$field["type"] = "enum";
|
||||
$field["length"] = $enums;
|
||||
}
|
||||
echo $driver->unconvertFunction($field) . " ";
|
||||
echo driver()->unconvertFunction($field) . " ";
|
||||
$table = $_GET["edit"] ?: $_GET["select"];
|
||||
if ($field["type"] == "enum") {
|
||||
echo h($functions[""]) . "<td>" . $adminer->editInput($_GET["edit"], $field, $attrs, $value);
|
||||
echo h($functions[""]) . "<td>" . adminer()->editInput($table, $field, $attrs, $value);
|
||||
} else {
|
||||
$has_function = (in_array($function, $functions) || isset($functions[$function]));
|
||||
echo (count($functions) > 1
|
||||
? "<select name='function[$name]'$disabled>" . optionlist($functions, $function === null || $has_function ? $function : "") . "</select>"
|
||||
. on_help("getTarget(event).value.replace(/^SQL\$/, '')", 1)
|
||||
. on_help("event.target.value.replace(/^SQL\$/, '')", 1)
|
||||
. script("qsl('select').onchange = functionChange;", "")
|
||||
: h(reset($functions))
|
||||
) . '<td>';
|
||||
$input = $adminer->editInput($_GET["edit"], $field, $attrs, $value); // usage in call is without a table
|
||||
$input = adminer()->editInput($table, $field, $attrs, $value); // usage in call is without a table
|
||||
if ($input != "") {
|
||||
echo $input;
|
||||
} elseif (preg_match('~bool~', $field["type"])) {
|
||||
@@ -277,23 +238,23 @@ function input($field, $value, $function, $autofocus = false) {
|
||||
foreach ($matches[1] as $i => $val) {
|
||||
$val = stripcslashes(str_replace("''", "'", $val));
|
||||
$checked = in_array($val, explode(",", $value), true);
|
||||
echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . h($val) . "'" . ($checked ? ' checked' : '') . ">" . h($adminer->editVal($val, $field)) . '</label>';
|
||||
echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . h($val) . "'" . ($checked ? ' checked' : '') . ">" . h(adminer()->editVal($val, $field)) . '</label>';
|
||||
}
|
||||
} elseif (preg_match('~blob|bytea|raw|file~', $field["type"]) && ini_bool("file_uploads")) {
|
||||
echo "<input type='file' name='fields-$name'>";
|
||||
} elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) {
|
||||
echo "<textarea$attrs cols='50' rows='12' class='jush-js'>" . h($value) . '</textarea>';
|
||||
} elseif (($text = preg_match('~text|lob|memo~i', $field["type"])) || preg_match("~\n~", $value)) {
|
||||
if ($text && JUSH != "sqlite") {
|
||||
$attrs .= " cols='50' rows='12'";
|
||||
} else {
|
||||
$rows = min(12, substr_count($value, "\n") + 1);
|
||||
$attrs .= " cols='30' rows='$rows'" . ($rows == 1 ? " style='height: 1.2em;'" : ""); // 1.2em - line-height
|
||||
$attrs .= " cols='30' rows='$rows'";
|
||||
}
|
||||
echo "<textarea$attrs>" . h($value) . '</textarea>';
|
||||
} elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) {
|
||||
echo "<textarea$attrs cols='50' rows='12' class='jush-js'>" . h($value) . '</textarea>';
|
||||
} else {
|
||||
// int(3) is only a display hint
|
||||
$types = $driver->types();
|
||||
$types = driver()->types();
|
||||
$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)
|
||||
@@ -305,11 +266,11 @@ function input($field, $value, $function, $autofocus = false) {
|
||||
echo "<input"
|
||||
. ((!$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'" : "")
|
||||
. (preg_match('~char|binary~', $field["type"]) && $maxlength > 20 ? " size='" . ($maxlength > 99 ? 60 : 40) . "'" : "")
|
||||
. "$attrs>"
|
||||
;
|
||||
}
|
||||
echo $adminer->editHint($_GET["edit"], $field, $value);
|
||||
echo adminer()->editHint($table, $field, $value);
|
||||
// skip 'original'
|
||||
$first = 0;
|
||||
foreach ($functions as $key => $val) {
|
||||
@@ -318,25 +279,24 @@ function input($field, $value, $function, $autofocus = false) {
|
||||
}
|
||||
$first++;
|
||||
}
|
||||
if ($first) {
|
||||
echo script("mixin(qsl('td'), {onchange: partial(skipOriginal, $first), oninput: function () { this.onchange(); }});");
|
||||
if ($first && count($functions) > 1) {
|
||||
echo script("qsl('td').oninput = partial(skipOriginal, $first);");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Process edit input field
|
||||
* @param one field from fields()
|
||||
* @return string or false to leave the original value
|
||||
* @param Field|RoutineField $field
|
||||
* @return mixed false to leave the original value
|
||||
*/
|
||||
function process_input($field) {
|
||||
global $adminer, $driver;
|
||||
function process_input(array $field) {
|
||||
if (stripos($field["default"], "GENERATED ALWAYS AS ") === 0) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
$idf = bracket_escape($field["field"]);
|
||||
$function = $_POST["function"][$idf];
|
||||
$function = idx($_POST["function"], $idf);
|
||||
$value = $_POST["fields"][$idf];
|
||||
if ($field["type"] == "enum" || $driver->enumLength($field)) {
|
||||
if ($field["type"] == "enum" || driver()->enumLength($field)) {
|
||||
if ($value == -1) {
|
||||
return false;
|
||||
}
|
||||
@@ -369,24 +329,22 @@ function process_input($field) {
|
||||
if (!is_string($file)) {
|
||||
return false; //! report errors
|
||||
}
|
||||
return $driver->quoteBinary($file);
|
||||
return driver()->quoteBinary($file);
|
||||
}
|
||||
return $adminer->processInput($field, $value, $function);
|
||||
return adminer()->processInput($field, $value, $function);
|
||||
}
|
||||
|
||||
/** Print results of search in all tables
|
||||
* @uses $_GET["where"][0]
|
||||
* @uses $_POST["tables"]
|
||||
* @return null
|
||||
*/
|
||||
function search_tables() {
|
||||
global $adminer, $connection;
|
||||
function search_tables(): void {
|
||||
$_GET["where"][0]["val"] = $_POST["query"];
|
||||
$sep = "<ul>\n";
|
||||
foreach (table_status('', true) as $table => $table_status) {
|
||||
$name = $adminer->tableName($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));
|
||||
$result = connection()->query("SELECT" . limit("1 FROM " . table($table), " WHERE " . implode(" AND ", adminer()->selectSearchProcess(fields($table), array())), 1));
|
||||
if (!$result || $result->fetch_row()) {
|
||||
$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";
|
||||
@@ -398,31 +356,26 @@ function search_tables() {
|
||||
}
|
||||
|
||||
/** Return events to display help on mouse over
|
||||
* @param string JS expression
|
||||
* @param bool JS expression
|
||||
* @return string
|
||||
* @param string $command JS expression
|
||||
* @param int $side 0 top, 1 left
|
||||
*/
|
||||
function on_help($command, $side = 0) {
|
||||
function on_help(string $command, int $side = 0): string {
|
||||
return script("mixin(qsl('select, input'), {onmouseover: function (event) { helpMouseover.call(this, event, $command, $side) }, onmouseout: helpMouseout});", "");
|
||||
}
|
||||
|
||||
/** Print edit data form
|
||||
* @param string
|
||||
* @param array
|
||||
* @param mixed
|
||||
* @param bool
|
||||
* @return null
|
||||
* @param Field[] $fields
|
||||
* @param mixed $row
|
||||
*/
|
||||
function edit_form($table, $fields, $row, $update) {
|
||||
global $adminer, $token, $error;
|
||||
$table_name = $adminer->tableName(table_status1($table, true));
|
||||
function edit_form(string $table, array $fields, $row, ?bool $update, string $error = ''): void {
|
||||
$table_name = adminer()->tableName(table_status1($table, true));
|
||||
page_header(
|
||||
($update ? lang('Edit') : lang('Insert')),
|
||||
$error,
|
||||
array("select" => array($table, $table_name)),
|
||||
$table_name
|
||||
);
|
||||
$adminer->editRowPrint($table, $fields, $row, $update);
|
||||
adminer()->editRowPrint($table, $fields, $row, $update);
|
||||
if ($row === false) {
|
||||
echo "<p class='error'>" . lang('No rows.') . "\n";
|
||||
return;
|
||||
@@ -434,8 +387,8 @@ function edit_form($table, $fields, $row, $update) {
|
||||
echo "<table class='layout'>" . script("qsl('table').onkeydown = editingKeydown;");
|
||||
$autofocus = !$_POST;
|
||||
foreach ($fields as $name => $field) {
|
||||
echo "<tr><th>" . $adminer->fieldName($field);
|
||||
$default = $_GET["set"][bracket_escape($name)];
|
||||
echo "<tr><th>" . adminer()->fieldName($field);
|
||||
$default = idx($_GET["set"], bracket_escape($name));
|
||||
if ($default === null) {
|
||||
$default = $field["default"];
|
||||
if ($field["type"] == "bit" && preg_match("~^b'([01]*)'\$~", $default, $regs)) {
|
||||
@@ -456,10 +409,10 @@ function edit_form($table, $fields, $row, $update) {
|
||||
)
|
||||
);
|
||||
if (!$_POST["save"] && is_string($value)) {
|
||||
$value = $adminer->editVal($value, $field);
|
||||
$value = adminer()->editVal($value, $field);
|
||||
}
|
||||
$function = ($_POST["save"]
|
||||
? (string) $_POST["function"][$name]
|
||||
? idx($_POST["function"], $name, "")
|
||||
: ($update && preg_match('~^CURRENT_TIMESTAMP~i', $field["on_update"])
|
||||
? "now"
|
||||
: ($value === false ? null : ($value !== null ? '' : 'NULL'))
|
||||
@@ -485,11 +438,11 @@ function edit_form($table, $fields, $row, $update) {
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
if (!support("table")) {
|
||||
if (!support("table") && !fields($table)) {
|
||||
echo "<tr>"
|
||||
. "<th><input name='field_keys[]'>"
|
||||
. script("qsl('input').oninput = fieldChange;")
|
||||
. "<td class='function'>" . html_select("field_funs[]", $adminer->editFunctions(array("null" => isset($_GET["select"]))))
|
||||
. "<td class='function'>" . html_select("field_funs[]", adminer()->editFunctions(array("null" => isset($_GET["select"]))))
|
||||
. "<td><input name='field_vals[]'>"
|
||||
. "\n"
|
||||
;
|
||||
@@ -511,10 +464,23 @@ function edit_form($table, $fields, $row, $update) {
|
||||
if (isset($_GET["select"])) {
|
||||
hidden_fields(array("check" => (array) $_POST["check"], "clone" => $_POST["clone"], "all" => $_POST["all"]));
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="referer" value="<?php echo h(isset($_POST["referer"]) ? $_POST["referer"] : $_SERVER["HTTP_REFERER"]); ?>">
|
||||
<input type="hidden" name="save" value="1">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
<?php
|
||||
echo input_hidden("referer", (isset($_POST["referer"]) ? $_POST["referer"] : $_SERVER["HTTP_REFERER"]));
|
||||
echo input_hidden("save", 1);
|
||||
echo input_token();
|
||||
echo "</form>\n";
|
||||
}
|
||||
|
||||
/** Shorten UTF-8 string
|
||||
* @return string escaped string with appended ...
|
||||
*/
|
||||
function shorten_utf8(string $string, int $length = 80, string $suffix = ""): string {
|
||||
if (!preg_match("(^(" . repeat_pattern("[\t\r\n -\x{10FFFF}]", $length) . ")($)?)u", $string, $match)) { // ~s causes trash in $match[2] under some PHP versions, (.|\n) is slow
|
||||
preg_match("(^(" . repeat_pattern("[\t\r\n -~]", $length) . ")($)?)", $string, $match);
|
||||
}
|
||||
return h($match[1]) . $suffix . (isset($match[2]) ? "" : "<i>…</i>");
|
||||
}
|
||||
|
||||
/** Get button with icon */
|
||||
function icon(string $icon, string $name, string $html, string $title): string {
|
||||
return "<button type='submit' name='$name' title='" . h($title) . "' class='icon icon-$icon'><span>$html</span></button>";
|
||||
}
|
||||
|
@@ -1,86 +1,37 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
// not used in a single language version
|
||||
|
||||
$langs = array(
|
||||
'en' => 'English', // Jakub Vrána - https://www.vrana.cz
|
||||
'ar' => 'العربية', // Y.M Amine - Algeria - nbr7@live.fr
|
||||
'bg' => 'Български', // Deyan Delchev
|
||||
'bn' => 'বাংলা', // Dipak Kumar - dipak.ndc@gmail.com, Hossain Ahmed Saiman - hossain.ahmed@altscope.com
|
||||
'bs' => 'Bosanski', // Emir Kurtovic
|
||||
'ca' => 'Català', // Joan Llosas
|
||||
'cs' => 'Čeština', // Jakub Vrána - https://www.vrana.cz
|
||||
'da' => 'Dansk', // Jarne W. Beutnagel - jarne@beutnagel.dk
|
||||
'de' => 'Deutsch', // Klemens Häckel - http://clickdimension.wordpress.com
|
||||
'el' => 'Ελληνικά', // Dimitrios T. Tanis - jtanis@tanisfood.gr
|
||||
'es' => 'Español', // Klemens Häckel - http://clickdimension.wordpress.com
|
||||
'et' => 'Eesti', // Priit Kallas
|
||||
'fa' => 'فارسی', // mojtaba barghbani - Iran - mbarghbani@gmail.com, Nima Amini - http://nimlog.com
|
||||
'fi' => 'Suomi', // Finnish - Kari Eveli - http://www.lexitec.fi/
|
||||
'fr' => 'Français', // Francis Gagné, Aurélien Royer
|
||||
'gl' => 'Galego', // Eduardo Penabad Ramos
|
||||
'he' => 'עברית', // Binyamin Yawitz - https://stuff-group.com/
|
||||
'hu' => 'Magyar', // Borsos Szilárd (Borsosfi) - http://www.borsosfi.hu, info@borsosfi.hu
|
||||
'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
|
||||
'lv' => 'Latviešu', // Kristaps Lediņš - https://krysits.com
|
||||
'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/
|
||||
'pt' => 'Português', // André Dias
|
||||
'pt-br' => 'Português (Brazil)', // Gian Live - gian@live.com, Davi Alexandre davi@davialexandre.com.br, RobertoPC - http://www.robertopc.com.br
|
||||
'ro' => 'Limba Română', // .nick .messing - dot.nick.dot.messing@gmail.com
|
||||
'ru' => 'Русский', // Maksim Izmaylov; Andre Polykanine - https://github.com/Oire/
|
||||
'sk' => 'Slovenčina', // Ivan Suchy - http://www.ivansuchy.com, Juraj Krivda - http://www.jstudio.cz
|
||||
'sl' => 'Slovenski', // Matej Ferlan - www.itdinamik.com, matej.ferlan@itdinamik.com
|
||||
'sr' => 'Српски', // Nikola Radovanović - cobisimo@gmail.com
|
||||
'sv' => 'Svenska', // rasmusolle - https://github.com/rasmusolle
|
||||
'ta' => 'தமிழ்', // G. Sampath Kumar, Chennai, India, sampathkumar11@gmail.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
|
||||
'zh' => '简体中文', // Mr. Lodar, vea - urn2.net - vea.urn2@gmail.com
|
||||
'zh-tw' => '繁體中文', // http://tzangms.com
|
||||
);
|
||||
|
||||
/** Get current language
|
||||
* @return string
|
||||
/** Translate string
|
||||
* @param literal-string $idf
|
||||
* @param float|string $number
|
||||
*/
|
||||
function get_lang() {
|
||||
global $LANG;
|
||||
return $LANG;
|
||||
function lang(string $idf, $number = null): string {
|
||||
$args = func_get_args();
|
||||
// this is matched by compile.php
|
||||
$args[0] = Lang::$translations[$idf] ?: $idf;
|
||||
return call_user_func_array('Adminer\lang_format', $args);
|
||||
}
|
||||
|
||||
/** Translate string
|
||||
* @param string
|
||||
* @param int
|
||||
* @return string
|
||||
/** Format translation, usable also by plugins
|
||||
* @param string|list<string> $translation
|
||||
* @param float|string $number
|
||||
*/
|
||||
// this is matched by compile.php
|
||||
function lang($idf, $number = null) {
|
||||
global $LANG, $translations;
|
||||
$translation = ($translations[$idf] ?: $idf);
|
||||
function lang_format($translation, $number = null): string {
|
||||
if (is_array($translation)) {
|
||||
// this is matched by compile.php
|
||||
$pos = ($number == 1 ? 0
|
||||
: ($LANG == 'cs' || $LANG == 'sk' ? ($number && $number < 5 ? 1 : 2) // different forms for 1, 2-4, other
|
||||
: ($LANG == 'fr' ? (!$number ? 0 : 1) // different forms for 0-1, other
|
||||
: ($LANG == 'pl' ? ($number % 10 > 1 && $number % 10 < 5 && $number / 10 % 10 != 1 ? 1 : 2) // different forms for 1, 2-4 except 12-14, other
|
||||
: ($LANG == 'sl' ? ($number % 100 == 1 ? 0 : ($number % 100 == 2 ? 1 : ($number % 100 == 3 || $number % 100 == 4 ? 2 : 3))) // different forms for 1, 2, 3-4, other
|
||||
: ($LANG == 'lt' ? ($number % 10 == 1 && $number % 100 != 11 ? 0 : ($number % 10 > 1 && $number / 10 % 10 != 1 ? 1 : 2)) // different forms for 1, 12-19, other
|
||||
: ($LANG == 'lv' ? ($number % 10 == 1 && $number % 100 != 11 ? 0 : ($number ? 1 : 2)) // different forms for 1 except 11, other, 0
|
||||
: (in_array($LANG, array('bs', 'ru', 'sr', 'uk')) ? ($number % 10 == 1 && $number % 100 != 11 ? 0 : ($number % 10 > 1 && $number % 10 < 5 && $number / 10 % 10 != 1 ? 1 : 2)) // different forms for 1 except 11, 2-4 except 12-14, other
|
||||
: (LANG == 'cs' || LANG == 'sk' ? ($number && $number < 5 ? 1 : 2) // different forms for 1, 2-4, other
|
||||
: (LANG == 'fr' ? (!$number ? 0 : 1) // different forms for 0-1, other
|
||||
: (LANG == 'pl' ? ($number % 10 > 1 && $number % 10 < 5 && $number / 10 % 10 != 1 ? 1 : 2) // different forms for 1, 2-4 except 12-14, other
|
||||
: (LANG == 'sl' ? ($number % 100 == 1 ? 0 : ($number % 100 == 2 ? 1 : ($number % 100 == 3 || $number % 100 == 4 ? 2 : 3))) // different forms for 1, 2, 3-4, other
|
||||
: (LANG == 'lt' ? ($number % 10 == 1 && $number % 100 != 11 ? 0 : ($number % 10 > 1 && $number / 10 % 10 != 1 ? 1 : 2)) // different forms for 1, 12-19, other
|
||||
: (LANG == 'lv' ? ($number % 10 == 1 && $number % 100 != 11 ? 0 : ($number ? 1 : 2)) // different forms for 1 except 11, other, 0
|
||||
: (in_array(LANG, array('bs', 'ru', 'sr', 'uk')) ? ($number % 10 == 1 && $number % 100 != 11 ? 0 : ($number % 10 > 1 && $number % 10 < 5 && $number / 10 % 10 != 1 ? 1 : 2)) // different forms for 1 except 11, 2-4 except 12-14, other
|
||||
: 1)))))))) // different forms for 1, other
|
||||
; // http://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html
|
||||
$translation = $translation[$pos];
|
||||
}
|
||||
$translation = str_replace("'", '’', $translation); // translations can contain HTML or be used in optionlist (we couldn't escape them here) but they can also be used e.g. in title='' //! escape plaintext translations
|
||||
$args = func_get_args();
|
||||
array_shift($args);
|
||||
$format = str_replace("%d", "%s", $translation);
|
||||
@@ -90,27 +41,82 @@ function lang($idf, $number = null) {
|
||||
return vsprintf($format, $args);
|
||||
}
|
||||
|
||||
function switch_lang() {
|
||||
global $LANG, $langs;
|
||||
// this is matched by compile.php
|
||||
// not used in a single language version from here
|
||||
|
||||
/** Get available languages
|
||||
* @return string[]
|
||||
*/
|
||||
function langs(): array {
|
||||
return array(
|
||||
'en' => 'English', // Jakub Vrána - https://www.vrana.cz
|
||||
'ar' => 'العربية', // Y.M Amine - Algeria - nbr7@live.fr
|
||||
'bg' => 'Български', // Deyan Delchev
|
||||
'bn' => 'বাংলা', // Dipak Kumar - dipak.ndc@gmail.com, Hossain Ahmed Saiman - hossain.ahmed@altscope.com
|
||||
'bs' => 'Bosanski', // Emir Kurtovic
|
||||
'ca' => 'Català', // Joan Llosas
|
||||
'cs' => 'Čeština', // Jakub Vrána - https://www.vrana.cz
|
||||
'da' => 'Dansk', // Jarne W. Beutnagel - jarne@beutnagel.dk
|
||||
'de' => 'Deutsch', // Klemens Häckel - http://clickdimension.wordpress.com
|
||||
'el' => 'Ελληνικά', // Dimitrios T. Tanis - jtanis@tanisfood.gr
|
||||
'es' => 'Español', // Klemens Häckel - http://clickdimension.wordpress.com
|
||||
'et' => 'Eesti', // Priit Kallas
|
||||
'fa' => 'فارسی', // mojtaba barghbani - Iran - mbarghbani@gmail.com, Nima Amini - http://nimlog.com
|
||||
'fi' => 'Suomi', // Finnish - Kari Eveli - http://www.lexitec.fi/
|
||||
'fr' => 'Français', // Francis Gagné, Aurélien Royer
|
||||
'gl' => 'Galego', // Eduardo Penabad Ramos
|
||||
'he' => 'עברית', // Binyamin Yawitz - https://stuff-group.com/
|
||||
'hi' => 'हिन्दी', // Joshi yogesh
|
||||
'hu' => 'Magyar', // Borsos Szilárd (Borsosfi) - http://www.borsosfi.hu, info@borsosfi.hu
|
||||
'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
|
||||
'lv' => 'Latviešu', // Kristaps Lediņš - https://krysits.com
|
||||
'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/
|
||||
'pt' => 'Português', // André Dias
|
||||
'pt-br' => 'Português (Brazil)', // Gian Live - gian@live.com, Davi Alexandre davi@davialexandre.com.br, RobertoPC - http://www.robertopc.com.br
|
||||
'ro' => 'Limba Română', // .nick .messing - dot.nick.dot.messing@gmail.com
|
||||
'ru' => 'Русский', // Maksim Izmaylov; Andre Polykanine - https://github.com/Oire/
|
||||
'sk' => 'Slovenčina', // Ivan Suchy - http://www.ivansuchy.com, Juraj Krivda - http://www.jstudio.cz
|
||||
'sl' => 'Slovenski', // Matej Ferlan - www.itdinamik.com, matej.ferlan@itdinamik.com
|
||||
'sr' => 'Српски', // Nikola Radovanović - cobisimo@gmail.com
|
||||
'sv' => 'Svenska', // rasmusolle - https://github.com/rasmusolle
|
||||
'ta' => 'தமிழ்', // G. Sampath Kumar, Chennai, India, sampathkumar11@gmail.com
|
||||
'th' => 'ภาษาไทย', // Panya Saraphi, elect.tu@gmail.com - http://www.opencart2u.com/
|
||||
'tr' => 'Türkçe', // Bilgehan Korkmaz - turktron.com
|
||||
'uk' => 'Українська', // Valerii Kryzhov
|
||||
'uz' => 'Oʻzbekcha', // Junaydullaev Inoyatullokhon - https://av.uz/
|
||||
'vi' => 'Tiếng Việt', // Giang Manh @ manhgd google mail
|
||||
'zh' => '简体中文', // Mr. Lodar, vea - urn2.net - vea.urn2@gmail.com
|
||||
'zh-tw' => '繁體中文', // http://tzangms.com
|
||||
);
|
||||
}
|
||||
|
||||
function switch_lang(): void {
|
||||
echo "<form action='' method='post'>\n<div id='lang'>";
|
||||
echo lang('Language') . ": " . html_select("lang", $langs, $LANG, "this.form.submit();");
|
||||
echo "<label>" . lang('Language') . ": " . html_select("lang", langs(), LANG, "this.form.submit();") . "</label>";
|
||||
echo " <input type='submit' value='" . lang('Use') . "' class='hidden'>\n";
|
||||
echo "<input type='hidden' name='token' value='" . get_token() . "'>\n"; // $token may be empty in auth.inc.php
|
||||
echo input_token();
|
||||
echo "</div>\n</form>\n";
|
||||
}
|
||||
|
||||
if (isset($_POST["lang"]) && verify_token()) { // $error not yet available
|
||||
cookie("adminer_lang", $_POST["lang"]);
|
||||
$_SESSION["lang"] = $_POST["lang"]; // cookies may be disabled
|
||||
$_SESSION["translations"] = array(); // used in compiled version
|
||||
redirect(remove_from_uri());
|
||||
}
|
||||
|
||||
$LANG = "en";
|
||||
if (isset($langs[$_COOKIE["adminer_lang"]])) {
|
||||
if (idx(langs(), $_COOKIE["adminer_lang"])) {
|
||||
cookie("adminer_lang", $_COOKIE["adminer_lang"]);
|
||||
$LANG = $_COOKIE["adminer_lang"];
|
||||
} elseif (isset($langs[$_SESSION["lang"]])) {
|
||||
} elseif (idx(langs(), $_SESSION["lang"])) {
|
||||
$LANG = $_SESSION["lang"];
|
||||
} else {
|
||||
$accept_language = array();
|
||||
@@ -120,14 +126,20 @@ if (isset($langs[$_COOKIE["adminer_lang"]])) {
|
||||
}
|
||||
arsort($accept_language);
|
||||
foreach ($accept_language as $key => $q) {
|
||||
if (isset($langs[$key])) {
|
||||
if (idx(langs(), $key)) {
|
||||
$LANG = $key;
|
||||
break;
|
||||
}
|
||||
$key = preg_replace('~-.*~', '', $key);
|
||||
if (!isset($accept_language[$key]) && isset($langs[$key])) {
|
||||
if (!isset($accept_language[$key]) && idx(langs(), $key)) {
|
||||
$LANG = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
define('Adminer\LANG', $LANG);
|
||||
|
||||
class Lang {
|
||||
/** @var array<literal-string, string|list<string>> */ static array $translations;
|
||||
}
|
||||
|
@@ -3,29 +3,31 @@ namespace Adminer;
|
||||
|
||||
// PDO can be used in several database drivers
|
||||
if (extension_loaded('pdo')) {
|
||||
abstract class PdoDb {
|
||||
public $server_info, $affected_rows, $errno, $error;
|
||||
protected $pdo;
|
||||
private $result;
|
||||
abstract class PdoDb extends SqlDb {
|
||||
protected \PDO $pdo;
|
||||
|
||||
function dsn($dsn, $username, $password, $options = array()) {
|
||||
/** Connect to server using DSN
|
||||
* @param mixed[] $options
|
||||
* @return string error message
|
||||
*/
|
||||
function dsn(string $dsn, string $username, string $password, array $options = array()): string {
|
||||
$options[\PDO::ATTR_ERRMODE] = \PDO::ERRMODE_SILENT;
|
||||
$options[\PDO::ATTR_STATEMENT_CLASS] = array('Adminer\PdoDbStatement');
|
||||
$options[\PDO::ATTR_STATEMENT_CLASS] = array('Adminer\PdoResult');
|
||||
try {
|
||||
$this->pdo = new \PDO($dsn, $username, $password, $options);
|
||||
} catch (Exception $ex) {
|
||||
auth_error(h($ex->getMessage()));
|
||||
} catch (\Exception $ex) {
|
||||
return $ex->getMessage();
|
||||
}
|
||||
$this->server_info = @$this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION);
|
||||
return '';
|
||||
}
|
||||
|
||||
abstract function select_db($database);
|
||||
|
||||
function quote($string) {
|
||||
function quote(string $string): string {
|
||||
return $this->pdo->quote($string);
|
||||
}
|
||||
|
||||
function query($query, $unbuffered = false) {
|
||||
function query(string $query, bool $unbuffered = false) {
|
||||
/** @var Result|bool */
|
||||
$result = $this->pdo->query($query);
|
||||
$this->error = "";
|
||||
if (!$result) {
|
||||
@@ -39,13 +41,9 @@ if (extension_loaded('pdo')) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
return $this->result = $this->query($query);
|
||||
}
|
||||
|
||||
function store_result($result = null) {
|
||||
if (!$result) {
|
||||
$result = $this->result;
|
||||
$result = $this->multi;
|
||||
if (!$result) {
|
||||
return false;
|
||||
}
|
||||
@@ -58,40 +56,42 @@ if (extension_loaded('pdo')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function next_result() {
|
||||
if (!$this->result) {
|
||||
function next_result(): bool {
|
||||
/** @var PdoResult|bool */
|
||||
$result = $this->multi;
|
||||
if (!is_object($result)) {
|
||||
return false;
|
||||
}
|
||||
$this->result->_offset = 0;
|
||||
return @$this->result->nextRowset(); // @ - PDO_PgSQL doesn't support it
|
||||
}
|
||||
|
||||
function result($query, $field = 0) {
|
||||
$result = $this->query($query);
|
||||
if (!$result) {
|
||||
return false;
|
||||
}
|
||||
$row = $result->fetch();
|
||||
return $row[$field];
|
||||
$result->_offset = 0;
|
||||
return @$result->nextRowset(); // @ - PDO_PgSQL doesn't support it
|
||||
}
|
||||
}
|
||||
|
||||
class PdoDbStatement extends \PDOStatement {
|
||||
class PdoResult extends \PDOStatement {
|
||||
public $_offset = 0, $num_rows;
|
||||
|
||||
function fetch_assoc() {
|
||||
return $this->fetch(\PDO::FETCH_ASSOC);
|
||||
return $this->fetch_array(\PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
function fetch_row() {
|
||||
return $this->fetch(\PDO::FETCH_NUM);
|
||||
return $this->fetch_array(\PDO::FETCH_NUM);
|
||||
}
|
||||
|
||||
function fetch_field() {
|
||||
private function fetch_array(int $mode) {
|
||||
$return = $this->fetch($mode);
|
||||
return ($return ? array_map(array($this, 'unresource'), $return) : $return);
|
||||
}
|
||||
|
||||
private function unresource($val) {
|
||||
return (is_resource($val) ? stream_get_contents($val) : $val);
|
||||
}
|
||||
|
||||
function fetch_field(): \stdClass {
|
||||
$row = (object) $this->getColumnMeta($this->_offset++);
|
||||
$row->orgtable = $row->table;
|
||||
$row->orgname = $row->name;
|
||||
$row->charsetnr = (in_array("blob", (array) $row->flags) ? 63 : 0);
|
||||
$type = $row->pdo_type;
|
||||
$row->type = ($type == \PDO::PARAM_INT ? 0 : 15);
|
||||
$row->charsetnr = ($type == \PDO::PARAM_LOB || (isset($row->flags) && in_array("blob", (array) $row->flags)) ? 63 : 0);
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
31
adminer/include/plugin.inc.php
Normal file
31
adminer/include/plugin.inc.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
// the overridable methods don't use return type declarations so that plugins can be compatible with PHP 5
|
||||
abstract class Plugin {
|
||||
/** @var array<literal-string, string|list<string>>[] */ protected $translations = array(); // key is language code
|
||||
|
||||
/** Get plain text plugin description; empty string means to use the first line of class doc-comment
|
||||
* @return string
|
||||
*/
|
||||
function description() {
|
||||
return $this->lang('');
|
||||
}
|
||||
|
||||
/** Get URL of plugin screenshot
|
||||
* @return string
|
||||
*/
|
||||
function screenshot() {
|
||||
return "";
|
||||
}
|
||||
|
||||
/** Translate a string from $this->translations; Adminer\lang() doesn't work for single language versions
|
||||
* @param literal-string $idf
|
||||
* @param float|string $number
|
||||
*/
|
||||
protected function lang(string $idf, $number = null): string {
|
||||
$args = func_get_args();
|
||||
$args[0] = idx($this->translations[LANG], $idf) ?: $idf;
|
||||
return call_user_func_array('Adminer\lang_format', $args);
|
||||
}
|
||||
}
|
85
adminer/include/plugins.inc.php
Normal file
85
adminer/include/plugins.inc.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
class Plugins {
|
||||
/** @var true[] */ private static array $append = array('dumpFormat' => true, 'dumpOutput' => true, 'editRowPrint' => true, 'editFunctions' => true, 'config' => true); // these hooks expect the value to be appended to the result
|
||||
|
||||
/** @var list<object> @visibility protected(set) */ public array $plugins;
|
||||
/** @visibility protected(set) */ public string $error = ''; // HTML
|
||||
/** @var list<object>[] */ private array $hooks = array();
|
||||
|
||||
/** Register plugins
|
||||
* @param ?list<object> $plugins object instances or null to autoload plugins from adminer-plugins/
|
||||
*/
|
||||
function __construct(?array $plugins) {
|
||||
if ($plugins === null) {
|
||||
$plugins = array();
|
||||
$basename = "adminer-plugins";
|
||||
if (is_dir($basename)) {
|
||||
foreach (glob("$basename/*.php") as $filename) {
|
||||
$include = include_once "./$filename";
|
||||
}
|
||||
}
|
||||
$help = " href='https://www.adminer.org/plugins/#use'" . target_blank();
|
||||
if (file_exists("$basename.php")) {
|
||||
$include = include_once "./$basename.php"; // example: return array(new AdminerLoginOtp($secret))
|
||||
if (is_array($include)) {
|
||||
foreach ($include as $plugin) {
|
||||
$plugins[get_class($plugin)] = $plugin;
|
||||
}
|
||||
} else {
|
||||
$this->error .= lang('%s must <a%s>return an array</a>.', "<b>$basename.php</b>", $help) . "<br>";
|
||||
}
|
||||
}
|
||||
foreach (get_declared_classes() as $class) {
|
||||
if (!$plugins[$class] && preg_match('~^Adminer\w~i', $class)) {
|
||||
// we need to use reflection because PHP 7.1 throws ArgumentCountError for missing arguments but older versions issue a warning
|
||||
$reflection = new \ReflectionClass($class);
|
||||
$constructor = $reflection->getConstructor();
|
||||
if ($constructor && $constructor->getNumberOfRequiredParameters()) {
|
||||
$this->error .= lang('<a%s>Configure</a> %s in %s.', $help, "<b>$class</b>", "<b>$basename.php</b>") . "<br>";
|
||||
} else {
|
||||
$plugins[$class] = new $class;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->plugins = $plugins;
|
||||
|
||||
$adminer = new Adminer;
|
||||
$plugins[] = $adminer;
|
||||
$reflection = new \ReflectionObject($adminer);
|
||||
foreach ($reflection->getMethods() as $method) {
|
||||
foreach ($plugins as $plugin) {
|
||||
$name = $method->getName();
|
||||
if (method_exists($plugin, $name)) {
|
||||
$this->hooks[$name][] = $plugin;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param literal-string $name
|
||||
* @param mixed[] $params
|
||||
* @return mixed
|
||||
*/
|
||||
function __call(string $name, array $params) {
|
||||
$args = array();
|
||||
foreach ($params as $key => $val) {
|
||||
// some plugins accept params by reference - we don't need to propage it outside, just to the other plugins
|
||||
$args[] = &$params[$key];
|
||||
}
|
||||
$return = null;
|
||||
foreach ($this->hooks[$name] as $plugin) {
|
||||
$value = call_user_func_array(array($plugin, $name), $args);
|
||||
if ($value !== null) {
|
||||
if (!self::$append[$name]) { // non-null value from non-appending method short-circuits the other plugins
|
||||
return $value;
|
||||
}
|
||||
$return = $value + (array) $return;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
@@ -2,18 +2,19 @@
|
||||
namespace Adminer;
|
||||
|
||||
class TmpFile {
|
||||
private $handler, $size;
|
||||
/** @var resource */ private $handler;
|
||||
/** @visibility protected(set) */ public int $size;
|
||||
|
||||
function __construct() {
|
||||
$this->handler = tmpfile();
|
||||
}
|
||||
|
||||
function write($contents) {
|
||||
function write(string $contents): void {
|
||||
$this->size += strlen($contents);
|
||||
fwrite($this->handler, $contents);
|
||||
}
|
||||
|
||||
function send() {
|
||||
function send(): void {
|
||||
fseek($this->handler, 0);
|
||||
fpassthru($this->handler);
|
||||
fclose($this->handler);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$VERSION = "5.0.6";
|
||||
const VERSION = "5.3.0";
|
||||
|
@@ -6,7 +6,7 @@ namespace Adminer;
|
||||
* @link http://www.coolcode.cn/?action=show&id=128
|
||||
*/
|
||||
|
||||
function int32($n) {
|
||||
function int32(int $n): int {
|
||||
while ($n >= 2147483648) {
|
||||
$n -= 4294967296;
|
||||
}
|
||||
@@ -16,7 +16,10 @@ function int32($n) {
|
||||
return (int) $n;
|
||||
}
|
||||
|
||||
function long2str($v, $w) {
|
||||
/**
|
||||
* @param int[] $v
|
||||
*/
|
||||
function long2str(array $v, bool $w): string {
|
||||
$s = '';
|
||||
foreach ($v as $val) {
|
||||
$s .= pack('V', $val);
|
||||
@@ -27,7 +30,10 @@ function long2str($v, $w) {
|
||||
return $s;
|
||||
}
|
||||
|
||||
function str2long($s, $w) {
|
||||
/**
|
||||
* @return int[]
|
||||
*/
|
||||
function str2long(string $s, bool $w): array {
|
||||
$v = array_values(unpack('V*', str_pad($s, 4 * ceil(strlen($s) / 4), "\0")));
|
||||
if ($w) {
|
||||
$v[] = strlen($s);
|
||||
@@ -35,16 +41,15 @@ function str2long($s, $w) {
|
||||
return $v;
|
||||
}
|
||||
|
||||
function xxtea_mx($z, $y, $sum, $k) {
|
||||
function xxtea_mx(int $z, int $y, int $sum, int $k): int {
|
||||
return int32((($z >> 5 & 0x7FFFFFF) ^ $y << 2) + (($y >> 3 & 0x1FFFFFFF) ^ $z << 4)) ^ int32(($sum ^ $y) + ($k ^ $z));
|
||||
}
|
||||
|
||||
/** Cipher
|
||||
* @param string plain-text password
|
||||
* @param string
|
||||
* @param string $str plain-text password
|
||||
* @return string binary cipher
|
||||
*/
|
||||
function encrypt_string($str, $key) {
|
||||
function encrypt_string(string $str, string $key): string {
|
||||
if ($str == "") {
|
||||
return "";
|
||||
}
|
||||
@@ -73,11 +78,10 @@ function encrypt_string($str, $key) {
|
||||
}
|
||||
|
||||
/** Decipher
|
||||
* @param string binary cipher
|
||||
* @param string
|
||||
* @return string plain-text password
|
||||
* @param string $str binary cipher
|
||||
* @return string|false plain-text password
|
||||
*/
|
||||
function decrypt_string($str, $key) {
|
||||
function decrypt_string(string $str, string $key) {
|
||||
if ($str == "") {
|
||||
return "";
|
||||
}
|
||||
|
@@ -3,7 +3,8 @@ namespace Adminer;
|
||||
|
||||
$TABLE = $_GET["indexes"];
|
||||
$index_types = array("PRIMARY", "UNIQUE", "INDEX");
|
||||
$table_status = table_status($TABLE, true);
|
||||
$table_status = table_status1($TABLE, true);
|
||||
$index_algorithms = driver()->indexAlgorithms($table_status);
|
||||
if (preg_match('~MyISAM|M?aria' . (min_version(5.6, '10.0.5') ? '|InnoDB' : '') . '~i', $table_status["Engine"])) {
|
||||
$index_types[] = "FULLTEXT";
|
||||
}
|
||||
@@ -29,12 +30,14 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"]) {
|
||||
$columns = array();
|
||||
$lengths = array();
|
||||
$descs = array();
|
||||
$index_condition = (support("partial_indexes") ? $index["partial"] : "");
|
||||
$index_algorithm = (in_array($index["algorithm"], $index_algorithms) ? $index["algorithm"] : "");
|
||||
$set = array();
|
||||
ksort($index["columns"]);
|
||||
foreach ($index["columns"] as $key => $column) {
|
||||
if ($column != "") {
|
||||
$length = $index["lengths"][$key];
|
||||
$desc = $index["descs"][$key];
|
||||
$length = idx($index["lengths"], $key);
|
||||
$desc = idx($index["descs"], $key);
|
||||
$set[] = idf_escape($column) . ($length ? "(" . (+$length) . ")" : "") . ($desc ? " DESC" : "");
|
||||
$columns[] = $column;
|
||||
$lengths[] = ($length ?: null);
|
||||
@@ -52,6 +55,8 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"]) {
|
||||
&& array_values($existing["columns"]) === $columns
|
||||
&& (!$existing["lengths"] || array_values($existing["lengths"]) === $lengths)
|
||||
&& array_values($existing["descs"]) === $descs
|
||||
&& $existing["partial"] == $index_condition
|
||||
&& (!$index_algorithms || $existing["algorithm"] == $index_algorithm)
|
||||
) {
|
||||
// skip existing index
|
||||
unset($indexes[$name]);
|
||||
@@ -59,7 +64,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"]) {
|
||||
}
|
||||
}
|
||||
if ($columns) {
|
||||
$alter[] = array($index["type"], $name, $set);
|
||||
$alter[] = array($index["type"], $name, $set, $index_algorithm, $index_condition);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,14 +110,29 @@ $show_options = ($_POST ? $_POST["options"] : get_setting("index_options"));
|
||||
<table class="nowrap">
|
||||
<thead><tr>
|
||||
<th id="label-type"><?php echo lang('Index Type'); ?>
|
||||
<?php
|
||||
$idxopts = " class='idxopts" . ($show_options ? "" : " hidden") . "'";
|
||||
if ($index_algorithms) {
|
||||
echo "<th id='label-algorithm'$idxopts>" . lang('Algorithm') . doc_link(array(
|
||||
'sql' => 'create-index.html#create-index-storage-engine-index-types',
|
||||
'mariadb' => 'storage-engine-index-types/',
|
||||
'pgsql' => 'indexes-types.html',
|
||||
));
|
||||
}
|
||||
?>
|
||||
<th><input type="submit" class="wayoff"><?php
|
||||
echo lang('Column') . ($lengths ? "<span class='idxopts" . ($show_options ? "" : " hidden") . "'> (" . lang('length') . ")</span>" : "");
|
||||
echo lang('Columns') . ($lengths ? "<span$idxopts> (" . lang('length') . ")</span>" : "");
|
||||
if ($lengths || support("descidx")) {
|
||||
echo checkbox("options", 1, $show_options, lang('Options'), "indexOptionsShow(this.checked)", "jsonly") . "\n";
|
||||
}
|
||||
?>
|
||||
<th id="label-name"><?php echo lang('Name'); ?>
|
||||
<th><noscript><?php echo "<input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='" . lang('Add next') . "'>"; ?></noscript>
|
||||
<?php
|
||||
if (support("partial_indexes")) {
|
||||
echo "<th id='label-condition'$idxopts>" . lang('Condition');
|
||||
}
|
||||
?>
|
||||
<th><noscript><?php echo icon("plus", "add[0]", "+", lang('Add next')); ?></noscript>
|
||||
</thead>
|
||||
<?php
|
||||
if ($primary) {
|
||||
@@ -128,6 +148,10 @@ foreach ($row["indexes"] as $index) {
|
||||
if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) {
|
||||
echo "<tr><td>" . html_select("indexes[$j][type]", array(-1 => "") + $index_types, $index["type"], ($j == count($row["indexes"]) ? "indexesAddRow.call(this);" : ""), "label-type");
|
||||
|
||||
if ($index_algorithms) {
|
||||
echo "<td$idxopts>" . html_select("indexes[$j][algorithm]", array_merge(array(""), $index_algorithms), $index['algorithm'], "label-algorithm");
|
||||
}
|
||||
|
||||
echo "<td>";
|
||||
ksort($index["columns"]);
|
||||
$i = 1;
|
||||
@@ -138,15 +162,18 @@ foreach ($row["indexes"] as $index) {
|
||||
$column,
|
||||
"partial(" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . ", '" . js_escape(JUSH == "sql" ? "" : $_GET["indexes"] . "_") . "')"
|
||||
);
|
||||
echo "<span class='idxopts" . ($show_options ? "" : " hidden") . "'>";
|
||||
echo ($lengths ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h($index["lengths"][$key]) . "' title='" . lang('Length') . "'>" : "");
|
||||
echo (support("descidx") ? checkbox("indexes[$j][descs][$i]", 1, $index["descs"][$key], lang('descending')) : "");
|
||||
echo "<span$idxopts>";
|
||||
echo ($lengths ? "<input type='number' name='indexes[$j][lengths][$i]' class='size' value='" . h(idx($index["lengths"], $key)) . "' title='" . lang('Length') . "'>" : "");
|
||||
echo (support("descidx") ? checkbox("indexes[$j][descs][$i]", 1, idx($index["descs"], $key), lang('descending')) : "");
|
||||
echo "</span> </span>";
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off' aria-labelledby='label-name'>\n";
|
||||
echo "<td><input type='image' class='icon' name='drop_col[$j]' src='../adminer/static/cross.gif' alt='x' title='" . lang('Remove') . "'>" . script("qsl('input').onclick = partial(editingRemoveRow, 'indexes\$1[type]');");
|
||||
if (support("partial_indexes")) {
|
||||
echo "<td$idxopts><input name='indexes[$j][partial]' value='" . h($index["partial"]) . "' autocapitalize='off' aria-labelledby='label-condition'>\n";
|
||||
}
|
||||
echo "<td>" . icon("cross", "drop_col[$j]", "x", lang('Remove')) . script("qsl('button').onclick = partial(editingRemoveRow, 'indexes\$1[type]');");
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
@@ -155,5 +182,5 @@ foreach ($row["indexes"] as $index) {
|
||||
</div>
|
||||
<p>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
<?php echo input_token(); ?>
|
||||
</form>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'تسجيل الدخول',
|
||||
'Logout successful.' => 'تم تسجيل الخروج بنجاح.',
|
||||
'Invalid credentials.' => 'بيانات الدخول غير صالحة.',
|
||||
@@ -212,11 +212,6 @@ $translations = array(
|
||||
'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 في المجموع',
|
||||
@@ -251,7 +246,6 @@ $translations = array(
|
||||
'Network' => 'شبكة',
|
||||
'Geometry' => 'هندسة',
|
||||
'File exists.' => 'الملف موجود.',
|
||||
'Attachments' => 'ملفات مرفقة',
|
||||
'Item%s has been inserted.' => '%sتم إدراج العنصر.',
|
||||
'now' => 'الآن',
|
||||
'%d query(s) executed OK.' => array('تم تنفيذ الاستعلام %d بنجاح.', 'تم تنفيذ الاستعلامات %d بنجاح.'),
|
||||
@@ -266,3 +260,5 @@ $translations = array(
|
||||
'Edit all' => 'تعديل الكل',
|
||||
'HH:MM:SS' => 'HH:MM:SS',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php ar` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Система',
|
||||
'Server' => 'Сървър',
|
||||
@@ -256,7 +256,7 @@ $translations = array(
|
||||
// in-place editing in select
|
||||
'Modify' => 'Промяна',
|
||||
'Ctrl+click on a value to modify it.' => 'Ctrl+щракване в стойността, за да я промените.',
|
||||
'Use edit link to modify this value.' => 'Използвайте "редакция" за промяна на данните.',
|
||||
'Use edit link to modify this value.' => 'Използвайте \'редакция\' за промяна на данните.',
|
||||
|
||||
// %s can contain auto-increment value
|
||||
'Item%s has been inserted.' => 'Елементи%s бяха вмъкнати.',
|
||||
@@ -279,13 +279,6 @@ $translations = array(
|
||||
'Delete' => 'Изтриване',
|
||||
'You have no privileges to update this table.' => 'Нямате праве за обновяване на таблицата.',
|
||||
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'От',
|
||||
'Subject' => 'Тема',
|
||||
'Attachments' => 'Прикачени',
|
||||
'Send' => 'Изпращане',
|
||||
'%d e-mail(s) have been sent.' => array('%d писмо беше изпратено.', '%d писма бяха изпратени.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Числа',
|
||||
'Date and time' => 'Дата и час',
|
||||
@@ -335,3 +328,5 @@ $translations = array(
|
||||
'Type has been created.' => 'Вида беше създаден.',
|
||||
'Alter type' => 'Промяна на вид',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php bg` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'লগইন',
|
||||
'Logout successful.' => 'সফলভাবে লগআউট হয়েছে।',
|
||||
'Invalid credentials.' => 'ভুল পাসওয়ার্ড।',
|
||||
@@ -214,11 +214,6 @@ $translations = array(
|
||||
'Binary' => 'বাইনারি',
|
||||
'Lists' => 'তালিকা',
|
||||
'Editor' => 'সম্পাদক',
|
||||
'E-mail' => 'ই-মেইল',
|
||||
'From' => 'থেকে',
|
||||
'Subject' => 'বিষয়',
|
||||
'Send' => 'পাঠান',
|
||||
'%d e-mail(s) have been sent.' => array('%d ইমেইল(গুলি) পাঠানো হয়েছে।', '%d ইমেইল(গুলি) পাঠানো হয়েছে।'),
|
||||
'Webserver file %s' => 'ওয়েবসার্ভার ফাইল %s',
|
||||
'File does not exist.' => 'ফাইলটির কোন অস্তিত্ব নেই।',
|
||||
'%d in total' => 'সর্বমোটঃ %d টি',
|
||||
@@ -252,7 +247,6 @@ $translations = array(
|
||||
'Network' => 'নেটওয়ার্ক',
|
||||
'Geometry' => 'জ্যামিতি',
|
||||
'File exists.' => 'ফাইল রয়েছে।',
|
||||
'Attachments' => 'সংযুক্তিগুলো',
|
||||
'%d query(s) executed OK.' => array('SQL-অনুসন্ধান সফলভাবে সম্পন্ন হয়েছে।', '%d SQL-অনুসন্ধানসমূহ সফলভাবে সম্পন্ন হয়েছে।'),
|
||||
'Show only errors' => 'শুধুমাত্র ত্রুটিগুলো দেখান',
|
||||
'Refresh' => 'রিফ্রেশ',
|
||||
@@ -265,4 +259,56 @@ $translations = array(
|
||||
'Permanent link' => 'স্থায়ী লিংক',
|
||||
'Edit all' => 'সবগুলো সম্পাদনা করুন',
|
||||
'HH:MM:SS' => 'HH:MM:SS',
|
||||
'Check has been dropped.' => 'চেক ড্রপ করা হয়েছে।',
|
||||
'Check has been altered.' => 'চেক পরিবর্তন করা হয়েছে।',
|
||||
'Check has been created.' => 'চেক তৈরি করা হয়েছে।',
|
||||
'Alter check' => 'চেক পরিবর্তন করুন',
|
||||
'Create check' => 'চেক তৈরি করুন',
|
||||
'Drop %s?' => '%s ড্রপ করবেন?',
|
||||
'Tables have been optimized.' => 'টেবিলগুলি অপ্টিমাইজ করা হয়েছে।',
|
||||
'Materialized view' => 'মেটেরিয়ালাইজড ভিউ',
|
||||
'Vacuum' => 'ভ্যাকুয়াম',
|
||||
'Selected' => 'নির্বাচিত',
|
||||
'overwrite' => 'ওভাররাইট',
|
||||
'DB' => 'ডিবি',
|
||||
'Algorithm' => 'অ্যালগরিদম',
|
||||
'Columns' => 'কলাম',
|
||||
'Ctrl+click on a value to modify it.' => 'একটি মান পরিবর্তন করতে Ctrl+ক্লিক করুন।',
|
||||
'File must be in UTF-8 encoding.' => 'ফাইলটি UTF-8 এনকোডিংয়ে হতে হবে।',
|
||||
'Modify' => 'পরিবর্তন করুন',
|
||||
'Load more data' => 'আরও ডেটা লোড করুন',
|
||||
'Loading' => 'লোড হচ্ছে',
|
||||
'ATTACH queries are not supported.' => 'ATTACH কোয়েরি সমর্থিত নয়।',
|
||||
'Warnings' => 'সতর্কতা',
|
||||
'%d / ' => array('%d / '),
|
||||
'Limit rows' => 'সারি সীমিত করুন',
|
||||
'Inherits from' => 'থেকে উত্তরাধিকারসূত্রে প্রাপ্ত',
|
||||
'Checks' => 'চেকস',
|
||||
'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>।',
|
||||
'Default value' => 'ডিফল্ট মান',
|
||||
'Full table scan' => 'সম্পূর্ণ টেবিল স্ক্যান',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('অনেকগুলি ব্যর্থ লগইন প্রচেষ্টা, %d মিনিট পরে আবার চেষ্টা করুন।'),
|
||||
'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> %s মেথড।',
|
||||
'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.' => 'ইনপুট পাসওয়ার্ডে একটি স্পেস রয়েছে যা এর কারণ হতে পারে।',
|
||||
'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 এর মাধ্যমে একটি বড় SQL ফাইল আপলোড করতে পারেন এবং সার্ভার থেকে এটি ইম্পোর্ট করতে পারেন।',
|
||||
'Size' => 'আকার',
|
||||
'Compute' => 'কম্পিউট',
|
||||
'Loaded plugins' => 'লোড করা প্লাগইনগুলি',
|
||||
'screenshot' => 'স্ক্রিনশট',
|
||||
'You are offline.' => 'আপনি অফলাইনে আছেন।',
|
||||
'You have no privileges to update this table.' => 'এই টেবিল আপডেট করার জন্য আপনার কোন অনুমতি নেই।',
|
||||
'Saving' => 'সংরক্ষণ করা হচ্ছে',
|
||||
'Unknown error.' => 'অজানা ত্রুটি।',
|
||||
'%s must <a%s>return an array</a>.' => '%s অবশ্যই <a%s>একটি অ্যারে রিটার্ন করতে হবে</a>।',
|
||||
'<a%s>Configure</a> %s in %s.' => '<a%s>কনফিগার করুন</a> %s এ %s।',
|
||||
'Disable %s or enable %s or %s extensions.' => '%s নিষ্ক্রিয় করুন অথবা %s বা %s এক্সটেনশন সক্রিয় করুন।',
|
||||
'Database does not support password.' => 'ডাটাবেস পাসওয়ার্ড সমর্থন করে না।',
|
||||
'yes' => 'হ্যাঁ',
|
||||
'no' => 'না',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php bn` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Sistem',
|
||||
'Server' => 'Server',
|
||||
@@ -264,13 +264,6 @@ $translations = array(
|
||||
'Delete' => 'Izbriši',
|
||||
'Modify' => 'Izmjene',
|
||||
|
||||
'E-mail' => 'El. pošta',
|
||||
'From' => 'Od',
|
||||
'Subject' => 'Naslov',
|
||||
'Attachments' => 'Prilozi',
|
||||
'Send' => 'Pošalji',
|
||||
'%d e-mail(s) have been sent.' => array('%d poruka el. pošte je poslata.', '%d poruke el. pošte su poslate.', '%d poruka el. pošte je poslato.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Broj',
|
||||
'Date and time' => 'Datum i vrijeme',
|
||||
@@ -320,3 +313,5 @@ $translations = array(
|
||||
'Type has been created.' => 'tip je spašen.',
|
||||
'Alter type' => 'Ažuriraj tip',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php bs` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Inicia la sessió',
|
||||
'Logout successful.' => 'Desconnexió correcta.',
|
||||
'Invalid credentials.' => 'Credencials invàlides.',
|
||||
@@ -206,11 +206,6 @@ $translations = array(
|
||||
'History' => 'Història',
|
||||
'Variables' => 'Variables',
|
||||
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Les columnes d\'origen i de destinació han de ser del mateix tipus, la columna de destinació ha d\'estar indexada i les dades referenciades han d\'existir.',
|
||||
'E-mail' => 'Correu electrònic',
|
||||
'From' => 'De',
|
||||
'Subject' => 'Assumpte',
|
||||
'Send' => 'Envia',
|
||||
'%d e-mail(s) have been sent.' => array('S\'ha enviat %d correu electrònic.', 'S\'han enviat %d correus electrònics.'),
|
||||
'Run file' => 'Executa el fitxer',
|
||||
'Numbers' => 'Nombres',
|
||||
'Date and time' => 'Data i hora',
|
||||
@@ -225,7 +220,6 @@ $translations = array(
|
||||
'File does not exist.' => 'El fitxer no existeix.',
|
||||
'Permanent login' => 'Sessió permanent',
|
||||
'%d in total' => '%d en total',
|
||||
'Attachments' => 'Adjuncions',
|
||||
'System' => 'Sistema',
|
||||
'last' => 'darrera',
|
||||
'Network' => 'Xarxa',
|
||||
@@ -267,3 +261,5 @@ $translations = array(
|
||||
'Edit all' => 'Edita-ho tot',
|
||||
'HH:MM:SS' => 'HH:MM:SS',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php ca` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Systém',
|
||||
'Server' => 'Server',
|
||||
@@ -42,6 +42,7 @@ $translations = array(
|
||||
'User has been created.' => 'Uživatel byl vytvořen.',
|
||||
'Hashed' => 'Zahašované',
|
||||
'Column' => 'Sloupec',
|
||||
'Columns' => 'Sloupce',
|
||||
'Routine' => 'Procedura',
|
||||
'Grant' => 'Povolit',
|
||||
'Revoke' => 'Zakázat',
|
||||
@@ -193,6 +194,7 @@ $translations = array(
|
||||
'Partitions' => 'Oddíly',
|
||||
'Partition name' => 'Název oddílu',
|
||||
'Values' => 'Hodnoty',
|
||||
'Inherits from' => 'Zděděná z',
|
||||
|
||||
'View' => 'Pohled',
|
||||
'Materialized view' => 'Materializovaný pohled',
|
||||
@@ -208,6 +210,8 @@ $translations = array(
|
||||
'Add next' => 'Přidat další',
|
||||
'Index Type' => 'Typ indexu',
|
||||
'length' => 'délka',
|
||||
'Algorithm' => 'Algoritmus',
|
||||
'Condition' => 'Podmínka',
|
||||
|
||||
'Foreign keys' => 'Cizí klíče',
|
||||
'Foreign key' => 'Cizí klíč',
|
||||
@@ -292,13 +296,6 @@ $translations = array(
|
||||
'Delete' => 'Smazat',
|
||||
'You have no privileges to update this table.' => 'Nemáte oprávnění editovat tuto tabulku.',
|
||||
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'Odesílatel',
|
||||
'Subject' => 'Předmět',
|
||||
'Attachments' => 'Přílohy',
|
||||
'Send' => 'Odeslat',
|
||||
'%d e-mail(s) have been sent.' => array('Byl odeslán %d e-mail.', 'Byly odeslány %d e-maily.', 'Bylo odesláno %d e-mailů.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Čísla',
|
||||
'Date and time' => 'Datum a čas',
|
||||
@@ -355,4 +352,11 @@ $translations = array(
|
||||
'Check has been created.' => 'Kontrola byla vytvořena.',
|
||||
'Check has been altered.' => 'Kontrola byla změněna.',
|
||||
'Check has been dropped.' => 'Kontrola byla odstraněna.',
|
||||
|
||||
'Loaded plugins' => 'Nahrané pluginy',
|
||||
'%s must <a%s>return an array</a>.' => '%s musí <a%s>vracet pole</a>.',
|
||||
'<a%s>Configure</a> %s in %s.' => '<a%s>Nakonfigurujte</a> %s v %s.',
|
||||
'screenshot' => 'obrázek',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php cs` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'System' => 'System',
|
||||
'Server' => 'Server',
|
||||
'Username' => 'Brugernavn',
|
||||
@@ -238,12 +238,6 @@ $translations = array(
|
||||
'Clone' => 'Klon',
|
||||
'Delete' => 'Slet',
|
||||
'You have no privileges to update this table.' => 'Du mangler rettigheder til at ændre denne tabellen.',
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'Fra',
|
||||
'Subject' => 'Titel',
|
||||
'Attachments' => 'Vedhæft',
|
||||
'Send' => 'Send',
|
||||
'%d e-mail(s) have been sent.' => array('%d email sendt.', '%d emails sendt.'),
|
||||
'Numbers' => 'Nummer',
|
||||
'Date and time' => 'Dato og tid',
|
||||
'Strings' => 'Strenge',
|
||||
@@ -281,3 +275,5 @@ $translations = array(
|
||||
'Alter type' => 'Ændre type',
|
||||
'Saving' => 'Gemmer',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php da` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Login',
|
||||
'Logout successful.' => 'Abmeldung erfolgreich.',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Danke, dass Sie Adminer genutzt haben. <a href="https://www.adminer.org/de/donation/">Spenden willkommen!</a>.',
|
||||
@@ -137,6 +137,7 @@ $translations = array(
|
||||
'User has been created.' => 'Benutzer wurde erstellt.',
|
||||
'Hashed' => 'Hashed',
|
||||
'Column' => 'Spalte',
|
||||
'Columns' => 'Spalten',
|
||||
'Routine' => 'Routine',
|
||||
'Grant' => 'Erlauben',
|
||||
'Revoke' => 'Widerrufen',
|
||||
@@ -215,11 +216,6 @@ $translations = array(
|
||||
'Binary' => 'Binär',
|
||||
'Lists' => 'Listen',
|
||||
'Editor' => 'Editor',
|
||||
'E-mail' => 'E-Mail',
|
||||
'From' => 'Von',
|
||||
'Subject' => 'Betreff',
|
||||
'Send' => 'Abschicken',
|
||||
'%d e-mail(s) have been sent.' => array('%d E-Mail abgeschickt.', '%d E-Mails abgeschickt.'),
|
||||
'Webserver file %s' => 'Webserver Datei %s',
|
||||
'File does not exist.' => 'Datei existiert nicht.',
|
||||
'%d in total' => '%d insgesamt',
|
||||
@@ -254,7 +250,6 @@ $translations = array(
|
||||
'Network' => 'Netzwerk',
|
||||
'Geometry' => 'Geometrie',
|
||||
'File exists.' => 'Datei existiert schon.',
|
||||
'Attachments' => 'Anhänge',
|
||||
'%d query(s) executed OK.' => array('SQL-Abfrage erfolgreich ausgeführt.', '%d SQL-Abfragen erfolgreich ausgeführt.'),
|
||||
'Show only errors' => 'Nur Fehler anzeigen',
|
||||
'Refresh' => 'Aktualisieren',
|
||||
@@ -294,7 +289,7 @@ $translations = array(
|
||||
'DB' => 'DB',
|
||||
'ATTACH queries are not supported.' => 'ATTACH Abfragen werden nicht unterstützt.',
|
||||
'Warnings' => 'Warnungen',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer unterstützt den Zugriff auf eine Datenbank ohne Passwort nicht, <a href="https://www.adminer.org/en/password/"%s>mehr Informationen</a>.',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer unterstützt den Zugriff auf eine Datenbank ohne Passwort nicht, <a href="https://www.adminer.org/de/password/"%s>mehr Informationen</a>.',
|
||||
'Full table scan' => 'Vollständige Überprüfung der Tabelle',
|
||||
'The action will be performed after successful login with the same credentials.' => 'Die Aktion wird nach erfolgreicher Anmeldung mit denselben Anmeldedaten ausgeführt.',
|
||||
'Connecting to privileged ports is not allowed.' => 'Die Verbindung zu privilegierten Ports ist nicht erlaubt.',
|
||||
@@ -308,4 +303,10 @@ $translations = array(
|
||||
'Alter check' => 'Check ändern',
|
||||
'Create check' => 'Check erstellen',
|
||||
'Checks' => 'Checks',
|
||||
'Loaded plugins' => 'Geladene Plugins',
|
||||
'%s must <a%s>return an array</a>.' => '%s muss <a%s>ein Array zurückgeben</a>.',
|
||||
'<a%s>Configure</a> %s in %s.' => '<a%s>Konfigure</a> %s mit %s.',
|
||||
'screenshot' => 'Screenshot',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php de` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Σύστημα',
|
||||
'Server' => 'Διακομιστής',
|
||||
@@ -279,13 +279,6 @@ $translations = array(
|
||||
'Delete' => 'Διαγραφή',
|
||||
'You have no privileges to update this table.' => 'Δεν έχετε δικαίωμα να τροποποιήσετε αυτό τον πίνακα.',
|
||||
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'Από',
|
||||
'Subject' => 'Θέμα',
|
||||
'Attachments' => 'Συνημμένα',
|
||||
'Send' => 'Αποστολή',
|
||||
'%d e-mail(s) have been sent.' => array('%d e-mail απεστάλη.', '%d e-mail απεστάλησαν.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Αριθμοί',
|
||||
'Date and time' => 'Ημερομηνία και ώρα',
|
||||
@@ -335,3 +328,5 @@ $translations = array(
|
||||
'Type has been created.' => 'Ο τύπος δημιουργήθηκε.',
|
||||
'Alter type' => 'Τροποποίηση τύπου',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php el` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Too many unsuccessful logins, try again in %d minute.', 'Too many unsuccessful logins, try again in %d minutes.'),
|
||||
'Query executed OK, %d row(s) affected.' => array('Query executed OK, %d row affected.', 'Query executed OK, %d rows affected.'),
|
||||
'%d byte(s)' => array('%d byte', '%d bytes'),
|
||||
@@ -11,7 +11,8 @@ $translations = array(
|
||||
'%d row(s)' => array('%d row', '%d rows'),
|
||||
'%d item(s) have been affected.' => array('%d item has been affected.', '%d items have been affected.'),
|
||||
'%d row(s) have been imported.' => array('%d row has been imported.', '%d rows have been imported.'),
|
||||
'%d e-mail(s) have been sent.' => array('%d e-mail has been sent.', '%d e-mails have been sent.'),
|
||||
'%d in total' => '%d in total',
|
||||
'%d query(s) executed OK.' => array('%d query executed OK.', '%d queries executed OK.'),
|
||||
);
|
||||
|
||||
// run `php ../../lang.php en` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Login',
|
||||
'Logout successful.' => 'Sesión finalizada con éxito.',
|
||||
'Invalid credentials.' => 'Usuario y/o clave de acceso incorrecta.',
|
||||
@@ -44,6 +44,7 @@ $translations = array(
|
||||
'Save and insert next' => 'Guardar e insertar siguiente',
|
||||
'Delete' => 'Eliminar',
|
||||
'Database' => 'Base de datos',
|
||||
'DB' => 'BD',
|
||||
'Routines' => 'Procedimientos',
|
||||
'Indexes have been altered.' => 'Índices actualizados.',
|
||||
'Indexes' => 'Índices',
|
||||
@@ -62,18 +63,22 @@ $translations = array(
|
||||
'Page' => 'Página',
|
||||
'Query executed OK, %d row(s) affected.' => array('Consulta ejecutada, %d registro afectado.', 'Consulta ejecutada, %d registros afectados.'),
|
||||
'Error in query' => 'Error al ejecutar consulta',
|
||||
'Unknown error.' => 'Error desconocido.',
|
||||
'Warnings' => 'Advertencias',
|
||||
'ATTACH queries are not supported.' => 'Consultas tipo ATTACH no soportadas.',
|
||||
'Execute' => 'Ejecutar',
|
||||
'Table' => 'Tabla',
|
||||
'Foreign keys' => 'Claves externas',
|
||||
'Triggers' => 'Disparadores',
|
||||
'View' => 'Vista',
|
||||
'Materialized view' => 'Vista materializada',
|
||||
'Unable to select the table' => 'No es posible seleccionar la tabla',
|
||||
'Invalid CSRF token. Send the form again.' => 'Token CSRF inválido. Vuelva a enviar los datos del formulario.',
|
||||
'Comment' => 'Comentario',
|
||||
'Default values' => 'Valores predeterminados',
|
||||
'%d byte(s)' => array('%d byte', '%d bytes'),
|
||||
'No commands to execute.' => 'No es posible ejecutar ningún comando.',
|
||||
'Unable to upload a file.' => 'No es posible importar el archivo.',
|
||||
'No commands to execute.' => 'Ningún comando para ejecutar.',
|
||||
'Unable to upload a file.' => 'No es posible cargar el archivo.',
|
||||
'File upload' => 'Importar archivo',
|
||||
'File uploads are disabled.' => 'Importación de archivos deshablilitada.',
|
||||
'Routine has been called, %d row(s) affected.' => array('Consulta ejecutada, %d registro afectado.', 'Consulta ejecutada, %d registros afectados.'),
|
||||
@@ -83,9 +88,9 @@ $translations = array(
|
||||
'Session support must be enabled.' => 'Deben estar habilitadas las sesiones.',
|
||||
'Session expired, please login again.' => 'Sesión caducada, por favor escriba su clave de nuevo.',
|
||||
'Text length' => 'Longitud de texto',
|
||||
'Foreign key has been dropped.' => 'Clave externa eliminada.',
|
||||
'Foreign key has been altered.' => 'Clave externa modificada.',
|
||||
'Foreign key has been created.' => 'Clave externa creada.',
|
||||
'Foreign key has been dropped.' => 'Clave foranea eliminada.',
|
||||
'Foreign key has been altered.' => 'Clave foranea modificada.',
|
||||
'Foreign key has been created.' => 'Clave foranea creada.',
|
||||
'Foreign key' => 'Clave externa',
|
||||
'Target table' => 'Tabla de destino',
|
||||
'Change' => 'Modificar',
|
||||
@@ -140,6 +145,8 @@ $translations = array(
|
||||
'Grant' => 'Conceder',
|
||||
'Revoke' => 'Impedir',
|
||||
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'POST data demasiado grande. Reduzca el tamaño o aumente la directiva de configuración %s.',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'Usted puede cargar un SQL grande mediante FTP e importarlo desde el servidor.',
|
||||
'You are offline.' => 'Usted no esta en linea.',
|
||||
'Logged as: %s' => 'Logueado como: %s',
|
||||
'Move up' => 'Mover arriba',
|
||||
'Move down' => 'Mover abajo',
|
||||
@@ -147,8 +154,8 @@ $translations = array(
|
||||
'Aggregation' => 'Agregados',
|
||||
'Export' => 'Exportar',
|
||||
'Output' => 'Salida',
|
||||
'open' => 'mostrar',
|
||||
'save' => 'archivo',
|
||||
'open' => 'abrir',
|
||||
'save' => 'guardar',
|
||||
'Format' => 'Formato',
|
||||
'Tables' => 'Tablas',
|
||||
'Data' => 'Datos',
|
||||
@@ -195,6 +202,7 @@ $translations = array(
|
||||
'Partition name' => 'Nombre de partición',
|
||||
'Values' => 'Valores',
|
||||
'%d row(s) have been imported.' => array('%d registro importado.', '%d registros importados.'),
|
||||
'File must be in UTF-8 encoding.' => 'El archivo tiene que ser codificacion UTF-8.',
|
||||
'anywhere' => 'donde sea',
|
||||
'Import' => 'Importar',
|
||||
'Stop on error' => 'Parar en caso de error',
|
||||
@@ -214,11 +222,6 @@ $translations = array(
|
||||
'Binary' => 'Binario',
|
||||
'Lists' => 'Listas',
|
||||
'Editor' => 'Editor',
|
||||
'E-mail' => 'Email',
|
||||
'From' => 'De',
|
||||
'Subject' => 'Asunto',
|
||||
'Send' => 'Enviar',
|
||||
'%d e-mail(s) have been sent.' => array('%d email enviado.', '%d emails enviados.'),
|
||||
'Webserver file %s' => 'Archivo de servidor web %s',
|
||||
'File does not exist.' => 'Ese archivo no existe.',
|
||||
'%d in total' => '%d en total',
|
||||
@@ -253,10 +256,9 @@ $translations = array(
|
||||
'Network' => 'Red',
|
||||
'Geometry' => 'Geometría',
|
||||
'File exists.' => 'Ese archivo ya existe.',
|
||||
'Attachments' => 'Adjuntos',
|
||||
'%d query(s) executed OK.' => array('%d sentencia SQL ejecutada correctamente.', '%d sentencias SQL ejecutadas correctamente.'),
|
||||
'Show only errors' => 'Mostrar solamente errores',
|
||||
'Refresh' => 'Refrescar',
|
||||
'Refresh' => 'Actualizar',
|
||||
'Invalid schema.' => 'Esquema inválido.',
|
||||
'Please use one of the extensions %s.' => 'Por favor, use una de las extensiones %s.',
|
||||
'now' => 'ahora',
|
||||
@@ -266,4 +268,28 @@ $translations = array(
|
||||
'Permanent link' => 'Enlace permanente',
|
||||
'Edit all' => 'Editar todos',
|
||||
'HH:MM:SS' => 'HH:MM:SS',
|
||||
|
||||
'Loaded plugins' => 'Plugins cargados',
|
||||
'%s must <a%s>return an array</a>.' => '%s tiene que <a%s>retornar un arreglo</a>.',
|
||||
'<a%s>Configure</a> %s in %s.' => '<a%s>Configurar</a> %s en %s.',
|
||||
'There is a space in the input password which might be the cause.' => 'Hay un espacio en el password, lo cual puede ser la causa.',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer no soporta accesar una base de datos sin clave, <a href="https://www.adminer.org/en/password/"%s>Ver detalles</a>.',
|
||||
'Database does not support password.' => 'La base de datos no soporta password.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Muchos intentos de acceso Intente en %d minutos.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Password maestro expirado. <a href="https://www.adminer.org/en/extension/"%s>Implemente</a> %s metodo para hacerlo permanente.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Si no puede enviar la solicitud por Adminer entonces cierre esta pagina.',
|
||||
'Connecting to privileged ports is not allowed.' => 'Conexiones a puertos privilegiados no son permitidas.',
|
||||
'Disable %s or enable %s or %s extensions.' => 'Desactivar %s o activar %s o %s extensiones.',
|
||||
'The action will be performed after successful login with the same credentials.' => 'La operacion sera ejecutada despues de ingresar nuevamente con las mismas credenciales.',
|
||||
'You have no privileges to update this table.' => 'Usted no tiene privilegios para actualizar esta tabla.',
|
||||
|
||||
// Table check constraints
|
||||
'Checks' => 'Chequeos',
|
||||
'Create check' => 'Crear chequeo',
|
||||
'Alter check' => 'Cambiar chequeo',
|
||||
'Check has been created.' => 'Chequeo creado.',
|
||||
'Check has been altered.' => 'Chequeo cambiado.',
|
||||
'Check has been dropped.' => 'Chequeo eliminado.',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php es` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Logi sisse',
|
||||
'Logout successful.' => 'Väljalogimine õnnestus.',
|
||||
'Invalid credentials.' => 'Ebakorrektsed andmed.',
|
||||
@@ -214,11 +214,6 @@ $translations = array(
|
||||
'Binary' => 'Binaar',
|
||||
'Lists' => 'Listid',
|
||||
'Editor' => 'Redaktor',
|
||||
'E-mail' => 'E-post',
|
||||
'From' => 'Kellelt',
|
||||
'Subject' => 'Pealkiri',
|
||||
'Send' => 'Saada',
|
||||
'%d e-mail(s) have been sent.' => 'Saadetud kirju: %d.',
|
||||
'Webserver file %s' => 'Fail serveris: %s',
|
||||
'File does not exist.' => 'Faili ei leitud.',
|
||||
'%d in total' => 'Kokku: %d',
|
||||
@@ -253,7 +248,6 @@ $translations = array(
|
||||
'Network' => 'Võrk (network)',
|
||||
'Geometry' => 'Geomeetria',
|
||||
'File exists.' => 'Fail juba eksisteerib.',
|
||||
'Attachments' => 'Manused',
|
||||
'%d query(s) executed OK.' => array('%d päring edukalt käivitatud.', '%d päringut edukalt käivitatud.'),
|
||||
'Show only errors' => 'Kuva vaid veateateid',
|
||||
'Refresh' => 'Uuenda',
|
||||
@@ -267,3 +261,5 @@ $translations = array(
|
||||
'Edit all' => 'Muuda kõiki',
|
||||
'HH:MM:SS' => 'HH:MM:SS',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php et` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'سیستم',
|
||||
'Server' => 'سرور',
|
||||
@@ -277,13 +277,6 @@ $translations = array(
|
||||
'Delete' => 'حذف',
|
||||
'You have no privileges to update this table.' => 'شما اختیار ویرایش این جدول را ندارید.',
|
||||
|
||||
'E-mail' => 'پست الکترونیک',
|
||||
'From' => 'فرستنده',
|
||||
'Subject' => 'موضوع',
|
||||
'Attachments' => 'پیوست ها',
|
||||
'Send' => 'ارسال',
|
||||
'%d e-mail(s) have been sent.' => array('%d ایمیل ارسال شد.', '%d ایمیل ارسال شد.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'اعداد',
|
||||
'Date and time' => 'تاریخ و زمان',
|
||||
@@ -333,3 +326,5 @@ $translations = array(
|
||||
'Type has been created.' => 'نوع ایجاد شد.',
|
||||
'Alter type' => 'ویرایش نوع',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php fa` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Järjestelmä',
|
||||
'Server' => 'Palvelin',
|
||||
@@ -279,13 +279,6 @@ $translations = array(
|
||||
'Delete' => 'Poista',
|
||||
'You have no privileges to update this table.' => 'Sinulla ei ole oikeutta päivittää tätä taulua.',
|
||||
|
||||
'E-mail' => 'S-posti',
|
||||
'From' => 'Lähettäjä',
|
||||
'Subject' => 'Aihe',
|
||||
'Attachments' => 'Liitteet',
|
||||
'Send' => 'Lähetä',
|
||||
'%d e-mail(s) have been sent.' => array('% sähköpostiviestiä lähetetty.', '% sähköpostiviestiä lähetetty.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Numerot',
|
||||
'Date and time' => 'Päiväys ja aika',
|
||||
@@ -349,3 +342,5 @@ $translations = array(
|
||||
'Database does not support password.' => 'Tietokanta ei tue salasanaa.',
|
||||
'Disable %s or enable %s or %s extensions.' => 'Poista käytöstä %s tai ota käyttöön laajennus %s tai %s.',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php fi` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Authentification',
|
||||
'Logout successful.' => 'Au revoir !',
|
||||
'Invalid credentials.' => 'Authentification échouée.',
|
||||
@@ -212,11 +212,6 @@ $translations = array(
|
||||
'Binary' => 'Binaires',
|
||||
'Lists' => 'Listes',
|
||||
'Editor' => 'Éditeur',
|
||||
'E-mail' => 'Courriel',
|
||||
'From' => 'De',
|
||||
'Subject' => 'Sujet',
|
||||
'Send' => 'Envoyer',
|
||||
'%d e-mail(s) have been sent.' => array('%d message a été envoyé.', '%d messages ont été envoyés.'),
|
||||
'Webserver file %s' => 'Fichier %s du serveur Web',
|
||||
'File does not exist.' => 'Le fichier est introuvable.',
|
||||
'%d in total' => '%d au total',
|
||||
@@ -242,7 +237,7 @@ $translations = array(
|
||||
'Type has been dropped.' => 'Le type a été supprimé.',
|
||||
'Type has been created.' => 'Le type a été créé.',
|
||||
'Ctrl+click on a value to modify it.' => 'Ctrl+cliquez sur une valeur pour la modifier.',
|
||||
'Use edit link to modify this value.' => 'Utilisez le lien "modifier" pour modifier cette valeur.',
|
||||
'Use edit link to modify this value.' => 'Utilisez le lien \'modifier\' pour modifier cette valeur.',
|
||||
'last' => 'dernière',
|
||||
'From server' => 'Depuis le serveur',
|
||||
'System' => 'Système',
|
||||
@@ -252,7 +247,6 @@ $translations = array(
|
||||
'Network' => 'Réseau',
|
||||
'Geometry' => 'Géométrie',
|
||||
'File exists.' => 'Le fichier existe.',
|
||||
'Attachments' => 'Pièces jointes',
|
||||
'Item%s has been inserted.' => 'L\'élément%s a été inséré.',
|
||||
'now' => 'maintenant',
|
||||
'%d query(s) executed OK.' => array('%d requête exécutée avec succès.', '%d requêtes exécutées avec succès.'),
|
||||
@@ -302,3 +296,5 @@ $translations = array(
|
||||
'Database does not support password.' => 'La base de données ne support pas les mots de passe.',
|
||||
'Disable %s or enable %s or %s extensions.' => 'Désactiver %s ou activer %s or %s extensions.',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php fr` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Conectar',
|
||||
'Logout successful.' => 'Pechouse a sesión con éxito.',
|
||||
'Invalid credentials.' => 'Credenciais (usuario e/ou contrasinal) inválidos.',
|
||||
@@ -214,11 +214,6 @@ $translations = array(
|
||||
'Binary' => 'Binario',
|
||||
'Lists' => 'Listas',
|
||||
'Editor' => 'Editor',
|
||||
'E-mail' => 'Email',
|
||||
'From' => 'De',
|
||||
'Subject' => 'Asunto',
|
||||
'Send' => 'Enviar',
|
||||
'%d e-mail(s) have been sent.' => array('%d email enviado.', '%d emails enviados.'),
|
||||
'Webserver file %s' => 'Ficheiro de servidor web %s',
|
||||
'File does not exist.' => 'O ficheiro non existe.',
|
||||
'%d in total' => '%d en total',
|
||||
@@ -253,7 +248,6 @@ $translations = array(
|
||||
'Network' => 'Rede',
|
||||
'Geometry' => 'Xeometría',
|
||||
'File exists.' => 'O ficheiro xa existe.',
|
||||
'Attachments' => 'Adxuntos',
|
||||
'%d query(s) executed OK.' => array('%d consulta executada correctamente.', '%d consultas executadas correctamente.'),
|
||||
'Show only errors' => 'Amosar só erros',
|
||||
'Refresh' => 'Refrescar',
|
||||
@@ -290,3 +284,5 @@ $translations = array(
|
||||
'yes' => 'si',
|
||||
'no' => 'non',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php gl` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'התחברות',
|
||||
'Logout successful.' => 'ההתחברות הצליחה',
|
||||
'Invalid credentials.' => 'פרטי התחברות שגויים',
|
||||
@@ -212,11 +212,6 @@ $translations = array(
|
||||
'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 בסך הכל',
|
||||
@@ -251,7 +246,6 @@ $translations = array(
|
||||
'Network' => 'רשת',
|
||||
'Geometry' => 'גיאומטריה',
|
||||
'File exists.' => 'קובץ קיים',
|
||||
'Attachments' => 'קבצים מצורפים',
|
||||
'Item%s has been inserted.' => 'הפריט %s הוזן בהצלחה',
|
||||
'now' => 'כעת',
|
||||
'%d query(s) executed OK.' => '%d שאילתות בוצעו בהצלחה',
|
||||
@@ -292,3 +286,5 @@ $translations = array(
|
||||
'yes' => 'כן',
|
||||
'no' => 'לא',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php he` to update this file
|
||||
|
314
adminer/lang/hi.inc.php
Normal file
314
adminer/lang/hi.inc.php
Normal file
@@ -0,0 +1,314 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
Lang::$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' => 'लॉगआउट',
|
||||
'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' => 'डेटाबेस',
|
||||
'Routines' => 'रूटीन्स',
|
||||
'Indexes have been altered.' => 'इंडेक्स बदल दिए गए हैं।',
|
||||
'Indexes' => 'इंडेक्स',
|
||||
'Alter indexes' => 'इंडेक्स बदलें',
|
||||
'Add next' => 'अगला जोड़ें',
|
||||
'Language' => 'भाषा',
|
||||
'Select' => 'चुनें',
|
||||
'New item' => 'नया आइटम',
|
||||
'Search' => 'खोजें',
|
||||
'Sort' => 'क्रमबद्ध करें',
|
||||
'descending' => 'अवरोही',
|
||||
'Limit' => 'सीमा',
|
||||
'No rows.' => 'कोई पंक्ति नहीं।',
|
||||
'Action' => 'कार्रवाई',
|
||||
'edit' => 'संपादित करें',
|
||||
'Page' => 'पृष्ठ',
|
||||
'Query executed OK, %d row(s) affected.' => array('क्वेरी सफलतापूर्वक निष्पादित, %d पंक्ति प्रभावित।', 'क्वेरी सफलतापूर्वक निष्पादित, %d पंक्तियां प्रभावित।'),
|
||||
'Error in query' => 'क्वेरी में त्रुटि',
|
||||
'Execute' => 'निष्पादित करें',
|
||||
'Table' => 'टेबल',
|
||||
'Foreign keys' => 'फॉरेन की',
|
||||
'Triggers' => 'ट्रिगर्स',
|
||||
'View' => 'व्यू',
|
||||
'Unable to select the table' => 'टेबल चुनने में असमर्थ',
|
||||
'Invalid CSRF token. Send the form again.' => 'अमान्य CSRF टोकन। फॉर्म फिर से भेजें।',
|
||||
'Comment' => 'टिप्पणी',
|
||||
'Default values' => 'डिफ़ॉल्ट मान',
|
||||
'%d byte(s)' => array('%d बाइट', '%d बाइट्स'),
|
||||
'No commands to execute.' => 'निष्पादित करने के लिए कोई कमांड नहीं।',
|
||||
'Unable to upload a file.' => 'फाइल अपलोड करने में असमर्थ।',
|
||||
'File upload' => 'फाइल अपलोड',
|
||||
'File uploads are disabled.' => 'फाइल अपलोड अक्षम हैं।',
|
||||
'Routine has been called, %d row(s) affected.' => array('रूटीन कॉल किया गया, %d पंक्ति प्रभावित।', 'रूटीन कॉल किया गया, %d पंक्तियां प्रभावित।'),
|
||||
'Call' => 'कॉल',
|
||||
'No extension' => 'कोई एक्सटेंशन नहीं',
|
||||
'None of the supported PHP extensions (%s) are available.' => 'कोई समर्थित PHP एक्सटेंशन (%s) उपलब्ध नहीं है।',
|
||||
'Session support must be enabled.' => 'सेशन सपोर्ट सक्षम होना चाहिए।',
|
||||
'Session expired, please login again.' => 'सेशन समाप्त, कृपया फिर से लॉगिन करें।',
|
||||
'Text length' => 'टेक्स्ट लंबाई',
|
||||
'Foreign key has been dropped.' => 'फॉरेन की हटा दी गई है।',
|
||||
'Foreign key has been altered.' => 'फॉरेन की बदल दी गई है।',
|
||||
'Foreign key has been created.' => 'फॉरेन की बनाई गई है।',
|
||||
'Foreign key' => 'फॉरेन की',
|
||||
'Target table' => 'लक्ष्य टेबल',
|
||||
'Change' => 'बदलें',
|
||||
'Source' => 'स्रोत',
|
||||
'Target' => 'लक्ष्य',
|
||||
'Add column' => 'कॉलम जोड़ें',
|
||||
'Alter' => 'बदलें',
|
||||
'Add foreign key' => 'फॉरेन की जोड़ें',
|
||||
'ON DELETE' => 'ऑन डिलीट',
|
||||
'ON UPDATE' => 'ऑन अपडेट',
|
||||
'Index Type' => 'इंडेक्स प्रकार',
|
||||
'length' => 'लंबाई',
|
||||
'View has been dropped.' => 'व्यू हटा दिया गया है।',
|
||||
'View has been altered.' => 'व्यू बदल दिया गया है।',
|
||||
'View has been created.' => 'व्यू बनाया गया है।',
|
||||
'Alter view' => 'व्यू बदलें',
|
||||
'Create view' => 'व्यू बनाएं',
|
||||
'Name' => 'नाम',
|
||||
'Process list' => 'प्रक्रिया सूची',
|
||||
'%d process(es) have been killed.' => array('%d प्रक्रिया समाप्त की गई है।', '%d प्रक्रियाएं समाप्त की गई हैं।'),
|
||||
'Kill' => 'समाप्त करें',
|
||||
'Parameter name' => 'पैरामीटर नाम',
|
||||
'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)' => array('%d पंक्ति', '%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 डेटा। डेटा कम करें या %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' => '०१२३४५६७८९',
|
||||
'Tables have been moved.' => 'टेबल्स स्थानांतरित कर दिए गए हैं।',
|
||||
'Move to other database' => 'अन्य डेटाबेस में स्थानांतरित करें',
|
||||
'Move' => 'स्थानांतरित करें',
|
||||
'Engine' => 'इंजन',
|
||||
'Save and continue edit' => 'सहेजें और संपादन जारी रखें',
|
||||
'original' => 'मूल',
|
||||
'Tables have been dropped.' => 'टेबल्स हटा दिए गए हैं।',
|
||||
'%d item(s) have been affected.' => '%d आइटम प्रभावित हुए हैं।',
|
||||
'Whole result' => 'पूरा परिणाम',
|
||||
'Clone' => 'क्लोन',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'अनुमत फील्ड्स की अधिकतम संख्या पार हो गई। कृपया %s बढ़ाएं।',
|
||||
'Partition by' => 'द्वारा विभाजन',
|
||||
'Partitions' => 'पार्टीशन्स',
|
||||
'Partition name' => 'पार्टीशन नाम',
|
||||
'Values' => 'मान',
|
||||
'%d row(s) have been imported.' => array('%d पंक्ति आयात की गई है।', '%d पंक्तियां आयात की गई हैं।'),
|
||||
'anywhere' => 'कहीं भी',
|
||||
'Import' => 'आयात',
|
||||
'Stop on error' => 'त्रुटि पर रुकें',
|
||||
'%.3f s' => '%.3f सेकंड',
|
||||
'$1-$3-$5' => '$1-$3-$5',
|
||||
'[yyyy]-mm-dd' => '[yyyy]-mm-dd',
|
||||
'History' => 'इतिहास',
|
||||
'Variables' => 'चर',
|
||||
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'स्रोत और लक्ष्य कॉलम्स का डेटा प्रकार समान होना चाहिए, लक्ष्य कॉलम्स पर एक इंडेक्स होना चाहिए और संदर्भित डेटा मौजूद होना चाहिए।',
|
||||
'Relations' => 'संबंध',
|
||||
'Run file' => 'फाइल चलाएं',
|
||||
'Clear' => 'साफ़ करें',
|
||||
'Maximum allowed file size is %sB.' => 'अधिकतम अनुमत फाइल आकार %sB है।',
|
||||
'Numbers' => 'संख्याएं',
|
||||
'Date and time' => 'तिथि और समय',
|
||||
'Strings' => 'स्ट्रिंग्स',
|
||||
'Binary' => 'बाइनरी',
|
||||
'Lists' => 'सूचियां',
|
||||
'Editor' => 'संपादक',
|
||||
'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.' => 'प्रकार बनाया गया है।',
|
||||
'Use edit link to modify this value.' => 'इस मान को संशोधित करने के लिए संपादन लिंक का उपयोग करें।',
|
||||
'last' => 'अंतिम',
|
||||
'From server' => 'सर्वर से',
|
||||
'System' => 'सिस्टम',
|
||||
'Select data' => 'डेटा चुनें',
|
||||
'Show structure' => 'संरचना दिखाएं',
|
||||
'empty' => 'खाली',
|
||||
'Network' => 'नेटवर्क',
|
||||
'Geometry' => 'ज्यामिति',
|
||||
'File exists.' => 'फाइल मौजूद है।',
|
||||
'%d query(s) executed OK.' => array('%d क्वेरी सफलतापूर्वक निष्पादित।', '%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' => 'HH:MM:SS',
|
||||
'Check has been dropped.' => 'चेक हटा दिया गया है।',
|
||||
'Check has been altered.' => 'चेक को बदल दिया गया है।',
|
||||
'Check has been created.' => 'चेक बनाया गया है।',
|
||||
'Alter check' => 'चेक बदलें',
|
||||
'Create check' => 'चेक बनाएँ',
|
||||
'Drop %s?' => '%s हटाएँ?',
|
||||
'Tables have been optimized.' => 'टेबल्स को ऑप्टिमाइज़ कर दिया गया है।',
|
||||
'Materialized view' => 'मटेरियलाइज़्ड व्यू',
|
||||
'Vacuum' => 'वैक्यूम',
|
||||
'Selected' => 'चयनित',
|
||||
'overwrite' => 'ओवरराइट',
|
||||
'DB' => 'डेटाबेस',
|
||||
'Algorithm' => 'एल्गोरिदम',
|
||||
'Columns' => 'कॉलम',
|
||||
'Ctrl+click on a value to modify it.' => 'किसी मान को संशोधित करने के लिए Ctrl+क्लिक करें।',
|
||||
'File must be in UTF-8 encoding.' => 'फ़ाइल UTF-8 एन्कोडिंग में होनी चाहिए।',
|
||||
'Modify' => 'संशोधित करें',
|
||||
'Load more data' => 'और डेटा लोड करें',
|
||||
'Loading' => 'लोड हो रहा है',
|
||||
'ATTACH queries are not supported.' => 'संलग्न क्वेरीज़ समर्थित नहीं हैं।',
|
||||
'Warnings' => 'चेतावनियाँ',
|
||||
'%d / ' => '%d / ',
|
||||
'Limit rows' => 'पंक्तियाँ सीमित करें',
|
||||
'Inherits from' => 'इनहेरिट करता है',
|
||||
'Checks' => 'चेक्स',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'एडमिनर बिना पासवर्ड के डेटाबेस एक्सेस करने का समर्थन नहीं करता, <a href="https://www.adminer.org/en/password/"%s>अधिक जानकारी</a>।',
|
||||
'Default value' => 'डिफ़ॉल्ट मान',
|
||||
'Full table scan' => 'पूरी टेबल स्कैन',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => 'बहुत अधिक असफल लॉगिन प्रयास, %d मिनट बाद पुनः प्रयास करें।',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'एडमिनर उपयोग करने के लिए धन्यवाद, <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.' => 'मास्टर पासवर्ड समाप्त हो गया। इसे स्थायी बनाने के लिए %s मेथड <a href="https://www.adminer.org/en/extension/"%s>इम्प्लीमेंट</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.' => 'इनपुट पासवर्ड में एक स्पेस है जो कारण हो सकता है।',
|
||||
'If you did not send this request from Adminer then close this page.' => 'अगर आपने यह अनुरोध एडमिनर से नहीं भेजा है तो इस पेज को बंद करें।',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'आप एक बड़ी SQL फ़ाइल FTP के माध्यम से अपलोड कर सकते हैं और सर्वर से इम्पोर्ट कर सकते हैं।',
|
||||
'Size' => 'आकार',
|
||||
'Compute' => 'कम्प्यूट',
|
||||
'Loaded plugins' => 'लोडेड प्लगइन्स',
|
||||
'screenshot' => 'स्क्रीनशॉट',
|
||||
'You are offline.' => 'आप ऑफ़लाइन हैं।',
|
||||
'You have no privileges to update this table.' => 'आपके पास इस टेबल को अपडेट करने की अनुमति नहीं है।',
|
||||
'Saving' => 'सेव हो रहा है',
|
||||
'Unknown error.' => 'अज्ञात त्रुटि।',
|
||||
'%s must <a%s>return an array</a>.' => '%s को <a%s>एक ऐरे रिटर्न</a> करना चाहिए।',
|
||||
'<a%s>Configure</a> %s in %s.' => '<a%s>कॉन्फ़िगर</a> %s में %s।',
|
||||
'Disable %s or enable %s or %s extensions.' => '%s को डिसेबल करें या %s या %s एक्सटेंशन्स को एनेबल करें।',
|
||||
'Database does not support password.' => 'डेटाबेस पासवर्ड का समर्थन नहीं करता।',
|
||||
'yes' => 'हाँ',
|
||||
'no' => 'नहीं',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php hi` to update this file
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Belépés',
|
||||
'Logout successful.' => 'Sikeres kilépés.',
|
||||
'Invalid credentials.' => 'Érvénytelen adatok.',
|
||||
@@ -206,11 +206,6 @@ $translations = array(
|
||||
'History' => 'Történet',
|
||||
'Variables' => 'Változók',
|
||||
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'A forrás és cél oszlopoknak azonos típusúak legyenek, a cél oszlopok indexeltek legyenek, és a hivatkozott adatnak léteznie kell.',
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'Feladó',
|
||||
'Subject' => 'Tárgy',
|
||||
'Send' => 'Küldés',
|
||||
'%d e-mail(s) have been sent.' => array('%d e-mail elküldve.', '%d e-mail elküldve.', '%d e-mail elküldve.'),
|
||||
'Run file' => 'Fájl futtatása',
|
||||
'Numbers' => 'Szám',
|
||||
'Date and time' => 'Dátum és idő',
|
||||
@@ -225,7 +220,6 @@ $translations = array(
|
||||
'File does not exist.' => 'A fájl nem létezik.',
|
||||
'Permanent login' => 'Emlékezz rám',
|
||||
'%d in total' => 'összesen %d',
|
||||
'Attachments' => 'Csatolmány',
|
||||
'System' => 'Adatbázis',
|
||||
'last' => 'utolsó',
|
||||
'Network' => 'Hálózat',
|
||||
@@ -266,3 +260,5 @@ $translations = array(
|
||||
'Edit all' => 'Összes szerkesztése',
|
||||
'HH:MM:SS' => 'óó:pp:mm',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php hu` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Sistem',
|
||||
'Server' => 'Server',
|
||||
@@ -259,13 +259,6 @@ $translations = array(
|
||||
'Clone' => 'Gandakan',
|
||||
'Delete' => 'Hapus',
|
||||
|
||||
'E-mail' => 'Surel',
|
||||
'From' => 'Dari',
|
||||
'Subject' => 'Judul',
|
||||
'Attachments' => 'Lampiran',
|
||||
'Send' => 'Kirim',
|
||||
'%d e-mail(s) have been sent.' => '%d surel berhasil dikirim.',
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Angka',
|
||||
'Date and time' => 'Tanggal dan waktu',
|
||||
@@ -315,3 +308,5 @@ $translations = array(
|
||||
'Type has been created.' => 'Jenis berhasil dibuat.',
|
||||
'Alter type' => 'Ubah jenis',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php id` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Autenticazione',
|
||||
'Logout successful.' => 'Uscita effettuata con successo.',
|
||||
'Invalid credentials.' => 'Credenziali non valide.',
|
||||
@@ -214,11 +214,6 @@ $translations = array(
|
||||
'Binary' => 'Binari',
|
||||
'Lists' => 'Liste',
|
||||
'Editor' => 'Editor',
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'Da',
|
||||
'Subject' => 'Oggetto',
|
||||
'Send' => 'Invia',
|
||||
'%d e-mail(s) have been sent.' => array('%d e-mail inviata.', '%d e-mail inviate.'),
|
||||
'Webserver file %s' => 'Webserver file %s',
|
||||
'File does not exist.' => 'Il file non esiste.',
|
||||
'%d in total' => '%d in totale',
|
||||
@@ -253,7 +248,6 @@ $translations = array(
|
||||
'Network' => 'Rete',
|
||||
'Geometry' => 'Geometria',
|
||||
'File exists.' => 'Il file esiste già.',
|
||||
'Attachments' => 'Allegati',
|
||||
'%d query(s) executed OK.' => array('%d query eseguita con successo.', '%d query eseguite con successo.'),
|
||||
'Show only errors' => 'Mostra solo gli errori',
|
||||
'Refresh' => 'Aggiorna',
|
||||
@@ -302,3 +296,5 @@ $translations = array(
|
||||
'yes' => 'si',
|
||||
'no' => 'no',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php it` to update this file
|
||||
|
@@ -1,19 +1,28 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'ログイン',
|
||||
'Logout successful.' => 'ログアウト',
|
||||
'Invalid credentials.' => '不正なログイン',
|
||||
'Logout successful.' => 'ログアウトしました。',
|
||||
'Invalid credentials.' => '不正なログインです。',
|
||||
'Server' => 'サーバ',
|
||||
'Username' => 'ユーザ名',
|
||||
'Password' => 'パスワード',
|
||||
'Loaded plugins' => '読込済プラグイン',
|
||||
'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>)',
|
||||
'%s must <a%s>return an array</a>.' => '%s は<a%s>配列を返す</a>必要があります。',
|
||||
'<a%s>Configure</a> %s in %s.' => '%2$s の %1$s を<a%s>設定</a>してください。',
|
||||
'There is a space in the input password which might be the cause.' => '入力されたパスワードに空白が含まれているので、それが原因かもしれません。',
|
||||
'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>)',
|
||||
'Database does not support password.' => 'データベースがパスワードに対応していません。',
|
||||
'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 関数を用います。',
|
||||
'Select database' => 'データベースを選択してください',
|
||||
'Invalid database.' => '不正なデータベース',
|
||||
'Table has been dropped.' => 'テーブルを削除しました',
|
||||
'Table has been altered.' => 'テーブルを変更しました',
|
||||
'Table has been created.' => 'テーブルを作成しました',
|
||||
'Alter table' => 'テーブルの変更',
|
||||
'Invalid database.' => '不正なデータベースです。',
|
||||
'Table has been dropped.' => 'テーブルを削除しました。',
|
||||
'Table has been altered.' => 'テーブルを変更しました。',
|
||||
'Table has been created.' => 'テーブルを作成しました。',
|
||||
'Alter table' => 'テーブルを変更',
|
||||
'Create table' => 'テーブルを作成',
|
||||
'Table name' => 'テーブル名',
|
||||
'engine' => 'エンジン',
|
||||
@@ -25,10 +34,11 @@ $translations = array(
|
||||
'Options' => '設定',
|
||||
'Save' => '保存',
|
||||
'Drop' => '削除',
|
||||
'Database has been dropped.' => 'データベースを削除しました',
|
||||
'Database has been created.' => 'データベースを作成しました',
|
||||
'Database has been renamed.' => 'データベースの名前を変えました',
|
||||
'Database has been altered.' => 'データベースを変更しました',
|
||||
'Drop %s?' => '%s を削除しますか?',
|
||||
'Database has been dropped.' => 'データベースを削除しました。',
|
||||
'Database has been created.' => 'データベースを作成しました。',
|
||||
'Database has been renamed.' => 'データベースの名前を変えました。',
|
||||
'Database has been altered.' => 'データベースを変更しました。',
|
||||
'Alter database' => 'データベースを変更',
|
||||
'Create database' => 'データベースを作成',
|
||||
'SQL command' => 'SQLコマンド',
|
||||
@@ -36,15 +46,17 @@ $translations = array(
|
||||
'Use' => '使用',
|
||||
'No tables.' => 'テーブルがありません。',
|
||||
'select' => '選択',
|
||||
'Item has been deleted.' => '項目を削除しました',
|
||||
'Item has been updated.' => '項目を更新しました',
|
||||
'Item has been deleted.' => '項目を削除しました。',
|
||||
'Item has been updated.' => '項目を更新しました。',
|
||||
'Edit' => '編集',
|
||||
'Insert' => '挿入',
|
||||
'Save and insert next' => '保存/追加',
|
||||
'Delete' => '削除',
|
||||
'You have no privileges to update this table.' => 'このテーブルを更新する権限がありません。',
|
||||
'Database' => 'データベース',
|
||||
'DB' => 'DB',
|
||||
'Routines' => 'ルーチン',
|
||||
'Indexes have been altered.' => '索引を変更しました',
|
||||
'Indexes have been altered.' => '索引を変更しました。',
|
||||
'Indexes' => '索引',
|
||||
'Alter indexes' => '索引の変更',
|
||||
'Add next' => '追加',
|
||||
@@ -55,38 +67,48 @@ $translations = array(
|
||||
'Sort' => 'ソート',
|
||||
'descending' => '降順',
|
||||
'Limit' => '制約',
|
||||
'No rows.' => '行がありません',
|
||||
'Limit rows' => '行数の制約',
|
||||
'No rows.' => '行がありません。',
|
||||
'Action' => '動作',
|
||||
'edit' => '編集',
|
||||
'Page' => 'ページ',
|
||||
'Query executed OK, %d row(s) affected.' => 'クエリーを実行しました。%d 行を変更しました',
|
||||
'Query executed OK, %d row(s) affected.' => 'クエリーを実行しました。%d 行を変更しました。',
|
||||
'Error in query' => 'クエリーのエラー',
|
||||
'Unknown error.' => '不明なエラーです。',
|
||||
'Warnings' => '警告',
|
||||
'ATTACH queries are not supported.' => 'ATTACH クエリーは対応していません。',
|
||||
'Execute' => '実行',
|
||||
'Table' => 'テーブル',
|
||||
'Foreign keys' => '外部キー',
|
||||
'Triggers' => 'トリガー',
|
||||
'View' => 'ビュー',
|
||||
'Materialized view' => 'マテビュー',
|
||||
'Full table scan' => 'テーブルの全スキャン',
|
||||
'Unable to select the table' => 'テーブルを選択できません',
|
||||
'Invalid CSRF token. Send the form again.' => '不正なCSRFトークン。再送信してください',
|
||||
'Invalid CSRF token. Send the form again.' => '不正なCSRFトークン。再送信してください。',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Adminerからのリクエストを送信しない場合はこのページを閉じてください。',
|
||||
'Comment' => 'コメント',
|
||||
'Default values' => '規定値',
|
||||
'%d byte(s)' => '%d バイト',
|
||||
'No commands to execute.' => '実行するコマンドがありません',
|
||||
'Unable to upload a file.' => 'ファイルをアップロードできません',
|
||||
'No commands to execute.' => '実行するコマンドがありません。',
|
||||
'Unable to upload a file.' => 'ファイルをアップロードできません。',
|
||||
'File upload' => 'ファイルをアップロード',
|
||||
'File uploads are disabled.' => 'ファイルのアップロードが無効です',
|
||||
'Routine has been called, %d row(s) affected.' => 'ルーチンを呼びました。%d 行を変更しました',
|
||||
'File uploads are disabled.' => 'ファイルのアップロードが無効です。',
|
||||
'Routine has been called, %d row(s) affected.' => 'ルーチンを呼びました。%d 行を変更しました。',
|
||||
'Call' => '呼出し',
|
||||
'No extension' => '拡張機能がありません',
|
||||
'None of the supported PHP extensions (%s) are available.' => 'PHPの拡張機能(%s)がセットアップされていません',
|
||||
'Session support must be enabled.' => 'セッションを有効にしてください',
|
||||
'Session expired, please login again.' => 'セッションの期限切れ。ログインし直してください',
|
||||
'None of the supported PHP extensions (%s) are available.' => 'PHPの拡張機能(%s)がセットアップされていません。',
|
||||
'Connecting to privileged ports is not allowed.' => '特権ポートへの接続は許可されていません。',
|
||||
'Disable %s or enable %s or %s extensions.' => '%s を無効にするか、拡張機能 %s または %s を有効にしてください。',
|
||||
'Session support must be enabled.' => 'セッションを有効にしてください。',
|
||||
'Session expired, please login again.' => 'セッションの期限切れ。ログインし直してください。',
|
||||
'The action will be performed after successful login with the same credentials.' => '同じアカウントで正しくログインすると作業を実行します。',
|
||||
'Text length' => '文字列の長さ',
|
||||
'Foreign key has been dropped.' => '外部キーを削除しました',
|
||||
'Foreign key has been altered.' => '外部キーを変更しました',
|
||||
'Foreign key has been created.' => '外部キーを作成しました',
|
||||
'Foreign key' => '外キー',
|
||||
'Target table' => 'テーブル',
|
||||
'Foreign key has been dropped.' => '外部キーを削除しました。',
|
||||
'Foreign key has been altered.' => '外部キーを変更しました。',
|
||||
'Foreign key has been created.' => '外部キーを作成しました。',
|
||||
'Foreign key' => '外部キー',
|
||||
'Target table' => '対象テーブル',
|
||||
'Change' => '変更',
|
||||
'Source' => 'ソース',
|
||||
'Target' => 'ターゲット',
|
||||
@@ -97,49 +119,53 @@ $translations = array(
|
||||
'ON UPDATE' => 'ON UPDATE',
|
||||
'Index Type' => '索引の型',
|
||||
'length' => '長さ',
|
||||
'View has been dropped.' => 'ビューを削除しました',
|
||||
'View has been altered.' => 'ビューを変更しました',
|
||||
'View has been created.' => 'ビューを作成しました',
|
||||
'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 プロセスを強制終了しました',
|
||||
'%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.' => 'ルーチンを作成',
|
||||
'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.' => 'トリガーを追加しました',
|
||||
'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 / ' => '%d / ',
|
||||
'%d row(s)' => '%d 行',
|
||||
'Remove' => '除外',
|
||||
'Are you sure?' => '実行しますか?',
|
||||
'Privileges' => '権限',
|
||||
'Create user' => 'ユーザを作成',
|
||||
'User has been dropped.' => 'ユーザを削除',
|
||||
'User has been altered.' => 'ユーザを変更',
|
||||
'User has been created.' => 'ユーザを作成',
|
||||
'User has been dropped.' => 'ユーザを削除しました。',
|
||||
'User has been altered.' => 'ユーザを変更しました。',
|
||||
'User has been created.' => 'ユーザを作成しました。',
|
||||
'Hashed' => 'Hashed',
|
||||
'Column' => '列',
|
||||
'Columns' => '列',
|
||||
'Routine' => 'ルーチン',
|
||||
'Grant' => '権限の付与',
|
||||
'Revoke' => '権限の取消し',
|
||||
'Logged as: %s' => 'ログ:%s',
|
||||
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'POSTデータが大きすぎます。データサイズを小さくするか %s 設定を大きくしてください',
|
||||
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'POSTデータが大きすぎます。データサイズを小さくするか %s 設定を大きくしてください。',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => '大きなSQLファイルは、FTP経由でアップロードしてサーバからインポートしてください。',
|
||||
'You are offline.' => 'オフライン状態です。',
|
||||
'Move up' => '上',
|
||||
'Move down' => '下',
|
||||
'Export' => 'エクスポート',
|
||||
@@ -151,9 +177,9 @@ $translations = array(
|
||||
'Format' => '形式',
|
||||
'Functions' => '関数',
|
||||
'Aggregation' => '集合',
|
||||
'Event has been dropped.' => '削除しました',
|
||||
'Event has been altered.' => '変更しました',
|
||||
'Event has been created.' => '作成しました',
|
||||
'Event has been dropped.' => 'イベントを削除しました。',
|
||||
'Event has been altered.' => 'イベントを変更しました。',
|
||||
'Event has been created.' => 'イベントを作成しました。',
|
||||
'Alter event' => '変更',
|
||||
'Create event' => '作成',
|
||||
'Start' => '開始',
|
||||
@@ -164,8 +190,8 @@ $translations = array(
|
||||
'Events' => 'イベント',
|
||||
'Schedule' => 'スケジュール',
|
||||
'At given time' => '指定時刻',
|
||||
'Tables have been truncated.' => 'テーブルをtruncateしました',
|
||||
'Tables have been moved.' => 'テーブルを移動しました',
|
||||
'Tables have been truncated.' => 'テーブルを空にしました。',
|
||||
'Tables have been moved.' => 'テーブルを移動しました。',
|
||||
'Tables and views' => 'テーブルとビュー',
|
||||
'Engine' => 'エンジン',
|
||||
'Collation' => '照合順序',
|
||||
@@ -177,6 +203,7 @@ $translations = array(
|
||||
'0123456789' => '0123456789',
|
||||
'Analyze' => '分析',
|
||||
'Optimize' => '最適化',
|
||||
'Vacuum' => '不要領域の回収',
|
||||
'Check' => 'チェック',
|
||||
'Repair' => '修復',
|
||||
'Truncate' => '空にする',
|
||||
@@ -184,84 +211,82 @@ $translations = array(
|
||||
'Move' => '移動',
|
||||
'Save and continue edit' => '保存して継続',
|
||||
'original' => '元',
|
||||
'%d item(s) have been affected.' => '%d を更新しました',
|
||||
'%d item(s) have been affected.' => '%d 個を更新しました。',
|
||||
'Whole result' => '全結果',
|
||||
'Tables have been dropped.' => 'テーブルを削除しました',
|
||||
'Tables have been dropped.' => 'テーブルを削除しました。',
|
||||
'Tables have been optimized.' => 'テーブルを最適化しました。',
|
||||
'Clone' => 'クローン',
|
||||
'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 行をインポートしました。',
|
||||
'File must be in UTF-8 encoding.' => 'ファイルをUTF-8で保存してください。',
|
||||
'Show structure' => '構造',
|
||||
'anywhere' => '任意',
|
||||
'Import' => 'インポート',
|
||||
'Stop on error' => 'エラーの場合は停止',
|
||||
'Select data' => 'データ',
|
||||
'%.3f s' => '%.3f 秒',
|
||||
'$1-$3-$5' => '$1.$3.$5',
|
||||
'[yyyy]-mm-dd' => '[yyyy].mm.dd',
|
||||
'$1-$3-$5' => '$1/$3/$5',
|
||||
'[yyyy]-mm-dd' => '[yyyy]/mm/dd',
|
||||
'History' => '履歴',
|
||||
'Variables' => '変数',
|
||||
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'ソースとターゲットの列は同じデータ型でなければなりません。ターゲット列に索引があり、データが存在しなければなりません。',
|
||||
'Relations' => '関係',
|
||||
'Run file' => 'ファイルを実行',
|
||||
'Clear' => '消去',
|
||||
'Maximum allowed file size is %sB.' => '最大ファイルサイズ %sB',
|
||||
'Maximum allowed file size is %sB.' => '最大ファイルサイズは %sB です。',
|
||||
'Numbers' => '数字',
|
||||
'Date and time' => '日時',
|
||||
'Strings' => '文字列',
|
||||
'Binary' => 'バイナリ',
|
||||
'Lists' => 'リスト',
|
||||
'Editor' => 'エディタ',
|
||||
'E-mail' => 'メール',
|
||||
'From' => '差出人',
|
||||
'Subject' => '題名',
|
||||
'Send' => '送信',
|
||||
'%d e-mail(s) have been sent.' => '%d メールを送信しました',
|
||||
'Webserver file %s' => 'Webサーバファイル %s',
|
||||
'File does not exist.' => 'ファイルは存在しません',
|
||||
'File does not exist.' => 'ファイルは存在しません。',
|
||||
'%d in total' => '合計 %d',
|
||||
'Permanent login' => '永続的にログイン',
|
||||
'Databases have been dropped.' => 'データベースを削除しました',
|
||||
'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.' => 'スキーマを変更しました',
|
||||
'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.' => 'シーケンスを変更しました',
|
||||
'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.' => 'ユーザー定義型を追加しました',
|
||||
'Use edit link to modify this value.' => 'リンクを編集する',
|
||||
'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' => 'データベース種類',
|
||||
'empty' => '空',
|
||||
'Network' => 'ネットワーク型',
|
||||
'Geometry' => 'ジオメトリ型',
|
||||
'File exists.' => 'ファイルが既に存在します',
|
||||
'Attachments' => '添付ファイル',
|
||||
'Item%s has been inserted.' => '%s項目を挿入しました',
|
||||
'File exists.' => 'ファイルが既に存在します。',
|
||||
'Item%s has been inserted.' => '%s項目を挿入しました。',
|
||||
'now' => '現在の日時',
|
||||
'%d query(s) executed OK.' => '%d クエリーを実行しました',
|
||||
'%d query(s) executed OK.' => '%d クエリーを実行しました。',
|
||||
'Show only errors' => 'エラーのみ表示',
|
||||
'Refresh' => 'リフレッシュ',
|
||||
'Invalid schema.' => '無効なスキーマ',
|
||||
'Please use one of the extensions %s.' => 'いずれかの拡張機能を使ってください %s',
|
||||
'Invalid schema.' => '無効なスキーマです。',
|
||||
'Please use one of the extensions %s.' => '%s のいずれかの拡張機能を使ってください。',
|
||||
'ltr' => 'ltr',
|
||||
'Tables have been copied.' => 'テーブルをコピーしました',
|
||||
'Tables have been copied.' => 'テーブルをコピーしました。',
|
||||
'Copy' => 'コピー',
|
||||
'overwrite' => '上書き',
|
||||
'Permanent link' => 'パーマネントリンク',
|
||||
'Edit all' => 'すべて編集',
|
||||
'HH:MM:SS' => '時:分:秒',
|
||||
@@ -275,4 +300,16 @@ $translations = array(
|
||||
'yes' => 'はい',
|
||||
'no' => 'いいえ',
|
||||
'Default value' => '既定値',
|
||||
|
||||
// Table check constraints
|
||||
'Checks' => 'チェック',
|
||||
'Create check' => 'チェックを作成',
|
||||
'Alter check' => 'チェックを変更',
|
||||
'Check has been created.' => 'チェックを作成しました。',
|
||||
'Check has been altered.' => 'チェックを変更しました。',
|
||||
'Check has been dropped.' => 'チェックを削除しました。',
|
||||
|
||||
'screenshot' => 'スクリーンショット',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php ja` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'შესვლა',
|
||||
'Logout successful.' => 'გამოხვედით სისტემიდან.',
|
||||
'Invalid credentials.' => 'არასწორი მომხმარებელი ან პაროლი.',
|
||||
@@ -210,11 +210,6 @@ $translations = array(
|
||||
'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',
|
||||
@@ -249,7 +244,6 @@ $translations = array(
|
||||
'Network' => 'ქსელი',
|
||||
'Geometry' => 'გეომეტრია',
|
||||
'File exists.' => 'ფაილი უკვე არსებობს.',
|
||||
'Attachments' => 'მიმაგრებული ფაილები',
|
||||
'%d query(s) executed OK.' => '%d მოთხოვნა შესრულდა.',
|
||||
'Show only errors' => 'მხოლოდ შეცდომები',
|
||||
'Refresh' => 'განახლება',
|
||||
@@ -302,3 +296,5 @@ $translations = array(
|
||||
'Database does not support password.' => 'ბაზაში არაა მხარდაჭერილი პაროლი.',
|
||||
'Disable %s or enable %s or %s extensions.' => 'გათიშეთ %s ან ჩართეთ %s ან %s გაფართოება.',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php ka` to update this file
|
||||
|
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'$1-$3-$5' => '$1-$3-$5',
|
||||
'%.3f s' => '%.3f 초',
|
||||
'%d byte(s)' => '%d 바이트',
|
||||
'%d e-mail(s) have been sent.' => '%d개 메일을 보냈습니다.',
|
||||
'%d in total' => '총 %d개',
|
||||
'%d item(s) have been affected.' => '%d개 항목을 갱신했습니다.',
|
||||
'%d process(es) have been killed.' => '%d개 프로세스를 강제 종료하였습니다.',
|
||||
@@ -38,7 +37,6 @@ $translations = array(
|
||||
'anywhere' => '모든',
|
||||
'Are you sure?' => '실행 하시겠습니까?',
|
||||
'At given time' => '지정 시간',
|
||||
'Attachments' => '첨부 파일',
|
||||
'Auto Increment' => '자동 증가',
|
||||
'Binary' => '이진',
|
||||
'Call' => '호출',
|
||||
@@ -80,7 +78,6 @@ $translations = array(
|
||||
'Delete' => '삭제',
|
||||
'descending' => '역순',
|
||||
'Drop' => '삭제',
|
||||
'E-mail' => '메일',
|
||||
'Edit all' => '모두 편집',
|
||||
'Edit' => '편집',
|
||||
'edit' => '편집',
|
||||
@@ -109,7 +106,6 @@ $translations = array(
|
||||
'Foreign keys' => '외부 키',
|
||||
'Format' => '형식',
|
||||
'From server' => '서버에서 실행',
|
||||
'From' => '보낸 사람',
|
||||
'Functions' => '함수',
|
||||
'Geometry' => '기하 형',
|
||||
'Grant' => '권한 부여',
|
||||
@@ -211,7 +207,6 @@ $translations = array(
|
||||
'Select' => '선택',
|
||||
'select' => '선택',
|
||||
'Selected' => '선택됨',
|
||||
'Send' => '보내기',
|
||||
'Sequence has been altered.' => '시퀀스를 변경했습니다.',
|
||||
'Sequence has been created.' => '시퀀스를 추가했습니다.',
|
||||
'Sequence has been dropped.' => '시퀀스를 제거했습니다.',
|
||||
@@ -230,7 +225,6 @@ $translations = array(
|
||||
'Status' => '상태',
|
||||
'Stop on error' => '오류의 경우 중지',
|
||||
'Strings' => '문자열',
|
||||
'Subject' => '제목',
|
||||
'System' => '데이터베이스 형식',
|
||||
'Table has been altered.' => '테이블을 변경했습니다.',
|
||||
'Table has been created.' => '테이블을 만들었습니다.',
|
||||
@@ -279,3 +273,5 @@ $translations = array(
|
||||
'You can upload a big SQL file via FTP and import it from server.' => '큰 SQL 파일은 FTP를 통하여 업로드하여 서버에서 가져올 수 있습니다.',
|
||||
'You have no privileges to update this table.' => '이 테이블을 업데이트할 권한이 없습니다.',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php ko` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Sistema',
|
||||
'Server' => 'Serveris',
|
||||
@@ -257,13 +257,6 @@ $translations = array(
|
||||
'Clone' => 'Klonuoti',
|
||||
'Delete' => 'Trinti',
|
||||
|
||||
'E-mail' => 'El. paštas',
|
||||
'From' => 'Nuo',
|
||||
'Subject' => 'Antraštė',
|
||||
'Attachments' => 'Priedai',
|
||||
'Send' => 'Siųsti',
|
||||
'%d e-mail(s) have been sent.' => array('Išsiųstas %d laiškas.', 'Išsiųsti %d laiškai.', 'Išsiųsta %d laiškų.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Skaičiai',
|
||||
'Date and time' => 'Data ir laikas',
|
||||
@@ -311,3 +304,5 @@ $translations = array(
|
||||
'Type has been created.' => 'Tipas sukurtas.',
|
||||
'Alter type' => 'Keisti tipą',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php lt` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Ieiet',
|
||||
'Logout successful.' => 'Jūs veiksmīgi izgājāt no sistēmas.',
|
||||
'Invalid credentials.' => 'Nepareizs lietotāja vārds vai parole.',
|
||||
@@ -214,11 +214,6 @@ $translations = array(
|
||||
'Binary' => 'Binārie',
|
||||
'Lists' => 'Saraksti',
|
||||
'Editor' => 'Redaktors',
|
||||
'E-mail' => 'Epasts',
|
||||
'From' => 'No',
|
||||
'Subject' => 'Tēma',
|
||||
'Send' => 'Sūtīt',
|
||||
'%d e-mail(s) have been sent.' => array('Nosūtīts %d epasts.', 'Nosūtīti %d epasti.', 'Nosūtīti %d epasti.'),
|
||||
'Webserver file %s' => 'Fails %s uz servera',
|
||||
'File does not exist.' => 'Fails neeksistē.',
|
||||
'%d in total' => 'Kopā %d',
|
||||
@@ -243,7 +238,7 @@ $translations = array(
|
||||
'Type has been dropped.' => 'Tips dzēsts.',
|
||||
'Type has been created.' => 'Tips izveidots.',
|
||||
'Ctrl+click on a value to modify it.' => 'Lai izmainītu vērtību, izmanto Ctrl + peles klikšķi.',
|
||||
'Use edit link to modify this value.' => 'Izmainīt vērtību var tikai ar saiti "Izmainīt".',
|
||||
'Use edit link to modify this value.' => 'Izmainīt vērtību var tikai ar saiti \'Izmainīt\'.',
|
||||
'last' => 'pēdējā',
|
||||
'From server' => 'No servera',
|
||||
'System' => 'Sistēma',
|
||||
@@ -253,7 +248,6 @@ $translations = array(
|
||||
'Network' => 'Tīkls',
|
||||
'Geometry' => 'Ģeometrija',
|
||||
'File exists.' => 'Fails eksistē.',
|
||||
'Attachments' => 'Pielikumi',
|
||||
'%d query(s) executed OK.' => array('%d pieprasījums veiksmīgs.', '%d pieprasījumi veiksmīgi.', '%d pieprasījumi veiksmīgi.'),
|
||||
'Show only errors' => 'Rādīt tikai kļūdas',
|
||||
'Refresh' => 'Atjaunot',
|
||||
@@ -302,3 +296,5 @@ $translations = array(
|
||||
'Unknown error.' => 'Nezināma kļūda.',
|
||||
'Database does not support password.' => 'Datubāze neatbalsta paroli.',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php lv` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Sistem',
|
||||
'Server' => 'Pelayan',
|
||||
@@ -283,13 +283,6 @@ $translations = array(
|
||||
'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',
|
||||
@@ -339,3 +332,5 @@ $translations = array(
|
||||
'Type has been created.' => 'Jenis telah dibuat.',
|
||||
'Alter type' => 'Ubah jenis',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php ms` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Aanmelden',
|
||||
'Logout successful.' => 'Successvol afgemeld.',
|
||||
'Invalid credentials.' => 'Ongeldige gebruikersgegevens.',
|
||||
@@ -215,11 +215,6 @@ $translations = array(
|
||||
'Binary' => 'Binaire gegevens',
|
||||
'Lists' => 'Lijsten',
|
||||
'Editor' => 'Editor',
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'Van',
|
||||
'Subject' => 'Onderwerp',
|
||||
'Send' => 'Verzenden',
|
||||
'%d e-mail(s) have been sent.' => array('%d e-mail verzonden.', '%d e-mails verzonden.'),
|
||||
'Webserver file %s' => 'Webserver bestand %s',
|
||||
'File does not exist.' => 'Bestand niet gevonden.',
|
||||
'%d in total' => '%d in totaal',
|
||||
@@ -243,7 +238,7 @@ $translations = array(
|
||||
'Type has been dropped.' => 'Type verwijderd.',
|
||||
'Type has been created.' => 'Type aangemaakt.',
|
||||
'Ctrl+click on a value to modify it.' => 'Ctrl+klik op een waarde om deze te bewerken.',
|
||||
'Use edit link to modify this value.' => 'Gebruik de link "bewerk" om deze waarde te wijzigen.',
|
||||
'Use edit link to modify this value.' => 'Gebruik de link \'bewerk\' om deze waarde te wijzigen.',
|
||||
'last' => 'laatste',
|
||||
'From server' => 'Van server',
|
||||
'System' => 'Databasesysteem',
|
||||
@@ -253,7 +248,6 @@ $translations = array(
|
||||
'Network' => 'Netwerk',
|
||||
'Geometry' => 'Geometrie',
|
||||
'File exists.' => 'Bestand bestaat reeds.',
|
||||
'Attachments' => 'Bijlagen',
|
||||
'%d query(s) executed OK.' => array('%d query succesvol uitgevoerd.', '%d querys succesvol uitgevoerd.'),
|
||||
'Show only errors' => 'Enkel fouten tonen',
|
||||
'Refresh' => 'Vernieuwen',
|
||||
@@ -302,3 +296,5 @@ $translations = array(
|
||||
'yes' => 'ja',
|
||||
'no' => 'neen',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php nl` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'System' => 'System',
|
||||
'Server' => 'Server',
|
||||
'Username' => 'Brukernavn',
|
||||
@@ -238,12 +238,6 @@ $translations = array(
|
||||
'Clone' => 'Klon',
|
||||
'Delete' => 'Slett',
|
||||
'You have no privileges to update this table.' => 'Du mangler rettighetene som trengs for å endre denne tabellen.',
|
||||
'E-mail' => 'E-post',
|
||||
'From' => 'Fra',
|
||||
'Subject' => 'Tittel',
|
||||
'Attachments' => 'Vedlegg',
|
||||
'Send' => 'Send',
|
||||
'%d e-mail(s) have been sent.' => array('%d epost sendt.', '%d eposter sendt.'),
|
||||
'Numbers' => 'Nummer',
|
||||
'Date and time' => 'Dato og tid',
|
||||
'Strings' => 'Strenger',
|
||||
@@ -281,3 +275,5 @@ $translations = array(
|
||||
'Alter type' => 'Endre type',
|
||||
'Saving' => 'Lagrer',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php no` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Rodzaj bazy',
|
||||
'Server' => 'Serwer',
|
||||
@@ -42,6 +42,7 @@ $translations = array(
|
||||
'User has been created.' => 'Użytkownik został dodany.',
|
||||
'Hashed' => 'Zahashowane',
|
||||
'Column' => 'Kolumna',
|
||||
'Columns' => 'Kolumny',
|
||||
'Routine' => 'Procedura',
|
||||
'Grant' => 'Uprawnienia',
|
||||
'Revoke' => 'Usuń uprawnienia',
|
||||
@@ -86,6 +87,7 @@ $translations = array(
|
||||
'Output' => 'Rezultat',
|
||||
'open' => 'otwórz',
|
||||
'save' => 'zapisz',
|
||||
'Saving' => 'Zapisywanie',
|
||||
'Format' => 'Format',
|
||||
'Data' => 'Dane',
|
||||
|
||||
@@ -193,6 +195,7 @@ $translations = array(
|
||||
'Partitions' => 'Partycje',
|
||||
'Partition name' => 'Nazwa partycji',
|
||||
'Values' => 'Wartości',
|
||||
'Inherits from' => 'Dziedziczy po',
|
||||
|
||||
'View' => 'Perspektywa',
|
||||
'Materialized view' => 'Zmaterializowana perspektywa',
|
||||
@@ -208,6 +211,8 @@ $translations = array(
|
||||
'Add next' => 'Dodaj następny',
|
||||
'Index Type' => 'Typ indeksu',
|
||||
'length' => 'długość',
|
||||
'Algorithm' => 'Algorytm',
|
||||
'Condition' => 'Warunek',
|
||||
|
||||
'Foreign keys' => 'Klucze obce',
|
||||
'Foreign key' => 'Klucz obcy',
|
||||
@@ -284,7 +289,6 @@ $translations = array(
|
||||
'Edit' => 'Edytuj',
|
||||
'Insert' => 'Dodaj',
|
||||
'Save' => 'Zapisz zmiany',
|
||||
'Saving' => 'Zapisywanie',
|
||||
'Save and continue edit' => 'Zapisz i kontynuuj edycję',
|
||||
'Save and insert next' => 'Zapisz i dodaj następny',
|
||||
'Selected' => 'Zaznaczone',
|
||||
@@ -292,13 +296,6 @@ $translations = array(
|
||||
'Delete' => 'Usuń',
|
||||
'You have no privileges to update this table.' => 'Brak uprawnień do edycji tej tabeli.',
|
||||
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'Nadawca',
|
||||
'Subject' => 'Temat',
|
||||
'Attachments' => 'Załączniki',
|
||||
'Send' => 'Wyślij',
|
||||
'%d e-mail(s) have been sent.' => array('Wysłano %d e-mail.', 'Wysłano %d e-maile.', 'Wysłano %d e-maili.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Numeryczne',
|
||||
'Date and time' => 'Data i czas',
|
||||
@@ -355,4 +352,11 @@ $translations = array(
|
||||
'Check has been created.' => 'Kontrola została utworzona.',
|
||||
'Check has been altered.' => 'Kontrola została zmieniona.',
|
||||
'Check has been dropped.' => 'Kontrola została usunięta.',
|
||||
|
||||
'Loaded plugins' => 'Wczytane wtyczki',
|
||||
'%s must <a%s>return an array</a>.' => '%s musi <a%s>zwrócić tablicę</a>.',
|
||||
'<a%s>Configure</a> %s in %s.' => '<a%s>Skonfiguruj</a> %s w %s.',
|
||||
'screenshot' => 'zrzut ekranu',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php pl` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Entrar',
|
||||
'Logout successful.' => 'Saída bem sucedida.',
|
||||
'Invalid credentials.' => 'Identificação inválida.',
|
||||
@@ -214,11 +214,6 @@ $translations = array(
|
||||
'Binary' => 'Binário',
|
||||
'Lists' => 'Listas',
|
||||
'Editor' => 'Editor',
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'De',
|
||||
'Subject' => 'Assunto',
|
||||
'Send' => 'Enviar',
|
||||
'%d e-mail(s) have been sent.' => array('%d email foi enviado.', '%d emails foram enviados.'),
|
||||
'Webserver file %s' => 'Arquivo do servidor web %s',
|
||||
'File does not exist.' => 'Arquivo não existe.',
|
||||
'%d in total' => '%d no total',
|
||||
@@ -253,7 +248,6 @@ $translations = array(
|
||||
'Network' => 'Rede',
|
||||
'Geometry' => 'Geometria',
|
||||
'File exists.' => 'Arquivo já existe.',
|
||||
'Attachments' => 'Anexos',
|
||||
'%d query(s) executed OK.' => array('%d consulta sql executada corretamente.', '%d consultas sql executadas corretamente.'),
|
||||
'Show only errors' => 'Mostrar somente erros',
|
||||
'Refresh' => 'Atualizar',
|
||||
@@ -262,3 +256,5 @@ $translations = array(
|
||||
'now' => 'agora',
|
||||
'ltr' => 'ltr',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php pt-br` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Entrar',
|
||||
'Logout successful.' => 'Sessão terminada com sucesso.',
|
||||
'Invalid credentials.' => 'Identificação inválida.',
|
||||
@@ -214,11 +214,6 @@ $translations = array(
|
||||
'Binary' => 'Binário',
|
||||
'Lists' => 'Listas',
|
||||
'Editor' => 'Editor',
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'De',
|
||||
'Subject' => 'Assunto',
|
||||
'Send' => 'Enviar',
|
||||
'%d e-mail(s) have been sent.' => array('%d email enviado.', '%d emails enviados.'),
|
||||
'Webserver file %s' => 'Ficheiro do servidor web %s',
|
||||
'File does not exist.' => 'Ficheiro não existe.',
|
||||
'%d in total' => '%d no total',
|
||||
@@ -253,7 +248,6 @@ $translations = array(
|
||||
'Network' => 'Rede',
|
||||
'Geometry' => 'Geometria',
|
||||
'File exists.' => 'Ficheiro já existe.',
|
||||
'Attachments' => 'Anexos',
|
||||
'%d query(s) executed OK.' => array('%d consulta sql executada corretamente.', '%d consultas sql executadas corretamente.'),
|
||||
'Show only errors' => 'Mostrar somente erros',
|
||||
'Refresh' => 'Atualizar',
|
||||
@@ -262,3 +256,5 @@ $translations = array(
|
||||
'now' => 'agora',
|
||||
'ltr' => 'ltr',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php pt` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Intră',
|
||||
'Logout successful.' => 'Ați ieșit cu succes.',
|
||||
'Invalid credentials.' => 'Numele de utilizator sau parola este greșită.',
|
||||
@@ -214,11 +214,6 @@ $translations = array(
|
||||
'Binary' => 'Tip binar',
|
||||
'Lists' => 'Liste',
|
||||
'Editor' => 'Editor',
|
||||
'E-mail' => 'Poșta electronică',
|
||||
'From' => 'De la',
|
||||
'Subject' => 'Pentru',
|
||||
'Send' => 'Trimite',
|
||||
'%d e-mail(s) have been sent.' => array('A fost trimis %d mail.', 'Au fost trimise %d mail-uri.'),
|
||||
'Webserver file %s' => 'Fișierul %s pe server',
|
||||
'File does not exist.' => 'Acest fișier nu există.',
|
||||
'%d in total' => 'În total %d',
|
||||
@@ -253,7 +248,6 @@ $translations = array(
|
||||
'Network' => 'Rețea',
|
||||
'Geometry' => 'Geometrie',
|
||||
'File exists.' => 'Fișierul există deja.',
|
||||
'Attachments' => 'Fișiere atașate',
|
||||
'%d query(s) executed OK.' => array('%d query executat.', '%d query-uri executate cu succes.'),
|
||||
'Show only errors' => 'Arată doar greșeli',
|
||||
'Refresh' => 'Împrospătează',
|
||||
@@ -267,3 +261,5 @@ $translations = array(
|
||||
'Edit all' => 'Editează tot',
|
||||
'HH:MM:SS' => 'HH:MM:SS',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php ro` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Войти',
|
||||
'Logout successful.' => 'Вы успешно покинули систему.',
|
||||
'Invalid credentials.' => 'Неправильное имя пользователя или пароль.',
|
||||
@@ -214,11 +214,6 @@ $translations = array(
|
||||
'Binary' => 'Двоичный тип',
|
||||
'Lists' => 'Списки',
|
||||
'Editor' => 'Редактор',
|
||||
'E-mail' => 'Эл. почта',
|
||||
'From' => 'От',
|
||||
'Subject' => 'Тема',
|
||||
'Send' => 'Послать',
|
||||
'%d e-mail(s) have been sent.' => array('Было отправлено %d письмо.', 'Было отправлено %d письма.', 'Было отправлено %d писем.'),
|
||||
'Webserver file %s' => 'Файл %s на вебсервере',
|
||||
'File does not exist.' => 'Такого файла не существует.',
|
||||
'%d in total' => 'Всего %d',
|
||||
@@ -253,7 +248,6 @@ $translations = array(
|
||||
'Network' => 'Сеть',
|
||||
'Geometry' => 'Геометрия',
|
||||
'File exists.' => 'Файл уже существует.',
|
||||
'Attachments' => 'Прикреплённые файлы',
|
||||
'%d query(s) executed OK.' => array('%d запрос выполнен успешно.', '%d запроса выполнено успешно.', '%d запросов выполнено успешно.'),
|
||||
'Show only errors' => 'Только ошибки',
|
||||
'Refresh' => 'Обновить',
|
||||
@@ -302,4 +296,15 @@ $translations = array(
|
||||
'Unknown error.' => 'Неизвестная ошибка.',
|
||||
'Database does not support password.' => 'База данных не поддерживает пароль.',
|
||||
'Disable %s or enable %s or %s extensions.' => 'Отключите %s или включите расширения %s или %s.',
|
||||
'Check has been dropped.' => 'Проверка удалена.',
|
||||
'Check has been altered.' => 'Проверка изменена.',
|
||||
'Check has been created.' => 'Проверка создана.',
|
||||
'Alter check' => 'Изменить проверку',
|
||||
'Create check' => 'Создать проверку',
|
||||
'Checks' => 'Проверки',
|
||||
'Loaded plugins' => 'Загруженные плагины',
|
||||
'%s must <a%s>return an array</a>.' => '%s должна <a%s>вернуть массив</a>.',
|
||||
'<a%s>Configure</a> %s in %s.' => '<a%s>Настроить</a> %s в %s.',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php ru` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'Prihlásiť sa',
|
||||
'Logout successful.' => 'Odhlásenie prebehlo v poriadku.',
|
||||
'Invalid credentials.' => 'Neplatné prihlasovacie údaje.',
|
||||
@@ -205,11 +205,6 @@ $translations = array(
|
||||
'History' => 'História',
|
||||
'Variables' => 'Premenné',
|
||||
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Zdrojové a cieľové stĺpce musia mať rovnaký datový typ, nad cieľovými stĺpcami musí byť definovaný index a odkazované dáta musia existovať.',
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'Odosielateľ',
|
||||
'Subject' => 'Predmet',
|
||||
'Send' => 'Odoslať',
|
||||
'%d e-mail(s) have been sent.' => array('Bol odoslaný %d e-mail.', 'Boli odoslané %d e-maily.', 'Bolo odoslaných %d e-mailov.'),
|
||||
'Run file' => 'Spustiť súbor',
|
||||
'Numbers' => 'Čísla',
|
||||
'Date and time' => 'Dátum a čas',
|
||||
@@ -253,7 +248,6 @@ $translations = array(
|
||||
'Network' => 'Sieť',
|
||||
'Geometry' => 'Geometria',
|
||||
'File exists.' => 'Súbor existuje.',
|
||||
'Attachments' => 'Prílohy',
|
||||
'%d query(s) executed OK.' => array('Bol vykonaný %d dotaz.', 'Boli vykonané %d dotazy.', 'Bolo vykonaných %d dotazov.'),
|
||||
'Show only errors' => 'Zobraziť iba chyby',
|
||||
'Refresh' => 'Obnoviť',
|
||||
@@ -281,7 +275,7 @@ $translations = array(
|
||||
'Warnings' => 'Varovania',
|
||||
'%d / ' => '%d / ',
|
||||
'Limit rows' => 'Limit riadkov',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer nepodporuje prístup k databáze bez hesla, <a href="https://www.adminer.org/cs/password/"%s>viac informácií</a>.',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer nepodporuje prístup k databáze bez hesla, <a href="https://www.adminer.org/sk/password/"%s>viac informácií</a>.',
|
||||
'Default value' => 'Predvolená hodnota',
|
||||
'Full table scan' => 'Prechod celej tabuľky',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Príliš veľa pokusov o prihlásenie, skúste to znova za %d minutu.', 'Príliš veľa pokusov o prihlásenie, skúste to znova za %d minuty.', 'Príliš veľa pokusov o prihlásenie, skúste to znova za %d minút.'),
|
||||
@@ -309,3 +303,5 @@ $translations = array(
|
||||
'Check has been altered.' => 'Kontrola bola zmenená.',
|
||||
'Check has been dropped.' => 'Kontrola bola odstránená.',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php sk` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Sistem',
|
||||
'Server' => 'Strežnik',
|
||||
@@ -254,13 +254,6 @@ $translations = array(
|
||||
'Clone' => 'Kloniraj',
|
||||
'Delete' => 'Izbriši',
|
||||
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'Od',
|
||||
'Subject' => 'Zadeva',
|
||||
'Attachments' => 'Priponke',
|
||||
'Send' => 'Pošlji',
|
||||
'%d e-mail(s) have been sent.' => array('Poslan je %d e-mail.', 'Poslana sta %d e-maila.', 'Poslani so %d e-maili.', 'Poslanih je %d e-mailov.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Števila',
|
||||
'Date and time' => 'Datum in čas',
|
||||
@@ -306,3 +299,5 @@ $translations = array(
|
||||
'Type has been created.' => 'Tip je ustvarjen.',
|
||||
'Alter type' => 'Spremeni tip',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php sl` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Систем',
|
||||
'Server' => 'Сервер',
|
||||
@@ -262,13 +262,6 @@ $translations = array(
|
||||
'Clone' => 'Дуплирај',
|
||||
'Delete' => 'Избриши',
|
||||
|
||||
'E-mail' => 'Ел. пошта',
|
||||
'From' => 'Од',
|
||||
'Subject' => 'Наслов',
|
||||
'Attachments' => 'Прилози',
|
||||
'Send' => 'Пошаљи',
|
||||
'%d e-mail(s) have been sent.' => array('%d порука ел. поште је послата.', '%d поруке ел. поште су послате.', '%d порука ел. поште је послато.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Број',
|
||||
'Date and time' => 'Датум и време',
|
||||
@@ -318,3 +311,5 @@ $translations = array(
|
||||
'Type has been created.' => 'тип је креиран.',
|
||||
'Alter type' => 'Уреди тип',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php sr` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'System',
|
||||
'Server' => 'Server',
|
||||
@@ -292,13 +292,6 @@ $translations = array(
|
||||
'Delete' => 'Ta bort',
|
||||
'You have no privileges to update this table.' => 'Du har inga privilegier för att uppdatera den här tabellen.',
|
||||
|
||||
'E-mail' => 'Email',
|
||||
'From' => 'Från',
|
||||
'Subject' => 'Ämne',
|
||||
'Attachments' => 'Bilagor',
|
||||
'Send' => 'Skicka',
|
||||
'%d e-mail(s) have been sent.' => array('%d email har blivit skickat.', '%d email har blivit skickade.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Nummer',
|
||||
'Date and time' => 'Datum och tid',
|
||||
@@ -348,3 +341,5 @@ $translations = array(
|
||||
'Type has been created.' => 'Typ har skapats.',
|
||||
'Alter type' => 'Ändra typ',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php sv` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'நுழை',
|
||||
'Logout successful.' => 'வெற்றிகரமாய் வெளியேறியாயிற்று.',
|
||||
'Invalid credentials.' => 'சரியான விபரங்கள் இல்லை.',
|
||||
@@ -212,11 +212,6 @@ $translations = array(
|
||||
'Binary' => 'பைனரி',
|
||||
'Lists' => 'பட்டியல்',
|
||||
'Editor' => 'தொகுப்பாளர்',
|
||||
'E-mail' => 'மின்னஞ்சல்',
|
||||
'From' => 'அனுப்புனர்',
|
||||
'Subject' => 'பொருள்',
|
||||
'Send' => 'அனுப்பு',
|
||||
'%d e-mail(s) have been sent.' => array('%d மின்னஞ்சல் அனுப்பபட்டது.', '%d மின்னஞ்சல்கள் அனுப்பப்பட்டன.'),
|
||||
'Webserver file %s' => 'வெப் சர்வர் கோப்பு %s',
|
||||
'File does not exist.' => 'கோப்பு இல்லை.',
|
||||
'%d in total' => 'மொத்தம் %d ',
|
||||
@@ -252,7 +247,6 @@ $translations = array(
|
||||
'Network' => 'நெட்வொர்க்',
|
||||
'Geometry' => 'வடிவவியல் (Geometry)',
|
||||
'File exists.' => 'கோப்பு உள்ளது.',
|
||||
'Attachments' => 'இணைப்புகள்',
|
||||
'now' => 'இப்பொழுது',
|
||||
'%d query(s) executed OK.' => array('%d வினவல் செயல்படுத்தப்பட்டது.', '%d வினவல்கள் செயல்படுத்தப்பட்டன.'),
|
||||
'Show only errors' => 'பிழைகளை மட்டும் காண்பிக்கவும்',
|
||||
@@ -266,3 +260,5 @@ $translations = array(
|
||||
'Edit all' => 'அனைத்தையும் தொகு',
|
||||
'HH:MM:SS' => 'HH:MM:SS',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php ta` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
'Login' => 'เข้าสู่ระบบ',
|
||||
'Logout successful.' => 'ออกจากระบบเรียบร้อยแล้ว.',
|
||||
'Invalid credentials.' => 'ข้อมูลไม่ถูกต้อง.',
|
||||
@@ -214,11 +214,6 @@ $translations = array(
|
||||
'Binary' => 'เลขฐานสอง',
|
||||
'Lists' => 'รายการ',
|
||||
'Editor' => 'ผู้แก้ไข',
|
||||
'E-mail' => 'อีเมล์',
|
||||
'From' => 'จาก',
|
||||
'Subject' => 'หัวข้อ',
|
||||
'Send' => 'ส่ง',
|
||||
'%d e-mail(s) have been sent.' => 'มี %d อีเมล์ ถูกส่งออกแล้ว.',
|
||||
'Webserver file %s' => 'Webserver file %s',
|
||||
'File does not exist.' => 'ไม่มีไฟล์.',
|
||||
'%d in total' => '%d ของทั้งหมด',
|
||||
@@ -253,7 +248,6 @@ $translations = array(
|
||||
'Network' => 'เครื่องข่าย',
|
||||
'Geometry' => 'เรขาคณิต',
|
||||
'File exists.' => 'มีไฟล์นี้อยู่แล้ว.',
|
||||
'Attachments' => 'ไฟล์แนบ',
|
||||
'%d query(s) executed OK.' => '%d คำสั่งถูกดำเนินการแล้ว.',
|
||||
'Show only errors' => 'แสดงเฉพาะเออเรอ',
|
||||
'Refresh' => 'โหลดใหม่',
|
||||
@@ -267,3 +261,5 @@ $translations = array(
|
||||
'Edit all' => 'แก้ไขทั้งหมด',
|
||||
'HH:MM:SS' => 'HH:MM:SS',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php th` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Sistem',
|
||||
'Server' => 'Sunucu',
|
||||
@@ -286,13 +286,6 @@ $translations = array(
|
||||
'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',
|
||||
'Subject' => 'Konu',
|
||||
'Attachments' => 'Ekler',
|
||||
'Send' => 'Gönder',
|
||||
'%d e-mail(s) have been sent.' => array('%d e-posta gönderildi.', '%d adet e-posta gönderildi.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Sayılar',
|
||||
'Date and time' => 'Tarih ve zaman',
|
||||
@@ -307,7 +300,7 @@ $translations = array(
|
||||
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
|
||||
'$1-$3-$5' => '$6.$4.$1',
|
||||
// hint for date format - use language equivalents for day, month and year shortcuts
|
||||
'[yyyy]-mm-dd' => '[yyyy]-aa-gg',
|
||||
'[yyyy]-mm-dd' => 'g.a.[yyyy]',
|
||||
// hint for time format - use language equivalents for hour, minute and second shortcuts
|
||||
'HH:MM:SS' => 'SS:DD:ss',
|
||||
'now' => 'şimdi',
|
||||
@@ -342,3 +335,5 @@ $translations = array(
|
||||
'Type has been created.' => 'Tür oluşturuldu.',
|
||||
'Alter type' => 'Türü değiştir',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php tr` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Система Бази Даних',
|
||||
'Server' => 'Сервер',
|
||||
@@ -259,13 +259,6 @@ $translations = array(
|
||||
'Clone' => 'Клонувати',
|
||||
'Delete' => 'Видалити',
|
||||
|
||||
'E-mail' => 'E-mail',
|
||||
'From' => 'Від',
|
||||
'Subject' => 'Заголовок',
|
||||
'Attachments' => 'Додатки',
|
||||
'Send' => 'Надіслати',
|
||||
'%d e-mail(s) have been sent.' => array('Було надіслано %d повідомлення.', 'Було надіслано %d повідомлення.', 'Було надіслано %d повідомлень.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Числа',
|
||||
'Date and time' => 'Дата і час',
|
||||
@@ -344,4 +337,18 @@ $translations = array(
|
||||
'Saving' => 'Збереження',
|
||||
'Unknown error.' => 'Невідома помилка.',
|
||||
'Database does not support password.' => 'База даних не підтримує пароль.',
|
||||
'Disable %s or enable %s or %s extensions.' => 'Вимкніть %s або увімкніть розширення %s або %s.',
|
||||
'Check has been dropped.' => 'Перевірку видалено.',
|
||||
'Check has been altered.' => 'Перевірка змінена.',
|
||||
'Check has been created.' => 'Перевірку створено.',
|
||||
'Alter check' => 'Змінити перевірку',
|
||||
'Create check' => 'Створити перевірку',
|
||||
'Vacuum' => 'Вакуум',
|
||||
'%d / ' => '%d / ',
|
||||
'Checks' => 'Перевірки',
|
||||
'Loaded plugins' => 'Завантажені плагіни',
|
||||
'%s must <a%s>return an array</a>.' => '%s має <a%s>повернути масив</a>.',
|
||||
'<a%s>Configure</a> %s in %s.' => '<a%s>Налаштувати</a> %s у %s.',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php uk` to update this file
|
||||
|
358
adminer/lang/uz.inc.php
Normal file
358
adminer/lang/uz.inc.php
Normal file
@@ -0,0 +1,358 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Tizim',
|
||||
'Server' => 'Server',
|
||||
'Username' => 'Foydalanuvchi nomi',
|
||||
'Password' => 'Parol',
|
||||
'Permanent login' => 'Doimiy kirish',
|
||||
'Login' => 'Kirish',
|
||||
'Logout' => 'Chiqish',
|
||||
'Logged as: %s' => 'Siz kirgansiz: %s',
|
||||
'Logout successful.' => 'Muvaffaqiyatli chiqdingiz.',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Adminer dasturidan foydalanganingiz uchun rahmat, <a href="https://www.adminer.org/en/donation/">xayriya qilishni</a> o\'ylab ko\'ring.',
|
||||
'Loaded plugins' => 'Yuklangan plaginlar',
|
||||
'%s must <a%s>return an array</a>.' => '%s <a%s>massiv qaytarishi</a> kerak.',
|
||||
'<a%s>Configure</a> %s in %s.' => '%s ni %s ichida <a%s>sozlang</a>.',
|
||||
'Invalid credentials.' => 'Noto\'g\'ri ma\'lumotlar.',
|
||||
'There is a space in the input password which might be the cause.' => 'Kiritilgan parolda bo\'sh joy bor, bu sabab bo\'lishi mumkin.',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer parolsiz ma\'lumotlar bazasiga kirishni qo\'llab-quvvatlamaydi, <a href="https://www.adminer.org/en/password/"%s>ko\'proq ma\'lumot</a>.',
|
||||
'Database does not support password.' => 'Ma\'lumotlar bazasi parolni qo\'llab-quvvatlamaydi.',
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Juda ko\'p muvaffaqiyatsiz urinishlar, %d daqiqadan so\'ng qayta urining.', 'Juda ko\'p muvaffaqiyatsiz urinishlar, %d daqiqadan so\'ng qayta urining.'),
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Asosiy parol muddati tugadi. Uni doimiy qilish uchun %s usulini <a href="https://www.adminer.org/en/extension/"%s>amalga oshiring</a>.',
|
||||
'Language' => 'Til',
|
||||
'Invalid CSRF token. Send the form again.' => 'Noto\'g\'ri CSRF belgisi. Shaklni qayta yuboring.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Agar bu so\'rovni Adminerdan yuborgan bo\'lmasangiz, ushbu sahifani yoping.',
|
||||
'No extension' => 'Kengaytma yo\'q',
|
||||
// %s contains the list of the extensions, e.g. 'mysqli, PDO_MySQL'
|
||||
'None of the supported PHP extensions (%s) are available.' => 'Qo\'llab-quvvatlanadigan PHP kengaytmalarining (%s) hech biri mavjud emas.',
|
||||
'Connecting to privileged ports is not allowed.' => 'Imtiyozli portlarga ulanishga ruxsat berilmagan.',
|
||||
'Disable %s or enable %s or %s extensions.' => '%s ni o\'chiring yoki %s yoki %s kengaytmalarini yoqing.',
|
||||
'Session support must be enabled.' => 'Sessiya qo\'llab-quvvatlashi yoqilgan bo\'lishi kerak.',
|
||||
'Session expired, please login again.' => 'Sessiya muddati tugadi, iltimos, qayta kiring.',
|
||||
'The action will be performed after successful login with the same credentials.' => 'Amal bir xil ma\'lumotlar bilan muvaffaqiyatli kirishdan so\'ng amalga oshiriladi.',
|
||||
'%s version: %s through PHP extension %s' => '%s versiyasi: %s PHP kengaytmasi %s orqali',
|
||||
'Refresh' => 'Yangilash',
|
||||
|
||||
// text direction - 'ltr' or 'rtl'
|
||||
'ltr' => 'ltr',
|
||||
|
||||
'Privileges' => 'Imtiyozlar',
|
||||
'Create user' => 'Foydalanuvchi yaratish',
|
||||
'User has been dropped.' => 'Foydalanuvchi o\'chirildi.',
|
||||
'User has been altered.' => 'Foydalanuvchi o\'zgartirildi.',
|
||||
'User has been created.' => 'Foydalanuvchi yaratildi.',
|
||||
'Hashed' => 'Xeshlangan',
|
||||
'Column' => 'Ustun',
|
||||
'Routine' => 'Protsedura',
|
||||
'Grant' => 'Berish',
|
||||
'Revoke' => 'Bekor qilish',
|
||||
|
||||
'Process list' => 'Jarayonlar ro\'yxati',
|
||||
'%d process(es) have been killed.' => array('%d jarayon to\'xtatildi.', '%d jarayonlar to\'xtatildi.'),
|
||||
'Kill' => 'To\'xtatish',
|
||||
|
||||
'Variables' => 'O\'zgaruvchilar',
|
||||
'Status' => 'Holat',
|
||||
|
||||
'SQL command' => 'SQL buyrug\'i',
|
||||
'%d query(s) executed OK.' => array('%d so\'rov muvaffaqiyatli bajarildi.', '%d so\'rovlar muvaffaqiyatli bajarildi.'),
|
||||
'Query executed OK, %d row(s) affected.' => array('So\'rov muvaffaqiyatli bajarildi, %d qator o\'zgartirildi.', 'So\'rov muvaffaqiyatli bajarildi, %d qatorlar o\'zgartirildi.'),
|
||||
'No commands to execute.' => 'Bajariladigan buyruqlar yo\'q.',
|
||||
'Error in query' => 'So\'rovda xatolik',
|
||||
'Unknown error.' => 'Noma\'lum xatolik.',
|
||||
'Warnings' => 'Ogohlantirishlar',
|
||||
'ATTACH queries are not supported.' => 'ATTACH so\'rovlari qo\'llab-quvvatlanmaydi.',
|
||||
'Execute' => 'Bajarish',
|
||||
'Stop on error' => 'Xatoda to\'xtash',
|
||||
'Show only errors' => 'Faqat xatolarni ko\'rsatish',
|
||||
// sprintf() format for time of the command
|
||||
'%.3f s' => '%.3f s',
|
||||
'History' => 'Tarix',
|
||||
'Clear' => 'Tozalash',
|
||||
'Edit all' => 'Hammasini tahrirlash',
|
||||
|
||||
'File upload' => 'Fayl yuklash',
|
||||
'From server' => 'Serverdan',
|
||||
'Webserver file %s' => 'Veb-server fayli %s',
|
||||
'Run file' => 'Faylni ishga tushirish',
|
||||
'File does not exist.' => 'Fayl mavjud emas.',
|
||||
'File uploads are disabled.' => 'Fayl yuklash o\'chirilgan.',
|
||||
'Unable to upload a file.' => 'Faylni yuklab bo\'lmadi.',
|
||||
'Maximum allowed file size is %sB.' => 'Maksimal ruxsat etilgan fayl hajmi %sB.',
|
||||
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Juda katta POST ma\'lumotlari. Ma\'lumotlarni kamaytiring yoki %s konfiguratsiya direktivasini oshiring.',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'Katta SQL faylini FTP orqali yuklab, uni serverdan import qilishingiz mumkin.',
|
||||
'You are offline.' => 'Siz oflayndasiz.',
|
||||
|
||||
'Export' => 'Eksport',
|
||||
'Output' => 'Natija',
|
||||
'open' => 'ochish',
|
||||
'save' => 'saqlash',
|
||||
'Saving' => 'Saqlanmoqda',
|
||||
'Format' => 'Format',
|
||||
'Data' => 'Ma\'lumotlar',
|
||||
|
||||
'Database' => 'Ma\'lumotlar bazasi',
|
||||
'DB' => 'MB',
|
||||
'Use' => 'Foydalanish',
|
||||
'Select database' => 'Ma\'lumotlar bazasini tanlash',
|
||||
'Invalid database.' => 'Noto\'g\'ri ma\'lumotlar bazasi.',
|
||||
'Database has been dropped.' => 'Ma\'lumotlar bazasi o\'chirildi.',
|
||||
'Databases have been dropped.' => 'Ma\'lumotlar bazalari o\'chirildi.',
|
||||
'Database has been created.' => 'Ma\'lumotlar bazasi yaratildi.',
|
||||
'Database has been renamed.' => 'Ma\'lumotlar bazasi qayta nomlandi.',
|
||||
'Database has been altered.' => 'Ma\'lumotlar bazasi o\'zgartirildi.',
|
||||
'Alter database' => 'Ma\'lumotlar bazasini o\'zgartirish',
|
||||
'Create database' => 'Ma\'lumotlar bazasini yaratish',
|
||||
'Database schema' => 'Ma\'lumotlar bazasi sxemasi',
|
||||
|
||||
// link to current database schema layout
|
||||
'Permanent link' => 'Doimiy havola',
|
||||
|
||||
// thousands separator - must contain single byte
|
||||
',' => ' ',
|
||||
'0123456789' => '0123456789',
|
||||
'Engine' => 'Dvigatel',
|
||||
'Collation' => 'Kodlash',
|
||||
'Data Length' => 'Ma\'lumotlar hajmi',
|
||||
'Index Length' => 'Indeks hajmi',
|
||||
'Data Free' => 'Bo\'sh ma\'lumotlar',
|
||||
'Rows' => 'Qatorlar',
|
||||
'%d in total' => 'Jami %d',
|
||||
'Analyze' => 'Tahlil qilish',
|
||||
'Optimize' => 'Optimallash',
|
||||
'Vacuum' => 'Tozalash',
|
||||
'Check' => 'Tekshirish',
|
||||
'Repair' => 'Ta\'mirlash',
|
||||
'Truncate' => 'Bo\'shatish',
|
||||
'Tables have been truncated.' => 'Jadvallar bo\'shatildi.',
|
||||
'Move to other database' => 'Boshqa ma\'lumotlar bazasiga ko\'chirish',
|
||||
'Move' => 'Ko\'chirish',
|
||||
'Tables have been moved.' => 'Jadvallar ko\'chirildi.',
|
||||
'Copy' => 'Nusxalash',
|
||||
'Tables have been copied.' => 'Jadvallar nusxalandi.',
|
||||
'overwrite' => 'qayta yozish',
|
||||
|
||||
'Routines' => 'Protseduralar',
|
||||
'Routine has been called, %d row(s) affected.' => array('Protsedura chaqirildi, %d qator o\'zgartirildi.', 'Protsedura chaqirildi, %d qatorlar o\'zgartirildi.'),
|
||||
'Call' => 'Chaqirish',
|
||||
'Parameter name' => 'Parametr nomi',
|
||||
'Create procedure' => 'Protsedura yaratish',
|
||||
'Create function' => 'Funksiya yaratish',
|
||||
'Routine has been dropped.' => 'Protsedura o\'chirildi.',
|
||||
'Routine has been altered.' => 'Protsedura o\'zgartirildi.',
|
||||
'Routine has been created.' => 'Protsedura yaratildi.',
|
||||
'Alter function' => 'Funksiyani o\'zgartirish',
|
||||
'Alter procedure' => 'Protseduranni o\'zgartirish',
|
||||
'Return type' => 'Qaytarish turi',
|
||||
|
||||
'Events' => 'Hodisalar',
|
||||
'Event has been dropped.' => 'Hodisa o\'chirildi.',
|
||||
'Event has been altered.' => 'Hodisa o\'zgartirildi.',
|
||||
'Event has been created.' => 'Hodisa yaratildi.',
|
||||
'Alter event' => 'Hodisani o\'zgartirish',
|
||||
'Create event' => 'Hodisa yaratish',
|
||||
'At given time' => 'Belgilangan vaqtda',
|
||||
'Every' => 'Har bir',
|
||||
'Schedule' => 'Jadval',
|
||||
'Start' => 'Boshlash',
|
||||
'End' => 'Tugatish',
|
||||
'On completion preserve' => 'Yakunlangandan so\'ng saqlash',
|
||||
|
||||
'Tables' => 'Jadvallar',
|
||||
'Tables and views' => 'Jadvallar va ko\'rinishlar',
|
||||
'Table' => 'Jadval',
|
||||
'No tables.' => 'Jadvallar yo\'q.',
|
||||
'Alter table' => 'Jadvalni o\'zgartirish',
|
||||
'Create table' => 'Jadval yaratish',
|
||||
'Table has been dropped.' => 'Jadval o\'chirildi.',
|
||||
'Tables have been dropped.' => 'Jadvallar o\'chirildi.',
|
||||
'Tables have been optimized.' => 'Jadvallar optimallashtirildi.',
|
||||
'Table has been altered.' => 'Jadval o\'zgartirildi.',
|
||||
'Table has been created.' => 'Jadval yaratildi.',
|
||||
'Table name' => 'Jadval nomi',
|
||||
'Show structure' => 'Tuzilishni ko\'rsatish',
|
||||
'engine' => 'dvigatel',
|
||||
'collation' => 'kodlash',
|
||||
'Column name' => 'Ustun nomi',
|
||||
'Type' => 'Tur',
|
||||
'Length' => 'Uzunlik',
|
||||
'Auto Increment' => 'Avto ko\'payish',
|
||||
'Options' => 'Variantlar',
|
||||
'Comment' => 'Izoh',
|
||||
'Default value' => 'Standart qiymat',
|
||||
'Default values' => 'Standart qiymatlar',
|
||||
'Drop' => 'O\'chirish',
|
||||
'Drop %s?' => '%s ni o\'chirasizmi?',
|
||||
'Are you sure?' => 'Ishonchingiz komilmi?',
|
||||
'Size' => 'Hajm',
|
||||
'Compute' => 'Hisoblash',
|
||||
'Move up' => 'Yuqoriga ko\'chirish',
|
||||
'Move down' => 'Pastga ko\'chirish',
|
||||
'Remove' => 'Olib tashlash',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Ruxsat etilgan maydonlar soni oshib ketdi. Iltimos, %s ni oshiring.',
|
||||
|
||||
'Partition by' => 'Bo\'lish mezon',
|
||||
'Partitions' => 'Bo\'limlar',
|
||||
'Partition name' => 'Bo\'lim nomi',
|
||||
'Values' => 'Qiymatlar',
|
||||
|
||||
'View' => 'Ko\'rinish',
|
||||
'Materialized view' => 'Moddiy ko\'rinish',
|
||||
'View has been dropped.' => 'Ko\'rinish o\'chirildi.',
|
||||
'View has been altered.' => 'Ko\'rinish o\'zgartirildi.',
|
||||
'View has been created.' => 'Ko\'rinish yaratildi.',
|
||||
'Alter view' => 'Ko\'rinishni o\'zgartirish',
|
||||
'Create view' => 'Ko\'rinish yaratish',
|
||||
|
||||
'Indexes' => 'Indekslar',
|
||||
'Indexes have been altered.' => 'Indekslar o\'zgartirildi.',
|
||||
'Alter indexes' => 'Indekslarni o\'zgartirish',
|
||||
'Add next' => 'Keyingisini qo\'shish',
|
||||
'Index Type' => 'Indeks turi',
|
||||
'length' => 'uzunlik',
|
||||
|
||||
'Foreign keys' => 'Tashqi kalitlar',
|
||||
'Foreign key' => 'Tashqi kalit',
|
||||
'Foreign key has been dropped.' => 'Tashqi kalit o\'chirildi.',
|
||||
'Foreign key has been altered.' => 'Tashqi kalit o\'zgartirildi.',
|
||||
'Foreign key has been created.' => 'Tashqi kalit yaratildi.',
|
||||
'Target table' => 'Maqsad jadvali',
|
||||
'Change' => 'O\'zgartirish',
|
||||
'Source' => 'Manba',
|
||||
'Target' => 'Maqsad',
|
||||
'Add column' => 'Ustun qo\'shish',
|
||||
'Alter' => 'O\'zgartirish',
|
||||
'Add foreign key' => 'Tashqi kalit qo\'shish',
|
||||
'ON DELETE' => 'O\'CHIRILGANDA',
|
||||
'ON UPDATE' => 'YANGILANGANDA',
|
||||
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Manba va maqsad ustunlari bir xil ma\'lumot turiga ega bo\'lishi kerak, maqsad ustunlarda indeks bo\'lishi kerak va havolalar qilingan ma\'lumotlar mavjud bo\'lishi kerak.',
|
||||
|
||||
'Triggers' => 'Triggerlar',
|
||||
'Add trigger' => 'Trigger qo\'shish',
|
||||
'Trigger has been dropped.' => 'Trigger o\'chirildi.',
|
||||
'Trigger has been altered.' => 'Trigger o\'zgartirildi.',
|
||||
'Trigger has been created.' => 'Trigger yaratildi.',
|
||||
'Alter trigger' => 'Triggerni o\'zgartirish',
|
||||
'Create trigger' => 'Trigger yaratish',
|
||||
'Time' => 'Vaqt',
|
||||
'Event' => 'Hodisa',
|
||||
'Name' => 'Nomi',
|
||||
|
||||
'select' => 'tanlash',
|
||||
'Select' => 'Tanlash',
|
||||
'Select data' => 'Ma\'lumotlarni tanlash',
|
||||
'Functions' => 'Funksiyalar',
|
||||
'Aggregation' => 'Agregatsiya',
|
||||
'Search' => 'Qidirish',
|
||||
'anywhere' => 'hamma joyda',
|
||||
'Search data in tables' => 'Jadvallarda ma\'lumotlarni qidirish',
|
||||
'Sort' => 'Saralash',
|
||||
'descending' => 'kamayish bo\'yicha',
|
||||
'Limit' => 'Cheklov',
|
||||
'Limit rows' => 'Qatorlarni cheklash',
|
||||
'Text length' => 'Matn uzunligi',
|
||||
'Action' => 'Amal',
|
||||
'Full table scan' => 'To\'liq jadval skanerlash',
|
||||
'Unable to select the table' => 'Jadvalni tanlab bo\'lmadi',
|
||||
'No rows.' => 'Qatorlar yo\'q.',
|
||||
// used in SQL query limit and it is followed by another number, e.g. '10 / 50 rows' meaning 10 of 50 rows
|
||||
'%d / ' => '%d / ',
|
||||
'%d row(s)' => array('%d qator', '%d qatorlar'),
|
||||
'Page' => 'Sahifa',
|
||||
'last' => 'oxirgi',
|
||||
'Load more data' => 'Ko\'proq ma\'lumot yuklash',
|
||||
'Loading' => 'Yuklanmoqda',
|
||||
'Whole result' => 'Butun natija',
|
||||
'%d byte(s)' => array('%d bayt', '%d baytlar'),
|
||||
|
||||
'Import' => 'Import',
|
||||
'%d row(s) have been imported.' => array('%d qator import qilindi.', '%d qatorlar import qilindi.'),
|
||||
'File must be in UTF-8 encoding.' => 'Fayl UTF-8 kodlashda bo\'lishi kerak.',
|
||||
|
||||
// in-place editing in select
|
||||
'Modify' => 'O\'zgartirish',
|
||||
'Ctrl+click on a value to modify it.' => 'Qiymatni o\'zgartirish uchun Ctrl+bosing.',
|
||||
'Use edit link to modify this value.' => 'Bu qiymatni o\'zgartirish uchun tahrir havolasidan foydalaning.',
|
||||
|
||||
// %s can contain auto-increment value, e.g. ' 123'
|
||||
'Item%s has been inserted.' => 'Element%s kiritildi.',
|
||||
'Item has been deleted.' => 'Element o\'chirildi.',
|
||||
'Item has been updated.' => 'Element yangilandi.',
|
||||
'%d item(s) have been affected.' => array('%d element o\'zgartirildi.', '%d elementlar o\'zgartirildi.'),
|
||||
'New item' => 'Yangi element',
|
||||
'original' => 'asl',
|
||||
// label for value '' in enum data type
|
||||
'empty' => 'bo\'sh',
|
||||
'edit' => 'tahrirlash',
|
||||
'Edit' => 'Tahrirlash',
|
||||
'Insert' => 'Kiritish',
|
||||
'Save' => 'Saqlash',
|
||||
'Save and continue edit' => 'Saqlash va tahrirlashni davom ettirish',
|
||||
'Save and insert next' => 'Saqlash va keyingisini kiritish',
|
||||
'Selected' => 'Tanlangan',
|
||||
'Clone' => 'Klonlash',
|
||||
'Delete' => 'O\'chirish',
|
||||
'You have no privileges to update this table.' => 'Bu jadvalni yangilash uchun sizda huquqlar yo\'q.',
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Raqamlar',
|
||||
'Date and time' => 'Sana va vaqt',
|
||||
'Strings' => 'Matnlar',
|
||||
'Binary' => 'Ikkilik',
|
||||
'Lists' => 'Ro\'yxatlar',
|
||||
'Network' => 'Tarmoq',
|
||||
'Geometry' => 'Geometriya',
|
||||
'Relations' => 'Munosabatlar',
|
||||
|
||||
'Editor' => 'Muharrir',
|
||||
// date format in Editor: $1 yyyy, $2 yy, $3 mm, $4 m, $5 dd, $6 d
|
||||
'$1-$3-$5' => '$5.$3.$1',
|
||||
// hint for date format - use language equivalents for day, month and year shortcuts
|
||||
'[yyyy]-mm-dd' => 'dd.mm.[yyyy]',
|
||||
// hint for time format - use language equivalents for hour, minute and second shortcuts
|
||||
'HH:MM:SS' => 'SS:MM:SS',
|
||||
'now' => 'hozir',
|
||||
'yes' => 'ha',
|
||||
'no' => 'yo\'q',
|
||||
|
||||
// general SQLite error in create, drop or rename database
|
||||
'File exists.' => 'Fayl mavjud.',
|
||||
'Please use one of the extensions %s.' => 'Iltimos, kengaytmalardan birini %s foydalaning.',
|
||||
|
||||
// PostgreSQL and MS SQL schema support
|
||||
'Alter schema' => 'Sxemani o\'zgartirish',
|
||||
'Create schema' => 'Sxema yaratish',
|
||||
'Schema has been dropped.' => 'Sxema o\'chirildi.',
|
||||
'Schema has been created.' => 'Sxema yaratildi.',
|
||||
'Schema has been altered.' => 'Sxema o\'zgartirildi.',
|
||||
'Schema' => 'Sxema',
|
||||
'Invalid schema.' => 'Noto\'g\'ri sxema.',
|
||||
|
||||
// PostgreSQL sequences support
|
||||
'Sequences' => 'Ketma-ketliklar',
|
||||
'Create sequence' => 'Ketma-ketlik yaratish',
|
||||
'Sequence has been dropped.' => 'Ketma-ketlik o\'chirildi.',
|
||||
'Sequence has been created.' => 'Ketma-ketlik yaratildi.',
|
||||
'Sequence has been altered.' => 'Ketma-ketlik o\'zgartirildi.',
|
||||
'Alter sequence' => 'Ketma-ketlikni o\'zgartirish',
|
||||
|
||||
// PostgreSQL user types support
|
||||
'User types' => 'Foydalanuvchi turlari',
|
||||
'Create type' => 'Tur yaratish',
|
||||
'Type has been dropped.' => 'Tur o\'chirildi.',
|
||||
'Type has been created.' => 'Tur yaratildi.',
|
||||
'Alter type' => 'Turni o\'zgartirish',
|
||||
|
||||
// Table check constraints
|
||||
'Checks' => 'Tekshirishlar',
|
||||
'Create check' => 'Tekshirish yaratish',
|
||||
'Alter check' => 'Tekshirishni o\'zgartirish',
|
||||
'Check has been created.' => 'Tekshirish yaratildi.',
|
||||
'Check has been altered.' => 'Tekshirish o\'zgartirildi.',
|
||||
'Check has been dropped.' => 'Tekshirish o\'chirildi.',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php uz` to update this file
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Hệ thống',
|
||||
'Server' => 'Máy chủ',
|
||||
@@ -271,13 +271,6 @@ $translations = array(
|
||||
'Delete' => 'Xoá',
|
||||
'You have no privileges to update this table.' => 'Bạn không có quyền sửa bảng này.',
|
||||
|
||||
'E-mail' => 'Địa chỉ email',
|
||||
'From' => 'Người gửi',
|
||||
'Subject' => 'Chủ đề',
|
||||
'Attachments' => 'Đính kèm',
|
||||
'Send' => 'Gửi',
|
||||
'%d e-mail(s) have been sent.' => '%d thư đã gửi.',
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Số',
|
||||
'Date and time' => 'Ngày giờ',
|
||||
@@ -327,3 +320,5 @@ $translations = array(
|
||||
'Type has been created.' => 'Đã tạo kiểu.',
|
||||
'Alter type' => 'Sửa kiểu dữ liệu',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php vi` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Xx',
|
||||
'Server' => 'Xx',
|
||||
@@ -43,6 +43,7 @@ $translations = array(
|
||||
'User has been created.' => 'Xx.',
|
||||
'Hashed' => 'Xx',
|
||||
'Column' => 'Xx',
|
||||
'Columns' => 'Xx',
|
||||
'Routine' => 'Xx',
|
||||
'Grant' => 'Xx',
|
||||
'Revoke' => 'Xx',
|
||||
@@ -195,6 +196,7 @@ $translations = array(
|
||||
'Partitions' => 'Xx',
|
||||
'Partition name' => 'Xx',
|
||||
'Values' => 'Xx',
|
||||
'Inherits from' => 'Xx',
|
||||
|
||||
'View' => 'Xx',
|
||||
'Materialized view' => 'Xx',
|
||||
@@ -210,6 +212,8 @@ $translations = array(
|
||||
'Add next' => 'Xx',
|
||||
'Index Type' => 'Xx',
|
||||
'length' => 'xx',
|
||||
'Algorithm' => 'Xx',
|
||||
'Condition' => 'Xx',
|
||||
|
||||
'Foreign keys' => 'Xx',
|
||||
'Foreign key' => 'Xx',
|
||||
@@ -294,13 +298,6 @@ $translations = array(
|
||||
'Delete' => 'Xx',
|
||||
'You have no privileges to update this table.' => 'Xx.',
|
||||
|
||||
'E-mail' => 'Xx',
|
||||
'From' => 'Xx',
|
||||
'Subject' => 'Xx',
|
||||
'Attachments' => 'Xx',
|
||||
'Send' => 'Xx',
|
||||
'%d e-mail(s) have been sent.' => array('%d xx.', '%d xx.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Xx',
|
||||
'Date and time' => 'Xx',
|
||||
@@ -357,4 +354,11 @@ $translations = array(
|
||||
'Check has been created.' => 'Xx.',
|
||||
'Check has been altered.' => 'Xx.',
|
||||
'Check has been dropped.' => 'Xx.',
|
||||
|
||||
'Loaded plugins' => 'Xx',
|
||||
'%s must <a%s>return an array</a>.' => '%s xx <a%s>xx</a>.',
|
||||
'<a%s>Configure</a> %s in %s.' => '<a%s>Xx</a> %s xx %s.',
|
||||
'screenshot' => 'xx',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php xx` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => '資料庫系統',
|
||||
'Server' => '伺服器',
|
||||
@@ -292,13 +292,6 @@ $translations = array(
|
||||
'Delete' => '刪除',
|
||||
'You have no privileges to update this table.' => '您沒有許可權更新這個資料表。',
|
||||
|
||||
'E-mail' => '電子郵件',
|
||||
'From' => '來自',
|
||||
'Subject' => '主旨',
|
||||
'Attachments' => '附件',
|
||||
'Send' => '寄出',
|
||||
'%d e-mail(s) have been sent.' => '已寄出 %d 封郵件。',
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => '數字',
|
||||
'Date and time' => '日期時間',
|
||||
@@ -348,3 +341,5 @@ $translations = array(
|
||||
'Type has been created.' => '已建立類型。',
|
||||
'Alter type' => '修改類型',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php zh-tw` to update this file
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
$translations = array(
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => '系统',
|
||||
'Server' => '服务器',
|
||||
@@ -208,7 +208,6 @@ $translations = array(
|
||||
'Alter indexes' => '修改索引',
|
||||
'Add next' => '下一行插入',
|
||||
'Index Type' => '索引类型',
|
||||
// 'Column (length)' => '列(长度)',
|
||||
|
||||
'Foreign keys' => '外键',
|
||||
'Foreign key' => '外键',
|
||||
@@ -292,13 +291,6 @@ $translations = array(
|
||||
'Delete' => '删除',
|
||||
'You have no privileges to update this table.' => '您没有权限更新这个表。',
|
||||
|
||||
'E-mail' => '电子邮件',
|
||||
'From' => '来自',
|
||||
'Subject' => '主题',
|
||||
'Attachments' => '附件',
|
||||
'Send' => '发送',
|
||||
'%d e-mail(s) have been sent.' => '%d 封邮件已发送。',
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => '数字',
|
||||
'Date and time' => '日期时间',
|
||||
@@ -348,3 +340,5 @@ $translations = array(
|
||||
'Type has been created.' => '已创建类型。',
|
||||
'Alter type' => '修改类型',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php zh` to update this file
|
||||
|
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
function adminer_object() {
|
||||
// required to run any plugin
|
||||
include_once "../plugins/plugin.php";
|
||||
|
||||
// autoloader
|
||||
foreach (glob("../plugins/*.php") as $filename) {
|
||||
include_once $filename;
|
||||
}
|
||||
|
||||
// enable extra drivers just by including them
|
||||
//~ include "../plugins/drivers/simpledb.php";
|
||||
|
||||
$plugins = array(
|
||||
// specify enabled plugins here
|
||||
new AdminerDatabaseHide(array('information_schema')),
|
||||
new AdminerDumpJson,
|
||||
new AdminerDumpBz2,
|
||||
new AdminerDumpZip,
|
||||
new AdminerDumpXml,
|
||||
new AdminerDumpAlter,
|
||||
//~ new AdminerSqlLog("past-" . rtrim(`git describe --tags --abbrev=0`) . ".sql"),
|
||||
//~ new AdminerTinymce("../externals/tinymce/jscripts/tiny_mce/tiny_mce_dev.js"),
|
||||
new AdminerFileUpload(""),
|
||||
new AdminerJsonColumn,
|
||||
new AdminerSlugify,
|
||||
new AdminerTranslation,
|
||||
new AdminerForeignSystem,
|
||||
new AdminerEnumOption,
|
||||
new AdminerTablesFilter,
|
||||
new AdminerEditForeign,
|
||||
);
|
||||
|
||||
/* It is possible to combine customization and plugins:
|
||||
class AdminerCustomization extends AdminerPlugin {
|
||||
}
|
||||
return new AdminerCustomization($plugins);
|
||||
*/
|
||||
|
||||
return new AdminerPlugin($plugins);
|
||||
}
|
||||
|
||||
// include original Adminer or Adminer Editor (usually named adminer.php)
|
||||
include "./index.php";
|
@@ -5,17 +5,17 @@ page_header(lang('Privileges'));
|
||||
|
||||
echo '<p class="links"><a href="' . h(ME) . 'user=">' . lang('Create user') . "</a>";
|
||||
|
||||
$result = $connection->query("SELECT User, Host FROM mysql." . (DB == "" ? "user" : "db WHERE " . q(DB) . " LIKE Db") . " ORDER BY Host, User");
|
||||
$result = connection()->query("SELECT User, Host FROM mysql." . (DB == "" ? "user" : "db WHERE " . q(DB) . " LIKE Db") . " ORDER BY Host, User");
|
||||
$grant = $result;
|
||||
if (!$result) {
|
||||
// list logged user, information_schema.USER_PRIVILEGES lists just the current user too
|
||||
$result = $connection->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
|
||||
$result = connection()->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
|
||||
}
|
||||
|
||||
echo "<form action=''><p>\n";
|
||||
hidden_fields_get();
|
||||
echo "<input type='hidden' name='db' value='" . h(DB) . "'>\n";
|
||||
echo ($grant ? "" : "<input type='hidden' name='grant' value=''>\n");
|
||||
echo input_hidden("db", DB);
|
||||
echo ($grant ? "" : input_hidden("grant"));
|
||||
echo "<table class='odds'>\n";
|
||||
echo "<thead><tr><th>" . lang('Username') . "<th>" . lang('Server') . "<th></thead>\n";
|
||||
|
||||
|
@@ -9,6 +9,11 @@ $row["fields"] = (array) $row["fields"];
|
||||
if ($_POST && !process_fields($row["fields"]) && !$error) {
|
||||
$orig = routine($_GET["procedure"], $routine);
|
||||
$temp_name = "$row[name]_adminer_" . uniqid();
|
||||
foreach ($row["fields"] as $key => $field) {
|
||||
if ($field["field"] == "") {
|
||||
unset($row["fields"][$key]);
|
||||
}
|
||||
}
|
||||
drop_create(
|
||||
"DROP $routine " . routine_id($PROCEDURE, $orig),
|
||||
create_routine($routine, $row),
|
||||
@@ -26,9 +31,13 @@ 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($_GET["procedure"], $routine);
|
||||
$row["name"] = $PROCEDURE;
|
||||
if (!$_POST) {
|
||||
if ($PROCEDURE == "") {
|
||||
$row["language"] = "sql";
|
||||
} else {
|
||||
$row = routine($_GET["procedure"], $routine);
|
||||
$row["name"] = $PROCEDURE;
|
||||
}
|
||||
}
|
||||
|
||||
$collations = get_vals("SHOW CHARACTER SET");
|
||||
@@ -39,7 +48,7 @@ echo ($collations ? "<datalist id='collations'>" . optionlist($collations) . "</
|
||||
|
||||
<form action="" method="post" id="form">
|
||||
<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" : ""); ?>
|
||||
<?php echo ($routine_languages ? "<label>" . lang('Language') . ": " . html_select("language", $routine_languages, $row["language"]) . "</label>\n" : ""); ?>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<div class="scrollable">
|
||||
<table class="nowrap">
|
||||
@@ -47,7 +56,7 @@ echo ($collations ? "<datalist id='collations'>" . optionlist($collations) . "</
|
||||
edit_fields($row["fields"], $collations, $routine);
|
||||
if (isset($_GET["function"])) {
|
||||
echo "<tr><td>" . lang('Return type');
|
||||
edit_type("returns", $row["returns"], $collations, array(), (JUSH == "pgsql" ? array("void", "trigger") : array()));
|
||||
edit_type("returns", (array) $row["returns"], $collations, array(), (JUSH == "pgsql" ? array("void", "trigger") : array()));
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
@@ -59,5 +68,5 @@ if (isset($_GET["function"])) {
|
||||
<?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; ?>">
|
||||
<?php echo input_token(); ?>
|
||||
</form>
|
||||
|
@@ -56,7 +56,7 @@ if (support("kill")) {
|
||||
echo ($i + 1) . "/" . lang('%d in total', max_connections());
|
||||
echo "<p><input type='submit' value='" . lang('Kill') . "'>\n";
|
||||
}
|
||||
echo input_token();
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
<?php echo script("tableCheck();"); ?>
|
||||
|
@@ -3,6 +3,7 @@ namespace Adminer;
|
||||
|
||||
page_header(lang('Database schema'), "", array(), h(DB . ($_GET["ns"] ? ".$_GET[ns]" : "")));
|
||||
|
||||
/** @var array{float, float}[] */
|
||||
$table_pos = array();
|
||||
$table_pos_js = array();
|
||||
$SCHEMA = ($_GET["schema"] ?: $_COOKIE["adminer_schema-" . str_replace(".", "_", DB)]); // $_COOKIE["adminer_schema"] was used before 3.2.0 //! ':' in table name
|
||||
@@ -14,26 +15,28 @@ foreach ($matches as $i => $match) {
|
||||
|
||||
$top = 0;
|
||||
$base_left = -1;
|
||||
/** @var array{fields:Field[], pos:array{float, float}, references:string[][][]}[] */
|
||||
$schema = array(); // table => array("fields" => array(name => field), "pos" => array(top, left), "references" => array(table => array(left => array(source, target))))
|
||||
$referenced = array(); // target_table => array(table => array(left => target_column))
|
||||
$lefts = array(); // float => bool
|
||||
$all_fields = driver()->allFields();
|
||||
foreach (table_status('', true) as $table => $table_status) {
|
||||
if (is_view($table_status)) {
|
||||
continue;
|
||||
}
|
||||
$pos = 0;
|
||||
$schema[$table]["fields"] = array();
|
||||
foreach (fields($table) as $name => $field) {
|
||||
foreach ($all_fields[$table] as $field) {
|
||||
$pos += 1.25;
|
||||
$field["pos"] = $pos;
|
||||
$schema[$table]["fields"][$name] = $field;
|
||||
$schema[$table]["fields"][$field["field"]] = $field;
|
||||
}
|
||||
$schema[$table]["pos"] = ($table_pos[$table] ?: array($top, 0));
|
||||
foreach ($adminer->foreignKeys($table) as $val) {
|
||||
foreach (adminer()->foreignKeys($table) as $val) {
|
||||
if (!$val["db"]) {
|
||||
$left = $base_left;
|
||||
if ($table_pos[$table][1] || $table_pos[$val["table"]][1]) {
|
||||
$left = min(floatval($table_pos[$table][1]), floatval($table_pos[$val["table"]][1])) - 1;
|
||||
if (idx($table_pos[$table], 1) || idx($table_pos[$val["table"]], 1)) {
|
||||
$left = min(idx($table_pos[$table], 1, 0), idx($table_pos[$val["table"]], 1, 0)) - 1;
|
||||
} else {
|
||||
$base_left -= .1;
|
||||
}
|
||||
@@ -52,9 +55,9 @@ foreach (table_status('', true) as $table => $table_status) {
|
||||
?>
|
||||
<div id="schema" style="height: <?php echo $top; ?>em;">
|
||||
<script<?php echo nonce(); ?>>
|
||||
qs('#schema').onselectstart = function () { return false; };
|
||||
var tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
|
||||
var em = qs('#schema').offsetHeight / <?php echo $top; ?>;
|
||||
qs('#schema').onselectstart = () => false;
|
||||
const tablePos = {<?php echo implode(",", $table_pos_js) . "\n"; ?>};
|
||||
const em = qs('#schema').offsetHeight / <?php echo $top; ?>;
|
||||
document.onmousemove = schemaMousemove;
|
||||
document.onmouseup = partialArg(schemaMouseup, '<?php echo js_escape(DB); ?>');
|
||||
</script>
|
||||
@@ -65,13 +68,13 @@ foreach ($schema as $name => $table) {
|
||||
echo script("qsl('div').onmousedown = schemaMousedown;");
|
||||
|
||||
foreach ($table["fields"] as $field) {
|
||||
$val = '<span' . type_class($field["type"]) . ' title="' . h($field["full_type"] . ($field["null"] ? " NULL" : '')) . '">' . h($field["field"]) . '</span>';
|
||||
$val = '<span' . type_class($field["type"]) . ' title="' . h($field["type"] . ($field["length"] ? "($field[length])" : "") . ($field["null"] ? " NULL" : '')) . '">' . h($field["field"]) . '</span>';
|
||||
echo "<br>" . ($field["primary"] ? "<i>$val</i>" : $val);
|
||||
}
|
||||
|
||||
foreach ((array) $table["references"] as $target_name => $refs) {
|
||||
foreach ($refs as $left => $ref) {
|
||||
$left1 = $left - $table_pos[$name][1];
|
||||
$left1 = $left - idx($table_pos[$name], 1);
|
||||
$i = 0;
|
||||
foreach ($ref[0] as $source) {
|
||||
echo "\n<div class='references' title='" . h($target_name) . "' id='refs$left-" . ($i++) . "' style='left: $left1" . "em; top: " . $table["fields"][$source]["pos"] . "em; padding-top: .5em;'>"
|
||||
@@ -83,11 +86,10 @@ foreach ($schema as $name => $table) {
|
||||
|
||||
foreach ((array) $referenced[$name] as $target_name => $refs) {
|
||||
foreach ($refs as $left => $columns) {
|
||||
$left1 = $left - $table_pos[$name][1];
|
||||
$left1 = $left - idx($table_pos[$name], 1);
|
||||
$i = 0;
|
||||
foreach ($columns as $target) {
|
||||
echo "\n<div class='references' title='" . h($target_name) . "' id='refd$left-" . ($i++) . "'"
|
||||
. " style='left: $left1" . "em; top: " . $table["fields"][$target]["pos"] . "em; height: 1.25em; background: url(../adminer/static/arrow.gif) no-repeat right center;'>"
|
||||
echo "\n<div class='references arrow' title='" . h($target_name) . "' id='refd$left-" . ($i++) . "' style='left: $left1" . "em; top: " . $table["fields"][$target]["pos"] . "em;'>"
|
||||
. "<div style='height: .5em; border-bottom: 1px solid gray; width: " . (-$left1) . "em;'></div>"
|
||||
. "</div>"
|
||||
;
|
||||
|
@@ -34,6 +34,6 @@ if (!$row) {
|
||||
if ($_GET["ns"] != "") {
|
||||
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . confirm(lang('Drop %s?', $_GET["ns"])) . "\n";
|
||||
}
|
||||
echo input_token();
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php echo $token; ?>">
|
||||
</form>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user