mirror of
https://github.com/vrana/adminer.git
synced 2026-03-26 06:10:53 +01:00
Compare commits
365 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5754b32693 | ||
|
|
11234ef939 | ||
|
|
e5e9b3a04d | ||
|
|
45c7082373 | ||
|
|
8fa7dedc4b | ||
|
|
f1c8f8532e | ||
|
|
00323425cb | ||
|
|
3d882578df | ||
|
|
318e304c7e | ||
|
|
50852b9036 | ||
|
|
c30f6227a2 | ||
|
|
a417a21ba6 | ||
|
|
fb1b76e411 | ||
|
|
38a937d966 | ||
|
|
f0142f0b8e | ||
|
|
cf1454f7a9 | ||
|
|
c0350d8893 | ||
|
|
1ac40e0c2b | ||
|
|
39b339b1b5 | ||
|
|
de4104f70d | ||
|
|
aeee1c1991 | ||
|
|
21d3a31503 | ||
|
|
e4ac9d611e | ||
|
|
bdc28bc959 | ||
|
|
83301e37da | ||
|
|
1b2354cdae | ||
|
|
a5faea641a | ||
|
|
9f4a51819e | ||
|
|
04473a21c8 | ||
|
|
9d1451e659 | ||
|
|
1879da5ad8 | ||
|
|
e471d8b0cf | ||
|
|
5b9f0186a8 | ||
|
|
da1ffdd34e | ||
|
|
56c18bcca0 | ||
|
|
948d57bb63 | ||
|
|
1a6735cac7 | ||
|
|
8e865cd650 | ||
|
|
864d831463 | ||
|
|
f61b085422 | ||
|
|
0ddb097cb6 | ||
|
|
2674250862 | ||
|
|
6f6f576c41 | ||
|
|
ecd9c74c99 | ||
|
|
2ea1f8a88c | ||
|
|
691edde5fc | ||
|
|
554e43aae4 | ||
|
|
503d83599c | ||
|
|
a7a704c818 | ||
|
|
d356091c2f | ||
|
|
a5ec07a77d | ||
|
|
68e8b5bf69 | ||
|
|
9c5215cf77 | ||
|
|
e6fe48516e | ||
|
|
58ff31a15d | ||
|
|
ca7c4d90e1 | ||
|
|
605ed2dcab | ||
|
|
76a8dbfb98 | ||
|
|
cca4d26784 | ||
|
|
80f9278d34 | ||
|
|
c1838743ed | ||
|
|
eb614963f8 | ||
|
|
1109ca6389 | ||
|
|
3856d0563e | ||
|
|
a49fcf4799 | ||
|
|
53d7e31bf6 | ||
|
|
15f4183fa6 | ||
|
|
e6be47941b | ||
|
|
240c8fc5e7 | ||
|
|
57c5370c67 | ||
|
|
489f78c21c | ||
|
|
6c8de72707 | ||
|
|
4d0e79234c | ||
|
|
c7ede7331e | ||
|
|
c5f3707bb9 | ||
|
|
1c008b7d71 | ||
|
|
c2be05f0e9 | ||
|
|
eaad45a781 | ||
|
|
9a5b8f1f92 | ||
|
|
1b43a6f034 | ||
|
|
fdc2326376 | ||
|
|
08f93d6d09 | ||
|
|
4fbe8ebf5a | ||
|
|
86285dcf34 | ||
|
|
26c4057946 | ||
|
|
d15d0b2ef3 | ||
|
|
bd1dffe086 | ||
|
|
4918ba407f | ||
|
|
46638ebd9a | ||
|
|
6f339bac6c | ||
|
|
f32f84cf57 | ||
|
|
ce063a64dd | ||
|
|
1d5d441271 | ||
|
|
fd28e64d8c | ||
|
|
3874148064 | ||
|
|
0640326df4 | ||
|
|
16f7080ff2 | ||
|
|
516530485d | ||
|
|
f921dafa61 | ||
|
|
d1831641a9 | ||
|
|
b1c825484d | ||
|
|
6c662e1f96 | ||
|
|
7ef0949539 | ||
|
|
9fc63eb9d0 | ||
|
|
2041d5c6e3 | ||
|
|
fc2ab7de16 | ||
|
|
2db30ba7e2 | ||
|
|
8d6ed3fffa | ||
|
|
9e0db9f1cd | ||
|
|
a979b4be22 | ||
|
|
26319460ef | ||
|
|
b41699624b | ||
|
|
17a0e84718 | ||
|
|
5c5f7d17fe | ||
|
|
4ad7eb0b70 | ||
|
|
b83da41739 | ||
|
|
e551efb031 | ||
|
|
6d0351ec7c | ||
|
|
dcf11d8fc9 | ||
|
|
0de6a057d3 | ||
|
|
18b62aba38 | ||
|
|
10ff74552d | ||
|
|
f5c7ab54f7 | ||
|
|
cc110c448c | ||
|
|
6f766f8c52 | ||
|
|
9a60d158f1 | ||
|
|
6dec0d63b0 | ||
|
|
c9a52cd28c | ||
|
|
9424b7431e | ||
|
|
35b2b969be | ||
|
|
165f1b241c | ||
|
|
4d75f822e9 | ||
|
|
5e9c185596 | ||
|
|
cfd69dfd8c | ||
|
|
1fc5acb389 | ||
|
|
8ca0e36970 | ||
|
|
9e8de24e3d | ||
|
|
4cb09852e3 | ||
|
|
e115dccdae | ||
|
|
1ba410cad1 | ||
|
|
0764a20a19 | ||
|
|
b2c4574325 | ||
|
|
466eceff40 | ||
|
|
27c5f6d21b | ||
|
|
2744538c8c | ||
|
|
41456c9eb7 | ||
|
|
9745c12769 | ||
|
|
f24f72ac51 | ||
|
|
2b52a9b653 | ||
|
|
9ba4b86916 | ||
|
|
1cc3fdf915 | ||
|
|
b960c41d63 | ||
|
|
3ec750ef7e | ||
|
|
737b631dda | ||
|
|
8fc450946c | ||
|
|
e282d6eb89 | ||
|
|
86ffeb2a1e | ||
|
|
31530ba03e | ||
|
|
146d3539d8 | ||
|
|
04068a631e | ||
|
|
4698686232 | ||
|
|
57b6afc8cb | ||
|
|
e589c80f42 | ||
|
|
acfebf1788 | ||
|
|
246c3c489b | ||
|
|
92b95606c1 | ||
|
|
ac8318f387 | ||
|
|
d1c2679acd | ||
|
|
caf6e495dc | ||
|
|
ec5ad85470 | ||
|
|
307fabaf22 | ||
|
|
1862b84612 | ||
|
|
e76be9f890 | ||
|
|
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 |
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"]
|
||||
|
||||
15
.github/ISSUE_TEMPLATE/bug_report.md
vendored
15
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -7,9 +7,14 @@ assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Adminer version:** please use latest published or Git
|
||||
**Driver:** e.g. MySQLi
|
||||
**Database version:** e.g. 10.2.12-MariaDB
|
||||
**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.
|
||||
Also please include a screenshot._
|
||||
<!--
|
||||
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._
|
||||
-->
|
||||
|
||||
19
.github/workflows/ci.yml
vendored
Normal file
19
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: php-actions/composer@v6
|
||||
- uses: php-actions/phpcs@v1
|
||||
with:
|
||||
path: .
|
||||
standard: phpcs.xml
|
||||
- uses: php-actions/phpstan@v3
|
||||
131
CHANGELOG.md
131
CHANGELOG.md
@@ -1,3 +1,125 @@
|
||||
## Adminer dev
|
||||
- Tables overview: allow sorting (bug #1231)
|
||||
- Select: Disable Ctrl+click inline edit without UPDATE privilege
|
||||
- Select: Display NULL in column title
|
||||
- Export: Remember unchecked objects (regression from 5.0.6)
|
||||
- Foreign key: Display new field in case of an error
|
||||
- PostgreSQL: Order NULL last
|
||||
- PostgreSQL: Display all SQL command warnings and only once
|
||||
- PostgreSQL: Export serial as serial, not nextval()
|
||||
- PostgreSQL: Export schema in nextval()
|
||||
- PostgreSQL: Export schema in REFERENCES
|
||||
- Editor: Display tinyint(1) as checkbox (bug #1246, regression from 5.4.2)
|
||||
- Croatian translation
|
||||
|
||||
## Adminer 5.4.2 (released 2026-02-08)
|
||||
- Avoid denial-of-service via version check (GHSA-q4f2-39gr-45jh, regression from 4.6.2)
|
||||
- Pretty print JSON in edit
|
||||
- Support multiline generated values in alter table
|
||||
- Link //domain.tld values
|
||||
- Improve print of nested tables
|
||||
- Hide sort links on unsortable columns
|
||||
- Display uneditable fields in edit form
|
||||
- Shorten all but numeric and date types in select
|
||||
- Fix escaping spaces in cookie value (bug #1208)
|
||||
- Don't quote comma in TSV export (bug #1238)
|
||||
- MariaDB: Don't display checks with the same name from another table (bug #1135)
|
||||
- PostgreSQL: Offer foreign keys in create table
|
||||
- PostgreSQL: Add missing parentheses to CHECK export
|
||||
- PostgreSQL: Allow creating NOT DEFERRABLE foreign keys
|
||||
- PostgreSQL: Remove duplicate DEFERRABLE in foreign key export
|
||||
- PostgreSQL: Add schema to sequence and view export
|
||||
- PostgreSQL: Fix definition of complex generated columns
|
||||
- PostgreSQL: Mark unique partial indexes as unique (bug #1172)
|
||||
- PostgreSQL: Fix namespace in inheritance links (bug #1221)
|
||||
- non-PostgreSQL: Display NOT NULL checks (bug #1237)
|
||||
- ClickHouse: Fix offset (bug #1188)
|
||||
- ClickHouse: Fix list of tables (bug #1176)
|
||||
- Plugins: Methods showVariables() and showStatus() (bug #1157)
|
||||
- Plugins: Allow to be in any namespace
|
||||
- New plugin: IGDB driver
|
||||
|
||||
## Adminer 5.4.1 (released 2025-09-26)
|
||||
- SQL command: Unlink NULL primary keys
|
||||
- Do not quote 0 in CSV export
|
||||
- Warn about exceeded upload_max_filesize in imports
|
||||
- Prolong queries saved from SQL command to URL (bug #1154)
|
||||
- MySQL: Fix displaying routine definition (bug #1156, regression from 5.4.0)
|
||||
|
||||
## Adminer 5.4.0 (released 2025-09-08)
|
||||
- Allow specifying operator in search anywhere
|
||||
- Do not order descending in GROUP BY select
|
||||
- Allow exporting SQL in SQL command (bug #1092)
|
||||
- Add section links in database overview
|
||||
- Warn about exceeded max_file_uploads in import
|
||||
- Display @ after username without server in existing logins
|
||||
- Display data length and index length for materialized views
|
||||
- Link routines from syntax highlighting
|
||||
- Autofocus added field in alter table
|
||||
- Executed SQL commands: Add button for copy to clipboard
|
||||
- Load more: run syntax highlighter
|
||||
- Allow connecting to IPv6 (bug #1095)
|
||||
- MySQL: Fix saving empty enum (bug #1152)
|
||||
- MySQL 5.0-: Do not load partitioning info in alter table (bug #1099)
|
||||
- MariaDB: Parse COLLATE in routine definition (bug #1104)
|
||||
- PostgreSQL: Show structure of inherited tables
|
||||
- PostgreSQL: Display index expressions
|
||||
- PostgreSQL: Add SQL operator to select
|
||||
- PostgreSQL: Hide only partitions, not all inherited tables from menu
|
||||
- PostgreSQL: Allow comparing json columns (bug #1107)
|
||||
- PostgreSQL: Shorten values in hstore columns
|
||||
- PostgreSQL: Quote edit value with interval operator
|
||||
- PostgreSQL: Fix calling functions with name-less parameters
|
||||
- PostgreSQL: Fix calling functions returing table
|
||||
- PostgreSQL: Don't treat user types containing 'file' as blobs (bug #1118)
|
||||
- PostgreSQL: Export DROP and CREATE DATABASE (bug #1140)
|
||||
- PostgreSQL 11-: Avoid duplicate oid in table status (bug #1089, regression from 5.3.0)
|
||||
- Elasticsearch: Support dropping aliases
|
||||
- Plugins: Methods afterConnect(), processList() and killProcess()
|
||||
- New plugin: Display row numbers in select (bug #1106)
|
||||
- New plugin: Specify query timeout
|
||||
|
||||
## Adminer 5.3.0 (released 2025-05-04)
|
||||
- Align numeric functions right
|
||||
- Autocomplete: Support table aliases
|
||||
- Fix type error in Create function (bug #1053, regression from 5.1.1)
|
||||
- Add border to column actions (bug #1072)
|
||||
- Align money values right (bug #1071)
|
||||
- MySQL: Avoid warning on selecting tables with fulltext indexes (bug #1036)
|
||||
- MySQL, PostgreSQL: Support index algorithms (bug #1030)
|
||||
- MySQL: Fix connecting to localhost:3306 (bug #1057, regression from 5.1.1)
|
||||
- PostgreSQL, CockroachDB: Creating partitioned tables (bug #1031)
|
||||
- PostgreSQL: Move partitioned tables from table list to parent table
|
||||
- PostgreSQL: Support partial indices (bug #1048)
|
||||
- PostgreSQL: Support calling functions returning table (bug #1040)
|
||||
- PostgreSQL: Add NOT ILIKE operator (bug #1066)
|
||||
- Editor: Fix bit and enum search (bug #1062)
|
||||
- Designs: adminer.css with 'prefers-color-scheme: dark' doesn't disable dark mode
|
||||
- Plugins: Method bodyClass() to add <body class>
|
||||
- Plugins: Allow setting dark mode in css()
|
||||
- Hindi translation
|
||||
|
||||
## Adminer 5.2.1 (released 2025-04-11)
|
||||
- Fix search anywhere (bug #1004, regression from 5.1.1)
|
||||
- Fix import without primary key (bug #1017, regression from 5.1.1)
|
||||
- PostgreSQL PDO: Fix bytea without primary key (bug #1021)
|
||||
- non-MySQL: Parse '--' without trailing space as comment in SQL command (bug #1025, regression from 5.2.0)
|
||||
|
||||
## Adminer 5.2.0 (released 2025-04-08)
|
||||
- Autocomplete SQL commands
|
||||
- Do not edit NULL values by Modify (bug #967)
|
||||
- Fix foreign key actions (regression from 5.1.1)
|
||||
- MySQL: Display number of found rows in group queries (regression from 5.1.1)
|
||||
- PostgreSQL: Support COPY FROM stdin in SQL query (bug #942)
|
||||
- non-MySQL: Parse '--' without trailing space as comment in SQL command (bug SF-842)
|
||||
- MS SQL: Limit one INSERT in export to 1000 rows (bug #983)
|
||||
- CSS: Add logo
|
||||
- Editor: Move mass sending e-mails to a plugin
|
||||
- Plugins: Support translations by extending Adminer\Plugin
|
||||
- New plugin: Configure options by end-users and store them to a cookie
|
||||
- New plugin: Configure menu table links
|
||||
- New plugin: Set up driver, server and database in Adminer Editor
|
||||
|
||||
## Adminer 5.1.1 (released 2025-04-02)
|
||||
- Export: Fix tar (regression from 5.0.3)
|
||||
- Select: Allow ordering by COUNT(*) (bug #966, regression from 5.0.2)
|
||||
@@ -25,8 +147,8 @@
|
||||
- CSS: Allow more custom styles with dark mode (bug #925)
|
||||
- CSS: Increase maximum width of string edit (bug #930)
|
||||
- CSS: Increase space after SQL result (bug #937)
|
||||
- Plugins: autoload plugins from adminer-plugins/
|
||||
- Plugins: configure plugins with adminer-plugins.php
|
||||
- Plugins: Autoload plugins from adminer-plugins/
|
||||
- Plugins: Configure plugins with adminer-plugins.php
|
||||
- Plugins: Display loaded plugins in server overview
|
||||
- New plugin: AI prompt in SQL command generating the queries with Google Gemini
|
||||
- New plugin: Verify new versions from GitHub
|
||||
@@ -75,8 +197,8 @@
|
||||
- MariaDB: Fix creating and altering generated columns (bug #897)
|
||||
- PostgreSQL: Fix "where" and "order" privileges (bug #902, regression from 5.0.2)
|
||||
- SQLite: Fix creating table in compiled version (bug #901, regression from 5.0.0)
|
||||
- Elastic: Do not pass null values on insert (PR #892)
|
||||
- Elastic: Fix displaying sparse rows (PR #893)
|
||||
- Elasticsearch: Do not pass null values on insert (PR #892)
|
||||
- Elasticsearch: Fix displaying sparse rows (PR #893)
|
||||
- Plugins: Add method dumpFooter()
|
||||
|
||||
## Adminer 5.0.2 (released 2025-03-10)
|
||||
@@ -157,6 +279,7 @@
|
||||
- SQLite: Fix expressions in default values (bug SF-860)
|
||||
- MS SQL: Foreign keys in non-default schema (bug SF-833)
|
||||
- Oracle: Include tables granted by other user
|
||||
- Elasticsearch: Move to plugin
|
||||
- MongoDB: Execute commands against the selected DB
|
||||
|
||||
## Adminer 4.15.0
|
||||
|
||||
@@ -18,9 +18,6 @@ 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
|
||||
- `adminer/sqlite.php` - Development version of Adminer with SQLite allowed
|
||||
- `editor/sqlite.php` - Development version of Editor with SQLite allowed
|
||||
- `adminer/designs.php` - Development version of Adminer with `adminer.css` switcher
|
||||
- `compile.php` - Create a single file version
|
||||
- `lang.php` - Update translations
|
||||
- `tests/*.html` - Katalon Recorder test suites
|
||||
|
||||
@@ -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") {
|
||||
@@ -29,10 +29,14 @@ if (!$error && $_POST) {
|
||||
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) . ")";
|
||||
$query = (isset($_GET["callf"]) ? "SELECT " : "CALL ") . (idx($routine["returns"], "type") == "record" ? "* FROM " : "") . table($PROCEDURE) . "(" . implode(", ", $call) . ")";
|
||||
$start = microtime(true);
|
||||
$result = connection()->multi_query($query);
|
||||
$affected = connection()->affected_rows; // getting warnings overwrites this
|
||||
@@ -41,7 +45,7 @@ if (!$error && $_POST) {
|
||||
if (!$result) {
|
||||
echo "<p class='error'>" . error() . "\n";
|
||||
} else {
|
||||
$connection2 = connect(adminer()->credentials());
|
||||
$connection2 = connect();
|
||||
if ($connection2) {
|
||||
$connection2->select_db(DB);
|
||||
}
|
||||
|
||||
@@ -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 = ($partition_by ? driver()->partitionsInfo($TABLE) : array());
|
||||
|
||||
$referencable_primary = referencable_primary($TABLE);
|
||||
$foreign_keys = array();
|
||||
@@ -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.');
|
||||
@@ -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"][] = "";
|
||||
}
|
||||
@@ -189,7 +173,7 @@ if (support("columns") || $TABLE == "") {
|
||||
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>\n";
|
||||
echo (preg_match("~sqlite|mssql~", JUSH) ? "" : "<input list='collations' name='Collation' value='" . h($row["Collation"]) . "' placeholder='(" . lang('collation') . ")'>");
|
||||
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";
|
||||
}
|
||||
@@ -221,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("event.target.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";
|
||||
|
||||
@@ -38,7 +38,7 @@ if ($tables_views && !$error && !$_POST["search"]) {
|
||||
} elseif (JUSH != "sql") {
|
||||
$result = (JUSH == "sqlite"
|
||||
? queries("VACUUM")
|
||||
: apply_queries("VACUUM" . ($_POST["optimize"] ? "" : " ANALYZE"), $_POST["tables"])
|
||||
: apply_queries("VACUUM" . ($_POST["optimize"] ? " ANALYZE" : ""), $_POST["tables"])
|
||||
);
|
||||
$message = lang('Tables have been optimized.');
|
||||
} elseif (!$_POST["tables"]) {
|
||||
@@ -49,27 +49,29 @@ if ($tables_views && !$error && !$_POST["search"]) {
|
||||
}
|
||||
}
|
||||
|
||||
queries_redirect(substr(ME, 0, -1), $message, $result);
|
||||
queries_redirect($_SERVER["REQUEST_URI"], $message, $result);
|
||||
}
|
||||
|
||||
page_header(($_GET["ns"] == "" ? lang('Database') . ": " . h(DB) : lang('Schema') . ": " . h($_GET["ns"])), $error, true);
|
||||
|
||||
if (adminer()->homepage()) {
|
||||
if ($_GET["ns"] !== "") {
|
||||
$order = $_GET["order"];
|
||||
echo "<h3 id='tables-views'>" . lang('Tables and views') . "</h3>\n";
|
||||
$tables_list = tables_list();
|
||||
$tables_list = ($order ? table_status() : tables_list());
|
||||
if (!$tables_list) {
|
||||
echo "<p class='message'>" . lang('No tables.') . "\n";
|
||||
} else {
|
||||
echo "<form action='' method='post'>\n";
|
||||
if (support("table")) {
|
||||
echo "<fieldset><legend>" . lang('Search data in tables') . " <span id='selected2'></span></legend><div>";
|
||||
echo "<input type='search' name='query' value='" . h($_POST["query"]) . "'>";
|
||||
echo html_select("op", adminer()->operators(), idx($_POST, "op", JUSH == "elastic" ? "should" : "LIKE %%"));
|
||||
echo " <input type='search' name='query' value='" . h($_POST["query"]) . "'>";
|
||||
echo script("qsl('input').onkeydown = partialArg(bodyKeydown, 'search');", "");
|
||||
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"] = $_POST["op"];
|
||||
search_tables();
|
||||
}
|
||||
}
|
||||
@@ -78,94 +80,115 @@ if (adminer()->homepage()) {
|
||||
echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
|
||||
echo '<thead><tr class="wrap">';
|
||||
echo '<td><input id="check-all" type="checkbox" class="jsonly">' . script("qs('#check-all').onclick = partial(formCheck, /^(tables|views)\[/);", "");
|
||||
echo '<th>' . lang('Table');
|
||||
echo '<td>' . lang('Engine') . doc_link(array('sql' => 'storage-engines.html'));
|
||||
echo '<td>' . lang('Collation') . doc_link(array('sql' => 'charset-charsets.html', 'mariadb' => 'supported-character-sets-and-collations/'));
|
||||
echo '<td>' . lang('Data Length') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT', 'oracle' => 'REFRN20286'));
|
||||
echo '<td>' . lang('Index Length') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT'));
|
||||
echo '<td>' . lang('Data Free') . doc_link(array('sql' => 'show-table-status.html'));
|
||||
echo '<td>' . lang('Auto Increment') . doc_link(array('sql' => 'example-auto-increment.html', 'mariadb' => 'auto_increment/'));
|
||||
echo '<td>' . lang('Rows') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'catalog-pg-class.html#CATALOG-PG-CLASS', 'oracle' => 'REFRN20286'));
|
||||
echo (support("comment") ? '<td>' . lang('Comment') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-info.html#FUNCTIONS-INFO-COMMENT-TABLE')) : '');
|
||||
echo '<th><a href="' . h(substr(ME, 0, -1)) . '">' . lang('Table') . '</a>';
|
||||
$columns = array("Engine" => array(lang('Engine') . doc_link(array('sql' => 'storage-engines.html'))));
|
||||
if (collations()) {
|
||||
$columns["Collation"] = array(lang('Collation') . doc_link(array('sql' => 'charset-charsets.html', 'mariadb' => 'supported-character-sets-and-collations/')));
|
||||
}
|
||||
if (function_exists('Adminer\alter_table')) {
|
||||
$columns["Data_length"] = array(lang('Data Length') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT', 'oracle' => 'REFRN20286')), "create", lang('Alter table'));
|
||||
}
|
||||
if (support('indexes')) {
|
||||
$columns["Index_length"] = array(lang('Index Length') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-admin.html#FUNCTIONS-ADMIN-DBOBJECT')), "indexes", lang('Alter indexes'));
|
||||
}
|
||||
$columns["Data_free"] = array(lang('Data Free') . doc_link(array('sql' => 'show-table-status.html')), "edit", lang('New item'));
|
||||
if (function_exists('Adminer\alter_table')) {
|
||||
$columns["Auto_increment"] = array(lang('Auto Increment') . doc_link(array('sql' => 'example-auto-increment.html', 'mariadb' => 'auto_increment/')), "auto_increment=1&create", lang('Alter table'));
|
||||
}
|
||||
$columns["Rows"] = array(lang('Rows') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'catalog-pg-class.html#CATALOG-PG-CLASS', 'oracle' => 'REFRN20286')), "select", lang('Select data'));
|
||||
if (support("comment")) {
|
||||
$columns["Comment"] = array(lang('Comment') . doc_link(array('sql' => 'show-table-status.html', 'pgsql' => 'functions-info.html#FUNCTIONS-INFO-COMMENT-TABLE')));
|
||||
}
|
||||
foreach ($columns as $key => $column) {
|
||||
echo "<th><a href='" . h(ME) . "order=$key'>$column[0]</a>";
|
||||
}
|
||||
echo "</thead>\n";
|
||||
|
||||
if ($order) {
|
||||
uasort($tables_list, function ($a, $b) use ($order) {
|
||||
$return = ($a[$order] < $b[$order] ? -1 : ($a[$order] > $b[$order] ? 1 : 0)); // <=> available since PHP 7.1
|
||||
return (in_array($order, array('Engine', 'Collation', 'Comment')) ? $return : -$return);
|
||||
});
|
||||
}
|
||||
|
||||
$tables = 0;
|
||||
foreach ($tables_list as $name => $type) {
|
||||
$view = ($type !== null && !preg_match('~table|sequence~i', $type));
|
||||
foreach ($tables_list as $name => $status) {
|
||||
$view = ($order ? is_view($status) : $status !== null && !preg_match('~table|sequence~i', $status));
|
||||
$status = ($order ? $status : array('Engine' => $status));
|
||||
$id = h("Table-" . $name);
|
||||
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>';
|
||||
if ($view && !preg_match('~materialized~i', $status['Engine'])) {
|
||||
$title = lang('View');
|
||||
echo '<td colspan="' . (count($columns) - 2) . '">' . (support("view") ? "<a href='" . h(ME) . "view=" . urlencode($name) . "' title='" . lang('Alter view') . "'>$title</a>" : $title);
|
||||
echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '" title="' . lang('Select data') . '">?</a>';
|
||||
echo '<td>' . h($status['Comment']);
|
||||
} else {
|
||||
foreach (
|
||||
array(
|
||||
"Engine" => array(),
|
||||
"Collation" => array(),
|
||||
"Data_length" => array("create", lang('Alter table')),
|
||||
"Index_length" => array("indexes", lang('Alter indexes')),
|
||||
"Data_free" => array("edit", lang('New item')),
|
||||
"Auto_increment" => array("auto_increment=1&create", lang('Alter table')),
|
||||
"Rows" => array("select", lang('Select data')),
|
||||
) as $key => $link
|
||||
) {
|
||||
foreach ($columns as $key => $column) {
|
||||
$id = " id='$key-" . h($name) . "'";
|
||||
echo ($link ? "<td align='right'>" . (support("table") || $key == "Rows" || (support("indexes") && $key != "Data_length")
|
||||
? "<a href='" . h(ME . "$link[0]=") . urlencode($name) . "'$id title='$link[1]'>?</a>"
|
||||
: "<span$id>?</span>"
|
||||
) : "<td id='$key-" . h($name) . "'>");
|
||||
$val = idx($status, $key, '?');
|
||||
echo ($column[1]
|
||||
? "<td align='right'><a href='" . h(ME . "$column[1]=") . urlencode($name) . "'$id title='$column[2]'>" . (is_numeric($val)
|
||||
? ($val < 0 ? '?' : ($key == "Rows" && $val && $status["Engine"] == (JUSH == "pgsql" ? "table" : "InnoDB") ? '~ ' : '') . format_number($val))
|
||||
: $val
|
||||
) . "</a>"
|
||||
: "<td id='$key-" . h($name) . "'>" . h($val)
|
||||
);
|
||||
}
|
||||
$tables++;
|
||||
}
|
||||
echo (support("comment") ? "<td id='Comment-" . h($name) . "'>" : "");
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
echo "<tr><td><th>" . lang('%d in total', count($tables_list));
|
||||
echo "<td>" . h(JUSH == "sql" ? get_val("SELECT @@default_storage_engine") : "");
|
||||
echo "<td>" . h(db_collation(DB, collations()));
|
||||
echo (collations() ? "<td>" . h(db_collation(DB, collations())) : '');
|
||||
foreach (array("Data_length", "Index_length", "Data_free") as $key) {
|
||||
echo "<td align='right' id='sum-$key'>";
|
||||
echo ($columns[$key] ? "<td align='right' id='sum-$key'>" : "");
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
echo "</table>\n";
|
||||
echo ($order ? '' : script("ajaxSetHtml('" . js_escape(ME) . "script=db');"));
|
||||
echo "</div>\n";
|
||||
if (!information_schema(DB)) {
|
||||
echo "<div class='footer'><div>\n";
|
||||
$vacuum = "<input type='submit' value='" . lang('Vacuum') . "'> " . on_help("'VACUUM'");
|
||||
$optimize = "<input type='submit' name='optimize' value='" . lang('Optimize') . "'> " . on_help(JUSH == "sql" ? "'OPTIMIZE TABLE'" : "'VACUUM OPTIMIZE'");
|
||||
echo "<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>"
|
||||
. (JUSH == "sqlite" ? $vacuum . "<input type='submit' name='check' value='" . lang('Check') . "'> " . on_help("'PRAGMA integrity_check'")
|
||||
$optimize = "<input type='submit' name='optimize' value='" . lang('Optimize') . "'> " . on_help(JUSH == "sql" ? "'OPTIMIZE TABLE'" : "'VACUUM ANALYZE'");
|
||||
$print = (JUSH == "sqlite" ? $vacuum . "<input type='submit' name='check' value='" . lang('Check') . "'> " . on_help("'PRAGMA integrity_check'")
|
||||
: (JUSH == "pgsql" ? $vacuum . $optimize
|
||||
: (JUSH == "sql" ? "<input type='submit' value='" . lang('Analyze') . "'> " . on_help("'ANALYZE TABLE'")
|
||||
. $optimize
|
||||
. "<input type='submit' name='check' value='" . lang('Check') . "'> " . on_help("'CHECK TABLE'")
|
||||
. "<input type='submit' name='repair' value='" . lang('Repair') . "'> " . on_help("'REPAIR TABLE'")
|
||||
: "")))
|
||||
. "<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";
|
||||
. (function_exists('Adminer\truncate_tables') ? "<input type='submit' name='truncate' value='" . lang('Truncate') . "'> " . on_help(JUSH == "sqlite" ? "'DELETE'" : "'TRUNCATE" . (JUSH == "pgsql" ? "'" : " TABLE'")) . confirm() : "")
|
||||
. (function_exists('Adminer\drop_tables') ? "<input type='submit' name='drop' value='" . lang('Drop') . "'>" . on_help("'DROP TABLE'") . confirm() : "");
|
||||
echo ($print ? "<div class='footer'><div>\n<fieldset><legend>" . lang('Selected') . " <span id='selected'></span></legend><div>$print\n</div></fieldset>\n" : "");
|
||||
|
||||
$databases = (support("scheme") ? adminer()->schemas() : adminer()->databases());
|
||||
$script = "";
|
||||
if (count($databases) != 1 && JUSH != "sqlite") {
|
||||
echo "<fieldset><legend>" . lang('Move to other database') . " <span id='selected3'></span></legend><div>";
|
||||
$db = (isset($_POST["target"]) ? $_POST["target"] : (support("scheme") ? $_GET["ns"] : DB));
|
||||
echo "<p>" . lang('Move to other database') . ": ";
|
||||
echo ($databases ? html_select("target", $databases, $db) : '<input name="target" value="' . h($db) . '" 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 "</div></fieldset>\n";
|
||||
$script = " selectCount('selected3', formChecked(this, /^(tables|views)\[/));";
|
||||
}
|
||||
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 script("qsl('input').onclick = function () { selectCount('selected', formChecked(this, /^(tables|views)\[/));"
|
||||
. (support("table") ? " selectCount('selected2', formChecked(this, /^tables\[/) || $tables);" : "")
|
||||
. "$script }")
|
||||
;
|
||||
echo input_token();
|
||||
echo "</div></fieldset>\n";
|
||||
echo "</div></div>\n";
|
||||
}
|
||||
echo "</form>\n";
|
||||
echo script("tableCheck();");
|
||||
}
|
||||
|
||||
echo "<p class='links'><a href='" . h(ME) . "create='>" . lang('Create table') . "</a>\n";
|
||||
echo (function_exists('Adminer\alter_table') ? "<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")) {
|
||||
@@ -239,9 +262,5 @@ if (adminer()->homepage()) {
|
||||
}
|
||||
echo '<p class="links"><a href="' . h(ME) . 'event=">' . lang('Create event') . "</a>\n";
|
||||
}
|
||||
|
||||
if ($tables_list) {
|
||||
echo script("ajaxSetHtml('" . js_escape(ME) . "script=db');");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,10 @@ add_driver("mssql", "MS SQL");
|
||||
|
||||
if (isset($_GET["mssql"])) {
|
||||
define('Adminer\DRIVER', "mssql");
|
||||
|
||||
if (extension_loaded("sqlsrv") && $_GET["ext"] != "pdo") {
|
||||
class Db extends SqlDb {
|
||||
public string $extension = "sqlsrv";
|
||||
public $extension = "sqlsrv";
|
||||
private $link, $result;
|
||||
|
||||
private function get_error() {
|
||||
@@ -25,7 +26,7 @@ if (isset($_GET["mssql"])) {
|
||||
$this->error = rtrim($this->error);
|
||||
}
|
||||
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
function attach(string $server, string $username, string $password): string {
|
||||
$connection_info = array("UID" => $username, "PWD" => $password, "CharacterSet" => "UTF-8");
|
||||
$ssl = adminer()->connectSsl();
|
||||
if (isset($ssl["Encrypt"])) {
|
||||
@@ -38,7 +39,8 @@ if (isset($_GET["mssql"])) {
|
||||
if ($db != "") {
|
||||
$connection_info["Database"] = $db;
|
||||
}
|
||||
$this->link = @sqlsrv_connect(preg_replace('~:~', ',', $server), $connection_info);
|
||||
list($host, $port) = host_port($server);
|
||||
$this->link = @sqlsrv_connect($host . ($port ? ",$port" : ""), $connection_info);
|
||||
if ($this->link) {
|
||||
$info = sqlsrv_server_info($this->link);
|
||||
$this->server_info = $info['SQLServerVersion'];
|
||||
@@ -178,19 +180,21 @@ if (isset($_GET["mssql"])) {
|
||||
|
||||
if (extension_loaded("pdo_sqlsrv")) {
|
||||
class Db extends MssqlDb {
|
||||
public string $extension = "PDO_SQLSRV";
|
||||
public $extension = "PDO_SQLSRV";
|
||||
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
return $this->dsn("sqlsrv:Server=" . str_replace(":", ",", $server), $username, $password);
|
||||
function attach(string $server, string $username, string $password): string {
|
||||
list($host, $port) = host_port($server);
|
||||
return $this->dsn("sqlsrv:Server=$host" . ($port ? ",$port" : ""), $username, $password);
|
||||
}
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_dblib")) {
|
||||
class Db extends MssqlDb {
|
||||
public string $extension = "PDO_DBLIB";
|
||||
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);
|
||||
function attach(string $server, string $username, string $password): string {
|
||||
list($host, $port) = host_port($server);
|
||||
return $this->dsn("dblib:charset=utf8;host=$host" . ($port ? (is_numeric($port) ? ";port=" : ";unix_socket=") . $port : ""), $username, $password);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,22 +202,22 @@ if (isset($_GET["mssql"])) {
|
||||
|
||||
|
||||
class Driver extends SqlDriver {
|
||||
static array $extensions = array("SQLSRV", "PDO_SQLSRV", "PDO_DBLIB");
|
||||
static string $jush = "mssql";
|
||||
static $extensions = array("SQLSRV", "PDO_SQLSRV", "PDO_DBLIB");
|
||||
static $jush = "mssql";
|
||||
|
||||
public array $insertFunctions = array("date|time" => "getdate");
|
||||
public array $editFunctions = array(
|
||||
public $insertFunctions = array("date|time" => "getdate");
|
||||
public $editFunctions = array(
|
||||
"int|decimal|real|float|money|datetime" => "+/-",
|
||||
"char|text" => "+",
|
||||
);
|
||||
|
||||
public array $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL");
|
||||
public array $functions = array("len", "lower", "round", "upper");
|
||||
public array $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
|
||||
public array $generated = array("PERSISTED", "VIRTUAL");
|
||||
public string $onActions = "NO ACTION|CASCADE|SET NULL|SET DEFAULT";
|
||||
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 $generated = array("PERSISTED", "VIRTUAL");
|
||||
public $onActions = "NO ACTION|CASCADE|SET NULL|SET DEFAULT";
|
||||
|
||||
static function connect(?string $server, string $username, string $password) {
|
||||
static function connect(string $server, string $username, string $password) {
|
||||
if ($server == "") {
|
||||
$server = "localhost:1433";
|
||||
}
|
||||
@@ -677,7 +681,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)) as $row
|
||||
return "TRUNCATE TABLE " . table($table);
|
||||
}
|
||||
|
||||
function use_sql($database) {
|
||||
function use_sql($database, $style = "") {
|
||||
return "USE " . idf_escape($database);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,19 +5,20 @@ SqlDriver::$drivers = array("server" => "MySQL / MariaDB") + SqlDriver::$drivers
|
||||
|
||||
if (!defined('Adminer\DRIVER')) {
|
||||
define('Adminer\DRIVER', "server"); // server - backwards compatibility
|
||||
|
||||
// MySQLi supports everything, MySQL doesn't support multiple result sets, PDO_MySQL doesn't support orgtable
|
||||
if (extension_loaded("mysqli") && $_GET["ext"] != "pdo") {
|
||||
class Db extends \MySQLi {
|
||||
/** @var Db */ static $instance;
|
||||
public string $extension = "MySQLi", $flavor = '';
|
||||
public $extension = "MySQLi", $flavor = '';
|
||||
|
||||
function __construct() {
|
||||
parent::init();
|
||||
}
|
||||
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
function attach(string $server, string $username, string $password): string {
|
||||
mysqli_report(MYSQLI_REPORT_OFF); // stays between requests, not required since PHP 5.3.4
|
||||
list($host, $port) = explode(":", $server, 2); // part after : is used for port or socket
|
||||
list($host, $port) = host_port($server);
|
||||
$ssl = adminer()->connectSsl();
|
||||
if ($ssl) {
|
||||
$this->ssl_set($ssl['key'], $ssl['cert'], $ssl['ca'], '', '');
|
||||
@@ -28,10 +29,10 @@ if (!defined('Adminer\DRIVER')) {
|
||||
($server . $username . $password != "" ? $password : ini_get("mysqli.default_pw")),
|
||||
null,
|
||||
(is_numeric($port) ? intval($port) : ini_get("mysqli.default_port")),
|
||||
(is_numeric($port) ? $port : null),
|
||||
(is_numeric($port) ? null : $port),
|
||||
($ssl ? ($ssl['verify'] !== false ? 2048 : 64) : 0) // 2048 - MYSQLI_CLIENT_SSL, 64 - MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT (not available before PHP 5.6.16)
|
||||
);
|
||||
$this->options(MYSQLI_OPT_LOCAL_INFILE, false);
|
||||
$this->options(MYSQLI_OPT_LOCAL_INFILE, 0);
|
||||
return ($return ? '' : $this->error);
|
||||
}
|
||||
|
||||
@@ -57,14 +58,14 @@ if (!defined('Adminer\DRIVER')) {
|
||||
class Db extends SqlDb {
|
||||
/** @var resource */ private $link;
|
||||
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
function attach(string $server, string $username, string $password): string {
|
||||
if (ini_bool("mysql.allow_local_infile")) {
|
||||
return lang('Disable %s or enable %s or %s extensions.', "'mysql.allow_local_infile'", "MySQLi", "PDO_MySQL");
|
||||
}
|
||||
$this->link = @mysql_connect(
|
||||
($server != "" ? $server : ini_get("mysql.default_host")),
|
||||
("$server$username" != "" ? $username : ini_get("mysql.default_user")),
|
||||
("$server$username$password" != "" ? $password : ini_get("mysql.default_password")),
|
||||
($server . $username != "" ? $username : ini_get("mysql.default_user")),
|
||||
($server . $username . $password != "" ? $password : ini_get("mysql.default_password")),
|
||||
true,
|
||||
131072 // CLIENT_MULTI_RESULTS for CALL
|
||||
);
|
||||
@@ -113,7 +114,7 @@ if (!defined('Adminer\DRIVER')) {
|
||||
}
|
||||
|
||||
class Result {
|
||||
public int $num_rows; // number of rows in the result
|
||||
public $num_rows; // number of rows in the result
|
||||
/** @var resource */ private $result;
|
||||
private int $offset = 0;
|
||||
|
||||
@@ -155,9 +156,9 @@ if (!defined('Adminer\DRIVER')) {
|
||||
|
||||
} elseif (extension_loaded("pdo_mysql")) {
|
||||
class Db extends PdoDb {
|
||||
public string $extension = "PDO_MySQL";
|
||||
public $extension = "PDO_MySQL";
|
||||
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
function attach(string $server, string $username, string $password): string {
|
||||
$options = array(\PDO::MYSQL_ATTR_LOCAL_INFILE => false);
|
||||
$ssl = adminer()->connectSsl();
|
||||
if ($ssl) {
|
||||
@@ -174,8 +175,9 @@ if (!defined('Adminer\DRIVER')) {
|
||||
$options[\PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = $ssl['verify'];
|
||||
}
|
||||
}
|
||||
list($host, $port) = host_port($server);
|
||||
return $this->dsn(
|
||||
"mysql:charset=utf8;host=" . str_replace(":", ";unix_socket=", preg_replace('~:(\d)~', ';port=\1', $server)),
|
||||
"mysql:charset=utf8;host=$host" . ($port ? (is_numeric($port) ? ";port=" : ";unix_socket=") . $port : ""),
|
||||
$username,
|
||||
$password,
|
||||
$options
|
||||
@@ -202,15 +204,15 @@ if (!defined('Adminer\DRIVER')) {
|
||||
|
||||
|
||||
class Driver extends SqlDriver {
|
||||
/** @var list<string> */ static array $extensions = array("MySQLi", "MySQL", "PDO_MySQL");
|
||||
static string $jush = "sql"; // JUSH identifier
|
||||
static $extensions = array("MySQLi", "MySQL", "PDO_MySQL");
|
||||
static $jush = "sql"; // JUSH identifier
|
||||
|
||||
/** @var list<string> */ public array $unsigned = array("unsigned", "zerofill", "unsigned zerofill");
|
||||
/** @var list<string> */ public array $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "FIND_IN_SET", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL");
|
||||
/** @var list<string> */ public array $functions = array("char_length", "date", "from_unixtime", "lower", "round", "floor", "ceil", "sec_to_time", "time_to_sec", "upper");
|
||||
/** @var list<string> */ public array $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
|
||||
public $unsigned = array("unsigned", "zerofill", "unsigned zerofill");
|
||||
public $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "REGEXP", "IN", "FIND_IN_SET", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL", "SQL");
|
||||
public $functions = array("char_length", "date", "from_unixtime", "lower", "round", "floor", "ceil", "sec_to_time", "time_to_sec", "upper");
|
||||
public $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
|
||||
|
||||
static function connect(?string $server, string $username, string $password) {
|
||||
static function connect(string $server, string $username, string $password) {
|
||||
$connection = parent::connect($server, $username, $password);
|
||||
if (is_string($connection)) {
|
||||
if (function_exists('iconv') && !is_utf8($connection) && strlen($s = iconv("windows-1250", "utf-8", $connection)) > strlen($connection)) { // windows-1250 - most common Windows encoding
|
||||
@@ -257,6 +259,9 @@ if (!defined('Adminer\DRIVER')) {
|
||||
$this->types[lang('Numbers')]["vector"] = 16383;
|
||||
$this->insertFunctions['vector'] = 'string_to_vector';
|
||||
}
|
||||
if (min_version(5.1, '', $connection)) {
|
||||
$this->partitionBy = array("HASH", "LINEAR HASH", "KEY", "LINEAR KEY", "RANGE", "LIST");
|
||||
}
|
||||
if (min_version(5.7, 10.2, $connection)) {
|
||||
$this->generated = array("STORED", "VIRTUAL");
|
||||
}
|
||||
@@ -334,6 +339,17 @@ if (!defined('Adminer\DRIVER')) {
|
||||
}
|
||||
}
|
||||
|
||||
function partitionsInfo(string $table): array {
|
||||
$from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . q(DB) . " AND TABLE_NAME = " . q($table);
|
||||
$result = $this->conn->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;
|
||||
}
|
||||
|
||||
function hasCStyleEscapes(): bool {
|
||||
static $c_style;
|
||||
if ($c_style === null) {
|
||||
@@ -352,6 +368,10 @@ if (!defined('Adminer\DRIVER')) {
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function indexAlgorithms(array $tableStatus): array {
|
||||
return (preg_match('~^(MEMORY|NDB)$~', $tableStatus["Engine"]) ? array("HASH", "BTREE") : array());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -438,7 +458,7 @@ if (!defined('Adminer\DRIVER')) {
|
||||
|
||||
/** Get table status
|
||||
* @param bool $fast return only "Name", "Engine" and "Comment" fields
|
||||
* @return TableStatus[]
|
||||
* @return array<string, TableStatus>
|
||||
*/
|
||||
function table_status(string $name = "", bool $fast = false): array {
|
||||
$return = array();
|
||||
@@ -543,6 +563,7 @@ if (!defined('Adminer\DRIVER')) {
|
||||
$return[$name]["columns"][] = $row["Column_name"];
|
||||
$return[$name]["lengths"][] = ($row["Index_type"] == "SPATIAL" ? null : $row["Sub_part"]);
|
||||
$return[$name]["descs"][] = null;
|
||||
$return[$name]["algorithm"] = $row["Index_type"];
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -556,7 +577,7 @@ if (!defined('Adminer\DRIVER')) {
|
||||
$create_table = get_val("SHOW CREATE TABLE " . table($table), 1);
|
||||
if ($create_table) {
|
||||
preg_match_all(
|
||||
"~CONSTRAINT ($pattern) FOREIGN KEY ?\\(((?:$pattern,? ?)+)\\) REFERENCES ($pattern)(?:\\.($pattern))? \\(((?:$pattern,? ?)+)\\)(?: ON DELETE (driver()->onActions))?(?: ON UPDATE (driver()->onActions))?~",
|
||||
"~CONSTRAINT ($pattern) FOREIGN KEY ?\\(((?:$pattern,? ?)+)\\) REFERENCES ($pattern)(?:\\.($pattern))? \\(((?:$pattern,? ?)+)\\)(?: ON DELETE (" . driver()->onActions . "))?(?: ON UPDATE (" . driver()->onActions . "))?~",
|
||||
$create_table,
|
||||
$matches,
|
||||
PREG_SET_ORDER
|
||||
@@ -675,10 +696,11 @@ if (!defined('Adminer\DRIVER')) {
|
||||
* @param string $name new name
|
||||
* @param list<array{string, list<string>, string}> $fields of [$orig, $process_field, $after]
|
||||
* @param string[] $foreign
|
||||
* @param numeric-string $auto_increment
|
||||
* @param numeric-string|'' $auto_increment
|
||||
* @param ?Partitions $partitioning null means remove partitioning
|
||||
* @return Result|bool
|
||||
*/
|
||||
function alter_table(string $table, string $name, array $fields, array $foreign, ?string $comment, string $engine, string $collation, string $auto_increment, string $partitioning) {
|
||||
function alter_table(string $table, string $name, array $fields, array $foreign, ?string $comment, string $engine, string $collation, string $auto_increment, ?array $partitioning) {
|
||||
$alter = array();
|
||||
foreach ($fields as $field) {
|
||||
if ($field[1]) {
|
||||
@@ -699,8 +721,28 @@ if (!defined('Adminer\DRIVER')) {
|
||||
. ($collation ? " COLLATE " . q($collation) : "")
|
||||
. ($auto_increment != "" ? " AUTO_INCREMENT=$auto_increment" : "")
|
||||
;
|
||||
|
||||
if ($partitioning) {
|
||||
$partitions = array();
|
||||
if ($partitioning["partition_by"] == 'RANGE' || $partitioning["partition_by"] == 'LIST') {
|
||||
foreach ($partitioning["partition_names"] as $key => $val) {
|
||||
$value = $partitioning["partition_values"][$key];
|
||||
$partitions[] = "\n PARTITION " . idf_escape($val) . " VALUES " . ($partitioning["partition_by"] == 'RANGE' ? "LESS THAN" : "IN") . ($value != "" ? " ($value)" : " MAXVALUE"); //! SQL injection
|
||||
}
|
||||
}
|
||||
// $partitioning["partition"] can be expression, not only column
|
||||
$status .= "\nPARTITION BY $partitioning[partition_by]($partitioning[partition])";
|
||||
if ($partitions) {
|
||||
$status .= " (" . implode(",", $partitions) . "\n)";
|
||||
} elseif ($partitioning["partitions"]) {
|
||||
$status .= " PARTITIONS " . (+$partitioning["partitions"]);
|
||||
}
|
||||
} elseif ($partitioning === null) {
|
||||
$status .= "\nREMOVE PARTITIONING";
|
||||
}
|
||||
|
||||
if ($table == "") {
|
||||
return queries("CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)$status$partitioning");
|
||||
return queries("CREATE TABLE " . table($name) . " (\n" . implode(",\n", $alter) . "\n)$status");
|
||||
}
|
||||
if ($table != $name) {
|
||||
$alter[] = "RENAME TO " . table($name);
|
||||
@@ -708,12 +750,12 @@ if (!defined('Adminer\DRIVER')) {
|
||||
if ($status) {
|
||||
$alter[] = ltrim($status);
|
||||
}
|
||||
return ($alter || $partitioning ? queries("ALTER TABLE " . table($table) . "\n" . implode(",\n", $alter) . $partitioning) : true);
|
||||
return ($alter ? queries("ALTER TABLE " . table($table) . "\n" . implode(",\n", $alter)) : true);
|
||||
}
|
||||
|
||||
/** Run commands to alter indexes
|
||||
* @param string $table escaped table name
|
||||
* @param list<array{string, string, 'DROP'|list<string>}> $alter of ["index type", "name", ["column definition", ...]] or ["index type", "name", "DROP"]
|
||||
* @param list<array{string, string, 'DROP'|list<string>, 3?: string, 4?: string}> $alter of ["index type", "name", ["column definition", ...], "algorithm", "condition"] or ["index type", "name", "DROP"]
|
||||
* @return Result|bool
|
||||
*/
|
||||
function alter_indexes(string $table, $alter) {
|
||||
@@ -851,43 +893,34 @@ if (!defined('Adminer\DRIVER')) {
|
||||
* @return Routine
|
||||
*/
|
||||
function routine(string $name, string $type): array {
|
||||
$aliases = array("bool", "boolean", "integer", "double precision", "real", "dec", "numeric", "fixed", "national char", "national varchar");
|
||||
$space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";
|
||||
$enum = driver()->enumLength;
|
||||
$type_pattern = "((" . implode("|", array_merge(array_keys(driver()->types()), $aliases)) . ")\\b(?:\\s*\\(((?:[^'\")]|$enum)++)\\))?"
|
||||
. "\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s,]+)['\"]?)?";
|
||||
$pattern = "$space*(" . ($type == "FUNCTION" ? "" : driver()->inout) . ")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern";
|
||||
$create = get_val("SHOW CREATE $type " . idf_escape($name), 2);
|
||||
preg_match("~\\(((?:$pattern\\s*,?)*)\\)\\s*" . ($type == "FUNCTION" ? "RETURNS\\s+$type_pattern\\s+" : "") . "(.*)~is", $create, $match);
|
||||
$fields = array();
|
||||
preg_match_all("~$pattern\\s*,?~is", $match[1], $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $param) {
|
||||
$fields[] = array(
|
||||
"field" => str_replace("``", "`", $param[2]) . $param[3],
|
||||
"type" => strtolower($param[5]),
|
||||
"length" => preg_replace_callback("~$enum~s", 'Adminer\normalize_enum', $param[6]),
|
||||
"unsigned" => strtolower(preg_replace('~\s+~', ' ', trim("$param[8] $param[7]"))),
|
||||
"null" => true,
|
||||
"full_type" => $param[4],
|
||||
"inout" => strtoupper($param[1]),
|
||||
"collation" => strtolower($param[9]),
|
||||
);
|
||||
$fields = get_rows("SELECT
|
||||
PARAMETER_NAME field,
|
||||
DATA_TYPE type,
|
||||
CHARACTER_MAXIMUM_LENGTH length,
|
||||
REGEXP_REPLACE(DTD_IDENTIFIER, '^[^ ]+ ', '') `unsigned`,
|
||||
1 `null`,
|
||||
DTD_IDENTIFIER full_type,
|
||||
PARAMETER_MODE `inout`,
|
||||
CHARACTER_SET_NAME collation
|
||||
FROM information_schema.PARAMETERS
|
||||
WHERE SPECIFIC_SCHEMA = DATABASE() AND ROUTINE_TYPE = '$type' AND SPECIFIC_NAME = " . q($name) . "
|
||||
ORDER BY ORDINAL_POSITION");
|
||||
$return = connection()->query("SELECT ROUTINE_COMMENT comment, ROUTINE_DEFINITION definition, 'SQL' language
|
||||
FROM information_schema.ROUTINES
|
||||
WHERE ROUTINE_SCHEMA = DATABASE() AND ROUTINE_TYPE = '$type' AND ROUTINE_NAME = " . q($name))->fetch_assoc();
|
||||
if ($fields && $fields[0]['field'] == '') {
|
||||
$return['returns'] = array_shift($fields);
|
||||
}
|
||||
return array(
|
||||
"fields" => $fields,
|
||||
"comment" => get_val("SELECT ROUTINE_COMMENT FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = DATABASE() AND ROUTINE_NAME = " . q($name)),
|
||||
) + ($type != "FUNCTION" ? array("definition" => $match[11]) : array(
|
||||
"returns" => array("type" => $match[12], "length" => $match[13], "unsigned" => $match[15], "collation" => $match[16]),
|
||||
"definition" => $match[17],
|
||||
"language" => "SQL", // available in information_schema.ROUTINES.BODY_STYLE
|
||||
));
|
||||
$return['fields'] = $fields;
|
||||
/** @phpstan-var Routine */
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Get list of routines
|
||||
* @return list<string[]> ["SPECIFIC_NAME" => , "ROUTINE_NAME" => , "ROUTINE_TYPE" => , "DTD_IDENTIFIER" => ]
|
||||
*/
|
||||
function routines(): array {
|
||||
return get_rows("SELECT ROUTINE_NAME AS SPECIFIC_NAME, ROUTINE_NAME, ROUTINE_TYPE, DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = DATABASE()");
|
||||
return get_rows("SELECT SPECIFIC_NAME, ROUTINE_NAME, ROUTINE_TYPE, DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = DATABASE()");
|
||||
}
|
||||
|
||||
/** Get list of available routine languages
|
||||
@@ -942,8 +975,17 @@ if (!defined('Adminer\DRIVER')) {
|
||||
}
|
||||
|
||||
/** Get SQL command to change database */
|
||||
function use_sql(string $database): string {
|
||||
return "USE " . idf_escape($database);
|
||||
function use_sql(string $database, string $style = ""): string {
|
||||
$name = idf_escape($database);
|
||||
$return = "";
|
||||
if (preg_match('~CREATE~', $style) && ($create = get_val("SHOW CREATE DATABASE $name", 1))) {
|
||||
set_utf8mb4($create);
|
||||
if ($style == "DROP+CREATE") {
|
||||
$return = "DROP DATABASE IF EXISTS $name;\n";
|
||||
}
|
||||
$return .= "$create;\n";
|
||||
}
|
||||
return $return . "USE $name";
|
||||
}
|
||||
|
||||
/** Get SQL commands to create triggers */
|
||||
@@ -1011,18 +1053,26 @@ if (!defined('Adminer\DRIVER')) {
|
||||
}
|
||||
|
||||
/** Check whether a feature is supported
|
||||
* @param literal-string $feature "check|comment|copy|database|descidx|drop_col|dump|event|indexes|kill|materializedview|partitioning|privileges|procedure|processlist|routine|scheme|sequence|status|table|trigger|type|variables|view|view_trigger"
|
||||
* @param literal-string $feature check|comment|columns|copy|database|descidx|drop_col|dump|event|indexes|kill|materializedview
|
||||
* |move_col|privileges|procedure|processlist|routine|scheme|sequence|sql|status|table|trigger|type|variables|view|view_trigger
|
||||
*/
|
||||
function support(string $feature): bool {
|
||||
return !preg_match("~scheme|sequence|type|view_trigger|materializedview" . (min_version(8) ? "" : "|descidx" . (min_version(5.1) ? "" : "|event|partitioning")) . (min_version('8.0.16', '10.2.1') ? "" : "|check") . "~", $feature);
|
||||
return preg_match(
|
||||
'~^(comment|columns|copy|database|drop_col|dump|indexes|kill|privileges|move_col|procedure|processlist|routine|sql|status|table|trigger|variables|view'
|
||||
. (min_version(5.1) ? '|event' : '')
|
||||
. (min_version(8) ? '|descidx' : '')
|
||||
. (min_version('8.0.16', '10.2.1') ? '|check' : '')
|
||||
. ')$~',
|
||||
$feature
|
||||
);
|
||||
}
|
||||
|
||||
/** Kill a process
|
||||
* @param numeric-string $val
|
||||
* @param numeric-string $id
|
||||
* @return Result|bool
|
||||
*/
|
||||
function kill_process(string $val) {
|
||||
return queries("KILL " . number($val));
|
||||
function kill_process(string $id) {
|
||||
return queries("KILL " . number($id));
|
||||
}
|
||||
|
||||
/** Return query to get connection ID */
|
||||
|
||||
@@ -5,9 +5,10 @@ add_driver("oracle", "Oracle (beta)");
|
||||
|
||||
if (isset($_GET["oracle"])) {
|
||||
define('Adminer\DRIVER', "oracle");
|
||||
|
||||
if (extension_loaded("oci8") && $_GET["ext"] != "pdo") {
|
||||
class Db extends SqlDb {
|
||||
public string $extension = "oci8";
|
||||
public $extension = "oci8";
|
||||
public $_current_db;
|
||||
private $link;
|
||||
|
||||
@@ -19,7 +20,7 @@ if (isset($_GET["oracle"])) {
|
||||
$this->error = $error;
|
||||
}
|
||||
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
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);
|
||||
@@ -59,6 +60,10 @@ if (isset($_GET["oracle"])) {
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function timeout(int $ms): bool {
|
||||
return oci_set_call_timeout($this->link, $ms);
|
||||
}
|
||||
}
|
||||
|
||||
class Result {
|
||||
@@ -102,10 +107,10 @@ if (isset($_GET["oracle"])) {
|
||||
|
||||
} elseif (extension_loaded("pdo_oci")) {
|
||||
class Db extends PdoDb {
|
||||
public string $extension = "PDO_OCI";
|
||||
public $extension = "PDO_OCI";
|
||||
public $_current_db;
|
||||
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
function attach(string $server, string $username, string $password): string {
|
||||
return $this->dsn("oci:dbname=//$server;charset=AL32UTF8", $username, $password);
|
||||
}
|
||||
|
||||
@@ -120,22 +125,22 @@ if (isset($_GET["oracle"])) {
|
||||
|
||||
|
||||
class Driver extends SqlDriver {
|
||||
static array $extensions = array("OCI8", "PDO_OCI");
|
||||
static string $jush = "oracle";
|
||||
static $extensions = array("OCI8", "PDO_OCI");
|
||||
static $jush = "oracle";
|
||||
|
||||
public array $insertFunctions = array( //! no parentheses
|
||||
public $insertFunctions = array( //! no parentheses
|
||||
"date" => "current_date",
|
||||
"timestamp" => "current_timestamp",
|
||||
);
|
||||
public array $editFunctions = array(
|
||||
public $editFunctions = array(
|
||||
"number|float|double" => "+/-",
|
||||
"date|timestamp" => "+ interval/- interval",
|
||||
"char|clob" => "||",
|
||||
);
|
||||
|
||||
public array $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL");
|
||||
public array $functions = array("length", "lower", "round", "upper");
|
||||
public array $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
|
||||
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(Db $connection) {
|
||||
parent::__construct($connection);
|
||||
@@ -164,7 +169,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)) && $this->conn->affected_rows)
|
||||
|| queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")"))
|
||||
) {
|
||||
return false;
|
||||
@@ -390,7 +395,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])
|
||||
|
||||
@@ -5,10 +5,11 @@ add_driver("pgsql", "PostgreSQL");
|
||||
|
||||
if (isset($_GET["pgsql"])) {
|
||||
define('Adminer\DRIVER', "pgsql");
|
||||
|
||||
if (extension_loaded("pgsql") && $_GET["ext"] != "pdo") {
|
||||
class Db extends SqlDb {
|
||||
public string $extension = "PgSQL";
|
||||
public int $timeout = 0;
|
||||
class PgsqlDb extends SqlDb {
|
||||
public $extension = "PgSQL";
|
||||
public $timeout = 0;
|
||||
private $link, $string, $database = true;
|
||||
|
||||
function _error($errno, $error) {
|
||||
@@ -19,10 +20,11 @@ if (isset($_GET["pgsql"])) {
|
||||
$this->error = $error;
|
||||
}
|
||||
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
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, "'\\") . "'";
|
||||
list($host, $port) = host_port(addcslashes($server, "'\\"));
|
||||
$this->string = "host='$host'" . ($port ? " port='$port'" : "") . " user='" . addcslashes($username, "'\\") . "' password='" . addcslashes($password, "'\\") . "'";
|
||||
$ssl = adminer()->connectSsl();
|
||||
if (isset($ssl["mode"])) {
|
||||
$this->string .= " sslmode='" . $ssl["mode"] . "'";
|
||||
@@ -86,7 +88,27 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
|
||||
function warnings() {
|
||||
return h(pg_last_notice($this->link)); // second parameter is available since PHP 7.1.0
|
||||
if (PHP_VERSION_ID >= 70100) {
|
||||
$return = implode("\n", pg_last_notice($this->link, 2)); // 2 - PGSQL_NOTICE_ALL
|
||||
pg_last_notice($this->link, 3); // 3 - PGSQL_NOTICE_CLEAR
|
||||
} else {
|
||||
$return = pg_last_notice($this->link);
|
||||
}
|
||||
return nl_br(h($return));
|
||||
}
|
||||
|
||||
/** 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,8 +134,9 @@ if (isset($_GET["pgsql"])) {
|
||||
$return = new \stdClass;
|
||||
$return->orgtable = pg_field_table($this->result, $column);
|
||||
$return->name = pg_field_name($this->result, $column);
|
||||
$return->type = pg_field_type($this->result, $column); //! map to MySQL numbers
|
||||
$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;
|
||||
}
|
||||
|
||||
@@ -123,14 +146,15 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
|
||||
} elseif (extension_loaded("pdo_pgsql")) {
|
||||
class Db extends PdoDb {
|
||||
public string $extension = "PDO_PgSQL";
|
||||
public int $timeout = 0;
|
||||
class PgsqlDb extends PdoDb {
|
||||
public $extension = "PDO_PgSQL";
|
||||
public $timeout = 0;
|
||||
|
||||
function attach(?string $server, string $username, string $password): string {
|
||||
function attach(string $server, string $username, string $password): string {
|
||||
$db = adminer()->database();
|
||||
list($host, $port) = host_port(addcslashes($server, "'\\"));
|
||||
//! 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") . "'";
|
||||
$dsn = "pgsql:host='$host'" . ($port ? " port='$port'" : "") . " client_encoding=utf8 dbname='" . ($db != "" ? addcslashes($db, "'\\") : "postgres") . "'";
|
||||
$ssl = adminer()->connectSsl();
|
||||
if (isset($ssl["mode"])) {
|
||||
$dsn .= " sslmode='" . $ssl["mode"] . "'";
|
||||
@@ -155,6 +179,12 @@ if (isset($_GET["pgsql"])) {
|
||||
// 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() {
|
||||
}
|
||||
}
|
||||
@@ -163,15 +193,32 @@ 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 array $extensions = array("PgSQL", "PDO_PgSQL");
|
||||
static string $jush = "pgsql";
|
||||
static $extensions = array("PgSQL", "PDO_PgSQL");
|
||||
static $jush = "pgsql";
|
||||
|
||||
public array $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL"); // no "SQL" to avoid CSRF
|
||||
public array $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
|
||||
public array $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
|
||||
public $operators = array("=", "<", ">", "<=", ">=", "!=", "~", "!~", "LIKE", "LIKE %%", "ILIKE", "ILIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT ILIKE", "NOT IN", "IS NOT NULL", "SQL"); //! SQL - same-site CSRF
|
||||
public $functions = array("char_length", "lower", "round", "to_hex", "to_timestamp", "upper");
|
||||
public $grouping = array("avg", "count", "count distinct", "max", "min", "sum");
|
||||
|
||||
static function connect(?string $server, string $username, string $password) {
|
||||
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;
|
||||
@@ -216,6 +263,10 @@ if (isset($_GET["pgsql"])) {
|
||||
if (min_version(12, 0, $connection)) {
|
||||
$this->generated = array("STORED");
|
||||
}
|
||||
$this->partitionBy = array("RANGE", "LIST");
|
||||
if (!$connection->flavor) {
|
||||
$this->partitionBy[] = "HASH";
|
||||
}
|
||||
}
|
||||
|
||||
function enumLength(array $field) {
|
||||
@@ -245,7 +296,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)) && $this->conn->affected_rows)
|
||||
|| queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")"))
|
||||
) {
|
||||
return false;
|
||||
@@ -288,6 +339,39 @@ if (isset($_GET["pgsql"])) {
|
||||
}
|
||||
}
|
||||
|
||||
function inheritsFrom(string $table): array {
|
||||
return get_rows("SELECT relname AS table, nspname AS ns FROM pg_class JOIN pg_inherits ON inhparent = oid JOIN pg_namespace ON relnamespace = pg_namespace.oid WHERE inhrelid = " . $this->tableOid($table) . " ORDER BY 2, 1");
|
||||
}
|
||||
|
||||
function inheritedTables(string $table): array {
|
||||
return get_rows("SELECT relname AS table, nspname AS ns FROM pg_inherits JOIN pg_class ON inhrelid = oid JOIN pg_namespace ON relnamespace = pg_namespace.oid WHERE inhparent = " . $this->tableOid($table) . " ORDER BY 2, 1");
|
||||
}
|
||||
|
||||
function partitionsInfo(string $table): array {
|
||||
$row = (min_version(10) ? $this->conn->query("SELECT * FROM pg_partitioned_table WHERE partrelid = " . $this->tableOid($table))->fetch_assoc() : null);
|
||||
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 = '" . ($this->conn->flavor == 'cockroach' ? "prefix" : "btree") . "' DESC, amname");
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function supportsIndex(array $table_status): bool {
|
||||
// returns true for "materialized view"
|
||||
return $table_status["Engine"] != "view";
|
||||
@@ -370,18 +454,19 @@ 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 ? ",
|
||||
relname AS \"Name\",
|
||||
CASE relkind WHEN 'v' THEN 'view' WHEN 'm' THEN 'materialized view' ELSE 'table' 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
|
||||
" . (min_version(12) ? "''" : "CASE WHEN relhasoids THEN 'oid' ELSE '' END") . " AS \"Oid\",
|
||||
reltuples AS \"Rows\",
|
||||
" . (min_version(10) ? "relispartition::int AS partition," : "") . "
|
||||
current_schema() AS nspname
|
||||
FROM pg_class c
|
||||
JOIN pg_namespace n ON(n.nspname = current_schema() AND n.oid = c.relnamespace)
|
||||
WHERE relkind IN ('r', 'm', 'v', '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;
|
||||
}
|
||||
@@ -408,20 +493,19 @@ 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) ? ",
|
||||
i.indrelid AS primary,
|
||||
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
|
||||
LEFT JOIN pg_index i ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey) AND i.indisprimary
|
||||
WHERE a.attrelid = " . driver()->tableOid($table) . "
|
||||
AND NOT a.attisdropped
|
||||
AND a.attnum > 0
|
||||
ORDER BY a.attnum") as $row
|
||||
) {
|
||||
//! collation, primary
|
||||
//! collation
|
||||
preg_match('~([^([]+)(\((.*)\))?([a-z ]+)?((\[[0-9]*])*)$~', $row["full_type"], $match);
|
||||
list(, $type, $length, $row["length"], $addon, $array) = $match;
|
||||
$row["length"] .= $array;
|
||||
@@ -441,7 +525,7 @@ ORDER BY a.attnum") as $row
|
||||
$row["auto_increment"] = $row['attidentity'] || preg_match('~^nextval\(~i', $row["default"])
|
||||
|| preg_match('~^unique_rowid\(~', $row["default"]); // CockroachDB
|
||||
$row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1, "where" => 1, "order" => 1);
|
||||
if (preg_match('~(.+)::[^,)]+(.*)~', $row["default"], $match)) {
|
||||
if (!$row['generated'] && preg_match('~(.+)::[^,)]+(.*)~', $row["default"], $match)) {
|
||||
$row["default"] = ($match[1] == "NULL" ? null : idf_unescape($match[1]) . $match[2]);
|
||||
}
|
||||
$return[$row["field"]] = $row;
|
||||
@@ -452,25 +536,28 @@ ORDER BY a.attnum") as $row
|
||||
function indexes($table, $connection2 = null) {
|
||||
$connection2 = connection($connection2);
|
||||
$return = array();
|
||||
$table_oid = get_val("SELECT oid FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema()) AND relname = " . q($table), 0, $connection2);
|
||||
$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, amname, pg_get_expr(indpred, indrelid, true) AS partial, pg_get_expr(indexprs, indrelid) AS indexpr
|
||||
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]["type"] = ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX"));
|
||||
$return[$relname]["columns"] = array();
|
||||
$return[$relname]["descs"] = array();
|
||||
if ($row["indkey"]) {
|
||||
foreach (explode(" ", $row["indkey"]) as $indkey) {
|
||||
$return[$relname]["columns"][] = $columns[$indkey];
|
||||
}
|
||||
foreach (explode(" ", $row["indoption"]) as $indoption) {
|
||||
$return[$relname]["descs"][] = (intval($indoption) & 1 ? '1' : null); // 1 - INDOPTION_DESC
|
||||
}
|
||||
$return[$relname]["algorithm"] = $row["amname"];
|
||||
$return[$relname]["partial"] = $row["partial"];
|
||||
$indexpr = preg_split('~(?<=\)), (?=\()~', $row["indexpr"]); //! '), (' used in expression
|
||||
foreach (explode(" ", $row["indkey"]) as $indkey) {
|
||||
$return[$relname]["columns"][] = ($indkey ? $columns[$indkey] : array_shift($indexpr));
|
||||
}
|
||||
foreach (explode(" ", $row["indoption"]) as $indoption) {
|
||||
$return[$relname]["descs"][] = (intval($indoption) & 1 ? '1' : null); // 1 - INDOPTION_DESC
|
||||
}
|
||||
$return[$relname]["lengths"] = array();
|
||||
}
|
||||
@@ -480,12 +567,13 @@ ORDER BY indisprimary DESC, indisunique DESC", $connection2) as $row
|
||||
function foreign_keys($table) {
|
||||
$return = array();
|
||||
foreach (
|
||||
get_rows("SELECT conname, condeferrable::int AS deferrable, pg_get_constraintdef(oid) AS definition
|
||||
get_rows("SELECT conname, condeferrable::int AS deferrable, condeferred::int AS deferred, 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
|
||||
) {
|
||||
$row['deferrable'] = ($row['deferrable'] ? '' : 'NOT ') . 'DEFERRABLE' . ($row['deferred'] ? ' INITIALLY DEFERRED' : '');
|
||||
if (preg_match('~FOREIGN KEY\s*\((.+)\)\s*REFERENCES (.+)\((.+)\)(.*)$~iA', $row['definition'], $match)) {
|
||||
$row['source'] = array_map('Adminer\idf_unescape', array_map('trim', explode(',', $match[1])));
|
||||
if (preg_match('~^(("([^"]|"")+"|[^"]+)\.)?"?("([^"]|"")+"|[^"]+)$~', $match[2], $match2)) {
|
||||
@@ -493,8 +581,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;
|
||||
}
|
||||
}
|
||||
@@ -502,7 +590,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() {
|
||||
@@ -585,7 +673,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));
|
||||
}
|
||||
@@ -612,7 +724,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]) . ")"
|
||||
@@ -620,7 +732,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) {
|
||||
@@ -716,7 +833,7 @@ FROM information_schema.routines
|
||||
WHERE routine_schema = current_schema() AND specific_name = ' . q($name));
|
||||
$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
|
||||
$return["fields"] = get_rows('SELECT COALESCE(parameter_name, ordinal_position::text) AS field, data_type AS type, character_maximum_length AS length, parameter_mode AS inout
|
||||
FROM information_schema.parameters
|
||||
WHERE specific_schema = current_schema() AND specific_name = ' . q($name) . '
|
||||
ORDER BY ordinal_position');
|
||||
@@ -762,7 +879,7 @@ ORDER BY SPECIFIC_NAME');
|
||||
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"
|
||||
);
|
||||
@@ -798,11 +915,12 @@ AND typelem = 0"
|
||||
$return = "";
|
||||
|
||||
$status = table_status1($table);
|
||||
$ns = idf_escape($status['nspname']);
|
||||
$fkeys = foreign_keys($table);
|
||||
ksort($fkeys);
|
||||
|
||||
foreach ($fkeys as $fkey_name => $fkey) {
|
||||
$return .= "ALTER TABLE ONLY " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " ADD CONSTRAINT " . idf_escape($fkey_name) . " $fkey[definition] " . ($fkey['deferrable'] ? 'DEFERRABLE' : 'NOT DEFERRABLE') . ";\n";
|
||||
$return .= "ALTER TABLE ONLY $ns." . idf_escape($status['Name']) . " ADD CONSTRAINT " . idf_escape($fkey_name) . " " . preg_replace('~( REFERENCES )([^(.]+\()~', "\\1$ns.\\2", $fkey["definition"]) . ";\n";
|
||||
}
|
||||
|
||||
return ($return ? "$return\n" : $return);
|
||||
@@ -813,9 +931,10 @@ AND typelem = 0"
|
||||
$sequences = array();
|
||||
|
||||
$status = table_status1($table);
|
||||
$ns = idf_escape($status['nspname']);
|
||||
if (is_view($status)) {
|
||||
$view = view($table);
|
||||
return rtrim("CREATE VIEW " . idf_escape($table) . " AS $view[select]", ";");
|
||||
return rtrim("CREATE VIEW $ns." . idf_escape($table) . " AS $view[select]", ";");
|
||||
}
|
||||
$fields = fields($table);
|
||||
|
||||
@@ -823,12 +942,17 @@ AND typelem = 0"
|
||||
return false;
|
||||
}
|
||||
|
||||
$return = "CREATE TABLE " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " (\n ";
|
||||
$return = "CREATE TABLE $ns." . idf_escape($status['Name']) . " (\n ";
|
||||
|
||||
// fields' definitions
|
||||
foreach ($fields as $field) {
|
||||
if ($field['default'] == "nextval('$status[Name]_$field[field]_seq')") {
|
||||
$field['default'] = null;
|
||||
$field['full_type'] = preg_replace('~int(eger)?~', 'serial', $field['full_type']);
|
||||
}
|
||||
|
||||
$part = idf_escape($field['field']) . ' ' . $field['full_type']
|
||||
. default_value($field)
|
||||
. preg_replace('~(nextval\(\')([^.\']+\')~', '\1' . str_replace("'", "''", $status['nspname']) . '.\2', default_value($field))
|
||||
. ($field['null'] ? "" : " NOT NULL");
|
||||
$return_parts[] = $part;
|
||||
|
||||
@@ -839,8 +963,8 @@ AND typelem = 0"
|
||||
? "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, "-- "));
|
||||
$sequences[] = ($style == "DROP+CREATE" ? "DROP SEQUENCE IF EXISTS $sequence_name;\n" : "")
|
||||
. "CREATE SEQUENCE $sequence_name INCREMENT $sq[increment_by] MINVALUE $sq[min_value] MAXVALUE $sq[max_value]"
|
||||
$sequences[] = ($style == "DROP+CREATE" ? "DROP SEQUENCE IF EXISTS $ns.$sequence_name;\n" : "")
|
||||
. "CREATE SEQUENCE $ns.$sequence_name INCREMENT $sq[increment_by] MINVALUE $sq[min_value] MAXVALUE $sq[max_value]"
|
||||
. ($auto_increment && $sq['last_value'] ? " START " . ($sq["last_value"] + 1) : "")
|
||||
. " CACHE $sq[cache_value];"
|
||||
;
|
||||
@@ -861,19 +985,27 @@ AND typelem = 0"
|
||||
}
|
||||
|
||||
foreach (driver()->checkConstraints($table) as $conname => $consrc) {
|
||||
$return_parts[] = "CONSTRAINT " . idf_escape($conname) . " CHECK $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']) {
|
||||
$return .= "\n\nCOMMENT ON TABLE " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . " IS " . q($status['Comment']) . ";";
|
||||
$return .= "\n\nCOMMENT ON TABLE $ns." . idf_escape($status['Name']) . " IS " . q($status['Comment']) . ";";
|
||||
}
|
||||
|
||||
foreach ($fields as $field_name => $field) {
|
||||
if ($field['comment']) {
|
||||
$return .= "\n\nCOMMENT ON COLUMN " . idf_escape($status['nspname']) . "." . idf_escape($status['Name']) . "." . idf_escape($field_name) . " IS " . q($field['comment']) . ";";
|
||||
$return .= "\n\nCOMMENT ON COLUMN $ns." . idf_escape($status['Name']) . "." . idf_escape($field_name) . " IS " . q($field['comment']) . ";";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -899,8 +1031,16 @@ AND typelem = 0"
|
||||
}
|
||||
|
||||
|
||||
function use_sql($database) {
|
||||
return "\connect " . idf_escape($database);
|
||||
function use_sql($database, $style = "") {
|
||||
$name = idf_escape($database);
|
||||
$return = "";
|
||||
if (preg_match('~CREATE~', $style)) {
|
||||
if ($style == "DROP+CREATE") {
|
||||
$return = "DROP DATABASE IF EXISTS $name;\n";
|
||||
}
|
||||
$return .= "CREATE DATABASE $name;\n"; //! get info from pg_database
|
||||
}
|
||||
return "$return\\connect $name";
|
||||
}
|
||||
|
||||
function show_variables() {
|
||||
@@ -919,9 +1059,11 @@ AND typelem = 0"
|
||||
}
|
||||
|
||||
function support($feature) {
|
||||
return preg_match('~^(check|database|table|columns|sql|indexes|descidx|comment|view|' . (min_version(9.3) ? 'materializedview|' : '') . 'scheme|' . (min_version(11) ? 'procedure|' : '') . 'routine|sequence|trigger|type|variables|drop_col'
|
||||
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
|
||||
. '|kill|dump)$~', $feature)
|
||||
. ')$~', $feature)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ add_driver("sqlite", "SQLite");
|
||||
|
||||
if (isset($_GET["sqlite"])) {
|
||||
define('Adminer\DRIVER', "sqlite");
|
||||
if (class_exists("SQLite3") && $_GET["ext"] != "pdo") {
|
||||
|
||||
if (class_exists("SQLite3") && $_GET["ext"] != "pdo") {
|
||||
abstract class SqliteDb extends SqlDb {
|
||||
public string $extension = "SQLite3";
|
||||
public $extension = "SQLite3";
|
||||
private $link;
|
||||
|
||||
function attach(?string $filename, string $username, string $password): string {
|
||||
function attach(string $filename, string $username, string $password): string {
|
||||
$this->link = new \SQLite3($filename);
|
||||
$version = $this->link->version();
|
||||
$this->server_info = $version["versionString"];
|
||||
@@ -73,13 +73,10 @@ if (isset($_GET["sqlite"])) {
|
||||
|
||||
} elseif (extension_loaded("pdo_sqlite")) {
|
||||
abstract class SqliteDb extends PdoDb {
|
||||
public string $extension = "PDO_SQLite";
|
||||
public $extension = "PDO_SQLite";
|
||||
|
||||
function attach(?string $filename, string $username, string $password): string {
|
||||
$this->dsn(DRIVER . ":$filename", "", "");
|
||||
$this->query("PRAGMA foreign_keys = 1");
|
||||
$this->query("PRAGMA busy_timeout = 500");
|
||||
return '';
|
||||
function attach(string $filename, string $username, string $password): string {
|
||||
return $this->dsn(DRIVER . ":$filename", "", "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +84,7 @@ if (isset($_GET["sqlite"])) {
|
||||
|
||||
if (class_exists('Adminer\SqliteDb')) {
|
||||
class Db extends SqliteDb {
|
||||
function attach(?string $filename, string $username, string $password): string {
|
||||
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");
|
||||
@@ -106,23 +103,23 @@ if (isset($_GET["sqlite"])) {
|
||||
|
||||
|
||||
class Driver extends SqlDriver {
|
||||
static array $extensions = array("SQLite3", "PDO_SQLite");
|
||||
static string $jush = "sqlite";
|
||||
static $extensions = array("SQLite3", "PDO_SQLite");
|
||||
static $jush = "sqlite";
|
||||
|
||||
protected array $types = array(array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0));
|
||||
protected $types = array(array("integer" => 0, "real" => 0, "numeric" => 0, "text" => 0, "blob" => 0));
|
||||
|
||||
public array $insertFunctions = array(); // "text" => "date('now')/time('now')/datetime('now')",
|
||||
public array $editFunctions = array(
|
||||
public $insertFunctions = array(); // "text" => "date('now')/time('now')/datetime('now')",
|
||||
public $editFunctions = array(
|
||||
"integer|real|numeric" => "+/-",
|
||||
// "text" => "date/time/datetime",
|
||||
"text" => "||",
|
||||
);
|
||||
|
||||
public array $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "LIKE %%", "IN", "IS NULL", "NOT LIKE", "NOT IN", "IS NOT NULL", "SQL"); // REGEXP can be user defined function
|
||||
public array $functions = array("hex", "length", "lower", "round", "unixepoch", "upper");
|
||||
public array $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
|
||||
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");
|
||||
|
||||
static function connect(?string $server, string $username, string $password) {
|
||||
static function connect(string $server, string $username, string $password) {
|
||||
if ($password != "") {
|
||||
return lang('Database does not support password.');
|
||||
}
|
||||
@@ -452,7 +449,7 @@ if (isset($_GET["sqlite"])) {
|
||||
* @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 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
|
||||
@@ -680,7 +677,7 @@ if (isset($_GET["sqlite"])) {
|
||||
return "DELETE FROM " . table($table);
|
||||
}
|
||||
|
||||
function use_sql($database) {
|
||||
function use_sql($database, $style = "") {
|
||||
}
|
||||
|
||||
function trigger_sql($table) {
|
||||
@@ -704,7 +701,7 @@ if (isset($_GET["sqlite"])) {
|
||||
function show_status() {
|
||||
$return = array();
|
||||
foreach (get_vals("PRAGMA compile_options") as $option) {
|
||||
$return[] = explode("=", $option, 2);
|
||||
$return[] = explode("=", $option, 2) + array('', '');
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,14 @@ namespace Adminer;
|
||||
$TABLE = $_GET["dump"];
|
||||
|
||||
if ($_POST && !$error) {
|
||||
$default = array("auto_increment" => '');
|
||||
foreach (array("type", "routine", "event", "trigger") as $support) {
|
||||
if (support($support)) {
|
||||
$default[$support . "s"] = '';
|
||||
}
|
||||
}
|
||||
save_settings(
|
||||
array_intersect_key($_POST, array_flip(array("output", "format", "db_style", "types", "routines", "events", "table_style", "auto_increment", "triggers", "data_style"))),
|
||||
array_intersect_key($_POST + $default, array_flip(array("output", "format", "db_style", "table_style", "data_style")) + $default),
|
||||
"adminer_export"
|
||||
);
|
||||
$tables = array_flip((array) $_POST["tables"]) + array_flip((array) $_POST["data"]);
|
||||
@@ -41,16 +47,9 @@ SET foreign_key_checks = 0;
|
||||
foreach ((array) $databases as $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") {
|
||||
echo "DROP DATABASE IF EXISTS " . idf_escape($db) . ";\n";
|
||||
}
|
||||
echo "$create;\n";
|
||||
}
|
||||
if ($is_sql) {
|
||||
if ($style) {
|
||||
echo use_sql($db) . ";\n\n";
|
||||
echo use_sql($db, $style) . ";\n\n";
|
||||
}
|
||||
$out = "";
|
||||
|
||||
@@ -160,10 +159,6 @@ $row = get_settings("adminer_export");
|
||||
if (!$row) {
|
||||
$row = array("output" => "text", "format" => "sql", "db_style" => (DB != "" ? "" : "CREATE"), "table_style" => "DROP+CREATE", "data_style" => "INSERT");
|
||||
}
|
||||
if (!isset($row["events"])) { // backwards compatibility
|
||||
$row["routines"] = $row["events"] = ($_GET["dump"] == "");
|
||||
$row["triggers"] = $row["table_style"];
|
||||
}
|
||||
|
||||
echo "<tr><th>" . lang('Output') . "<td>" . html_radios("output", adminer()->dumpOutput(), $row["output"]) . "\n";
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ $where = (isset($_GET["select"])
|
||||
);
|
||||
$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 ((!$update && !isset($field["privileges"]["insert"])) || adminer()->fieldName($field) == "") {
|
||||
unset($fields[$name]);
|
||||
}
|
||||
}
|
||||
@@ -65,9 +65,7 @@ if ($_POST && !$error && !isset($_GET["select"])) {
|
||||
}
|
||||
|
||||
$row = null;
|
||||
if ($_POST["save"]) {
|
||||
$row = (array) $_POST["fields"];
|
||||
} elseif ($where) {
|
||||
if ($where) {
|
||||
$select = array();
|
||||
foreach ($fields as $name => $field) {
|
||||
if (isset($field["privileges"]["select"])) {
|
||||
@@ -113,4 +111,8 @@ if (!support("table") && !$fields) { // used by Mongo and SimpleDB
|
||||
}
|
||||
}
|
||||
|
||||
if ($_POST["save"]) {
|
||||
$row = (array) $_POST["fields"] + ($row ? $row : array());
|
||||
}
|
||||
|
||||
edit_form($TABLE, $fields, $row, $update, $error);
|
||||
|
||||
@@ -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;
|
||||
@@ -34,6 +34,10 @@ if ($_GET["file"] == "favicon.ico") {
|
||||
../externals/jush/modules/jush-sqlite.js;
|
||||
../externals/jush/modules/jush-mssql.js;
|
||||
../externals/jush/modules/jush-oracle.js;
|
||||
../externals/jush/modules/jush-simpledb.js', 'minify_js'));
|
||||
../externals/jush/modules/jush-simpledb.js;
|
||||
../externals/jush/modules/jush-igdb.js', 'minify_js'));
|
||||
} 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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,10 +39,10 @@ page_header(lang('Foreign key'), $error, array("table" => $TABLE), h($TABLE));
|
||||
|
||||
if ($_POST) {
|
||||
ksort($row["source"]);
|
||||
if ($_POST["add"]) {
|
||||
$row["source"][] = "";
|
||||
} elseif ($_POST["change"] || $_POST["change-js"]) {
|
||||
if ($_POST["change"] || $_POST["change-js"]) {
|
||||
$row["target"] = array();
|
||||
} else {
|
||||
$row["source"][] = "";
|
||||
}
|
||||
} elseif ($name != "") {
|
||||
$foreign_keys = foreign_keys($TABLE);
|
||||
@@ -67,12 +67,12 @@ 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) {
|
||||
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);
|
||||
}
|
||||
@@ -83,7 +83,7 @@ if (support("scheme")) {
|
||||
$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");
|
||||
?>
|
||||
@@ -101,12 +101,13 @@ foreach ($row["source"] as $key => $val) {
|
||||
?>
|
||||
</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 (DRIVER === 'pgsql' ? html_select("deferrable", array('NOT DEFERRABLE', 'DEFERRABLE', 'DEFERRABLE INITIALLY DEFERRED'), $row["deferrable"]) . ' ' : ''); ?>
|
||||
<?php echo doc_link(array(
|
||||
'sql' => "innodb-foreign-key-constraints.html",
|
||||
'mariadb' => "foreign-keys/",
|
||||
'pgsql' => "sql-createtable.html#SQL-CREATETABLE-REFERENCES",
|
||||
'pgsql' => "sql-createtable.html#SQL-CREATETABLE-PARMS-REFERENCES",
|
||||
'mssql' => "t-sql/statements/create-table-transact-sql",
|
||||
'oracle' => "SQLRF01111",
|
||||
)); ?>
|
||||
|
||||
@@ -12,7 +12,7 @@ class Adminer {
|
||||
* @return string HTML code
|
||||
*/
|
||||
function name(): string {
|
||||
return "<a href='https://www.adminer.org/'" . target_blank() . " id='h1'>Adminer</a>";
|
||||
return "<a href='https://www.adminer.org/'" . target_blank() . " id='h1'><img src='../adminer/static/logo.png' width='24' height='24' alt='' id='logo'>Adminer</a>";
|
||||
}
|
||||
|
||||
/** Connection parameters
|
||||
@@ -60,6 +60,10 @@ class Adminer {
|
||||
return get_databases($flush);
|
||||
}
|
||||
|
||||
/** Print links after list of plugins */
|
||||
function pluginsLinks(): void {
|
||||
}
|
||||
|
||||
/** Operators used in select
|
||||
* @return list<string> operators
|
||||
*/
|
||||
@@ -81,6 +85,10 @@ class Adminer {
|
||||
return 2;
|
||||
}
|
||||
|
||||
/** Called after connecting and selecting a database */
|
||||
function afterConnect(): void {
|
||||
}
|
||||
|
||||
/** Headers to send before HTML output */
|
||||
function headers(): void {
|
||||
}
|
||||
@@ -104,15 +112,24 @@ class Adminer {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Print extra classes in <body class>; must start with a space */
|
||||
function bodyClass(): void {
|
||||
echo " adminer";
|
||||
}
|
||||
|
||||
/** Get URLs of the CSS files
|
||||
* @return list<string>
|
||||
* @return string[] key is URL, value is either 'light' (supports only light color scheme), 'dark' or '' (both)
|
||||
*/
|
||||
function css(): array {
|
||||
$return = array();
|
||||
foreach (array("", "-dark") as $mode) {
|
||||
$filename = "adminer$mode.css";
|
||||
if (file_exists($filename)) {
|
||||
$return[] = "$filename?v=" . crc32(file_get_contents($filename));
|
||||
$file = file_get_contents($filename);
|
||||
$return["$filename?v=" . crc32($file)] = ($mode
|
||||
? "dark"
|
||||
: (preg_match('~prefers-color-scheme:\s*dark~', $file) ? '' : 'light')
|
||||
);
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
@@ -123,7 +140,7 @@ class Adminer {
|
||||
echo "<table class='layout'>\n";
|
||||
// this is matched by compile.php
|
||||
echo adminer()->loginFormField('driver', '<tr><th>' . lang('System') . '<td>', html_select("auth[driver]", SqlDriver::$drivers, DRIVER, "loginDriver(this);"));
|
||||
echo adminer()->loginFormField('server', '<tr><th>' . lang('Server') . '<td>', '<input name="auth[server]" value="' . h(SERVER) . '" title="hostname[:port]" placeholder="localhost" autocapitalize="off">');
|
||||
echo adminer()->loginFormField('server', '<tr><th>' . lang('Server') . '<td>', '<input name="auth[server]" value="' . h(SERVER) . '" title="' . lang('hostname[:port] or :socket') . '" placeholder="localhost" autocapitalize="off">');
|
||||
// this is matched by compile.php
|
||||
echo adminer()->loginFormField('username', '<tr><th>' . lang('Username') . '<td>', '<input name="auth[username]" id="username" autofocus value="' . h($_GET["username"]) . '" autocomplete="username" autocapitalize="off">' . script("const authDriver = qs('#username').form['auth[driver]']; authDriver && authDriver.onchange();"));
|
||||
echo adminer()->loginFormField('password', '<tr><th>' . lang('Password') . '<td>', '<input type="password" name="auth[password]" autocomplete="current-password">');
|
||||
@@ -165,7 +182,7 @@ class Adminer {
|
||||
* @return string HTML code, "" to ignore field
|
||||
*/
|
||||
function fieldName(array $field, int $order = 0): string {
|
||||
$type = $field["full_type"];
|
||||
$type = $field["full_type"] . ($field["null"] ? " NULL" : "");
|
||||
$comment = $field["comment"];
|
||||
return '<span title="' . h($type . ($comment != "" ? ($type ? ": " : "") . $comment : '')) . '">' . h($field["field"]) . '</span>';
|
||||
}
|
||||
@@ -175,6 +192,7 @@ class Adminer {
|
||||
* @param ?string $set new item options, NULL for no new item
|
||||
*/
|
||||
function selectLinks(array $tableStatus, ?string $set = ""): void {
|
||||
$name = $tableStatus["Name"];
|
||||
echo '<p class="links">';
|
||||
$links = array("select" => lang('Select data'));
|
||||
if (support("table") || support("indexes")) {
|
||||
@@ -184,15 +202,16 @@ class Adminer {
|
||||
if (support("table")) {
|
||||
$is_view = is_view($tableStatus);
|
||||
if ($is_view) {
|
||||
$links["view"] = lang('Alter view');
|
||||
} else {
|
||||
if (support("view")) {
|
||||
$links["view"] = lang('Alter view');
|
||||
}
|
||||
} elseif (function_exists('Adminer\alter_table')) {
|
||||
$links["create"] = lang('Alter table');
|
||||
}
|
||||
}
|
||||
if ($set !== null) {
|
||||
$links["edit"] = lang('New item');
|
||||
}
|
||||
$name = $tableStatus["Name"];
|
||||
foreach ($links as $key => $val) {
|
||||
echo " <a href='" . h(ME) . "$key=" . urlencode($name) . ($key == "edit" ? $set : "") . "'" . bold(isset($_GET[$key])) . ">$val</a>";
|
||||
}
|
||||
@@ -269,7 +288,7 @@ class Adminer {
|
||||
|
||||
/** Get a link to use in select table
|
||||
* @param string $val raw value of the field
|
||||
* @param Field $field
|
||||
* @param array{type: string} $field
|
||||
* @return string|void null to create the default link
|
||||
*/
|
||||
function selectLink(?string $val, array $field) {
|
||||
@@ -278,7 +297,7 @@ class Adminer {
|
||||
/** Value printed in select table
|
||||
* @param ?string $val HTML-escaped value to print
|
||||
* @param ?string $link link to foreign key
|
||||
* @param Field $field
|
||||
* @param array{type: string} $field
|
||||
* @param string $original original value before applying editVal() and escaping
|
||||
*/
|
||||
function selectVal(?string $val, ?string $link, array $field, ?string $original): string {
|
||||
@@ -287,19 +306,26 @@ class Adminer {
|
||||
: (preg_match('~json~', $field["type"]) ? "<code class='jush-js'>$val</code>"
|
||||
: $val)
|
||||
));
|
||||
if (preg_match('~blob|bytea|raw|file~', $field["type"]) && !is_utf8($val)) {
|
||||
if (is_blob($field) && !is_utf8($val)) {
|
||||
$return = "<i>" . lang('%d byte(s)', strlen($original)) . "</i>";
|
||||
}
|
||||
return ($link ? "<a href='" . h($link) . "'" . (is_url($link) ? target_blank() : "") . ">$return</a>" : $return);
|
||||
}
|
||||
|
||||
/** Value conversion used in select and edit
|
||||
* @param Field $field
|
||||
* @param array{type: string} $field
|
||||
*/
|
||||
function editVal(?string $val, array $field): ?string {
|
||||
return $val;
|
||||
}
|
||||
|
||||
/** Get configuration options for AdminerConfig
|
||||
* @return string[] key is config description, value is HTML
|
||||
*/
|
||||
function config(): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
/** Print table structure in tabular format
|
||||
* @param Field[] $fields
|
||||
* @param TableStatus $tableStatus
|
||||
@@ -332,9 +358,15 @@ class Adminer {
|
||||
|
||||
/** Print list of indexes on table in tabular format
|
||||
* @param Index[] $indexes
|
||||
* @param TableStatus $tableStatus
|
||||
*/
|
||||
function tableIndexesPrint(array $indexes): void {
|
||||
function tableIndexesPrint(array $indexes, array $tableStatus): void {
|
||||
$partial = false;
|
||||
foreach ($indexes as $name => $index) {
|
||||
$partial |= !!$index["partial"];
|
||||
}
|
||||
echo "<table>\n";
|
||||
$default_algorithm = first(driver()->indexAlgorithms($tableStatus));
|
||||
foreach ($indexes as $name => $index) {
|
||||
ksort($index["columns"]); // enforce correct columns order
|
||||
$print = array();
|
||||
@@ -344,7 +376,14 @@ class Adminer {
|
||||
. ($index["descs"][$key] ? " DESC" : "")
|
||||
;
|
||||
}
|
||||
echo "<tr title='" . h($name) . "'><th>$index[type]<td>" . implode(", ", $print) . "\n";
|
||||
|
||||
echo "<tr title='" . h($name) . "'>";
|
||||
echo "<th>$index[type]" . ($default_algorithm && $index['algorithm'] != $default_algorithm ? " ($index[algorithm])" : "");
|
||||
echo "<td>" . implode(", ", $print);
|
||||
if ($partial) {
|
||||
echo "<td>" . ($index['partial'] ? "<code class='jush-" . JUSH . "'>WHERE " . h($index['partial']) : "");
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
echo "</table>\n";
|
||||
}
|
||||
@@ -384,9 +423,9 @@ class Adminer {
|
||||
foreach ($indexes as $i => $index) {
|
||||
if ($index["type"] == "FULLTEXT") {
|
||||
echo "<div>(<i>" . implode("</i>, <i>", array_map('Adminer\h', $index["columns"])) . "</i>) AGAINST";
|
||||
echo " <input type='search' name='fulltext[$i]' value='" . h($_GET["fulltext"][$i]) . "'>";
|
||||
echo " <input type='search' name='fulltext[$i]' value='" . h(idx($_GET["fulltext"], $i)) . "'>";
|
||||
echo script("qsl('input').oninput = selectFieldChange;", "");
|
||||
echo checkbox("boolean[$i]", 1, isset($_GET["boolean"][$i]), "BOOL");
|
||||
echo (JUSH == 'sql' ? checkbox("boolean[$i]", 1, isset($_GET["boolean"][$i]), "BOOL") : '');
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
@@ -522,46 +561,44 @@ class Adminer {
|
||||
function selectSearchProcess(array $fields, array $indexes): array {
|
||||
$return = array();
|
||||
foreach ($indexes as $i => $index) {
|
||||
if ($index["type"] == "FULLTEXT" && $_GET["fulltext"][$i] != "") {
|
||||
if ($index["type"] == "FULLTEXT" && idx($_GET["fulltext"], $i) != "") {
|
||||
$return[] = "MATCH (" . implode(", ", array_map('Adminer\idf_escape', $index["columns"])) . ") AGAINST (" . q($_GET["fulltext"][$i]) . (isset($_GET["boolean"][$i]) ? " IN BOOLEAN MODE" : "") . ")";
|
||||
}
|
||||
}
|
||||
foreach ((array) $_GET["where"] as $key => $val) {
|
||||
if ("$val[col]$val[val]" != "" && in_array($val["op"], adminer()->operators())) {
|
||||
$prefix = "";
|
||||
$cond = " $val[op]";
|
||||
if (preg_match('~IN$~', $val["op"])) {
|
||||
$in = process_length($val["val"]);
|
||||
$cond .= " " . ($in != "" ? $in : "(NULL)");
|
||||
} elseif ($val["op"] == "SQL") {
|
||||
$cond = " $val[val]"; // SQL injection
|
||||
} elseif ($val["op"] == "LIKE %%") {
|
||||
$cond = " LIKE " . adminer()->processInput($fields[$val["col"]], "%$val[val]%");
|
||||
} elseif ($val["op"] == "ILIKE %%") {
|
||||
$cond = " ILIKE " . adminer()->processInput($fields[$val["col"]], "%$val[val]%");
|
||||
} elseif ($val["op"] == "FIND_IN_SET") {
|
||||
$prefix = "$val[op](" . q($val["val"]) . ", ";
|
||||
$cond = ")";
|
||||
} elseif (!preg_match('~NULL$~', $val["op"])) {
|
||||
$cond .= " " . adminer()->processInput($fields[$val["col"]], $val["val"]);
|
||||
}
|
||||
if ($val["col"] != "") {
|
||||
$return[] = $prefix . driver()->convertSearch(idf_escape($val["col"]), $val, $fields[$val["col"]]) . $cond;
|
||||
} else {
|
||||
// find anywhere
|
||||
$cols = array();
|
||||
foreach ($fields as $name => $field) {
|
||||
if (
|
||||
isset($field["privileges"]["where"])
|
||||
&& (preg_match('~^[-\d.' . (preg_match('~IN$~', $val["op"]) ? ',' : '') . ']+$~', $val["val"]) || !preg_match('~' . number_type() . '|bit~', $field["type"]))
|
||||
&& (!preg_match("~[\x80-\xFF]~", $val["val"]) || preg_match('~char|text|enum|set~', $field["type"]))
|
||||
&& (!preg_match('~date|timestamp~', $field["type"]) || preg_match('~^\d+-\d+-\d+~', $val["val"]))
|
||||
) {
|
||||
$cols[] = $prefix . driver()->convertSearch(idf_escape($name), $val, $field) . $cond;
|
||||
}
|
||||
$col = $val["col"];
|
||||
if ("$col$val[val]" != "" && in_array($val["op"], adminer()->operators())) {
|
||||
$conds = array();
|
||||
foreach (($col != "" ? array($col => $fields[$col]) : $fields) as $name => $field) {
|
||||
$prefix = "";
|
||||
$cond = " $val[op]";
|
||||
if (preg_match('~IN$~', $val["op"])) {
|
||||
$in = process_length($val["val"]);
|
||||
$cond .= " " . ($in != "" ? $in : "(NULL)");
|
||||
} elseif ($val["op"] == "SQL") {
|
||||
$cond = " $val[val]"; // SQL injection
|
||||
} elseif (preg_match('~^(I?LIKE) %%$~', $val["op"], $match)) {
|
||||
$cond = " $match[1] " . adminer()->processInput($field, "%$val[val]%");
|
||||
} elseif ($val["op"] == "FIND_IN_SET") {
|
||||
$prefix = "$val[op](" . q($val["val"]) . ", ";
|
||||
$cond = ")";
|
||||
} elseif (!preg_match('~NULL$~', $val["op"])) {
|
||||
$cond .= " " . adminer()->processInput($field, $val["val"]);
|
||||
}
|
||||
if ($col != "" || ( // find anywhere
|
||||
isset($field["privileges"]["where"])
|
||||
&& (preg_match('~^[-\d.' . (preg_match('~IN$~', $val["op"]) ? ',' : '') . ']+$~', $val["val"]) || !preg_match('~' . number_type() . '|bit~', $field["type"]))
|
||||
&& (!preg_match("~[\x80-\xFF]~", $val["val"]) || preg_match('~char|text|enum|set~', $field["type"]))
|
||||
&& (!preg_match('~date|timestamp~', $field["type"]) || preg_match('~^\d+-\d+-\d+~', $val["val"]))
|
||||
)) {
|
||||
$conds[] = $prefix . driver()->convertSearch(idf_escape($name), $val, $field) . $cond;
|
||||
}
|
||||
$return[] = ($cols ? "(" . implode(" OR ", $cols) . ")" : "1 = 0");
|
||||
}
|
||||
$return[] =
|
||||
(count($conds) == 1 ? $conds[0] :
|
||||
($conds ? "(" . implode(" OR ", $conds) . ")" :
|
||||
"1 = 0"
|
||||
));
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
@@ -577,7 +614,7 @@ class Adminer {
|
||||
foreach ((array) $_GET["order"] as $key => $val) {
|
||||
if ($val != "") {
|
||||
$return[] = (preg_match('~^((COUNT\(DISTINCT |[A-Z0-9_]+\()(`(?:[^`]|``)+`|"(?:[^"]|"")+")\)|COUNT\(\*\))$~', $val) ? $val : idf_escape($val)) //! MS SQL uses []
|
||||
. (isset($_GET["desc"][$key]) ? " DESC" : "")
|
||||
. (isset($_GET["desc"][$key]) ? " DESC" . (JUSH == 'pgsql' && idx($fields[$val], "null") ? " NULLS LAST" : "") : "")
|
||||
;
|
||||
}
|
||||
}
|
||||
@@ -633,13 +670,13 @@ class Adminer {
|
||||
}
|
||||
$history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"]
|
||||
$sql_id = "sql-" . count($history[$_GET["db"]]);
|
||||
$return = "<a href='#$sql_id' class='toggle'>" . lang('SQL command') . "</a>\n";
|
||||
$return = "<a href='#$sql_id' class='toggle'>" . lang('SQL command') . "</a> <a href='' class='jsonly copy'>🗐</a>\n";
|
||||
if (!$failed && ($warnings = driver()->warnings())) {
|
||||
$id = "warnings-" . count($history[$_GET["db"]]);
|
||||
$return = "<a href='#$id' class='toggle'>" . lang('Warnings') . "</a>, $return<div id='$id' class='hidden'>\n$warnings</div>\n";
|
||||
}
|
||||
return " <span class='time'>" . @date("H:i:s") . "</span>" // @ - time zone may be not set
|
||||
. " $return<div id='$sql_id' class='hidden'><pre><code class='jush-" . JUSH . "'>" . shorten_utf8($query, 1000) . "</code></pre>"
|
||||
. " $return<div id='$sql_id' class='hidden'><pre><code class='jush-" . JUSH . "'>" . shorten_utf8($query, 1e4) . "</code></pre>"
|
||||
. ($time ? " <span class='time'>($time)</span>" : '')
|
||||
. (support("sql") ? '<p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a>' : '')
|
||||
. '</div>'
|
||||
@@ -668,7 +705,7 @@ class Adminer {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($key && $functions && !preg_match('~set|blob|bytea|raw|file|bool~', $field["type"])) {
|
||||
if ($key && $functions && !preg_match('~set|bool~', $field["type"]) && !is_blob($field)) {
|
||||
$return .= "/SQL";
|
||||
}
|
||||
}
|
||||
@@ -682,13 +719,13 @@ class Adminer {
|
||||
* @param ?string $table null in call.inc.php
|
||||
* @param Field $field
|
||||
* @param string $attrs attributes to use inside the tag
|
||||
* @param string|string[]|false|null $value false means original value
|
||||
* @return string custom input field or empty string for default
|
||||
*/
|
||||
function editInput(?string $table, array $field, string $attrs, ?string $value): string {
|
||||
function editInput(?string $table, array $field, string $attrs, $value): string {
|
||||
if ($field["type"] == "enum") {
|
||||
return (isset($_GET["select"]) ? "<label><input type='radio'$attrs value='-1' checked><i>" . lang('original') . "</i></label> " : "")
|
||||
. ($field["null"] ? "<label><input type='radio'$attrs value=''" . ($value !== null || isset($_GET["select"]) ? "" : " checked") . "><i>NULL</i></label> " : "")
|
||||
. enum_input("radio", $attrs, $field, $value, $value === 0 ? 0 : null) // 0 - empty value
|
||||
return (isset($_GET["select"]) ? "<label><input type='radio'$attrs value='orig' checked><i>" . lang('original') . "</i></label> " : "")
|
||||
. enum_input("radio", $attrs, $field, $value, "NULL")
|
||||
;
|
||||
}
|
||||
return "";
|
||||
@@ -719,7 +756,7 @@ class Adminer {
|
||||
} elseif (preg_match('~^([+-]|\|\|)$~', $function)) {
|
||||
$return = idf_escape($name) . " $function $return";
|
||||
} elseif (preg_match('~^[+-] interval$~', $function)) {
|
||||
$return = idf_escape($name) . " $function " . (preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+\$~i", $value) ? $value : $return);
|
||||
$return = idf_escape($name) . " $function " . (preg_match("~^(\\d+|'[0-9.: -]') [A-Z_]+\$~i", $value) && JUSH != "pgsql" ? $value : $return);
|
||||
} elseif (preg_match('~^(addtime|subtime|concat)$~', $function)) {
|
||||
$return = "$function(" . idf_escape($name) . ", $return)";
|
||||
} elseif (preg_match('~^(md5|sha1|password|encrypt)$~', $function)) {
|
||||
@@ -808,7 +845,7 @@ class Adminer {
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = connection()->query($query, 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers
|
||||
$result = connection()->query($query, 1); // 1 - MYSQLI_USE_RESULT
|
||||
if ($result) {
|
||||
$insert = "";
|
||||
$buffer = "";
|
||||
@@ -816,6 +853,7 @@ class Adminer {
|
||||
$generated = array();
|
||||
$suffix = "";
|
||||
$fetch_function = ($table != '' ? 'fetch_assoc' : 'fetch_row');
|
||||
$count = 0;
|
||||
while ($row = $result->$fetch_function()) {
|
||||
if (!$keys) {
|
||||
$values = array();
|
||||
@@ -855,13 +893,17 @@ class Adminer {
|
||||
$s = ($max_packet ? "\n" : " ") . "(" . implode(",\t", $row) . ")";
|
||||
if (!$buffer) {
|
||||
$buffer = $insert . $s;
|
||||
} elseif (strlen($buffer) + 4 + strlen($s) + strlen($suffix) < $max_packet) { // 4 - length specification
|
||||
} elseif (JUSH == 'mssql'
|
||||
? $count % 1000 != 0 // https://learn.microsoft.com/en-us/sql/t-sql/queries/table-value-constructor-transact-sql#limitations-and-restrictions
|
||||
: strlen($buffer) + 4 + strlen($s) + strlen($suffix) < $max_packet // 4 - length specification
|
||||
) {
|
||||
$buffer .= ",$s";
|
||||
} else {
|
||||
echo $buffer . $suffix;
|
||||
$buffer = $insert . $s;
|
||||
}
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
if ($buffer) {
|
||||
echo $buffer . $suffix;
|
||||
@@ -879,7 +921,7 @@ class Adminer {
|
||||
* @return string filename without extension
|
||||
*/
|
||||
function dumpFilename(string $identifier): string {
|
||||
return friendly_url($identifier != "" ? $identifier : (SERVER != "" ? SERVER : "localhost"));
|
||||
return friendly_url($identifier != "" ? $identifier : (SERVER ?: "localhost"));
|
||||
}
|
||||
|
||||
/** Send headers for export
|
||||
@@ -926,6 +968,12 @@ class Adminer {
|
||||
echo (support("scheme") ? "<a href='" . h(ME) . "scheme='>" . ($_GET["ns"] != "" ? lang('Alter schema') : lang('Create schema')) . "</a>\n" : "");
|
||||
echo ($_GET["ns"] !== "" ? '<a href="' . h(ME) . 'schema=">' . lang('Database schema') . "</a>\n" : "");
|
||||
echo (support("privileges") ? "<a href='" . h(ME) . "privileges='>" . lang('Privileges') . "</a>\n" : "");
|
||||
if ($_GET["ns"] !== "") {
|
||||
echo (support("routine") ? "<a href='#routines'>" . lang('Routines') . "</a>\n" : "");
|
||||
echo (support("sequence") ? "<a href='#sequences'>" . lang('Sequences') . "</a>\n" : "");
|
||||
echo (support("type") ? "<a href='#user-types'>" . lang('User types') . "</a>\n" : "");
|
||||
echo (support("event") ? "<a href='#events'>" . lang('Events') . "</a>\n" : "");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -948,7 +996,7 @@ class Adminer {
|
||||
if ($password !== null) {
|
||||
$dbs = $_SESSION["db"][$vendor][$server][$username];
|
||||
foreach (($dbs ? array_keys($dbs) : array("")) as $db) {
|
||||
$output .= "<li><a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>($name) " . h($username . ($server != "" ? "@" . adminer()->serverName($server) : "") . ($db != "" ? " - $db" : "")) . "</a>\n";
|
||||
$output .= "<li><a href='" . h(auth_url($vendor, $server, $username, $db)) . "'>($name) " . h("$username@" . ($server != "" ? adminer()->serverName($server) : "") . ($db != "" ? " - $db" : "")) . "</a>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -974,7 +1022,7 @@ class Adminer {
|
||||
$actions[] = "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "' id='dump'" . bold(isset($_GET["dump"])) . ">" . lang('Export') . "</a>";
|
||||
}
|
||||
$in_db = $_GET["ns"] !== "" && !$missing && DB != "";
|
||||
if ($in_db) {
|
||||
if ($in_db && function_exists('Adminer\alter_table')) {
|
||||
$actions[] = '<a href="' . h(ME) . 'create="' . bold($_GET["create"] === "") . ">" . lang('Create table') . "</a>";
|
||||
}
|
||||
echo ($actions ? "<p class='links'>\n" . implode("\n", $actions) . "\n" : "");
|
||||
@@ -993,28 +1041,44 @@ class Adminer {
|
||||
*/
|
||||
function syntaxHighlighting(array $tables): void {
|
||||
// this is matched by compile.php
|
||||
echo script_src("../externals/jush/modules/jush.js");
|
||||
echo script_src("../externals/jush/modules/jush-textarea.js");
|
||||
echo script_src("../externals/jush/modules/jush-txt.js");
|
||||
echo script_src("../externals/jush/modules/jush-js.js");
|
||||
echo script_src("../externals/jush/modules/jush.js", true);
|
||||
echo script_src("../externals/jush/modules/jush-autocomplete-sql.js", true);
|
||||
echo script_src("../externals/jush/modules/jush-textarea.js", true);
|
||||
echo script_src("../externals/jush/modules/jush-txt.js", true);
|
||||
echo script_src("../externals/jush/modules/jush-js.js", true);
|
||||
if (support("sql")) {
|
||||
echo script_src("../externals/jush/modules/jush-" . JUSH . ".js");
|
||||
echo script_src("../externals/jush/modules/jush-" . JUSH . ".js", true);
|
||||
echo "<script" . nonce() . ">\n";
|
||||
if ($tables) {
|
||||
$links = array();
|
||||
foreach ($tables as $table => $type) {
|
||||
$links[] = preg_quote($table, '/');
|
||||
}
|
||||
echo "var jushLinks = { " . JUSH . ": [ '" . js_escape(ME) . (support("table") ? "table=" : "select=") . "\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
|
||||
echo "var jushLinks = { " . JUSH . ":";
|
||||
json_row(js_escape(ME) . (support("table") ? "table" : "select") . '=$&', '/\b(' . implode('|', $links) . ')\b/g', false);
|
||||
if (support('routine')) {
|
||||
foreach (routines() as $row) {
|
||||
json_row(js_escape(ME) . 'function=' . urlencode($row["SPECIFIC_NAME"]) . '&name=$&', '/\b' . preg_quote($row["ROUTINE_NAME"], '/') . '(?=["`]?\()/g', false);
|
||||
}
|
||||
}
|
||||
json_row('');
|
||||
echo "};\n";
|
||||
foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
|
||||
echo "jushLinks.$val = jushLinks." . JUSH . ";\n";
|
||||
}
|
||||
if (isset($_GET["sql"]) || isset($_GET["trigger"]) || isset($_GET["check"])) {
|
||||
$tablesColumns = array_fill_keys(array_keys($tables), array());
|
||||
foreach (driver()->allFields() as $table => $fields) {
|
||||
foreach ($fields as $field) {
|
||||
$tablesColumns[$table][] = $field["field"];
|
||||
}
|
||||
}
|
||||
echo "addEventListener('DOMContentLoaded', () => { autocompleter = jush.autocompleteSql('" . idf_escape("") . "', " . json_encode($tablesColumns) . "); });\n";
|
||||
}
|
||||
}
|
||||
echo "</script>\n";
|
||||
}
|
||||
echo script("syntaxHighlighting('" . preg_replace('~^(\d\.?\d).*~s', '\1', connection()->server_info) . "'"
|
||||
. (connection()->flavor == 'maria' ? ", 'maria'" : (connection()->flavor == 'cockroach' ? ", 'cockroach'" : "")) . ");"
|
||||
);
|
||||
echo script("syntaxHighlighting('" . preg_replace('~^(\d\.?\d).*~s', '\1', connection()->server_info) . "', '" . connection()->flavor . "');");
|
||||
}
|
||||
|
||||
/** Print databases list in menu */
|
||||
@@ -1026,14 +1090,14 @@ class Adminer {
|
||||
echo "<form action=''>\n<p id='dbs'>\n";
|
||||
hidden_fields_get();
|
||||
$db_events = script("mixin(qsl('select'), {onmousedown: dbMouseDown, onchange: dbChange});");
|
||||
echo "<span title='" . lang('Database') . "'>" . lang('DB') . ":</span> " . ($databases
|
||||
echo "<label title='" . lang('Database') . "'>" . lang('DB') . ": " . ($databases
|
||||
? html_select("db", array("" => "") + $databases, DB) . $db_events
|
||||
: "<input name='db' value='" . h(DB) . "' autocapitalize='off' size='19'>\n"
|
||||
);
|
||||
) . "</label>";
|
||||
echo "<input type='submit' value='" . lang('Use') . "'" . ($databases ? " class='hidden'" : "") . ">\n";
|
||||
if (support("scheme")) {
|
||||
if ($missing != "db" && DB != "" && connection()->select_db(DB)) {
|
||||
echo "<br><span>" . lang('Schema') . ":</span> " . html_select("ns", array("" => "") + adminer()->schemas(), $_GET["ns"]) . $db_events;
|
||||
echo "<br><label>" . lang('Schema') . ": " . html_select("ns", array("" => "") + adminer()->schemas(), $_GET["ns"]) . "$db_events</label>";
|
||||
if ($_GET["ns"] != "") {
|
||||
set_schema($_GET["ns"]);
|
||||
}
|
||||
@@ -1054,15 +1118,16 @@ class Adminer {
|
||||
function tablesPrint(array $tables): void {
|
||||
echo "<ul id='tables'>" . script("mixin(qs('#tables'), {onmouseover: menuOver, onmouseout: menuOut});");
|
||||
foreach ($tables as $table => $status) {
|
||||
$table = "$table"; // do not highlight "0" as active everywhere
|
||||
$name = adminer()->tableName($status);
|
||||
if ($name != "") {
|
||||
if ($name != "" && !$status["partition"]) {
|
||||
echo '<li><a href="' . h(ME) . 'select=' . urlencode($table) . '"'
|
||||
. bold($_GET["select"] == $table || $_GET["edit"] == $table, "select")
|
||||
. " title='" . lang('Select data') . "'>" . lang('select') . "</a> "
|
||||
;
|
||||
echo (support("table") || support("indexes")
|
||||
? '<a href="' . h(ME) . 'table=' . urlencode($table) . '"'
|
||||
. bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"])), (is_view($status) ? "view" : "structure"))
|
||||
. bold(in_array($table, array($_GET["table"], $_GET["create"], $_GET["indexes"], $_GET["foreign"], $_GET["trigger"], $_GET["check"], $_GET["view"])), (is_view($status) ? "view" : "structure"))
|
||||
. " title='" . lang('Show structure') . "'>$name</a>"
|
||||
: "<span>$name</span>"
|
||||
) . "\n";
|
||||
@@ -1070,4 +1135,33 @@ class Adminer {
|
||||
}
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
/** Get server variables
|
||||
* @return list<string[]> [[$name, $value]]
|
||||
*/
|
||||
function showVariables(): array {
|
||||
return show_variables();
|
||||
}
|
||||
|
||||
/** Get status variables
|
||||
* @return list<string[]> [[$name, $value]]
|
||||
*/
|
||||
function showStatus(): array {
|
||||
return show_status();
|
||||
}
|
||||
|
||||
/** Get process list
|
||||
* @return list<string[]> [$row]
|
||||
*/
|
||||
function processList(): array {
|
||||
return process_list();
|
||||
}
|
||||
|
||||
/** Kill a process
|
||||
* @param numeric-string $id
|
||||
* @return Result|bool
|
||||
*/
|
||||
function killProcess(string $id) {
|
||||
return kill_process($id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ if (isset($_GET["username"]) && !class_exists('Adminer\Db')) {
|
||||
|
||||
$connection = '';
|
||||
if (isset($_GET["username"]) && is_string(get_password())) {
|
||||
list($host, $port) = explode(":", SERVER, 2);
|
||||
list(, $port) = host_port(SERVER);
|
||||
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.'), $permanent);
|
||||
}
|
||||
|
||||
@@ -29,16 +29,6 @@ if (isset($_GET["file"])) {
|
||||
include "../adminer/file.inc.php";
|
||||
}
|
||||
|
||||
if ($_GET["script"] == "version") {
|
||||
$filename = get_temp_dir() . "/adminer.version";
|
||||
@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"])));
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
// Adminer doesn't use any global variables; they used to be declared here
|
||||
|
||||
if (!$_SERVER["REQUEST_URI"]) { // IIS 5 compatibility
|
||||
@@ -61,7 +51,11 @@ if (!defined("SID")) {
|
||||
}
|
||||
|
||||
// disable magic quotes to be able to use database escaping function
|
||||
remove_slashes(array(&$_GET, &$_POST, &$_COOKIE), $filter);
|
||||
if (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) {
|
||||
$_GET = remove_slashes($_GET, $filter);
|
||||
$_POST = remove_slashes($_POST, $filter);
|
||||
$_COOKIE = remove_slashes($_COOKIE, $filter);
|
||||
}
|
||||
if (function_exists("get_magic_quotes_runtime") && get_magic_quotes_runtime()) {
|
||||
set_magic_quotes_runtime(false);
|
||||
}
|
||||
@@ -79,21 +73,20 @@ include "../adminer/drivers/oracle.inc.php";
|
||||
include "../adminer/drivers/mssql.inc.php";
|
||||
include "./include/adminer.inc.php";
|
||||
include "../adminer/include/plugins.inc.php";
|
||||
include "../adminer/include/plugin.inc.php";
|
||||
|
||||
if (function_exists('adminer_object')) {
|
||||
Adminer::$instance = adminer_object();
|
||||
} elseif (is_dir("adminer-plugins") || file_exists("adminer-plugins.php")) {
|
||||
Adminer::$instance = new Plugins(null);
|
||||
} else {
|
||||
Adminer::$instance = new Adminer;
|
||||
}
|
||||
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, '' means default server, null means no server
|
||||
define('Adminer\DB', $_GET["db"]); // for the sake of speed and size
|
||||
define('Adminer\SERVER', "" . $_GET[DRIVER]); // read from pgsql=localhost, '' means default server
|
||||
define('Adminer\DB', "$_GET[db]"); // for the sake of speed and size
|
||||
define(
|
||||
'Adminer\ME',
|
||||
preg_replace('~\?.*~', '', relative_uri()) . '?'
|
||||
@@ -109,3 +102,5 @@ include "../adminer/include/xxtea.inc.php";
|
||||
include "../adminer/include/auth.inc.php";
|
||||
include "./include/editing.inc.php";
|
||||
include "./include/connect.inc.php";
|
||||
|
||||
adminer()->afterConnect();
|
||||
|
||||
@@ -44,14 +44,7 @@ if (
|
||||
}
|
||||
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";
|
||||
if (isset(adminer()->plugins) && is_array(adminer()->plugins)) {
|
||||
echo "<p>" . lang('Loaded plugins') . ":\n<ul>\n";
|
||||
foreach (adminer()->plugins as $plugin) {
|
||||
$reflection = new \ReflectionObject($plugin);
|
||||
echo "<li><b>" . get_class($plugin) . "</b>" . h(preg_match('~^/[\s*]+(.+)~', $reflection->getDocComment(), $match) ? ": $match[1]" : "") . "\n";
|
||||
}
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
$databases = adminer()->databases();
|
||||
if ($databases) {
|
||||
$scheme = support("scheme");
|
||||
@@ -69,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);
|
||||
@@ -96,6 +88,29 @@ if (
|
||||
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");
|
||||
|
||||
@@ -6,19 +6,19 @@ namespace Adminer;
|
||||
abstract class SqlDb {
|
||||
/** @var Db */ static $instance;
|
||||
|
||||
public string $extension; // extension name
|
||||
public string $flavor = ''; // different vendor with the same API, e.g. MariaDB; usually stays empty
|
||||
public string $server_info; // server version
|
||||
public int $affected_rows = 0; // number of affected rows
|
||||
public string $info = ''; // see https://php.net/mysql_info
|
||||
public int $errno = 0; // last error code
|
||||
public string $error = ''; // last error message
|
||||
/** @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;
|
||||
abstract function attach(string $server, string $username, string $password): string;
|
||||
|
||||
/** Quote string to use in SQL
|
||||
* @return string escaped string enclosed in '
|
||||
|
||||
@@ -13,7 +13,7 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s
|
||||
exit;
|
||||
}
|
||||
if (!ob_get_level()) {
|
||||
ob_start(null, 4096);
|
||||
ob_start('ob_gzhandler', 4096);
|
||||
}
|
||||
$title_all = $title . ($title2 != "" ? ": $title2" : "");
|
||||
$title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . adminer()->name());
|
||||
@@ -27,17 +27,13 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s
|
||||
<title><?php echo $title_page; ?></title>
|
||||
<link rel="stylesheet" href="../adminer/static/default.css">
|
||||
<?php
|
||||
|
||||
$css = adminer()->css();
|
||||
$has_light = false;
|
||||
$has_dark = false;
|
||||
foreach ($css as $filename) {
|
||||
if (strpos($filename, "adminer.css") !== false) {
|
||||
$has_light = true;
|
||||
}
|
||||
if (strpos($filename, "adminer-dark.css") !== false) {
|
||||
$has_dark = true;
|
||||
}
|
||||
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
|
||||
@@ -47,36 +43,27 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s
|
||||
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";
|
||||
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 : "") . " 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));
|
||||
$public = "-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwqWOVuF5uw7/+Z70djoK
|
||||
RlHIZFZPO0uYRezq90+7Amk+FDNd7KkL5eDve+vHRJBLAszF/7XKXe11xwliIsFs
|
||||
DFWQlsABVZB3oisKCBEuI71J4kPH8dKGEWR9jDHFw3cWmoH3PmqImX6FISWbG3B8
|
||||
h7FIx3jEaw5ckVPVTeo5JRm/1DZzJxjyDenXvBQ/6o9DgZKeNDgxwKzH+sw9/YCO
|
||||
jHnq1cFpOIISzARlrHMa/43YfeNRAm/tsBXjSxembBPo7aQZLAWHmaj5+K19H10B
|
||||
nCpz9Y++cipkVEiKRGih4ZEvjoFysEOdRLj6WiD/uUNky4xGeA6LaJqh5XpkFkcQ
|
||||
fQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
";
|
||||
if (openssl_verify($version["version"], base64_decode($version["signature"]), $public) == 1) {
|
||||
$_COOKIE["adminer_version"] = $version["version"]; // doesn't need to send to the browser
|
||||
}
|
||||
}
|
||||
echo script("mixin(document.body, {onkeydown: bodyKeydown, onclick: bodyClick"
|
||||
. (isset($_COOKIE["adminer_version"]) ? "" : ", onload: partial(verifyVersion, '" . VERSION . "', '" . js_escape(ME) . "', '" . get_token() . "')")
|
||||
. (isset($_COOKIE["adminer_version"]) ? "" : ", onload: partial(verifyVersion, '" . VERSION . "')")
|
||||
. "});
|
||||
document.body.classList.replace('nojs', 'js');
|
||||
const offlineMessage = '" . js_escape(lang('You are offline.')) . "';
|
||||
@@ -150,8 +137,8 @@ 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-'
|
||||
"connect-src" => "'self'",
|
||||
"frame-src" => "https://www.adminer.org",
|
||||
"connect-src" => "'self' https://www.adminer.org",
|
||||
"frame-src" => "'none'",
|
||||
"object-src" => "'none'",
|
||||
"base-uri" => "'none'",
|
||||
"form-action" => "'self'",
|
||||
|
||||
@@ -7,33 +7,35 @@ function add_driver(string $id, string $name): void {
|
||||
}
|
||||
|
||||
/** Get driver name */
|
||||
function get_driver(string $id): string {
|
||||
function get_driver(string $id): ?string {
|
||||
return SqlDriver::$drivers[$id];
|
||||
}
|
||||
|
||||
abstract class SqlDriver {
|
||||
static Driver $instance;
|
||||
/** @var string[] */ static array $drivers = array(); // all available drivers
|
||||
/** @var list<string> */ static array $extensions = array(); // possible extensions in the current driver
|
||||
static string $jush; // 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 Db $conn;
|
||||
/** @var int[][] */ protected array $types = array(); // [$group => [$type => $maximum_unsigned_length, ...], ...]
|
||||
/** @var string[] */ public array $insertFunctions = array(); // ["$type|$type2" => "$function/$function2"] functions used in edit and insert
|
||||
/** @var string[] */ public array $editFunctions = array(); // ["$type|$type2" => "$function/$function2"] functions used in edit only
|
||||
/** @var list<string> */ public array $unsigned = array(); // number variants
|
||||
/** @var list<string> */ public array $operators = array(); // operators used in select
|
||||
/** @var list<string> */ public array $functions = array(); // functions used in select
|
||||
/** @var list<string> */ public array $grouping = array(); // grouping functions used in select
|
||||
public string $onActions = "RESTRICT|NO ACTION|CASCADE|SET NULL|SET DEFAULT"; // used in foreign_keys()
|
||||
public string $inout = "IN|OUT|INOUT"; // used in routines
|
||||
public string $enumLength = "'(?:''|[^'\\\\]|\\\\.)*'"; // regular expression for parsing enum lengths
|
||||
/** @var list<string> */ public array $generated = array(); // allowed types of generated columns
|
||||
/** @var Db */ protected $conn;
|
||||
/** @var int[][] */ protected $types = array(); // [$group => [$type => $maximum_unsigned_length, ...], ...]
|
||||
/** @var string */ public $delimiter = ";";
|
||||
/** @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
|
||||
|
||||
/** Connect to the database
|
||||
* @return Db|string string for error
|
||||
*/
|
||||
static function connect(?string $server, string $username, string $password) {
|
||||
static function connect(string $server, string $username, string $password) {
|
||||
$connection = new Db;
|
||||
return ($connection->attach($server, $username, $password) ?: $connection);
|
||||
}
|
||||
@@ -188,19 +190,11 @@ abstract class SqlDriver {
|
||||
return $idf;
|
||||
}
|
||||
|
||||
/** 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 Field $field
|
||||
* @param array{type: string} $field
|
||||
*/
|
||||
function value(?string $val, array $field): ?string {
|
||||
return (method_exists($this->conn, 'value')
|
||||
? $this->conn->value($val, $field)
|
||||
: (is_resource($val) ? stream_get_contents($val) : $val)
|
||||
);
|
||||
return (method_exists($this->conn, 'value') ? $this->conn->value($val, $field) : $val);
|
||||
}
|
||||
|
||||
/** Quote binary string */
|
||||
@@ -220,6 +214,27 @@ abstract class SqlDriver {
|
||||
function tableHelp(string $name, bool $is_view = false) {
|
||||
}
|
||||
|
||||
/** Get tables this table inherits from
|
||||
* @return list<array{table: string, ns: string}>
|
||||
*/
|
||||
function inheritsFrom(string $table): array {
|
||||
return array();
|
||||
}
|
||||
|
||||
/** Get inherited tables
|
||||
* @return list<array{table: string, ns: 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;
|
||||
@@ -239,6 +254,14 @@ abstract class SqlDriver {
|
||||
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
|
||||
* @return string[] [$name => $clause]
|
||||
*/
|
||||
@@ -246,23 +269,27 @@ abstract class SqlDriver {
|
||||
// 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
|
||||
JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS t ON c.CONSTRAINT_SCHEMA = t.CONSTRAINT_SCHEMA AND c.CONSTRAINT_NAME = t.CONSTRAINT_NAME" . ($this->conn->flavor == 'maria' ? " AND c.TABLE_NAME = t.TABLE_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'", $this->conn); // ignore default IS NOT NULL checks in PostrgreSQL
|
||||
AND t.TABLE_NAME = " . q($table) . (JUSH == "pgsql" ? "
|
||||
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}>>
|
||||
* @return array<list<array{field:string, null:bool, type:string, length:?numeric-string}>> optionally also 'primary'
|
||||
*/
|
||||
function allFields(): array {
|
||||
$return = array();
|
||||
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`" : "") . "
|
||||
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;
|
||||
ORDER BY TABLE_NAME, ORDINAL_POSITION", $this->conn) as $row
|
||||
) {
|
||||
$row["null"] = ($row["nullable"] == "YES");
|
||||
$return[$row["tab"]][] = $row;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -72,25 +72,18 @@ function print_select_result($result, ?Db $connection2 = null, array $orgtables
|
||||
} else {
|
||||
$link = ME . "edit=" . urlencode($links[$key]);
|
||||
foreach ($indexes[$links[$key]] as $col => $j) {
|
||||
if ($row[$j] === null) {
|
||||
$link = "";
|
||||
break;
|
||||
}
|
||||
$link .= "&where" . urlencode("[" . bracket_escape($col) . "]") . "=" . urlencode($row[$j]);
|
||||
}
|
||||
}
|
||||
} elseif (is_url($val)) {
|
||||
$link = $val;
|
||||
}
|
||||
if ($val === null) {
|
||||
$val = "<i>NULL</i>";
|
||||
} elseif ($blobs[$key] && !is_utf8($val)) {
|
||||
$val = "<i>" . lang('%d byte(s)', strlen($val)) . "</i>"; //! link to download
|
||||
} else {
|
||||
$val = h($val);
|
||||
if ($types[$key] == 254) { // 254 - char
|
||||
$val = "<code>$val</code>";
|
||||
}
|
||||
}
|
||||
if ($link) {
|
||||
$val = "<a href='" . h($link) . "'" . (is_url($link) ? target_blank() : '') . ">$val</a>";
|
||||
}
|
||||
$field = array(
|
||||
'type' => ($blobs[$key] ? 'blob' : ($types[$key] == 254 ? 'char' : '')),
|
||||
);
|
||||
$val = select_value($val, $link, $field, null);
|
||||
// https://dev.mysql.com/doc/dev/mysql-server/latest/field__types_8h.html
|
||||
echo "<td" . ($types[$key] <= 9 || $types[$key] == 246 ? " class='number'" : "") . ">$val";
|
||||
}
|
||||
@@ -150,13 +143,13 @@ function select_input(string $attrs, array $options, ?string $value = "", string
|
||||
* @param string $key or "" to close the object
|
||||
* @param string|int $val
|
||||
*/
|
||||
function json_row(string $key, $val = null): void {
|
||||
function json_row(string $key, $val = null, bool $escape = true): void {
|
||||
static $first = true;
|
||||
if ($first) {
|
||||
echo "{";
|
||||
}
|
||||
if ($key != "") {
|
||||
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\t\"\\/") . '": ' . ($val !== null ? '"' . addcslashes($val, "\r\n\"\\/") . '"' : 'null');
|
||||
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\t\"\\/") . '": ' . ($val !== null ? ($escape ? '"' . addcslashes($val, "\r\n\"\\/") . '"' : $val) : 'null');
|
||||
$first = false;
|
||||
} else {
|
||||
echo "\n}\n";
|
||||
@@ -201,20 +194,6 @@ function edit_type(string $key, array $field, array $collations, array $foreign_
|
||||
);
|
||||
}
|
||||
|
||||
/** Get partition info
|
||||
* @return array{partition_by:string, partition:string, partitions:string, partition_names:list<string>, partition_values:list<string>}
|
||||
*/
|
||||
function get_partitions_info(string $table): array {
|
||||
$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 */
|
||||
function process_length(?string $length): string {
|
||||
$enum_length = driver()->enumLength;
|
||||
@@ -260,15 +239,18 @@ function process_field(array $field, array $type_field): array {
|
||||
* @param Field $field
|
||||
*/
|
||||
function default_value(array $field): string {
|
||||
$default = $field["default"];
|
||||
if ($field["default"] === null) {
|
||||
return "";
|
||||
}
|
||||
$default = str_replace("\r", "", $field["default"]);
|
||||
$generated = $field["generated"];
|
||||
return ($default === null ? "" : (in_array($generated, driver()->generated)
|
||||
? (JUSH == "mssql" ? " AS ($default)" . ($generated == "VIRTUAL" ? "" : " $generated") . "" : " GENERATED ALWAYS AS ($default) $generated")
|
||||
return (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
|
||||
: str_ireplace("current_timestamp()", "CURRENT_TIMESTAMP", (JUSH == "sqlite" ? "($default)" : $default))
|
||||
)
|
||||
));
|
||||
);
|
||||
}
|
||||
|
||||
/** Get type class to use in CSS
|
||||
@@ -328,7 +310,7 @@ function edit_fields(array $fields, array $collations, $type = "TABLE", array $f
|
||||
echo "<tr" . ($display ? "" : " style='display: none;'") . ">\n";
|
||||
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'>";
|
||||
echo "<input name='fields[$i][field]' value='" . h($field["field"]) . "' data-maxlength='64' autocapitalize='off' aria-labelledby='label-name'" . (isset($_POST["add"][$i-1]) ? " autofocus" : "") . ">";
|
||||
}
|
||||
echo input_hidden("fields[$i][orig]", $orig);
|
||||
edit_type("fields[$i]", $field, $collations, $foreign_keys);
|
||||
@@ -339,7 +321,9 @@ function edit_fields(array $fields, array $collations, $type = "TABLE", array $f
|
||||
? 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'>";
|
||||
$attrs = " name='fields[$i][default]' aria-labelledby='label-default'";
|
||||
$value = h($field["default"]);
|
||||
echo (preg_match('~\n~', $field["default"]) ? "<textarea$attrs rows='2' cols='30' style='vertical-align: bottom;'>\n$value</textarea>" : "<input$attrs value='$value'>"); // \n to preserve the leading newline
|
||||
echo (support("comment") ? "<td$comment_class><input name='fields[$i][comment]' value='" . h($field["comment"]) . "' data-maxlength='" . (min_version(5.5) ? 1024 : 255) . "' aria-labelledby='label-comment'>" : "");
|
||||
}
|
||||
echo "<td>";
|
||||
@@ -470,7 +454,7 @@ function create_routine($routine, array $row): string {
|
||||
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"], ";");
|
||||
@@ -499,8 +483,9 @@ function format_foreign_key(array $foreign_key): string {
|
||||
. ($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]" : "")
|
||||
. ($foreign_key["deferrable"] ? " $foreign_key[deferrable]" : "")
|
||||
;
|
||||
}
|
||||
|
||||
@@ -521,20 +506,6 @@ function tar_file(string $filename, $tmp_file): void {
|
||||
echo str_repeat("\0", 511 - ($tmp_file->size + 511) % 512);
|
||||
}
|
||||
|
||||
/** Get INI bytes value */
|
||||
function ini_bytes(string $ini): int {
|
||||
$val = ini_get($ini);
|
||||
switch (strtolower(substr($val, -1))) {
|
||||
case 'g':
|
||||
$val = (int) $val * 1024; // no break
|
||||
case 'm':
|
||||
$val = (int) $val * 1024; // no break
|
||||
case 'k':
|
||||
$val = (int) $val * 1024;
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
|
||||
/** Create link to database documentation
|
||||
* @param string[] $paths JUSH => $path
|
||||
* @param string $text HTML code
|
||||
|
||||
@@ -24,10 +24,9 @@ function driver(): Driver {
|
||||
return Driver::$instance;
|
||||
}
|
||||
|
||||
/** Connect to the database
|
||||
* @param array{?string, string, string} $credentials [$server, $username, $password]
|
||||
*/
|
||||
function connect(array $credentials): ?Db {
|
||||
/** Connect to the database */
|
||||
function connect(): ?Db {
|
||||
$credentials = adminer()->credentials();
|
||||
$return = Driver::connect($credentials[0], $credentials[1], $credentials[2]);
|
||||
return (is_object($return) ? $return : null);
|
||||
}
|
||||
@@ -77,24 +76,19 @@ function number_type(): string {
|
||||
}
|
||||
|
||||
/** Disable magic_quotes_gpc
|
||||
* @param list<array> $process e.g. [&$_GET, &$_POST, &$_COOKIE]
|
||||
* @param mixed[] $values
|
||||
* @param bool $filter whether to leave values as is
|
||||
* @return void modified in place
|
||||
* @return mixed[]
|
||||
*/
|
||||
function remove_slashes(array $process, bool $filter = false): void {
|
||||
if (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) {
|
||||
while (list($key, $val) = each($process)) {
|
||||
foreach ($val as $k => $v) {
|
||||
unset($process[$key][$k]);
|
||||
if (is_array($v)) {
|
||||
$process[$key][stripslashes($k)] = $v;
|
||||
$process[] = &$process[$key][stripslashes($k)];
|
||||
} else {
|
||||
$process[$key][stripslashes($k)] = ($filter ? $v : stripslashes($v));
|
||||
}
|
||||
}
|
||||
}
|
||||
function remove_slashes(array $values, bool $filter = false): array {
|
||||
$return = array();
|
||||
foreach ($values as $key => $val) {
|
||||
$return[stripslashes($key)] = (is_array($val)
|
||||
? remove_slashes($val, $filter)
|
||||
: ($filter ? $val : stripslashes($val))
|
||||
);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Escape or unescape string to use inside form [] */
|
||||
@@ -129,6 +123,20 @@ function ini_bool(string $ini): bool {
|
||||
return (preg_match('~^(on|true|yes)$~i', $val) || (int) $val); // boolean values set by php_value are strings
|
||||
}
|
||||
|
||||
/** Get INI bytes value */
|
||||
function ini_bytes(string $ini): int {
|
||||
$val = ini_get($ini);
|
||||
switch (strtolower(substr($val, -1))) {
|
||||
case 'g':
|
||||
$val = (int) $val * 1024; // no break
|
||||
case 'm':
|
||||
$val = (int) $val * 1024; // no break
|
||||
case 'k':
|
||||
$val = (int) $val * 1024;
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
|
||||
/** Check if SID is necessary */
|
||||
function sid(): bool {
|
||||
static $return;
|
||||
@@ -231,7 +239,7 @@ function get_rows(string $query, ?Db $connection2 = null, string $error = "<p cl
|
||||
*/
|
||||
function unique_array(?array $row, array $indexes) {
|
||||
foreach ($indexes as $index) {
|
||||
if (preg_match("~PRIMARY|UNIQUE~", $index["type"])) {
|
||||
if (preg_match("~PRIMARY|UNIQUE~", $index["type"]) && !$index["partial"]) {
|
||||
$return = array();
|
||||
foreach ($index["columns"] as $key) {
|
||||
if (!isset($row[$key])) { // NULL is ambiguous
|
||||
@@ -265,9 +273,10 @@ function where(array $where, array $fields = array()): string {
|
||||
$field_type = $field["type"];
|
||||
$return[] = $column
|
||||
. (JUSH == "sql" && $field_type == "json" ? " = CAST(" . q($val) . " AS JSON)"
|
||||
: (JUSH == "pgsql" && preg_match('~^json~', $field_type) ? "::jsonb = " . q($val) . "::jsonb"
|
||||
: (JUSH == "sql" && is_numeric($val) && preg_match('~\.~', $val) ? " LIKE " . q($val) // LIKE because of floats but slow with ints
|
||||
: (JUSH == "mssql" && strpos($field_type, "datetime") === false ? " LIKE " . q(preg_replace('~[_%[]~', '[\0]', $val)) // LIKE because of text but it does not work with datetime
|
||||
: " = " . unconvert_field($field, q($val)))))
|
||||
: " = " . unconvert_field($field, q($val))))))
|
||||
; //! enum and set
|
||||
if (JUSH == "sql" && preg_match('~char|text~', $field_type) && preg_match("~[^ -@]~", $val)) { // not just [a-z] to catch non-ASCII characters
|
||||
$return[] = "$column = " . q($val) . " COLLATE " . charset(connection()) . "_bin";
|
||||
@@ -292,7 +301,7 @@ function where_check(string $val, array $fields = array()): string {
|
||||
* @param int $i condition order
|
||||
* @param string $column column identifier
|
||||
*/
|
||||
function where_link(int $i, string $column, string $value, string $operator = "="): string {
|
||||
function where_link(int $i, string $column, ?string $value, string $operator = "="): string {
|
||||
return "&where%5B$i%5D%5Bcol%5D=" . urlencode($column) . "&where%5B$i%5D%5Bop%5D=" . urlencode(($value !== null ? $operator : "IS NULL")) . "&where%5B$i%5D%5Bval%5D=" . urlencode($value);
|
||||
}
|
||||
|
||||
@@ -320,7 +329,7 @@ function convert_fields(array $columns, array $fields, array $select = array()):
|
||||
*/
|
||||
function cookie(string $name, ?string $value, int $lifetime = 2592000): void {
|
||||
header(
|
||||
"Set-Cookie: $name=" . urlencode($value)
|
||||
"Set-Cookie: $name=" . rawurlencode($value)
|
||||
. ($lifetime ? "; expires=" . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT" : "")
|
||||
. "; path=" . preg_replace('~\?.*~', '', $_SERVER["REQUEST_URI"])
|
||||
. (HTTPS ? "; secure" : "")
|
||||
@@ -338,18 +347,20 @@ function get_settings(string $cookie): array {
|
||||
}
|
||||
|
||||
/** Get setting stored in a cookie
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
function get_setting(string $key, string $cookie = "adminer_settings") {
|
||||
$settings = get_settings($cookie);
|
||||
return $settings[$key];
|
||||
function get_setting(string $key, string $cookie = "adminer_settings", $default = null) {
|
||||
return idx(get_settings($cookie), $key, $default);
|
||||
}
|
||||
|
||||
/** Store settings to a cookie
|
||||
* @param mixed[] $settings
|
||||
*/
|
||||
function save_settings(array $settings, string $cookie = "adminer_settings"): void {
|
||||
cookie($cookie, http_build_query($settings + get_settings($cookie)));
|
||||
$value = http_build_query($settings + get_settings($cookie));
|
||||
cookie($cookie, $value);
|
||||
$_COOKIE[$cookie] = $value;
|
||||
}
|
||||
|
||||
/** Restart stopped session */
|
||||
@@ -459,7 +470,7 @@ function queries(string $query) {
|
||||
if (!Queries::$start) {
|
||||
Queries::$start = microtime(true);
|
||||
}
|
||||
Queries::$queries[] = (preg_match('~;$~', $query) ? "DELIMITER ;;\n$query;\nDELIMITER " : $query) . ";";
|
||||
Queries::$queries[] = (driver()->delimiter != ';' ? $query : (preg_match('~;$~', $query) ? "DELIMITER ;;\n$query;\nDELIMITER " : $query) . ";");
|
||||
return connection()->query($query);
|
||||
}
|
||||
|
||||
@@ -594,10 +605,10 @@ function column_foreign_keys(string $table): array {
|
||||
return $return;
|
||||
}
|
||||
|
||||
/** Compute fields() from $_POST edit data
|
||||
/** Compute fields() from $_POST edit data; used by Mongo and SimpleDB
|
||||
* @return Field[] same as fields()
|
||||
*/
|
||||
function fields_from_edit(): array { // used by Mongo and SimpleDB
|
||||
function fields_from_edit(): array {
|
||||
$return = array();
|
||||
foreach ((array) $_POST["field_keys"] as $key => $val) {
|
||||
if ($val != "") {
|
||||
@@ -640,12 +651,13 @@ function dump_headers(string $identifier, bool $multi_table = false): string {
|
||||
* @param string[] $row
|
||||
*/
|
||||
function dump_csv(array $row): void {
|
||||
$tsv = $_POST["format"] == "tsv";
|
||||
foreach ($row as $key => $val) {
|
||||
if (preg_match('~["\n,;\t]|^0|\.\d*0$~', $val) || $val === "") {
|
||||
if (preg_match('~["\n]|^0[^.]|\.\d*0$|' . ($tsv ? '\t' : '[,;]|^$') . '~', $val)) {
|
||||
$row[$key] = '"' . str_replace('"', '""', $val) . '"';
|
||||
}
|
||||
}
|
||||
echo implode(($_POST["format"] == "csv" ? "," : ($_POST["format"] == "tsv" ? "\t" : ";")), $row) . "\r\n";
|
||||
echo implode(($_POST["format"] == "csv" ? "," : ($tsv ? "\t" : ";")), $row) . "\r\n";
|
||||
}
|
||||
|
||||
/** Apply SQL function
|
||||
@@ -684,7 +696,7 @@ function file_open_lock(string $filename) {
|
||||
if (!$fp) {
|
||||
return;
|
||||
}
|
||||
chmod($filename, 0660);
|
||||
@chmod($filename, 0660); // @ - may not be permitted
|
||||
if (!flock($fp, LOCK_EX)) {
|
||||
fclose($fp);
|
||||
return;
|
||||
@@ -749,19 +761,35 @@ function rand_string(): string {
|
||||
}
|
||||
|
||||
/** Format value to use in select
|
||||
* @param string|string[] $val
|
||||
* @param Field $field
|
||||
* @param string|string[]|list<string[]> $val
|
||||
* @param array{type: string} $field
|
||||
* @param ?numeric-string $text_length
|
||||
* @return string HTML
|
||||
*/
|
||||
function select_value($val, string $link, array $field, ?string $text_length): string {
|
||||
if (is_array($val)) {
|
||||
$return = "";
|
||||
foreach ($val as $k => $v) {
|
||||
$return .= "<tr>"
|
||||
. ($val != array_values($val) ? "<th>" . h($k) : "")
|
||||
. "<td>" . select_value($v, $link, $field, $text_length)
|
||||
;
|
||||
if (array_filter($val, 'is_array') == array_values($val)) { // list of arrays
|
||||
$keys = array();
|
||||
foreach ($val as $v) {
|
||||
$keys += array_fill_keys(array_keys($v), null);
|
||||
}
|
||||
foreach (array_keys($keys) as $k) {
|
||||
$return .= "<th>" . h($k);
|
||||
}
|
||||
foreach ($val as $v) {
|
||||
$return .= "<tr>";
|
||||
foreach (array_merge($keys, $v) as $v2) {
|
||||
$return .= "<td>" . select_value($v2, $link, $field, $text_length);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($val as $k => $v) {
|
||||
$return .= "<tr>"
|
||||
. ($val != array_values($val) ? "<th>" . h($k) : "")
|
||||
. "<td>" . select_value($v, $link, $field, $text_length)
|
||||
;
|
||||
}
|
||||
}
|
||||
return "<table>$return</table>";
|
||||
}
|
||||
@@ -776,7 +804,7 @@ function select_value($val, string $link, array $field, ?string $text_length): s
|
||||
$link = $val; // IE 11 and all modern browsers hide referrer
|
||||
}
|
||||
}
|
||||
$return = adminer()->editVal($val, $field);
|
||||
$return = adminer()->editVal(driver()->value($val, $field), $field);
|
||||
if ($return !== null) {
|
||||
if (!is_utf8($return)) {
|
||||
$return = "\0"; // htmlspecialchars of binary data returns an empty string
|
||||
@@ -789,6 +817,13 @@ function select_value($val, string $link, array $field, ?string $text_length): s
|
||||
return adminer()->selectVal($return, $link, $field, $val);
|
||||
}
|
||||
|
||||
/** Check whether the field type is blob or equivalent
|
||||
* @param array{type: string} $field
|
||||
*/
|
||||
function is_blob(array $field): bool {
|
||||
return preg_match('~blob|bytea|raw|file~', $field["type"]) && !in_array($field["type"], idx(driver()->structuredTypes(), lang('User types'), array()));
|
||||
}
|
||||
|
||||
/** Check whether the string is e-mail address */
|
||||
function is_mail(?string $email): bool {
|
||||
$atom = '[-a-z0-9!#$%&\'*+/=?^_`{|}~]'; // characters of local-name
|
||||
@@ -800,14 +835,24 @@ function is_mail(?string $email): bool {
|
||||
/** Check whether the string is URL address */
|
||||
function is_url(?string $string): bool {
|
||||
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component //! IDN
|
||||
return preg_match("~^(https?)://($domain?\\.)+$domain(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string); //! restrict path, query and fragment characters
|
||||
return preg_match("~^((https?):)?//($domain?\\.)+$domain(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string); //! restrict path, query and fragment characters
|
||||
}
|
||||
|
||||
/** Check if field should be shortened
|
||||
* @param Field $field
|
||||
* @param array{type: string} $field
|
||||
*/
|
||||
function is_shortable(array $field): bool {
|
||||
return preg_match('~char|text|json|lob|geometry|point|linestring|polygon|string|bytea~', $field["type"]);
|
||||
return !preg_match('~' . number_type() . '|date|time|year~', $field["type"]);
|
||||
}
|
||||
|
||||
/** Split server into host and (port or socket)
|
||||
* @return array{0: string, 1: string}
|
||||
*/
|
||||
function host_port(string $server) {
|
||||
return (preg_match('~^(\[(.+)]|([^:]+)):([^:]+)$~', $server, $match) // [a:b] - IPv6
|
||||
? array($match[2] . $match[3], $match[4])
|
||||
: array($server, '')
|
||||
);
|
||||
}
|
||||
|
||||
/** Get query to compute number of found rows
|
||||
@@ -831,7 +876,7 @@ function slow_query(string $query): array {
|
||||
$slow_query = driver()->slowQuery($query, $timeout);
|
||||
$connection2 = null;
|
||||
if (!$slow_query && support("kill")) {
|
||||
$connection2 = connect(adminer()->credentials());
|
||||
$connection2 = connect();
|
||||
if ($connection2 && ($db == "" || $connection2->select_db($db))) {
|
||||
$kill = get_val(connection_id(), 0, $connection2); // MySQL and MySQLi can use thread_id but it's not in PDO_MySQL
|
||||
echo script("const timeout = setTimeout(() => { ajax('" . js_escape(ME) . "script=kill', function () {}, 'kill=$kill&token=" . get_token() . "'); }, 1000 * $timeout);");
|
||||
|
||||
@@ -7,8 +7,8 @@ function script(string $source, string $trailing = "\n"): string {
|
||||
}
|
||||
|
||||
/** Return <script src> element */
|
||||
function script_src(string $url): string {
|
||||
return "<script src='" . h($url) . "'" . nonce() . "></script>\n";
|
||||
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 */
|
||||
@@ -90,9 +90,17 @@ function optionlist($options, $selected = null, bool $use_keys = false): string
|
||||
* @param string[] $options
|
||||
*/
|
||||
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 };", "") : "")
|
||||
;
|
||||
}
|
||||
@@ -100,10 +108,10 @@ function html_select(string $name, array $options, ?string $value = "", string $
|
||||
/** Generate HTML radio list
|
||||
* @param string[] $options
|
||||
*/
|
||||
function html_radios(string $name, array $options, string $value = ""): string {
|
||||
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;
|
||||
}
|
||||
@@ -168,18 +176,34 @@ function hidden_fields_get(): void {
|
||||
echo input_hidden("username", $_GET["username"]);
|
||||
}
|
||||
|
||||
/** Get <input type='file'> */
|
||||
function file_input(string $input): string {
|
||||
$max_file_uploads = "max_file_uploads";
|
||||
$max_file_uploads_value = ini_get($max_file_uploads);
|
||||
$upload_max_filesize = "upload_max_filesize";
|
||||
$upload_max_filesize_value = ini_get($upload_max_filesize);
|
||||
return (ini_bool("file_uploads")
|
||||
? $input . script("qsl('input[type=\"file\"]').onchange = partialArg(fileChange, "
|
||||
. "$max_file_uploads_value, '" . lang('Increase %s.', "$max_file_uploads = $max_file_uploads_value") . "', " // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
|
||||
. ini_bytes("upload_max_filesize") . ", '" . lang('Increase %s.', "$upload_max_filesize = $upload_max_filesize_value") . "')")
|
||||
: lang('File uploads are disabled.')
|
||||
);
|
||||
}
|
||||
|
||||
/** Print enum or set input field
|
||||
* @param 'radio'|'checkbox' $type
|
||||
* @param Field $field
|
||||
* @param mixed $value string|array
|
||||
* @param string|string[]|false|null $value false means original value
|
||||
*/
|
||||
function enum_input(string $type, string $attrs, array $field, $value, ?string $empty = null): string {
|
||||
function enum_input(string $type, string $attrs, array $field, $value, string $empty = ""): 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) {
|
||||
$prefix = ($field["type"] == "enum" ? "val-" : "");
|
||||
$checked = (is_array($value) ? in_array("null", $value) : $value === null);
|
||||
$return = ($field["null"] && $prefix ? "<label><input type='$type'$attrs value='null'" . ($checked ? " checked" : "") . "><i>$empty</i></label>" : "");
|
||||
foreach ($matches[1] as $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>';
|
||||
$checked = (is_array($value) ? in_array($prefix . $val, $value) : $value === $val);
|
||||
$return .= " <label><input type='$type'$attrs value='" . h($prefix . $val) . "'" . ($checked ? ' checked' : '') . '>' . h(adminer()->editVal($val, $field)) . '</label>';
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
@@ -192,21 +216,23 @@ function input(array $field, $value, ?string $function, ?bool $autofocus = false
|
||||
$name = h(bracket_escape($field["field"]));
|
||||
echo "<td class='function'>";
|
||||
if (is_array($value) && !$function) {
|
||||
$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";
|
||||
}
|
||||
$json = ($function == "json" || preg_match('~^jsonb?$~', $field["type"]));
|
||||
if ($json && $value != '' && (JUSH != "pgsql" || $field["type"] != "json")) {
|
||||
$value = json_encode(is_array($value) ? $value : json_decode($value), 128 | 64 | 256); // 128 - JSON_PRETTY_PRINT, 64 - JSON_UNESCAPED_SLASHES, 256 - JSON_UNESCAPED_UNICODE available since PHP 5.4
|
||||
}
|
||||
$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);
|
||||
$disabled = stripos($field["default"], "GENERATED ALWAYS AS ") === 0 ? " disabled=''" : "";
|
||||
$attrs = " name='fields[$name]'$disabled" . ($autofocus ? " autofocus" : "");
|
||||
$enums = driver()->enumLength($field);
|
||||
if ($enums) {
|
||||
$field["type"] = "enum";
|
||||
$field["length"] = $enums;
|
||||
}
|
||||
$attrs = " name='fields[$name]" . ($field["type"] == "enum" || $field["type"] == "set" ? "[]" : "") . "'" . ($autofocus ? " autofocus" : "");
|
||||
echo driver()->unconvertFunction($field) . " ";
|
||||
$table = $_GET["edit"] ?: $_GET["select"];
|
||||
if ($field["type"] == "enum") {
|
||||
@@ -214,7 +240,7 @@ function input(array $field, $value, ?string $function, ?bool $autofocus = false
|
||||
} 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>"
|
||||
? "<select name='function[$name]'>" . optionlist($functions, $function === null || $has_function ? $function : "") . "</select>"
|
||||
. on_help("event.target.value.replace(/^SQL\$/, '')", 1)
|
||||
. script("qsl('select').onchange = functionChange;", "")
|
||||
: h(reset($functions))
|
||||
@@ -226,15 +252,10 @@ function input(array $field, $value, ?string $function, ?bool $autofocus = false
|
||||
echo "<input type='hidden'$attrs value='0'>"
|
||||
. "<input type='checkbox'" . (preg_match('~^(1|t|true|y|yes|on)$~i', $value) ? " checked='checked'" : "") . "$attrs value='1'>";
|
||||
} elseif ($field["type"] == "set") {
|
||||
preg_match_all("~'((?:[^']|'')*)'~", $field["length"], $matches);
|
||||
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>';
|
||||
}
|
||||
} elseif (preg_match('~blob|bytea|raw|file~', $field["type"]) && ini_bool("file_uploads")) {
|
||||
echo enum_input("checkbox", $attrs, $field, (is_string($value) ? explode(",", $value) : $value));
|
||||
} elseif (is_blob($field) && ini_bool("file_uploads")) {
|
||||
echo "<input type='file' name='fields-$name'>";
|
||||
} elseif ($function == "json" || preg_match('~^jsonb?$~', $field["type"])) {
|
||||
} elseif ($json) {
|
||||
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") {
|
||||
@@ -282,19 +303,21 @@ function input(array $field, $value, ?string $function, ?bool $autofocus = false
|
||||
* @return mixed false to leave the original value
|
||||
*/
|
||||
function process_input(array $field) {
|
||||
if (stripos($field["default"], "GENERATED ALWAYS AS ") === 0) {
|
||||
return;
|
||||
}
|
||||
$idf = bracket_escape($field["field"]);
|
||||
$function = idx($_POST["function"], $idf);
|
||||
$value = $_POST["fields"][$idf];
|
||||
$value = idx($_POST["fields"], $idf);
|
||||
if ($value === null) {
|
||||
return false;
|
||||
}
|
||||
if ($field["type"] == "enum" || driver()->enumLength($field)) {
|
||||
if ($value == -1) {
|
||||
$value = idx($value, 0);
|
||||
if ($value == "orig" || !$value) {
|
||||
return false;
|
||||
}
|
||||
if ($value == "") {
|
||||
if ($value == "null") {
|
||||
return "NULL";
|
||||
}
|
||||
$value = substr($value, 4); // 4 - strlen("val-")
|
||||
}
|
||||
if ($field["auto_increment"] && $value == "") {
|
||||
return null;
|
||||
@@ -316,7 +339,7 @@ function process_input(array $field) {
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
if (preg_match('~blob|bytea|raw|file~', $field["type"]) && ini_bool("file_uploads")) {
|
||||
if (is_blob($field) && ini_bool("file_uploads")) {
|
||||
$file = get_file("fields-$idf");
|
||||
if (!is_string($file)) {
|
||||
return false; //! report errors
|
||||
@@ -373,6 +396,7 @@ function edit_form(string $table, array $fields, $row, ?bool $update, string $er
|
||||
return;
|
||||
}
|
||||
echo "<form action='' method='post' enctype='multipart/form-data' id='form'>\n";
|
||||
$editable = false;
|
||||
if (!$fields) {
|
||||
echo "<p class='error'>" . lang('You have no privileges to update this table.') . "\n";
|
||||
} else {
|
||||
@@ -403,30 +427,35 @@ function edit_form(string $table, array $fields, $row, ?bool $update, string $er
|
||||
if (!$_POST["save"] && is_string($value)) {
|
||||
$value = adminer()->editVal($value, $field);
|
||||
}
|
||||
$function = ($_POST["save"]
|
||||
? idx($_POST["function"], $name, "")
|
||||
: ($update && preg_match('~^CURRENT_TIMESTAMP~i', $field["on_update"])
|
||||
? "now"
|
||||
: ($value === false ? null : ($value !== null ? '' : 'NULL'))
|
||||
)
|
||||
);
|
||||
if (!$_POST && !$update && $value == $field["default"] && preg_match('~^[\w.]+\(~', $value)) {
|
||||
$function = "SQL";
|
||||
}
|
||||
if (preg_match("~time~", $field["type"]) && preg_match('~^CURRENT_TIMESTAMP~i', $value)) {
|
||||
$value = "";
|
||||
$function = "now";
|
||||
}
|
||||
if ($field["type"] == "uuid" && $value == "uuid()") {
|
||||
$value = "";
|
||||
$function = "uuid";
|
||||
}
|
||||
if ($autofocus !== false) {
|
||||
$autofocus = ($field["auto_increment"] || $function == "now" || $function == "uuid" ? null : true); // null - don't autofocus this input but check the next one
|
||||
}
|
||||
input($field, $value, $function, $autofocus);
|
||||
if ($autofocus) {
|
||||
$autofocus = false;
|
||||
if (($update && !isset($field["privileges"]["update"])) || $field["generated"]) {
|
||||
echo "<td class='function'><td>" . select_value($value, '', $field, null);
|
||||
} else {
|
||||
$editable = true;
|
||||
$function = ($_POST["save"]
|
||||
? idx($_POST["function"], $name, "")
|
||||
: ($update && preg_match('~^CURRENT_TIMESTAMP~i', $field["on_update"])
|
||||
? "now"
|
||||
: ($value === false ? null : ($value !== null ? '' : 'NULL'))
|
||||
)
|
||||
);
|
||||
if (!$_POST && !$update && $value == $field["default"] && preg_match('~^[\w.]+\(~', $value)) {
|
||||
$function = "SQL";
|
||||
}
|
||||
if (preg_match("~time~", $field["type"]) && preg_match('~^CURRENT_TIMESTAMP~i', $value)) {
|
||||
$value = "";
|
||||
$function = "now";
|
||||
}
|
||||
if ($field["type"] == "uuid" && $value == "uuid()") {
|
||||
$value = "";
|
||||
$function = "uuid";
|
||||
}
|
||||
if ($autofocus !== false) {
|
||||
$autofocus = ($field["auto_increment"] || $function == "now" || $function == "uuid" ? null : true); // null - don't autofocus this input but check the next one
|
||||
}
|
||||
input($field, $value, $function, $autofocus);
|
||||
if ($autofocus) {
|
||||
$autofocus = false;
|
||||
}
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
@@ -442,7 +471,7 @@ function edit_form(string $table, array $fields, $row, ?bool $update, string $er
|
||||
echo "</table>\n";
|
||||
}
|
||||
echo "<p>\n";
|
||||
if ($fields) {
|
||||
if ($editable) {
|
||||
echo "<input type='submit' value='" . lang('Save') . "'>\n";
|
||||
if (!isset($_GET["select"])) {
|
||||
echo "<input type='submit' name='insert' value='" . ($update
|
||||
|
||||
@@ -1,7 +1,48 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
// not used in a single language version
|
||||
/** Translate string
|
||||
* @param literal-string $idf
|
||||
* @param float|string $number
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
/** Format translation, usable also by plugins
|
||||
* @param string|list<string> $translation
|
||||
* @param float|string $number
|
||||
*/
|
||||
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', 'hr', '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);
|
||||
if ($format != $translation) {
|
||||
$args[0] = format_number($number);
|
||||
}
|
||||
return vsprintf($format, $args);
|
||||
}
|
||||
|
||||
// this is matched by compile.php
|
||||
// not used in a single language version from here
|
||||
|
||||
/** Get available languages
|
||||
* @return string[]
|
||||
@@ -25,6 +66,8 @@ function langs(): array {
|
||||
'fr' => 'Français', // Francis Gagné, Aurélien Royer
|
||||
'gl' => 'Galego', // Eduardo Penabad Ramos
|
||||
'he' => 'עברית', // Binyamin Yawitz - https://stuff-group.com/
|
||||
'hi' => 'हिन्दी', // Joshi yogesh
|
||||
'hr' => 'Hrvatski', // Nikola Paradžik
|
||||
'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
|
||||
@@ -56,40 +99,9 @@ function langs(): array {
|
||||
);
|
||||
}
|
||||
|
||||
/** Translate string
|
||||
* @param literal-string $idf
|
||||
* @param float|string $number
|
||||
*/
|
||||
function lang(string $idf, $number = null): string {
|
||||
// this is matched by compile.php
|
||||
$translation = (Lang::$translations[$idf] ?: $idf);
|
||||
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
|
||||
: 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);
|
||||
if ($format != $translation) {
|
||||
$args[0] = format_number($number);
|
||||
}
|
||||
return vsprintf($format, $args);
|
||||
}
|
||||
|
||||
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_token();
|
||||
echo "</div>\n</form>\n";
|
||||
|
||||
@@ -71,11 +71,20 @@ if (extension_loaded('pdo')) {
|
||||
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);
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
namespace Adminer;
|
||||
|
||||
class Plugins {
|
||||
/** @var true[] */ private static array $append = array('dumpFormat' => true, 'dumpOutput' => true, 'editRowPrint' => true, 'editFunctions' => true); // these hooks expect the value to be appended to the result
|
||||
/** @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
|
||||
@@ -17,12 +17,12 @@ class Plugins {
|
||||
$basename = "adminer-plugins";
|
||||
if (is_dir($basename)) {
|
||||
foreach (glob("$basename/*.php") as $filename) {
|
||||
$include = include_once "./$filename";
|
||||
$this->includeOnce($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))
|
||||
$include = $this->includeOnce("$basename.php"); // example: return array(new AdminerLoginOtp($secret));
|
||||
if (is_array($include)) {
|
||||
foreach ($include as $plugin) {
|
||||
$plugins[get_class($plugin)] = $plugin;
|
||||
@@ -32,7 +32,7 @@ class Plugins {
|
||||
}
|
||||
}
|
||||
foreach (get_declared_classes() as $class) {
|
||||
if (!$plugins[$class] && preg_match('~^Adminer\w~i', $class)) {
|
||||
if (!$plugins[$class] && (preg_match('~^Adminer\w~i', $class) || is_subclass_of($class, 'Adminer\Plugin'))) {
|
||||
// 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();
|
||||
@@ -59,6 +59,13 @@ class Plugins {
|
||||
}
|
||||
}
|
||||
|
||||
/** Separate function to not overwrite local variables
|
||||
* @return array<object>|true
|
||||
*/
|
||||
function includeOnce(string $filename) {
|
||||
return include_once "./$filename";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param literal-string $name
|
||||
* @param mixed[] $params
|
||||
@@ -67,7 +74,7 @@ class Plugins {
|
||||
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
|
||||
// some plugins accept params by reference - we don't need to propagate it outside, just to the other plugins
|
||||
$args[] = &$params[$key];
|
||||
}
|
||||
$return = null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
const VERSION = "5.1.1";
|
||||
const VERSION = "5.4.3-dev";
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Adminer;
|
||||
$TABLE = $_GET["indexes"];
|
||||
$index_types = array("PRIMARY", "UNIQUE", "INDEX");
|
||||
$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";
|
||||
}
|
||||
@@ -11,6 +12,7 @@ if (preg_match('~MyISAM|M?aria' . (min_version(5.7, '10.2.2') ? '|InnoDB' : '')
|
||||
$index_types[] = "SPATIAL";
|
||||
}
|
||||
$indexes = indexes($TABLE);
|
||||
$fields = fields($TABLE);
|
||||
$primary = array();
|
||||
if (JUSH == "mongo") { // doesn't support primary key
|
||||
$primary = $indexes["_id_"];
|
||||
@@ -29,13 +31,15 @@ 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 = idx($index["lengths"], $key);
|
||||
$desc = idx($index["descs"], $key);
|
||||
$set[] = idf_escape($column) . ($length ? "(" . (+$length) . ")" : "") . ($desc ? " DESC" : "");
|
||||
$set[] = ($fields[$column] ? idf_escape($column) : $column) . ($length ? "(" . (+$length) . ")" : "") . ($desc ? " DESC" : "");
|
||||
$columns[] = $column;
|
||||
$lengths[] = ($length ?: null);
|
||||
$descs[] = $desc;
|
||||
@@ -52,6 +56,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 +65,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,7 +82,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"]) {
|
||||
|
||||
page_header(lang('Indexes'), $error, array("table" => $TABLE), h($TABLE));
|
||||
|
||||
$fields = array_keys(fields($TABLE));
|
||||
$fields_keys = array_keys($fields);
|
||||
if ($_POST["add"]) {
|
||||
foreach ($row["indexes"] as $key => $index) {
|
||||
if ($index["columns"][count($index["columns"])] != "") {
|
||||
@@ -105,20 +111,35 @@ $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'); ?>
|
||||
<?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) {
|
||||
echo "<tr><td>PRIMARY<td>";
|
||||
foreach ($primary["columns"] as $key => $column) {
|
||||
echo select_input(" disabled", $fields, $column);
|
||||
echo select_input(" disabled", $fields_keys, $column);
|
||||
echo "<label><input disabled type='checkbox'>" . lang('descending') . "</label> ";
|
||||
}
|
||||
echo "<td><td>\n";
|
||||
@@ -128,17 +149,21 @@ 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;
|
||||
foreach ($index["columns"] as $key => $column) {
|
||||
echo "<span>" . select_input(
|
||||
" name='indexes[$j][columns][$i]' title='" . lang('Column') . "'",
|
||||
($fields ? array_combine($fields, $fields) : $fields),
|
||||
($fields && ($column == "" || $fields[$column]) ? array_combine($fields_keys, $fields_keys) : array()),
|
||||
$column,
|
||||
"partial(" . ($i == count($index["columns"]) ? "indexesAddColumn" : "indexesChangeColumn") . ", '" . js_escape(JUSH == "sql" ? "" : $_GET["indexes"] . "_") . "')"
|
||||
);
|
||||
echo "<span class='idxopts" . ($show_options ? "" : " hidden") . "'>";
|
||||
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>";
|
||||
@@ -146,6 +171,9 @@ foreach ($row["indexes"] as $index) {
|
||||
}
|
||||
|
||||
echo "<td><input name='indexes[$j][name]' value='" . h($index["name"]) . "' autocapitalize='off' aria-labelledby='label-name'>\n";
|
||||
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++;
|
||||
|
||||
@@ -212,11 +212,6 @@ Lang::$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 @@ Lang::$translations = array(
|
||||
'Network' => 'شبكة',
|
||||
'Geometry' => 'هندسة',
|
||||
'File exists.' => 'الملف موجود.',
|
||||
'Attachments' => 'ملفات مرفقة',
|
||||
'Item%s has been inserted.' => '%sتم إدراج العنصر.',
|
||||
'now' => 'الآن',
|
||||
'%d query(s) executed OK.' => array('تم تنفيذ الاستعلام %d بنجاح.', 'تم تنفيذ الاستعلامات %d بنجاح.'),
|
||||
|
||||
@@ -279,13 +279,6 @@ Lang::$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' => 'Дата и час',
|
||||
|
||||
@@ -214,11 +214,6 @@ Lang::$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 @@ Lang::$translations = array(
|
||||
'Network' => 'নেটওয়ার্ক',
|
||||
'Geometry' => 'জ্যামিতি',
|
||||
'File exists.' => 'ফাইল রয়েছে।',
|
||||
'Attachments' => 'সংযুক্তিগুলো',
|
||||
'%d query(s) executed OK.' => array('SQL-অনুসন্ধান সফলভাবে সম্পন্ন হয়েছে।', '%d SQL-অনুসন্ধানসমূহ সফলভাবে সম্পন্ন হয়েছে।'),
|
||||
'Show only errors' => 'শুধুমাত্র ত্রুটিগুলো দেখান',
|
||||
'Refresh' => 'রিফ্রেশ',
|
||||
@@ -265,6 +259,56 @@ Lang::$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
|
||||
|
||||
@@ -264,13 +264,6 @@ Lang::$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',
|
||||
|
||||
@@ -206,11 +206,6 @@ Lang::$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 @@ Lang::$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',
|
||||
|
||||
@@ -13,9 +13,7 @@ Lang::$translations = array(
|
||||
'Logged as: %s' => 'Přihlášen jako: %s',
|
||||
'Logout successful.' => 'Odhlášení proběhlo v pořádku.',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Díky za použití Admineru, <a href="https://www.adminer.org/cs/donation/">přispějte</a> na vývoj.',
|
||||
'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.',
|
||||
'hostname[:port] or :socket' => 'hostname[:port] nebo :socket',
|
||||
'Invalid credentials.' => 'Neplatné přihlašovací údaje.',
|
||||
'There is a space in the input password which might be the cause.' => 'Problém může být, že je v zadaném hesle mezera.',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer nepodporuje přístup k databázi bez hesla, <a href="https://www.adminer.org/cs/password/"%s>více informací</a>.',
|
||||
@@ -30,7 +28,7 @@ Lang::$translations = array(
|
||||
'Connecting to privileged ports is not allowed.' => 'Připojování k privilegovaným portům není povoleno.',
|
||||
'Disable %s or enable %s or %s extensions.' => 'Zakažte %s nebo povolte rozšíření %s nebo %s.',
|
||||
'Session support must be enabled.' => 'Session proměnné musí být povolené.',
|
||||
'Session expired, please login again.' => 'Session vypršela, přihlašte se prosím znovu.',
|
||||
'Session expired, please login again.' => 'Session vypršela, přihlaste se prosím znovu.',
|
||||
'The action will be performed after successful login with the same credentials.' => 'Akce bude provedena po úspěšném přihlášení se stejnými přihlašovacími údaji.',
|
||||
'%s version: %s through PHP extension %s' => 'Verze %s: %s přes PHP rozšíření %s',
|
||||
'Refresh' => 'Obnovit',
|
||||
@@ -45,6 +43,7 @@ Lang::$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',
|
||||
@@ -78,6 +77,7 @@ Lang::$translations = array(
|
||||
'Webserver file %s' => 'Soubor %s na webovém serveru',
|
||||
'Run file' => 'Spustit soubor',
|
||||
'File does not exist.' => 'Soubor neexistuje.',
|
||||
'Increase %s.' => 'Zvyšte %s.',
|
||||
'File uploads are disabled.' => 'Nahrávání souborů není povoleno.',
|
||||
'Unable to upload a file.' => 'Nepodařilo se nahrát soubor.',
|
||||
'Maximum allowed file size is %sB.' => 'Maximální povolená velikost souboru je %sB.',
|
||||
@@ -196,6 +196,8 @@ Lang::$translations = array(
|
||||
'Partitions' => 'Oddíly',
|
||||
'Partition name' => 'Název oddílu',
|
||||
'Values' => 'Hodnoty',
|
||||
'Inherits from' => 'Zděděná z',
|
||||
'Inherited by' => 'Zděděné',
|
||||
|
||||
'View' => 'Pohled',
|
||||
'Materialized view' => 'Materializovaný pohled',
|
||||
@@ -211,6 +213,8 @@ Lang::$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íč',
|
||||
@@ -295,13 +299,6 @@ Lang::$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',
|
||||
@@ -358,6 +355,11 @@ Lang::$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
|
||||
|
||||
@@ -238,12 +238,6 @@ Lang::$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',
|
||||
|
||||
@@ -137,6 +137,7 @@ Lang::$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 @@ Lang::$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 @@ Lang::$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',
|
||||
@@ -308,6 +303,10 @@ Lang::$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
|
||||
|
||||
@@ -279,13 +279,6 @@ Lang::$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' => 'Ημερομηνία και ώρα',
|
||||
|
||||
@@ -11,7 +11,6 @@ Lang::$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.'),
|
||||
);
|
||||
|
||||
@@ -222,11 +222,6 @@ Lang::$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',
|
||||
@@ -261,7 +256,6 @@ Lang::$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' => 'Actualizar',
|
||||
@@ -276,8 +270,8 @@ Lang::$translations = array(
|
||||
'HH:MM:SS' => 'HH:MM:SS',
|
||||
|
||||
'Loaded plugins' => 'Plugins cargados',
|
||||
// '<b>%s</b> must return an array.' => '<b>%s</b> tiene que retornar un arreglo.',
|
||||
// 'Configure <b>%s</b> in <b>%s</b>.' => 'Configurar <b>%s</b> en <b>%s</b>.',
|
||||
'%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.',
|
||||
|
||||
@@ -214,11 +214,6 @@ Lang::$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 @@ Lang::$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',
|
||||
|
||||
@@ -277,13 +277,6 @@ Lang::$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' => 'تاریخ و زمان',
|
||||
|
||||
@@ -279,13 +279,6 @@ Lang::$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',
|
||||
|
||||
@@ -212,11 +212,6 @@ Lang::$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',
|
||||
@@ -252,7 +247,6 @@ Lang::$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.'),
|
||||
|
||||
@@ -214,11 +214,6 @@ Lang::$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 @@ Lang::$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',
|
||||
|
||||
@@ -212,11 +212,6 @@ Lang::$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 @@ Lang::$translations = array(
|
||||
'Network' => 'רשת',
|
||||
'Geometry' => 'גיאומטריה',
|
||||
'File exists.' => 'קובץ קיים',
|
||||
'Attachments' => 'קבצים מצורפים',
|
||||
'Item%s has been inserted.' => 'הפריט %s הוזן בהצלחה',
|
||||
'now' => 'כעת',
|
||||
'%d query(s) executed OK.' => '%d שאילתות בוצעו בהצלחה',
|
||||
|
||||
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
|
||||
364
adminer/lang/hr.inc.php
Normal file
364
adminer/lang/hr.inc.php
Normal file
@@ -0,0 +1,364 @@
|
||||
<?php
|
||||
namespace Adminer;
|
||||
|
||||
Lang::$translations = array(
|
||||
// label for database system selection (MySQL, SQLite, ...)
|
||||
'System' => 'Sustav',
|
||||
'Server' => 'Poslužitelj',
|
||||
'Username' => 'Korisničko ime',
|
||||
'Password' => 'Lozinka',
|
||||
'Permanent login' => 'Trajna prijava',
|
||||
'Login' => 'Prijava',
|
||||
'Logout' => 'Odjava',
|
||||
'Logged as: %s' => 'Prijavljen kao: %s',
|
||||
'Logout successful.' => 'Uspješna odjava.',
|
||||
'Invalid credentials.' => 'Neispravni podaci za prijavu.',
|
||||
'Language' => 'Jezik',
|
||||
'Invalid CSRF token. Send the form again.' => 'Nevažeći CSRF token. Pošaljite obrazac ponovo.',
|
||||
'No extension' => 'Nema proširenja',
|
||||
'None of the supported PHP extensions (%s) are available.' => 'Nijedno od podržanih PHP proširenja (%s) nije dostupno.',
|
||||
'Session support must be enabled.' => 'Podrška za sesije mora biti uključena.',
|
||||
'Session expired, please login again.' => 'Sesija je istekla, molimo prijavite se ponovo.',
|
||||
'%s version: %s through PHP extension %s' => '%s verzija: %s putem PHP proširenja %s',
|
||||
'Refresh' => 'Osvježi',
|
||||
|
||||
// text direction - 'ltr' or 'rtl'
|
||||
'ltr' => 'ltr',
|
||||
|
||||
'Privileges' => 'Ovlasti',
|
||||
'Create user' => 'Novi korisnik',
|
||||
'User has been dropped.' => 'Korisnik je izbrisan.',
|
||||
'User has been altered.' => 'Korisnik je izmijenjen.',
|
||||
'User has been created.' => 'Korisnik je kreiran.',
|
||||
'Hashed' => 'Hashirano',
|
||||
'Column' => 'Stupac',
|
||||
'Routine' => 'Rutina',
|
||||
'Grant' => 'Dodijeli',
|
||||
'Revoke' => 'Opozovi',
|
||||
|
||||
'Process list' => 'Popis procesa',
|
||||
'%d process(es) have been killed.' => array('%d proces je zaustavljen.', '%d procesa su zaustavljena.', '%d procesa je zaustavljeno.'),
|
||||
'Kill' => 'Zaustavi',
|
||||
|
||||
'Variables' => 'Varijable',
|
||||
'Status' => 'Status',
|
||||
|
||||
'SQL command' => 'SQL naredba',
|
||||
'%d query(s) executed OK.' => array('%d upit je uspješno izvršen.', '%d upita su uspješno izvršena.', '%d upita je uspješno izvršeno.'),
|
||||
'Query executed OK, %d row(s) affected.' => array('Upit je uspješno izvršen, %d redak je ažuriran.', 'Upit je uspješno izvršen, %d retka su ažurirana.', 'Upit je uspješno izvršen, %d redaka je ažurirano.'),
|
||||
'No commands to execute.' => 'Nema naredbi za izvršavanje.',
|
||||
'Error in query' => 'Greška u upitu',
|
||||
'Execute' => 'Izvrši',
|
||||
'Stop on error' => 'Zaustavi pri grešci',
|
||||
'Show only errors' => 'Prikaži samo greške',
|
||||
// sprintf() format for time of the command
|
||||
'%.3f s' => '%.3f s',
|
||||
'History' => 'Povijest',
|
||||
'Clear' => 'Očisti',
|
||||
'Edit all' => 'Uredi sve',
|
||||
|
||||
'File upload' => 'Prijenos datoteke',
|
||||
'From server' => 'S poslužitelja',
|
||||
'Webserver file %s' => 'Datoteka %s s web poslužitelja',
|
||||
'Run file' => 'Pokreni datoteku',
|
||||
'File does not exist.' => 'Datoteka ne postoji.',
|
||||
'File uploads are disabled.' => 'Prijenos datoteka je onemogućen.',
|
||||
'Unable to upload a file.' => 'Prijenos datoteke nije uspio.',
|
||||
'Maximum allowed file size is %sB.' => 'Maksimalna dozvoljena veličina datoteke je %sB.',
|
||||
'Too big POST data. Reduce the data or increase the %s configuration directive.' => 'Preveliki POST podaci. Smanjite podatke ili povećajte vrijednost konfiguracijske direktive %s.',
|
||||
|
||||
'Export' => 'Izvoz',
|
||||
'Output' => 'Ispis',
|
||||
'open' => 'otvori',
|
||||
'save' => 'spremi',
|
||||
'Format' => 'Format',
|
||||
'Data' => 'Podaci',
|
||||
|
||||
'Database' => 'Baza podataka',
|
||||
'Use' => 'Koristi',
|
||||
'Select database' => 'Odaberite bazu',
|
||||
'Invalid database.' => 'Neispravna baza podataka.',
|
||||
'Database has been dropped.' => 'Baza podataka je izbrisana.',
|
||||
'Databases have been dropped.' => 'Baze podataka su izbrisane.',
|
||||
'Database has been created.' => 'Baza podataka je kreirana.',
|
||||
'Database has been renamed.' => 'Baza podataka je preimenovana.',
|
||||
'Database has been altered.' => 'Baza podataka je izmijenjena.',
|
||||
'Alter database' => 'Izmijeni bazu podataka',
|
||||
'Create database' => 'Kreiraj bazu podataka',
|
||||
'Database schema' => 'Shema baze podataka',
|
||||
|
||||
// link to current database schema layout
|
||||
'Permanent link' => 'Trajna veza',
|
||||
|
||||
// thousands separator - must contain single byte
|
||||
',' => '.',
|
||||
'0123456789' => '0123456789',
|
||||
'Engine' => 'Motor',
|
||||
'Collation' => 'Uspoređivanje',
|
||||
'Data Length' => 'Duljina podataka',
|
||||
'Index Length' => 'Duljina indeksa',
|
||||
'Data Free' => 'Slobodan prostor',
|
||||
'Rows' => 'Redaka',
|
||||
'%d in total' => 'ukupno %d',
|
||||
'Analyze' => 'Analiziraj',
|
||||
'Optimize' => 'Optimiziraj',
|
||||
'Check' => 'Provjeri',
|
||||
'Repair' => 'Popravi',
|
||||
'Truncate' => 'Isprazni',
|
||||
'Tables have been truncated.' => 'Tablice su ispražnjene.',
|
||||
'Move to other database' => 'Premjesti u drugu bazu podataka',
|
||||
'Move' => 'Premjesti',
|
||||
'Tables have been moved.' => 'Tablice su premještene.',
|
||||
'Copy' => 'Kopiraj',
|
||||
'Tables have been copied.' => 'Tablice su kopirane.',
|
||||
|
||||
'Routines' => 'Rutine',
|
||||
'Routine has been called, %d row(s) affected.' => array('Rutina je pozvana, %d redak je ažuriran.', 'Rutina je pozvana, %d retka su ažurirana.', 'Rutina je pozvana, %d redaka je ažurirano.'),
|
||||
'Call' => 'Pozovi',
|
||||
'Parameter name' => 'Naziv parametra',
|
||||
'Create procedure' => 'Kreiraj proceduru',
|
||||
'Create function' => 'Kreiraj funkciju',
|
||||
'Routine has been dropped.' => 'Rutina je izbrisana.',
|
||||
'Routine has been altered.' => 'Rutina je izmijenjena.',
|
||||
'Routine has been created.' => 'Rutina je kreirana.',
|
||||
'Alter function' => 'Izmijeni funkciju',
|
||||
'Alter procedure' => 'Izmijeni proceduru',
|
||||
'Return type' => 'Tip povratne vrijednosti',
|
||||
|
||||
'Events' => 'Događaji',
|
||||
'Event has been dropped.' => 'Događaj je izbrisan.',
|
||||
'Event has been altered.' => 'Događaj je izmijenjen.',
|
||||
'Event has been created.' => 'Događaj je kreiran.',
|
||||
'Alter event' => 'Izmijeni događaj',
|
||||
'Create event' => 'Kreiraj događaj',
|
||||
'At given time' => 'U zadano vrijeme',
|
||||
'Every' => 'Svako',
|
||||
'Schedule' => 'Raspored',
|
||||
'Start' => 'Početak',
|
||||
'End' => 'Kraj',
|
||||
'On completion preserve' => 'Zadrži po završetku',
|
||||
|
||||
'Tables' => 'Tablice',
|
||||
'Tables and views' => 'Tablice i pogledi',
|
||||
'Table' => 'Tablica',
|
||||
'No tables.' => 'Nema tablica.',
|
||||
'Alter table' => 'Izmijeni tablicu',
|
||||
'Create table' => 'Kreiraj tablicu',
|
||||
'Table has been dropped.' => 'Tablica je izbrisana.',
|
||||
'Tables have been dropped.' => 'Tablice su izbrisane.',
|
||||
'Tables have been optimized.' => 'Tablice su optimizirane.',
|
||||
'Table has been altered.' => 'Tablica je izmijenjena.',
|
||||
'Table has been created.' => 'Tablica je kreirana.',
|
||||
'Table name' => 'Naziv tablice',
|
||||
'Show structure' => 'Prikaži strukturu',
|
||||
'engine' => 'motor',
|
||||
'collation' => 'uspoređivanje',
|
||||
'Column name' => 'Naziv stupca',
|
||||
'Type' => 'Tip',
|
||||
'Length' => 'Duljina',
|
||||
'Auto Increment' => 'Auto-inkrement',
|
||||
'Options' => 'Opcije',
|
||||
'Comment' => 'Komentar',
|
||||
'Default values' => 'Zadane vrijednosti',
|
||||
'Drop' => 'Izbriši',
|
||||
'Are you sure?' => 'Jeste li sigurni?',
|
||||
'Move up' => 'Pomakni gore',
|
||||
'Move down' => 'Pomakni dolje',
|
||||
'Remove' => 'Ukloni',
|
||||
'Maximum number of allowed fields exceeded. Please increase %s.' => 'Premašen je maksimalni broj dozvoljenih polja. Molimo povećajte %s.',
|
||||
|
||||
'Partition by' => 'Particioniraj po',
|
||||
'Partitions' => 'Particije',
|
||||
'Partition name' => 'Naziv particije',
|
||||
'Values' => 'Vrijednosti',
|
||||
|
||||
'View' => 'Pogled',
|
||||
'View has been dropped.' => 'Pogled je izbrisan.',
|
||||
'View has been altered.' => 'Pogled je izmijenjen.',
|
||||
'View has been created.' => 'Pogled je kreiran.',
|
||||
'Alter view' => 'Izmijeni pogled',
|
||||
'Create view' => 'Kreiraj pogled',
|
||||
|
||||
'Indexes' => 'Indeksi',
|
||||
'Indexes have been altered.' => 'Indeksi su izmijenjeni.',
|
||||
'Alter indexes' => 'Izmijeni indekse',
|
||||
'Add next' => 'Dodaj sljedeći',
|
||||
'Index Type' => 'Tip indeksa',
|
||||
'length' => 'duljina',
|
||||
|
||||
'Foreign keys' => 'Strani ključevi',
|
||||
'Foreign key' => 'Strani ključ',
|
||||
'Foreign key has been dropped.' => 'Strani ključ je izbrisan.',
|
||||
'Foreign key has been altered.' => 'Strani ključ je izmijenjen.',
|
||||
'Foreign key has been created.' => 'Strani ključ je kreiran.',
|
||||
'Target table' => 'Ciljna tablica',
|
||||
'Change' => 'Izmijeni',
|
||||
'Source' => 'Izvor',
|
||||
'Target' => 'Cilj',
|
||||
'Add column' => 'Dodaj stupac',
|
||||
'Alter' => 'Izmijeni',
|
||||
'Add foreign key' => 'Dodaj strani ključ',
|
||||
'ON DELETE' => 'ON DELETE (pri brisanju)',
|
||||
'ON UPDATE' => 'ON UPDATE (pri ažuriranju)',
|
||||
'Source and target columns must have the same data type, there must be an index on the target columns and referenced data must exist.' => 'Izvorni i ciljni stupci moraju biti istog tipa podataka, ciljni stupci moraju biti indeksirani i referencirani podaci moraju postojati.',
|
||||
|
||||
'Triggers' => 'Okidači',
|
||||
'Add trigger' => 'Dodaj okidač',
|
||||
'Trigger has been dropped.' => 'Okidač je izbrisan.',
|
||||
'Trigger has been altered.' => 'Okidač je izmijenjen.',
|
||||
'Trigger has been created.' => 'Okidač je kreiran.',
|
||||
'Alter trigger' => 'Izmijeni okidač',
|
||||
'Create trigger' => 'Kreiraj okidač',
|
||||
'Time' => 'Vrijeme',
|
||||
'Event' => 'Događaj',
|
||||
'Name' => 'Naziv',
|
||||
|
||||
'select' => 'odaberi',
|
||||
'Select' => 'Odaberi',
|
||||
'Selected' => 'Odabrano',
|
||||
'Select data' => 'Odaberi podatke',
|
||||
'Functions' => 'Funkcije',
|
||||
'Aggregation' => 'Agregacija',
|
||||
'Search' => 'Pretraži',
|
||||
'anywhere' => 'bilo gdje',
|
||||
'Search data in tables' => 'Pretraži podatke u tablicama',
|
||||
'Sort' => 'Sortiraj',
|
||||
'descending' => 'silazno',
|
||||
'Limit' => 'Ograničenje',
|
||||
'Text length' => 'Duljina teksta',
|
||||
'Action' => 'Radnja',
|
||||
'Full table scan' => 'Puno pretraživanje tablice',
|
||||
'Unable to select the table' => 'Nije moguće odabrati tablicu',
|
||||
'No rows.' => 'Nema redaka.',
|
||||
'%d row(s)' => array('%d redak', '%d retka', '%d redaka'),
|
||||
'Page' => 'Stranica',
|
||||
'last' => 'posljednja',
|
||||
'Loading' => 'Učitavanje',
|
||||
'Load more data' => 'Učitaj više podataka',
|
||||
'Whole result' => 'Cijeli skup rezultata',
|
||||
'%d byte(s)' => array('%d bajt', '%d bajta', '%d bajtova'),
|
||||
|
||||
'Import' => 'Uvoz',
|
||||
'%d row(s) have been imported.' => array('%d redak je uvezen.', '%d retka su uvezena.', '%d redaka je uvezeno.'),
|
||||
|
||||
// in-place editing in select
|
||||
'Ctrl+click on a value to modify it.' => 'Ctrl+klik na vrijednost za izmjenu.',
|
||||
'Use edit link to modify this value.' => 'Koristite vezu za uređivanje ove vrijednosti.',
|
||||
|
||||
// %s can contain auto-increment value
|
||||
'Item%s has been inserted.' => 'Stavka %s je unesena.',
|
||||
'Item has been deleted.' => 'Stavka je izbrisana.',
|
||||
'Item has been updated.' => 'Stavka je ažurirana.',
|
||||
'%d item(s) have been affected.' => array('%d stavka je zahvaćena.', '%d stavke su zahvaćene.', '%d stavki je zahvaćeno.'),
|
||||
'New item' => 'Nova stavka',
|
||||
'original' => 'original',
|
||||
// label for value '' in enum data type
|
||||
'empty' => 'prazno',
|
||||
'edit' => 'uredi',
|
||||
'Edit' => 'Uredi',
|
||||
'Insert' => 'Unesi',
|
||||
'Save' => 'Spremi',
|
||||
'Save and continue edit' => 'Spremi i nastavi uređivanje',
|
||||
'Save and insert next' => 'Spremi i unesi sljedeće',
|
||||
'Clone' => 'Kloniraj',
|
||||
'Delete' => 'Izbriši',
|
||||
'Modify' => 'Izmijeni',
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Brojevi',
|
||||
'Date and time' => 'Datum i vrijeme',
|
||||
'Strings' => 'Tekst',
|
||||
'Binary' => 'Binarno',
|
||||
'Lists' => 'Liste',
|
||||
'Network' => 'Mreža',
|
||||
'Geometry' => 'Geometrija',
|
||||
'Relations' => 'Odnosi',
|
||||
|
||||
'Editor' => 'Uređivač',
|
||||
// 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' => 'HH:MM:SS',
|
||||
'now' => 'sada',
|
||||
'yes' => 'da',
|
||||
'no' => 'ne',
|
||||
|
||||
// general SQLite error in create, drop or rename database
|
||||
'File exists.' => 'Datoteka već postoji.',
|
||||
'Please use one of the extensions %s.' => 'Molimo koristite jedan od nastavaka %s.',
|
||||
|
||||
// PostgreSQL and MS SQL schema support
|
||||
'Alter schema' => 'Izmijeni shemu',
|
||||
'Create schema' => 'Kreiraj shemu',
|
||||
'Schema has been dropped.' => 'Shema je izbrisana.',
|
||||
'Schema has been created.' => 'Shema je kreirana.',
|
||||
'Schema has been altered.' => 'Shema je izmijenjena.',
|
||||
'Schema' => 'Shema',
|
||||
'Invalid schema.' => 'Neispravna shema.',
|
||||
|
||||
// PostgreSQL sequences support
|
||||
'Sequences' => 'Nizovi',
|
||||
'Create sequence' => 'Kreiraj niz',
|
||||
'Sequence has been dropped.' => 'Niz je izbrisan.',
|
||||
'Sequence has been created.' => 'Niz je kreiran.',
|
||||
'Sequence has been altered.' => 'Niz je izmijenjen.',
|
||||
'Alter sequence' => 'Izmijeni niz',
|
||||
|
||||
// PostgreSQL user types support
|
||||
'User types' => 'Korisnički tipovi',
|
||||
'Create type' => 'Kreiraj tip',
|
||||
'Type has been dropped.' => 'Tip je izbrisan.',
|
||||
'Type has been created.' => 'Tip je kreiran.',
|
||||
'Alter type' => 'Izmijeni tip',
|
||||
|
||||
// MS SQL login
|
||||
'Too many unsuccessful logins, try again in %d minute(s).' => array('Previše neuspješnih pokušaja prijave, pokušajte ponovo za %d minutu.', 'Previše neuspješnih pokušaja prijave, pokušajte ponovo za %d minute.', 'Previše neuspješnih pokušaja prijave, pokušajte ponovo za %d minuta.'),
|
||||
'Check has been dropped.' => 'Provjera je izbrisana.',
|
||||
'Check has been altered.' => 'Provjera je izmijenjena.',
|
||||
'Check has been created.' => 'Provjera je kreirana.',
|
||||
'Alter check' => 'Izmijeni provjeru',
|
||||
'Create check' => 'Kreiraj provjeru',
|
||||
'Drop %s?' => 'Izbrisati %s?',
|
||||
'Vacuum' => 'Vakuumiranje',
|
||||
'overwrite' => 'prepiši',
|
||||
'Disable %s or enable %s or %s extensions.' => 'Onemogućite %s ili omogućite %s ili %s proširenja.',
|
||||
'Database does not support password.' => 'Baza podataka ne podržava lozinku.',
|
||||
'DB' => 'BP',
|
||||
'hostname[:port] or :socket' => 'hostname[:port] ili :socket',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer ne podržava pristup bazi podataka bez lozinke, <a href="https://www.adminer.org/en/password/"%s>više informacija</a>.',
|
||||
'Warnings' => 'Upozorenja',
|
||||
'Default value' => 'Zadana vrijednost',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Hvala što koristite Adminer, razmislite o <a href="https://www.adminer.org/en/donation/">donaciji</a>.',
|
||||
'Master password expired. <a href="https://www.adminer.org/en/extension/"%s>Implement</a> %s method to make it permanent.' => 'Glavna lozinka je istekla. <a href="https://www.adminer.org/en/extension/"%s>Implementirajte</a> metodu %s kako biste je učinili trajnom.',
|
||||
'The action will be performed after successful login with the same credentials.' => 'Radnja će biti izvršena nakon uspješne prijave s istim podacima.',
|
||||
'Connecting to privileged ports is not allowed.' => 'Spajanje na privilegirane portove nije dopušteno.',
|
||||
'There is a space in the input password which might be the cause.' => 'U unesenoj lozinci postoji razmak koji bi mogao biti uzrok problema.',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Ako ovaj zahtjev niste poslali iz Adminera, zatvorite ovu stranicu.',
|
||||
'You can upload a big SQL file via FTP and import it from server.' => 'Veliku SQL datoteku možete prenijeti putem FTP-a i uvesti je s poslužitelja.',
|
||||
'Size' => 'Veličina',
|
||||
'Compute' => 'Izračunaj',
|
||||
'Loaded plugins' => 'Učitani dodaci',
|
||||
'screenshot' => 'snimka zaslona',
|
||||
'You are offline.' => 'Niste povezani s mrežom.',
|
||||
'Increase %s.' => 'Povećajte %s.',
|
||||
'You have no privileges to update this table.' => 'Nemate ovlasti za ažuriranje ove tablice.',
|
||||
'Saving' => 'Spremanje',
|
||||
'Unknown error.' => 'Nepoznata greška.',
|
||||
'%s must <a%s>return an array</a>.' => '%s mora <a%s>vratiti niz</a>.',
|
||||
'<a%s>Configure</a> %s in %s.' => '<a%s>Konfigurirajte</a> %s u %s.',
|
||||
'Algorithm' => 'Algoritam',
|
||||
'Columns' => 'Stupci',
|
||||
'Condition' => 'Uvjet',
|
||||
'File must be in UTF-8 encoding.' => 'Datoteka mora biti u UTF-8 kodiranju.',
|
||||
'ATTACH queries are not supported.' => 'ATTACH upiti nisu podržani.',
|
||||
'%d / ' => '%d / ',
|
||||
'Limit rows' => 'Ograniči retke',
|
||||
'Materialized view' => 'Materijaliziran pogled',
|
||||
'Inherits from' => 'Nasljeđuje od',
|
||||
'Checks' => 'Provjere',
|
||||
'Inherited by' => 'Nasljeđeno od',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php hr` to update this file
|
||||
@@ -206,11 +206,6 @@ Lang::$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 @@ Lang::$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',
|
||||
|
||||
@@ -259,13 +259,6 @@ Lang::$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',
|
||||
|
||||
@@ -214,11 +214,6 @@ Lang::$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 @@ Lang::$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',
|
||||
|
||||
@@ -5,13 +5,13 @@ Lang::$translations = array(
|
||||
'Login' => 'ログイン',
|
||||
'Logout successful.' => 'ログアウトしました。',
|
||||
'Invalid credentials.' => '不正なログインです。',
|
||||
'Server' => 'サーバ',
|
||||
'Username' => 'ユーザ名',
|
||||
'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>。',
|
||||
'<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.' => 'データベースがパスワードに対応していません。',
|
||||
@@ -20,14 +20,14 @@ Lang::$translations = array(
|
||||
'Select database' => 'データベースを選択してください',
|
||||
'Invalid database.' => '不正なデータベースです。',
|
||||
'Table has been dropped.' => 'テーブルを削除しました。',
|
||||
'Table has been altered.' => 'テーブルを変更しました。',
|
||||
'Table has been altered.' => 'テーブルの設定を変更しました。',
|
||||
'Table has been created.' => 'テーブルを作成しました。',
|
||||
'Alter table' => 'テーブルを変更',
|
||||
'Alter table' => 'テーブルの設定を変更',
|
||||
'Create table' => 'テーブルを作成',
|
||||
'Table name' => 'テーブル名',
|
||||
'engine' => 'エンジン',
|
||||
'collation' => '照合順序',
|
||||
'Column name' => '列名',
|
||||
'collation' => 'コレーション',
|
||||
'Column name' => 'カラム名',
|
||||
'Type' => '型',
|
||||
'Length' => '長さ',
|
||||
'Auto Increment' => '連番',
|
||||
@@ -38,16 +38,16 @@ Lang::$translations = array(
|
||||
'Database has been dropped.' => 'データベースを削除しました。',
|
||||
'Database has been created.' => 'データベースを作成しました。',
|
||||
'Database has been renamed.' => 'データベースの名前を変えました。',
|
||||
'Database has been altered.' => 'データベースを変更しました。',
|
||||
'Alter database' => 'データベースを変更',
|
||||
'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 has been deleted.' => 'レコードを削除しました。',
|
||||
'Item has been updated.' => 'レコードを更新しました。',
|
||||
'Edit' => '編集',
|
||||
'Insert' => '挿入',
|
||||
'Save and insert next' => '保存/追加',
|
||||
@@ -56,18 +56,18 @@ Lang::$translations = array(
|
||||
'Database' => 'データベース',
|
||||
'DB' => 'DB',
|
||||
'Routines' => 'ルーチン',
|
||||
'Indexes have been altered.' => '索引を変更しました。',
|
||||
'Indexes' => '索引',
|
||||
'Alter indexes' => '索引の変更',
|
||||
'Indexes have been altered.' => 'インデックスを変更しました。',
|
||||
'Indexes' => 'インデックス',
|
||||
'Alter indexes' => 'インデックスを変更',
|
||||
'Add next' => '追加',
|
||||
'Language' => '言語',
|
||||
'Select' => '選択',
|
||||
'New item' => '項目の作成',
|
||||
'New item' => '新規レコードを挿入',
|
||||
'Search' => '検索',
|
||||
'Sort' => 'ソート',
|
||||
'descending' => '降順',
|
||||
'Limit' => '制約',
|
||||
'Limit rows' => '行数の制約',
|
||||
'Limit rows' => '表示行数を制限',
|
||||
'No rows.' => '行がありません。',
|
||||
'Action' => '動作',
|
||||
'edit' => '編集',
|
||||
@@ -82,17 +82,17 @@ Lang::$translations = array(
|
||||
'Foreign keys' => '外部キー',
|
||||
'Triggers' => 'トリガー',
|
||||
'View' => 'ビュー',
|
||||
'Materialized view' => 'マテビュー',
|
||||
'Full table scan' => 'テーブルの全スキャン',
|
||||
'Materialized view' => 'マテリアライズドビュー',
|
||||
'Full table scan' => 'テーブルを全スキャン',
|
||||
'Unable to select the table' => 'テーブルを選択できません',
|
||||
'Invalid CSRF token. Send the form again.' => '不正なCSRFトークン。再送信してください。',
|
||||
'If you did not send this request from Adminer then close this page.' => 'Adminerからのリクエストを送信しない場合はこのページを閉じてください。',
|
||||
'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' => '規定値',
|
||||
'Default values' => '既定値',
|
||||
'%d byte(s)' => '%d バイト',
|
||||
'No commands to execute.' => '実行するコマンドがありません。',
|
||||
'Unable to upload a file.' => 'ファイルをアップロードできません。',
|
||||
'File upload' => 'ファイルをアップロード',
|
||||
'File upload' => 'アップロード',
|
||||
'File uploads are disabled.' => 'ファイルのアップロードが無効です。',
|
||||
'Routine has been called, %d row(s) affected.' => 'ルーチンを呼びました。%d 行を変更しました。',
|
||||
'Call' => '呼出し',
|
||||
@@ -103,21 +103,21 @@ Lang::$translations = array(
|
||||
'Session support must be enabled.' => 'セッションを有効にしてください。',
|
||||
'Session expired, please login again.' => 'セッションの期限切れ。ログインし直してください。',
|
||||
'The action will be performed after successful login with the same credentials.' => '同じアカウントで正しくログインすると作業を実行します。',
|
||||
'Text length' => '文字列の長さ',
|
||||
'Text length' => '文字数を丸める',
|
||||
'Foreign key has been dropped.' => '外部キーを削除しました。',
|
||||
'Foreign key has been altered.' => '外部キーを変更しました。',
|
||||
'Foreign key has been created.' => '外部キーを作成しました。',
|
||||
'Foreign key' => '外キー',
|
||||
'Target table' => 'テーブル',
|
||||
'Foreign key' => '外部キー',
|
||||
'Target table' => '対象テーブル',
|
||||
'Change' => '変更',
|
||||
'Source' => 'ソース',
|
||||
'Target' => 'ターゲット',
|
||||
'Add column' => '列を追加',
|
||||
'Add column' => 'カラムを追加',
|
||||
'Alter' => '変更',
|
||||
'Add foreign key' => '外部キーを追加',
|
||||
'ON DELETE' => 'ON DELETE',
|
||||
'ON UPDATE' => 'ON UPDATE',
|
||||
'Index Type' => '索引の型',
|
||||
'Index Type' => 'インデックスの型',
|
||||
'length' => '長さ',
|
||||
'View has been dropped.' => 'ビューを削除しました。',
|
||||
'View has been altered.' => 'ビューを変更しました。',
|
||||
@@ -126,25 +126,25 @@ Lang::$translations = array(
|
||||
'Create view' => 'ビューを作成',
|
||||
'Name' => '名称',
|
||||
'Process list' => 'プロセス一覧',
|
||||
'%d process(es) have been killed.' => '%d プロセスを強制終了しました。',
|
||||
'Kill' => '強制終了',
|
||||
'Parameter name' => '参数名',
|
||||
'Database schema' => '構造',
|
||||
'Create procedure' => 'プロシージャの作成',
|
||||
'Create function' => '関数の作成',
|
||||
'Routine has been dropped.' => 'ルーチンを作成しました。',
|
||||
'%d process(es) have been killed.' => '%d プロセスを終了しました。',
|
||||
'Kill' => 'プロセスを終了',
|
||||
'Parameter name' => 'パラメータ名',
|
||||
'Database schema' => 'スキーマ',
|
||||
'Create procedure' => 'プロシージャを作成',
|
||||
'Create function' => '関数を作成',
|
||||
'Routine has been dropped.' => 'ルーチンを削除しました。',
|
||||
'Routine has been altered.' => 'ルーチンを変更しました。',
|
||||
'Routine has been created.' => 'ルーチンを作成しました。',
|
||||
'Alter function' => '関数の変更',
|
||||
'Alter procedure' => 'プロシージャの変更',
|
||||
'Alter function' => '関数を変更',
|
||||
'Alter procedure' => 'プロシージャを変更',
|
||||
'Return type' => '戻り値の型',
|
||||
'Add trigger' => 'トリガーの追加',
|
||||
'Add trigger' => 'トリガーを追加',
|
||||
'Trigger has been dropped.' => 'トリガーを削除しました。',
|
||||
'Trigger has been altered.' => 'トリガーを変更しました。',
|
||||
'Trigger has been created.' => 'トリガーを追加しました。',
|
||||
'Alter trigger' => 'トリガーの変更',
|
||||
'Create trigger' => 'トリガーの作成',
|
||||
'Time' => '時間',
|
||||
'Alter trigger' => 'トリガーを変更',
|
||||
'Create trigger' => 'トリガーを作成',
|
||||
'Time' => 'タイミング',
|
||||
'Event' => 'イベント',
|
||||
'%s version: %s through PHP extension %s' => '%sバージョン:%s、 PHP拡張機能 %s',
|
||||
'%d / ' => '%d / ',
|
||||
@@ -157,10 +157,11 @@ Lang::$translations = array(
|
||||
'User has been altered.' => 'ユーザを変更しました。',
|
||||
'User has been created.' => 'ユーザを作成しました。',
|
||||
'Hashed' => 'Hashed',
|
||||
'Column' => '列',
|
||||
'Column' => 'カラム',
|
||||
'Columns' => 'カラム',
|
||||
'Routine' => 'ルーチン',
|
||||
'Grant' => '権限の付与',
|
||||
'Revoke' => '権限の取消し',
|
||||
'Grant' => '権限を付与',
|
||||
'Revoke' => '権限を取り消す',
|
||||
'Logged as: %s' => 'ログ:%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経由でアップロードしてサーバからインポートしてください。',
|
||||
@@ -171,16 +172,16 @@ Lang::$translations = array(
|
||||
'Tables' => 'テーブル',
|
||||
'Data' => 'データ',
|
||||
'Output' => '出力',
|
||||
'open' => '開く',
|
||||
'open' => 'ブラウザに表示',
|
||||
'save' => '保存',
|
||||
'Format' => '形式',
|
||||
'Functions' => '関数',
|
||||
'Aggregation' => '集合',
|
||||
'Aggregation' => '集約関数',
|
||||
'Event has been dropped.' => 'イベントを削除しました。',
|
||||
'Event has been altered.' => 'イベントを変更しました。',
|
||||
'Event has been created.' => 'イベントを作成しました。',
|
||||
'Alter event' => '変更',
|
||||
'Create event' => '作成',
|
||||
'Alter event' => 'イベントを変更',
|
||||
'Create event' => 'イベントを作成',
|
||||
'Start' => '開始',
|
||||
'End' => '終了',
|
||||
'Every' => '毎回',
|
||||
@@ -193,24 +194,24 @@ Lang::$translations = array(
|
||||
'Tables have been moved.' => 'テーブルを移動しました。',
|
||||
'Tables and views' => 'テーブルとビュー',
|
||||
'Engine' => 'エンジン',
|
||||
'Collation' => '照合順序',
|
||||
'Collation' => 'コレーション',
|
||||
'Data Length' => 'データ長',
|
||||
'Index Length' => '索引長',
|
||||
'Index Length' => 'インデックス長',
|
||||
'Data Free' => '空き',
|
||||
'Rows' => '行数',
|
||||
',' => ',',
|
||||
'0123456789' => '0123456789',
|
||||
'Analyze' => '分析',
|
||||
'Optimize' => '最適化',
|
||||
'Vacuum' => '不要領域の回収',
|
||||
'Check' => 'チェック',
|
||||
'Vacuum' => '不要領域を回収(Vacuum)',
|
||||
'Check' => '検査',
|
||||
'Repair' => '修復',
|
||||
'Truncate' => '空にする',
|
||||
'Move to other database' => '別のデータベースへ移動',
|
||||
'Move to other database' => '他のデータベースへ移動',
|
||||
'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 optimized.' => 'テーブルを最適化しました。',
|
||||
@@ -222,7 +223,7 @@ Lang::$translations = array(
|
||||
'Values' => '値',
|
||||
'%d row(s) have been imported.' => '%d 行をインポートしました。',
|
||||
'File must be in UTF-8 encoding.' => 'ファイルをUTF-8で保存してください。',
|
||||
'Show structure' => '構造',
|
||||
'Show structure' => 'スキーマ',
|
||||
'anywhere' => '任意',
|
||||
'Import' => 'インポート',
|
||||
'Stop on error' => 'エラーの場合は停止',
|
||||
@@ -232,9 +233,9 @@ Lang::$translations = array(
|
||||
'[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.' => 'ソースとターゲットの列は同じデータ型でなければなりません。ターゲット列に索引があり、データが存在しなければなりません。',
|
||||
'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' => 'ファイルを実行',
|
||||
'Run file' => '実行',
|
||||
'Clear' => '消去',
|
||||
'Maximum allowed file size is %sB.' => '最大ファイルサイズは %sB です。',
|
||||
'Numbers' => '数字',
|
||||
@@ -243,12 +244,7 @@ Lang::$translations = array(
|
||||
'Binary' => 'バイナリ',
|
||||
'Lists' => 'リスト',
|
||||
'Editor' => 'エディタ',
|
||||
'E-mail' => 'メール',
|
||||
'From' => '差出人',
|
||||
'Subject' => '題名',
|
||||
'Send' => '送信',
|
||||
'%d e-mail(s) have been sent.' => '%d メールを送信しました。',
|
||||
'Webserver file %s' => 'Webサーバファイル %s',
|
||||
'Webserver file %s' => 'ファイル名 %s',
|
||||
'File does not exist.' => 'ファイルは存在しません。',
|
||||
'%d in total' => '合計 %d',
|
||||
'Permanent login' => '永続的にログイン',
|
||||
@@ -272,16 +268,15 @@ Lang::$translations = array(
|
||||
'Type has been dropped.' => 'ユーザー定義型を削除しました。',
|
||||
'Type has been created.' => 'ユーザー定義型を追加しました。',
|
||||
'Ctrl+click on a value to modify it.' => 'Ctrl+クリックで値を修正します。',
|
||||
'Use edit link to modify this value.' => 'この値を修正するとリンクを編集します。',
|
||||
'Use edit link to modify this value.' => 'この値を修正するにはリンクを使用してください。',
|
||||
'last' => '最終',
|
||||
'From server' => 'サーバーから実行',
|
||||
'From server' => 'サーバー上のファイル',
|
||||
'System' => 'データベース種類',
|
||||
'empty' => '空',
|
||||
'Network' => 'ネットワーク型',
|
||||
'Geometry' => 'ジオメトリ型',
|
||||
'File exists.' => 'ファイルが既に存在します。',
|
||||
'Attachments' => '添付ファイル',
|
||||
'Item%s has been inserted.' => '%s項目を挿入しました。',
|
||||
'Item%s has been inserted.' => '%sレコードを挿入しました。',
|
||||
'now' => '現在の日時',
|
||||
'%d query(s) executed OK.' => '%d クエリーを実行しました。',
|
||||
'Show only errors' => 'エラーのみ表示',
|
||||
@@ -292,27 +287,30 @@ Lang::$translations = array(
|
||||
'Tables have been copied.' => 'テーブルをコピーしました。',
|
||||
'Copy' => 'コピー',
|
||||
'overwrite' => '上書き',
|
||||
'Permanent link' => 'パーマネントリンク',
|
||||
'Edit all' => 'すべて編集',
|
||||
'Permanent link' => '固定リンク',
|
||||
'Edit all' => '一括編集',
|
||||
'Selected' => '選択中',
|
||||
'Modify' => '編集',
|
||||
'Load more data' => 'さらにデータを表示',
|
||||
'Compute' => '再計算',
|
||||
'Saving' => '保存しています...',
|
||||
'Checks' => 'CHECK制約',
|
||||
'Create check' => 'CHECK制約を追加',
|
||||
'Alter check' => 'CHECK制約を編集',
|
||||
'Check has been created.' => 'CHECK制約を追加しました。',
|
||||
'Check has been altered.' => 'CHECK制約を編集しました。',
|
||||
'Check has been dropped.' => 'CHECK制約を削除しました。',
|
||||
|
||||
'screenshot' => 'スクリーンショット',
|
||||
'Algorithm' => 'アルゴリズム',
|
||||
'Condition' => '条件',
|
||||
'Inherits from' => '継承元',
|
||||
'HH:MM:SS' => '時:分:秒',
|
||||
'Selected' => '選択済',
|
||||
'Modify' => '修正',
|
||||
'Load more data' => '続きを読み込み',
|
||||
'Loading' => '読み込み中',
|
||||
'Size' => 'サイズ',
|
||||
'Compute' => '算出',
|
||||
'Saving' => '保存中',
|
||||
'yes' => 'はい',
|
||||
'no' => 'いいえ',
|
||||
'Default value' => '既定値',
|
||||
|
||||
// Table check constraints
|
||||
'Checks' => 'チェック',
|
||||
'Create check' => 'チェックを作成',
|
||||
'Alter check' => 'チェックを変更',
|
||||
'Check has been created.' => 'チェックを作成しました。',
|
||||
'Check has been altered.' => 'チェックを変更しました。',
|
||||
'Check has been dropped.' => 'チェックを削除しました。',
|
||||
);
|
||||
|
||||
// run `php ../../lang.php ja` to update this file
|
||||
|
||||
@@ -210,11 +210,6 @@ Lang::$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 @@ Lang::$translations = array(
|
||||
'Network' => 'ქსელი',
|
||||
'Geometry' => 'გეომეტრია',
|
||||
'File exists.' => 'ფაილი უკვე არსებობს.',
|
||||
'Attachments' => 'მიმაგრებული ფაილები',
|
||||
'%d query(s) executed OK.' => '%d მოთხოვნა შესრულდა.',
|
||||
'Show only errors' => 'მხოლოდ შეცდომები',
|
||||
'Refresh' => 'განახლება',
|
||||
|
||||
@@ -5,7 +5,6 @@ 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 @@ Lang::$translations = array(
|
||||
'anywhere' => '모든',
|
||||
'Are you sure?' => '실행 하시겠습니까?',
|
||||
'At given time' => '지정 시간',
|
||||
'Attachments' => '첨부 파일',
|
||||
'Auto Increment' => '자동 증가',
|
||||
'Binary' => '이진',
|
||||
'Call' => '호출',
|
||||
@@ -80,7 +78,6 @@ Lang::$translations = array(
|
||||
'Delete' => '삭제',
|
||||
'descending' => '역순',
|
||||
'Drop' => '삭제',
|
||||
'E-mail' => '메일',
|
||||
'Edit all' => '모두 편집',
|
||||
'Edit' => '편집',
|
||||
'edit' => '편집',
|
||||
@@ -109,7 +106,6 @@ Lang::$translations = array(
|
||||
'Foreign keys' => '외부 키',
|
||||
'Format' => '형식',
|
||||
'From server' => '서버에서 실행',
|
||||
'From' => '보낸 사람',
|
||||
'Functions' => '함수',
|
||||
'Geometry' => '기하 형',
|
||||
'Grant' => '권한 부여',
|
||||
@@ -211,7 +207,6 @@ Lang::$translations = array(
|
||||
'Select' => '선택',
|
||||
'select' => '선택',
|
||||
'Selected' => '선택됨',
|
||||
'Send' => '보내기',
|
||||
'Sequence has been altered.' => '시퀀스를 변경했습니다.',
|
||||
'Sequence has been created.' => '시퀀스를 추가했습니다.',
|
||||
'Sequence has been dropped.' => '시퀀스를 제거했습니다.',
|
||||
@@ -230,7 +225,6 @@ Lang::$translations = array(
|
||||
'Status' => '상태',
|
||||
'Stop on error' => '오류의 경우 중지',
|
||||
'Strings' => '문자열',
|
||||
'Subject' => '제목',
|
||||
'System' => '데이터베이스 형식',
|
||||
'Table has been altered.' => '테이블을 변경했습니다.',
|
||||
'Table has been created.' => '테이블을 만들었습니다.',
|
||||
|
||||
@@ -257,13 +257,6 @@ Lang::$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',
|
||||
|
||||
@@ -214,11 +214,6 @@ Lang::$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',
|
||||
@@ -253,7 +248,6 @@ Lang::$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',
|
||||
|
||||
@@ -283,13 +283,6 @@ Lang::$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',
|
||||
|
||||
@@ -215,11 +215,6 @@ Lang::$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',
|
||||
@@ -253,7 +248,6 @@ Lang::$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',
|
||||
|
||||
@@ -238,12 +238,6 @@ Lang::$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',
|
||||
|
||||
@@ -13,9 +13,6 @@ Lang::$translations = array(
|
||||
'Logged as: %s' => 'Zalogowany jako: %s',
|
||||
'Logout successful.' => 'Wylogowano pomyślnie.',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Dziękujemy za używanie Adminera, rozważ <a href="https://www.adminer.org/pl/donation/">dotację</a>.',
|
||||
'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.',
|
||||
'Invalid credentials.' => 'Nieprawidłowe dane logowania.',
|
||||
'There is a space in the input password which might be the cause.' => 'W haśle wejściowym znajduje się spacja, która może być przyczyną.',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Adminer nie obsługuje dostępu do bazy danych bez hasła, <a href="https://www.adminer.org/pl/password/"%s>więcej informacji</a>.',
|
||||
@@ -45,6 +42,7 @@ Lang::$translations = array(
|
||||
'User has been created.' => 'Użytkownik został dodany.',
|
||||
'Hashed' => 'Zahashowane',
|
||||
'Column' => 'Kolumna',
|
||||
'Columns' => 'Kolumny',
|
||||
'Routine' => 'Procedura',
|
||||
'Grant' => 'Uprawnienia',
|
||||
'Revoke' => 'Usuń uprawnienia',
|
||||
@@ -78,6 +76,7 @@ Lang::$translations = array(
|
||||
'Webserver file %s' => 'Plik %s na serwerze',
|
||||
'Run file' => 'Uruchom z pliku',
|
||||
'File does not exist.' => 'Plik nie istnieje.',
|
||||
'Increase %s.' => 'Zwiększ %s.',
|
||||
'File uploads are disabled.' => 'Wgrywanie plików jest wyłączone.',
|
||||
'Unable to upload a file.' => 'Wgranie pliku było niemożliwe.',
|
||||
'Maximum allowed file size is %sB.' => 'Maksymalna wielkość pliku to %sB.',
|
||||
@@ -89,6 +88,7 @@ Lang::$translations = array(
|
||||
'Output' => 'Rezultat',
|
||||
'open' => 'otwórz',
|
||||
'save' => 'zapisz',
|
||||
'Saving' => 'Zapisywanie',
|
||||
'Format' => 'Format',
|
||||
'Data' => 'Dane',
|
||||
|
||||
@@ -196,6 +196,8 @@ Lang::$translations = array(
|
||||
'Partitions' => 'Partycje',
|
||||
'Partition name' => 'Nazwa partycji',
|
||||
'Values' => 'Wartości',
|
||||
'Inherits from' => 'Dziedziczy po',
|
||||
'Inherited by' => 'Odziedziczone przez',
|
||||
|
||||
'View' => 'Perspektywa',
|
||||
'Materialized view' => 'Zmaterializowana perspektywa',
|
||||
@@ -211,6 +213,8 @@ Lang::$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',
|
||||
@@ -287,7 +291,6 @@ Lang::$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',
|
||||
@@ -295,13 +298,6 @@ Lang::$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',
|
||||
@@ -358,6 +354,11 @@ Lang::$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
|
||||
|
||||
@@ -214,11 +214,6 @@ Lang::$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 @@ Lang::$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',
|
||||
|
||||
@@ -214,11 +214,6 @@ Lang::$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 @@ Lang::$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',
|
||||
|
||||
@@ -214,11 +214,6 @@ Lang::$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 @@ Lang::$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ă',
|
||||
|
||||
@@ -214,11 +214,6 @@ Lang::$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 @@ Lang::$translations = array(
|
||||
'Network' => 'Сеть',
|
||||
'Geometry' => 'Геометрия',
|
||||
'File exists.' => 'Файл уже существует.',
|
||||
'Attachments' => 'Прикреплённые файлы',
|
||||
'%d query(s) executed OK.' => array('%d запрос выполнен успешно.', '%d запроса выполнено успешно.', '%d запросов выполнено успешно.'),
|
||||
'Show only errors' => 'Только ошибки',
|
||||
'Refresh' => 'Обновить',
|
||||
|
||||
@@ -205,11 +205,6 @@ Lang::$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 @@ Lang::$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ť',
|
||||
|
||||
@@ -254,13 +254,6 @@ Lang::$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',
|
||||
|
||||
@@ -262,13 +262,6 @@ Lang::$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' => 'Датум и време',
|
||||
|
||||
@@ -292,13 +292,6 @@ Lang::$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',
|
||||
|
||||
@@ -212,11 +212,6 @@ Lang::$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 @@ Lang::$translations = array(
|
||||
'Network' => 'நெட்வொர்க்',
|
||||
'Geometry' => 'வடிவவியல் (Geometry)',
|
||||
'File exists.' => 'கோப்பு உள்ளது.',
|
||||
'Attachments' => 'இணைப்புகள்',
|
||||
'now' => 'இப்பொழுது',
|
||||
'%d query(s) executed OK.' => array('%d வினவல் செயல்படுத்தப்பட்டது.', '%d வினவல்கள் செயல்படுத்தப்பட்டன.'),
|
||||
'Show only errors' => 'பிழைகளை மட்டும் காண்பிக்கவும்',
|
||||
|
||||
@@ -214,11 +214,6 @@ Lang::$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 @@ Lang::$translations = array(
|
||||
'Network' => 'เครื่องข่าย',
|
||||
'Geometry' => 'เรขาคณิต',
|
||||
'File exists.' => 'มีไฟล์นี้อยู่แล้ว.',
|
||||
'Attachments' => 'ไฟล์แนบ',
|
||||
'%d query(s) executed OK.' => '%d คำสั่งถูกดำเนินการแล้ว.',
|
||||
'Show only errors' => 'แสดงเฉพาะเออเรอ',
|
||||
'Refresh' => 'โหลดใหม่',
|
||||
|
||||
@@ -286,13 +286,6 @@ Lang::$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',
|
||||
|
||||
@@ -259,13 +259,6 @@ Lang::$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' => 'Дата і час',
|
||||
|
||||
@@ -297,13 +297,6 @@ Lang::$translations = array(
|
||||
'Delete' => 'O\'chirish',
|
||||
'You have no privileges to update this table.' => 'Bu jadvalni yangilash uchun sizda huquqlar yo\'q.',
|
||||
|
||||
'E-mail' => 'E-pochta',
|
||||
'From' => 'Kimdan',
|
||||
'Subject' => 'Mavzu',
|
||||
'Attachments' => 'Ilovalar',
|
||||
'Send' => 'Yuborish',
|
||||
'%d e-mail(s) have been sent.' => array('%d e-pochta yuborildi.', '%d e-pochtalar yuborildi.'),
|
||||
|
||||
// data type descriptions
|
||||
'Numbers' => 'Raqamlar',
|
||||
'Date and time' => 'Sana va vaqt',
|
||||
|
||||
@@ -271,13 +271,6 @@ Lang::$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ờ',
|
||||
|
||||
@@ -13,9 +13,7 @@ Lang::$translations = array(
|
||||
'Logged as: %s' => 'Xx: %s',
|
||||
'Logout successful.' => 'Xx.',
|
||||
'Thanks for using Adminer, consider <a href="https://www.adminer.org/en/donation/">donating</a>.' => 'Xx <a href="https://www.adminer.org/en/donation/">xx</a>.',
|
||||
'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.',
|
||||
'hostname[:port] or :socket' => 'xx',
|
||||
'Invalid credentials.' => 'Xx.',
|
||||
'There is a space in the input password which might be the cause.' => 'Xx.',
|
||||
'Adminer does not support accessing a database without a password, <a href="https://www.adminer.org/en/password/"%s>more information</a>.' => 'Xx, <a href="https://www.adminer.org/en/password/"%s>xx</a>.',
|
||||
@@ -46,6 +44,7 @@ Lang::$translations = array(
|
||||
'User has been created.' => 'Xx.',
|
||||
'Hashed' => 'Xx',
|
||||
'Column' => 'Xx',
|
||||
'Columns' => 'Xx',
|
||||
'Routine' => 'Xx',
|
||||
'Grant' => 'Xx',
|
||||
'Revoke' => 'Xx',
|
||||
@@ -79,6 +78,7 @@ Lang::$translations = array(
|
||||
'Webserver file %s' => 'Xx %s',
|
||||
'Run file' => 'Xx',
|
||||
'File does not exist.' => 'Xx.',
|
||||
'Increase %s.' => 'Xx %s.',
|
||||
'File uploads are disabled.' => 'Xx.',
|
||||
'Unable to upload a file.' => 'Xx.',
|
||||
'Maximum allowed file size is %sB.' => 'Xx %sB.',
|
||||
@@ -198,6 +198,8 @@ Lang::$translations = array(
|
||||
'Partitions' => 'Xx',
|
||||
'Partition name' => 'Xx',
|
||||
'Values' => 'Xx',
|
||||
'Inherits from' => 'Xx',
|
||||
'Inherited by' => 'Xx',
|
||||
|
||||
'View' => 'Xx',
|
||||
'Materialized view' => 'Xx',
|
||||
@@ -213,6 +215,8 @@ Lang::$translations = array(
|
||||
'Add next' => 'Xx',
|
||||
'Index Type' => 'Xx',
|
||||
'length' => 'xx',
|
||||
'Algorithm' => 'Xx',
|
||||
'Condition' => 'Xx',
|
||||
|
||||
'Foreign keys' => 'Xx',
|
||||
'Foreign key' => 'Xx',
|
||||
@@ -297,13 +301,6 @@ Lang::$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',
|
||||
@@ -360,6 +357,11 @@ Lang::$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
|
||||
|
||||
@@ -292,13 +292,6 @@ Lang::$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' => '日期時間',
|
||||
|
||||
@@ -208,7 +208,6 @@ Lang::$translations = array(
|
||||
'Alter indexes' => '修改索引',
|
||||
'Add next' => '下一行插入',
|
||||
'Index Type' => '索引类型',
|
||||
// 'Column (length)' => '列(长度)',
|
||||
|
||||
'Foreign keys' => '外键',
|
||||
'Foreign key' => '外键',
|
||||
@@ -292,13 +291,6 @@ Lang::$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' => '日期时间',
|
||||
|
||||
@@ -48,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">
|
||||
@@ -56,13 +56,13 @@ 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>
|
||||
<?php echo script("editFields();"); ?>
|
||||
</div>
|
||||
<p><?php textarea("definition", $row["definition"]); ?>
|
||||
<p><?php textarea("definition", $row["definition"], 20); ?>
|
||||
<p>
|
||||
<input type="submit" value="<?php echo lang('Save'); ?>">
|
||||
<?php if ($PROCEDURE != "") { ?>
|
||||
|
||||
@@ -5,7 +5,7 @@ if (support("kill")) {
|
||||
if ($_POST && !$error) {
|
||||
$killed = 0;
|
||||
foreach ((array) $_POST["kill"] as $val) {
|
||||
if (kill_process($val)) {
|
||||
if (adminer()->killProcess($val)) {
|
||||
$killed++;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ page_header(lang('Process list'), $error);
|
||||
echo script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});");
|
||||
// HTML valid because there is always at least one process
|
||||
$i = -1;
|
||||
foreach (process_list() as $i => $row) {
|
||||
foreach (adminer()->processList() as $i => $row) {
|
||||
if (!$i) {
|
||||
echo "<thead><tr lang='en'>" . (support("kill") ? "<th>" : "");
|
||||
foreach ($row as $key => $val) {
|
||||
|
||||
@@ -18,7 +18,8 @@ $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
|
||||
/** @var array<numeric-string, bool> */
|
||||
$lefts = array();
|
||||
$all_fields = driver()->allFields();
|
||||
foreach (table_status('', true) as $table => $table_status) {
|
||||
if (is_view($table_status)) {
|
||||
@@ -102,16 +103,18 @@ foreach ($schema as $name => $table) {
|
||||
|
||||
foreach ($schema as $name => $table) {
|
||||
foreach ((array) $table["references"] as $target_name => $refs) {
|
||||
foreach ($refs as $left => $ref) {
|
||||
$min_pos = $top;
|
||||
$max_pos = -10;
|
||||
foreach ($ref[0] as $key => $source) {
|
||||
$pos1 = $table["pos"][0] + $table["fields"][$source]["pos"];
|
||||
$pos2 = $schema[$target_name]["pos"][0] + $schema[$target_name]["fields"][$ref[1][$key]]["pos"];
|
||||
$min_pos = min($min_pos, $pos1, $pos2);
|
||||
$max_pos = max($max_pos, $pos1, $pos2);
|
||||
if ($schema[$target_name]) { // otherwise table in another schema
|
||||
foreach ($refs as $left => $ref) {
|
||||
$min_pos = $top;
|
||||
$max_pos = -10;
|
||||
foreach ($ref[0] as $key => $source) {
|
||||
$pos1 = $table["pos"][0] + $table["fields"][$source]["pos"];
|
||||
$pos2 = $schema[$target_name]["pos"][0] + $schema[$target_name]["fields"][$ref[1][$key]]["pos"];
|
||||
$min_pos = min($min_pos, $pos1, $pos2);
|
||||
$max_pos = max($max_pos, $pos1, $pos2);
|
||||
}
|
||||
echo "<div class='references' id='refl$left' style='left: $left" . "em; top: $min_pos" . "em; padding: .5em 0;'><div style='border-right: 1px solid gray; margin-top: 1px; height: " . ($max_pos - $min_pos) . "em;'></div></div>\n";
|
||||
}
|
||||
echo "<div class='references' id='refl$left' style='left: $left" . "em; top: $min_pos" . "em; padding: .5em 0;'><div style='border-right: 1px solid gray; margin-top: 1px; height: " . ($max_pos - $min_pos) . "em;'></div></div>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ if ($_GET["script"] == "db") {
|
||||
$sums = array("Data_length" => 0, "Index_length" => 0, "Data_free" => 0);
|
||||
foreach (table_status() as $name => $table_status) {
|
||||
json_row("Comment-$name", h($table_status["Comment"]));
|
||||
if (!is_view($table_status)) {
|
||||
if (!is_view($table_status) || preg_match('~materialized~i', $table_status["Engine"])) {
|
||||
foreach (array("Engine", "Collation") as $key) {
|
||||
json_row("$key-$name", h($table_status[$key]));
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ if ($_GET["val"] && is_ajax()) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$primary = $unselected = null;
|
||||
$primary = $unselected = array();
|
||||
foreach ($indexes as $index) {
|
||||
if ($index["type"] == "PRIMARY") {
|
||||
$primary = array_flip($index["columns"]);
|
||||
@@ -271,6 +271,7 @@ if (!$columns && support("table")) {
|
||||
echo "</form>\n";
|
||||
|
||||
$page = $_GET["page"];
|
||||
$found_rows = null;
|
||||
if ($page == "last") {
|
||||
$found_rows = get_val(count_rows($TABLE, $where, $is_group, $group));
|
||||
$page = floor(max(0, intval($found_rows) - 1) / $limit);
|
||||
@@ -352,17 +353,14 @@ if (!$columns && support("table")) {
|
||||
$desc = "&desc%5B0%5D=1";
|
||||
echo "<th id='th[" . h(bracket_escape($key)) . "]'>" . script("mixin(qsl('th'), {onmouseover: partial(columnMouse), onmouseout: partial(columnMouse, ' hidden')});", "");
|
||||
$fun = apply_sql_function($val["fun"], $name); //! columns looking like functions
|
||||
$sortable = isset($field["privileges"]["order"]) || $fun;
|
||||
echo ($sortable ? '<a href="' . h($href . ($order[0] == $column || $order[0] == $key || (!$order && $is_group && $group[0] == $column) ? $desc : '')) . '">' . "$fun</a>" : $fun); // $order[0] == $key - COUNT(*)
|
||||
echo "<span class='column hidden'>";
|
||||
if ($sortable) {
|
||||
echo "<a href='" . h($href . $desc) . "' title='" . lang('descending') . "' class='text'> ↓</a>";
|
||||
}
|
||||
$sortable = isset($field["privileges"]["order"]) || $fun != $name;
|
||||
echo ($sortable ? "<a href='" . h($href . ($order[0] == $column || $order[0] == $key ? $desc : '')) . "'>$fun</a>" : $fun); // $order[0] == $key - COUNT(*)
|
||||
$menu = ($sortable ? "<a href='" . h($href . $desc) . "' title='" . lang('descending') . "' class='text'> ↓</a>" : '');
|
||||
if (!$val["fun"] && isset($field["privileges"]["where"])) {
|
||||
echo '<a href="#fieldset-search" title="' . lang('Search') . '" class="text jsonly"> =</a>';
|
||||
echo script("qsl('a').onclick = partial(selectSearch, '" . js_escape($key) . "');");
|
||||
$menu .= '<a href="#fieldset-search" title="' . lang('Search') . '" class="text jsonly"> =</a>';
|
||||
$menu .= script("qsl('a').onclick = partial(selectSearch, '" . js_escape($key) . "');");
|
||||
}
|
||||
echo "</span>";
|
||||
echo ($menu ? "<span class='column hidden'>$menu</span>" : "");
|
||||
}
|
||||
$functions[$key] = $val["fun"];
|
||||
next($select);
|
||||
@@ -388,10 +386,12 @@ if (!$columns && support("table")) {
|
||||
$unique_array = unique_array($rows[$n], $indexes);
|
||||
if (!$unique_array) {
|
||||
$unique_array = array();
|
||||
reset($select);
|
||||
foreach ($rows[$n] as $key => $val) {
|
||||
if (!preg_match('~^(COUNT\((\*|(DISTINCT )?`(?:[^`]|``)+`)\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\(`(?:[^`]|``)+`\))$~', $key)) { //! columns looking like functions
|
||||
if (!preg_match('~^(COUNT|AVG|GROUP_CONCAT|MAX|MIN|SUM)\(~', current($select))) {
|
||||
$unique_array[$key] = $val;
|
||||
}
|
||||
next($select);
|
||||
}
|
||||
}
|
||||
$unique_idf = "";
|
||||
@@ -409,16 +409,17 @@ if (!$columns && support("table")) {
|
||||
. ($is_group || information_schema(DB) ? "" : " <a href='" . h(ME . "edit=" . urlencode($TABLE) . $unique_idf) . "' class='edit'>" . lang('edit') . "</a>")
|
||||
);
|
||||
|
||||
reset($select);
|
||||
foreach ($row as $key => $val) {
|
||||
if (isset($names[$key])) {
|
||||
$column = current($select);
|
||||
$field = (array) $fields[$key];
|
||||
$val = driver()->value($val, $field);
|
||||
if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) {
|
||||
$email_fields[$key] = (is_mail($val) ? $names[$key] : ""); //! filled e-mails can be contained on other pages
|
||||
}
|
||||
|
||||
$link = "";
|
||||
if (preg_match('~blob|bytea|raw|file~', $field["type"]) && $val != "") {
|
||||
if (is_blob($field) && $val != "") {
|
||||
$link = ME . 'download=' . urlencode($TABLE) . '&field=' . urlencode($key) . $unique_idf;
|
||||
}
|
||||
if (!$link && $val !== null) { // link related items
|
||||
@@ -438,7 +439,7 @@ if (!$columns && support("table")) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($key == "COUNT(*)") { //! columns looking like functions
|
||||
if ($column == "COUNT(*)") {
|
||||
$link = ME . "select=" . urlencode($TABLE);
|
||||
$i = 0;
|
||||
foreach ((array) $_GET["where"] as $v) {
|
||||
@@ -451,23 +452,28 @@ if (!$columns && support("table")) {
|
||||
}
|
||||
}
|
||||
|
||||
$val = select_value($val, $link, $field, $text_length);
|
||||
$html = select_value($val, $link, $field, $text_length);
|
||||
$id = h("val[$unique_idf][" . bracket_escape($key) . "]");
|
||||
$value = idx(idx($_POST["val"], $unique_idf), bracket_escape($key));
|
||||
$editable = !is_array($row[$key]) && is_utf8($val) && $rows[$n][$key] == $row[$key] && !$functions[$key] && !$field["generated"];
|
||||
$text = preg_match('~text|json|lob~', $field["type"]);
|
||||
echo "<td id='$id'" . (preg_match(number_type(), $field["type"]) && ($val == '<i>NULL</i>' || is_numeric(strip_tags($val))) ? " class='number'" : "");
|
||||
if (($_GET["modify"] && $editable) || $value !== null) {
|
||||
$h_value = h($value !== null ? $value : $row[$key]);
|
||||
$posted = idx(idx($_POST["val"], $unique_idf), bracket_escape($key));
|
||||
$update = idx($field["privileges"], "update");
|
||||
$editable = !is_array($row[$key]) && is_utf8($html) && $rows[$n][$key] == $row[$key] && !$functions[$key] && !$field["generated"] && $update;
|
||||
$type = (preg_match('~^(AVG|MIN|MAX)\((.+)\)~', $column, $match) ? $fields[idf_unescape($match[2])]["type"] : $field["type"]);
|
||||
$text = preg_match('~text|json|lob~', $type);
|
||||
$is_number = preg_match(number_type(), $type) || preg_match('~^(CHAR_LENGTH|ROUND|FLOOR|CEIL|TIME_TO_SEC|COUNT|SUM)\(~', $column);
|
||||
echo "<td id='$id'" . ($is_number && ($val === null || is_numeric(strip_tags($html)) || $type == "money") ? " class='number'" : "");
|
||||
if (($_GET["modify"] && $editable && $val !== null) || $posted !== null) {
|
||||
$h_value = h($posted !== null ? $posted : $row[$key]);
|
||||
echo ">" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>");
|
||||
} else {
|
||||
$long = strpos($val, "<i>…</i>");
|
||||
echo " data-text='" . ($long ? 2 : ($text ? 1 : 0)) . "'"
|
||||
. ($editable ? "" : " data-warning='" . h(lang('Use edit link to modify this value.')) . "'")
|
||||
. ">$val"
|
||||
;
|
||||
$long = strpos($html, "<i>…</i>");
|
||||
echo ($update
|
||||
? " data-text='" . ($long ? 2 : ($text ? 1 : 0)) . "'"
|
||||
. ($editable ? "" : " data-warning='" . h(lang('Use edit link to modify this value.')) . "'")
|
||||
: ""
|
||||
) . ">$html";
|
||||
}
|
||||
}
|
||||
next($select);
|
||||
}
|
||||
|
||||
if ($backward_keys) {
|
||||
@@ -487,7 +493,6 @@ if (!$columns && support("table")) {
|
||||
if (!is_ajax()) {
|
||||
if ($rows || $page) {
|
||||
$exact_count = true;
|
||||
$found_rows = null;
|
||||
if ($_GET["page"] != "last") {
|
||||
if (!$limit || (count($rows) < $limit && ($rows || !$page))) {
|
||||
$found_rows = ($page ? $page * $limit : 0) + count($rows);
|
||||
@@ -496,7 +501,7 @@ if (!$columns && support("table")) {
|
||||
if (intval($found_rows) < max(1e4, 2 * ($page + 1) * $limit)) {
|
||||
// slow with big tables
|
||||
$found_rows = first(slow_query(count_rows($TABLE, $where, $is_group, $group)));
|
||||
} else {
|
||||
} elseif (JUSH == 'sql' || JUSH == 'pgsql') {
|
||||
$exact_count = false;
|
||||
}
|
||||
}
|
||||
@@ -584,15 +589,15 @@ if (!$columns && support("table")) {
|
||||
}
|
||||
|
||||
if (adminer()->selectImportPrint()) {
|
||||
echo "<div>";
|
||||
echo "<p>";
|
||||
echo "<a href='#import'>" . lang('Import') . "</a>";
|
||||
echo script("qsl('a').onclick = partial(toggle, 'import');", "");
|
||||
echo "<span id='import'" . ($_POST["import"] ? "" : " class='hidden'") . ">: ";
|
||||
echo "<input type='file' name='csv_file'> ";
|
||||
echo html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;", "tsv" => "TSV"), $adminer_import["format"]);
|
||||
echo " <input type='submit' name='import' value='" . lang('Import') . "'>";
|
||||
echo file_input("<input type='file' name='csv_file'> "
|
||||
. html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;", "tsv" => "TSV"), $adminer_import["format"])
|
||||
. " <input type='submit' name='import' value='" . lang('Import') . "'>")
|
||||
;
|
||||
echo "</span>";
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
echo input_token();
|
||||
|
||||
@@ -4,9 +4,13 @@ namespace Adminer;
|
||||
if (!$error && $_POST["export"]) {
|
||||
save_settings(array("output" => $_POST["output"], "format" => $_POST["format"]), "adminer_import");
|
||||
dump_headers("sql");
|
||||
adminer()->dumpTable("", "");
|
||||
adminer()->dumpData("", "table", $_POST["query"]);
|
||||
adminer()->dumpFooter();
|
||||
if ($_POST["format"] == "sql") {
|
||||
echo "$_POST[query]\n";
|
||||
} else {
|
||||
adminer()->dumpTable("", "");
|
||||
adminer()->dumpData("", "table", $_POST["query"]);
|
||||
adminer()->dumpFooter();
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -20,6 +24,7 @@ if (!$error && $_POST["clear"]) {
|
||||
stop_session();
|
||||
|
||||
page_header((isset($_GET["import"]) ? lang('Import') : lang('SQL command')), $error);
|
||||
$line_comment = '--' . (JUSH == 'sql' ? ' ' : '');
|
||||
|
||||
if (!$error && $_POST) {
|
||||
$fp = false;
|
||||
@@ -51,11 +56,11 @@ if (!$error && $_POST) {
|
||||
}
|
||||
}
|
||||
|
||||
$space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|-- )[^\n]*\n?|--\r?\n)";
|
||||
$delimiter = ";";
|
||||
$space = "(?:\\s|/\\*[\s\S]*?\\*/|(?:#|$line_comment)[^\n]*\n?|--\r?\n)";
|
||||
$delimiter = driver()->delimiter;
|
||||
$offset = 0;
|
||||
$empty = true;
|
||||
$connection2 = connect(adminer()->credentials()); // connection for exploring indexes and EXPLAIN (to not replace FOUND_ROWS()) //! PDO - silent error
|
||||
$connection2 = connect(); // connection for exploring indexes and EXPLAIN (to not replace FOUND_ROWS()) //! PDO - silent error
|
||||
if ($connection2 && DB != "") {
|
||||
$connection2->select_db(DB);
|
||||
if ($_GET["ns"] != "") {
|
||||
@@ -64,18 +69,19 @@ if (!$error && $_POST) {
|
||||
}
|
||||
$commands = 0;
|
||||
$errors = array();
|
||||
$parse = '[\'"' . (JUSH == "sql" ? '`#' : (JUSH == "sqlite" ? '`[' : (JUSH == "mssql" ? '[' : ''))) . ']|/\*|-- |$' . (JUSH == "pgsql" ? '|\$[^$]*\$' : '');
|
||||
$parse = '[\'"' . (JUSH == "sql" ? '`#' : (JUSH == "sqlite" ? '`[' : (JUSH == "mssql" ? '[' : ''))) . ']|/\*|' . $line_comment . '|$' . (JUSH == "pgsql" ? '|\$([a-zA-Z]\w*)?\$' : '');
|
||||
$total_start = microtime(true);
|
||||
$adminer_export = get_settings("adminer_import"); // this doesn't offer SQL export so we match the import/export style at select
|
||||
$dump_format = adminer()->dumpFormat();
|
||||
unset($dump_format["sql"]);
|
||||
|
||||
while ($query != "") {
|
||||
if (!$offset && preg_match("~^$space*+DELIMITER\\s+(\\S+)~i", $query, $match)) {
|
||||
$delimiter = $match[1];
|
||||
$delimiter = preg_quote($match[1]);
|
||||
$query = substr($query, strlen($match[0]));
|
||||
} elseif (!$offset && JUSH == 'pgsql' && preg_match("~^($space*+COPY\\s+)[^;]+\\s+FROM\\s+stdin;~i", $query, $match)) {
|
||||
$delimiter = "\n\\\\\\.\r?\n";
|
||||
$offset = strlen($match[0]);
|
||||
} else {
|
||||
preg_match('(' . preg_quote($delimiter) . "\\s*|$parse)", $query, $match, PREG_OFFSET_CAPTURE, $offset); // should always match
|
||||
preg_match("($delimiter\\s*|$parse)", $query, $match, PREG_OFFSET_CAPTURE, $offset); // always matches
|
||||
list($found, $pos) = $match[0];
|
||||
if (!$found && $fp && !feof($fp)) {
|
||||
$query .= fread($fp, 1e5);
|
||||
@@ -85,14 +91,15 @@ if (!$error && $_POST) {
|
||||
}
|
||||
$offset = $pos + strlen($found);
|
||||
|
||||
if ($found && rtrim($found) != $delimiter) { // find matching quote or comment end
|
||||
if ($found && !preg_match("(^$delimiter)", $found)) { // find matching quote or comment end
|
||||
$c_style_escapes = driver()->hasCStyleEscapes() || (JUSH == "pgsql" && ($pos > 0 && strtolower($query[$pos - 1]) == "e"));
|
||||
|
||||
$pattern = ($found == '/*' ? '\*/'
|
||||
: ($found == '[' ? ']'
|
||||
: (preg_match('~^-- |^#~', $found) ? "\n"
|
||||
: preg_quote($found) . ($c_style_escapes ? "|\\\\." : "")))
|
||||
);
|
||||
$pattern =
|
||||
($found == '/*' ? '\*/' :
|
||||
($found == '[' ? ']' :
|
||||
(preg_match("~^$line_comment|^#~", $found) ? "\n" :
|
||||
preg_quote($found) . ($c_style_escapes ? '|\\\\.' : ''))))
|
||||
;
|
||||
|
||||
while (preg_match("($pattern|\$)s", $query, $match, PREG_OFFSET_CAPTURE, $offset)) {
|
||||
$s = $match[0][0];
|
||||
@@ -108,7 +115,7 @@ if (!$error && $_POST) {
|
||||
|
||||
} else { // end of a query
|
||||
$empty = false;
|
||||
$q = substr($query, 0, $pos);
|
||||
$q = substr($query, 0, $pos + ($delimiter[0] == "\n" ? 3 : 0)); // 3 - pass "\n\\." to PostgreSQL COPY
|
||||
$commands++;
|
||||
$print = "<pre id='sql-$commands'><code class='jush-" . JUSH . "'>" . adminer()->sqlCommandQuery($q) . "</code></pre>\n";
|
||||
if (JUSH == "sqlite" && preg_match("~^$space*+ATTACH\\b~i", $q, $match)) {
|
||||
@@ -169,7 +176,7 @@ if (!$error && $_POST) {
|
||||
$id = "export-$commands";
|
||||
echo ", <a href='#$id'>" . lang('Export') . "</a>" . script("qsl('a').onclick = partial(toggle, '$id');", "") . "<span id='$id' class='hidden'>: "
|
||||
. html_select("output", adminer()->dumpOutput(), $adminer_export["output"]) . " "
|
||||
. html_select("format", $dump_format, $adminer_export["format"])
|
||||
. html_select("format", adminer()->dumpFormat(), $adminer_export["format"])
|
||||
. input_hidden("query", $q)
|
||||
. "<input type='submit' name='export' value='" . lang('Export') . "'>" . input_token() . "</span>\n"
|
||||
. "</form>\n"
|
||||
@@ -243,12 +250,9 @@ if (!isset($_GET["import"])) {
|
||||
echo lang('Limit rows') . ": <input type='number' name='limit' class='size' value='" . h($_POST ? $_POST["limit"] : $_GET["limit"]) . "'>\n";
|
||||
|
||||
} else {
|
||||
echo "<fieldset><legend>" . lang('File upload') . "</legend><div>";
|
||||
$gz = (extension_loaded("zlib") ? "[.gz]" : "");
|
||||
echo (ini_bool("file_uploads")
|
||||
? "SQL$gz (< " . ini_get("upload_max_filesize") . "B): <input type='file' name='sql_file[]' multiple>\n$execute" // ignore post_max_size because it is for all form fields together and bytes computing would be necessary
|
||||
: lang('File uploads are disabled.')
|
||||
);
|
||||
echo "<fieldset><legend>" . lang('File upload') . "</legend><div>";
|
||||
echo file_input("SQL$gz: <input type='file' name='sql_file[]' multiple>\n$execute");
|
||||
echo "</div></fieldset>\n";
|
||||
$importServerPath = adminer()->importServerPath();
|
||||
if ($importServerPath) {
|
||||
@@ -271,7 +275,7 @@ if (!isset($_GET["import"]) && $history) {
|
||||
list($q, $time, $elapsed) = $val;
|
||||
echo '<a href="' . h(ME . "sql=&history=$key") . '">' . lang('Edit') . "</a>"
|
||||
. " <span class='time' title='" . @date('Y-m-d', $time) . "'>" . @date("H:i:s", $time) . "</span>" // @ - time zone may be not set
|
||||
. " <code class='jush-" . JUSH . "'>" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace('~^(#|-- ).*~m', '', $q)))), 80, "</code>")
|
||||
. " <code class='jush-" . JUSH . "'>" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace("~^(#|$line_comment).*~m", '', $q)))), 80, "</code>")
|
||||
. ($elapsed ? " <span class='time'>($elapsed)</span>" : "")
|
||||
. "<br>\n"
|
||||
;
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
html {
|
||||
--bg: #002240;
|
||||
--fg: #829bb0;
|
||||
--dim: #154269;
|
||||
--lit: #011d35;
|
||||
}
|
||||
|
||||
a { color: #517fa8; }
|
||||
a:visited { color: #517fa8; }
|
||||
a, a:visited { color: #618cb3; }
|
||||
a:link:hover, a:visited:hover { color: #9bc0e1; }
|
||||
h1 { border-color: #5e94c1; color: #ffddbf; background: #154269; }
|
||||
h1 { border-color: #5e94c1; color: #ffddbf; }
|
||||
h2 { border-color: #a3bdd3; color: #000; background: #3c678d; }
|
||||
table, td, th { border-color: #0e416d; }
|
||||
table, td, th, .js .column { border-color: #0e416d; }
|
||||
th { background: #11385a; }
|
||||
thead td, thead th { color: #a8b05f; background: #011d35; }
|
||||
thead th a { color: #a8b05f; }
|
||||
thead td, thead th, thead th a { color: #a8b05f; }
|
||||
fieldset { border-color: #16548a; }
|
||||
code { background: #11385a; }
|
||||
tbody tr:hover td, tbody tr:hover th { background: #133553; }
|
||||
@@ -21,7 +21,6 @@ pre.jush { background: #11385a; }
|
||||
input.default { box-shadow: 1px 1px 1px #888; }
|
||||
input.required, input.maxlength { box-shadow: 1px 1px 1px red; }
|
||||
.version { color: #888; }
|
||||
.js .column { background: #011d35; }
|
||||
.error { color: red; background: #efdada; border: 1px solid #e76f6f; }
|
||||
.error b { background: #efeaea; }
|
||||
.message { color: #0b860b; background: #efe; border: 1px solid #7fbd7f; }
|
||||
@@ -37,7 +36,6 @@ input.required, input.maxlength { box-shadow: 1px 1px 1px red; }
|
||||
.icon:hover { background-color: #d1394e; }
|
||||
#menu { border-color: #a3bdd3; }
|
||||
#menu p, #logins, #tables { border-color: #326b9c; }
|
||||
#breadcrumb { background: #154269; }
|
||||
#h1 { color: #ffddbf; }
|
||||
#version { color: #d2b397; }
|
||||
#schema .table { border-color: #093459; }
|
||||
@@ -45,3 +43,4 @@ input.required, input.maxlength { box-shadow: 1px 1px 1px red; }
|
||||
#schema div.table a { color: #3c7bb3; }
|
||||
#menu .active { color: #398c8d; }
|
||||
#edit-fields tbody tr:hover td, #edit-fields tbody tr:hover th { background: #3b6f9d; }
|
||||
:target { color: #a8b05f; }
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
html {
|
||||
--bg: #fff;
|
||||
--fg: #000;
|
||||
--dim: #eee;
|
||||
--lit: #ddf;
|
||||
}
|
||||
|
||||
body { color: var(--fg); background: var(--bg); font: 90%/1.25 Verdana, Arial, Helvetica, sans-serif; margin: 0; min-width: fit-content; }
|
||||
@@ -11,24 +13,24 @@ a:visited { color: navy; }
|
||||
a:link:hover, a:visited:hover { color: red; text-decoration: underline; }
|
||||
a.text:hover { text-decoration: none; }
|
||||
a.jush-help:hover { color: inherit; }
|
||||
h1 { font-size: 150%; margin: 0; padding: .8em 1em; border-bottom: 1px solid #999; font-weight: normal; color: #777; background: #eee; }
|
||||
h2 { font-size: 150%; margin: 0 0 20px -18px; padding: .8em 1em; border-bottom: 1px solid var(--fg); font-weight: normal; background: #ddf; }
|
||||
h1 { font-size: 150%; margin: 0; padding: .8em .667em; border-bottom: 1px solid #999; font-weight: normal; color: #777; background: var(--dim); }
|
||||
h2 { font-size: 150%; margin: 0 0 20px -18px; padding: .8em 1em; border-bottom: 1px solid var(--fg); font-weight: normal; background: var(--lit); }
|
||||
h3 { font-weight: normal; font-size: 130%; margin: 1em 0 0; }
|
||||
form { margin: 0; }
|
||||
td table { width: 100%; margin: 0; }
|
||||
table { margin: 1em 20px 0 0; font-size: 90%; border-spacing: 0; border-width: 1px 0 0 1px; }
|
||||
table, td, th { border-color: #999; border-style: solid; }
|
||||
table, td, th, .js .column { border-color: #999; border-style: solid; }
|
||||
td, th { border-width: 0 1px 1px 0; padding: .2em .3em; margin: 0; }
|
||||
th { background: #eee; text-align: left; }
|
||||
th { background: var(--dim); text-align: left; }
|
||||
thead { position: sticky; top: 0; }
|
||||
thead th { text-align: center; padding: .2em .5em; }
|
||||
thead td, thead th { background: #ddf; }
|
||||
fieldset { display: inline; vertical-align: top; padding: .5em .8em; margin: .8em .5em 0 0; border: 1px solid #999; }
|
||||
thead td, thead th { background: var(--lit); }
|
||||
fieldset { display: inline; vertical-align: top; padding: .5em .8em; margin: .8em .5em 0 0; border: 1px solid #999; border-radius: 5px; }
|
||||
p { margin: .8em 20px 0 0; }
|
||||
img { vertical-align: middle; border: 0; }
|
||||
td img { max-width: 200px; max-height: 200px; }
|
||||
tbody tr:hover td, tbody tr:hover th { background: #eee; }
|
||||
code { font-size: 110%; padding: 1px 2px; background: #eee; }
|
||||
tbody tr:hover td, tbody tr:hover th { background: var(--dim); }
|
||||
code { font-size: 110%; padding: 1px 2px; background: var(--dim); }
|
||||
pre { margin: 1em 0 0; }
|
||||
td pre { margin: 0; }
|
||||
pre, textarea { font: 110%/1.25 monospace; }
|
||||
@@ -43,7 +45,7 @@ input.wayoff { left: -1000px; position: absolute; }
|
||||
.block { display: block; }
|
||||
.version { color: #777; font-size: 62%; }
|
||||
.js .hidden, .nojs .jsonly { display: none; }
|
||||
.js .column { position: absolute; background: #ddf; padding: .27em 1ex .3em 0; margin-top: -.27em; }
|
||||
.js .column { position: absolute; background: var(--lit); padding: .27em 1ex .33em 0; margin-top: -.37em; border-width: 1px 1px 1px 0; border-radius: 0 8px 8px 0; }
|
||||
.nowrap td, .nowrap th, td.nowrap, p.nowrap { white-space: pre; }
|
||||
.wrap td { white-space: normal; }
|
||||
.error { color: red; background: #fee; }
|
||||
@@ -55,8 +57,9 @@ input.wayoff { left: -1000px; position: absolute; }
|
||||
.date { color: #7F007F; }
|
||||
.enum { color: #007F7F; }
|
||||
.binary { color: red; }
|
||||
.odds tbody tr { background: var(--bg); }
|
||||
.odds tbody tr:nth-child(2n) { background: #F5F5F5; }
|
||||
.js .checkable .checked td, .js .checkable .checked th { background: #ddf; }
|
||||
.js .checkable .checked td, .js .checkable .checked th { background: var(--lit); }
|
||||
.time { color: silver; font-size: 70%; }
|
||||
.function, .number, .datetime { text-align: right; }
|
||||
.type { width: 15ex; }
|
||||
@@ -66,16 +69,16 @@ input.wayoff { left: -1000px; position: absolute; }
|
||||
.sqlarea { width: 98%; }
|
||||
.sql-footer { margin-bottom: 2.5em; }
|
||||
.explain table { white-space: pre; }
|
||||
.icon { width: 18px; height: 18px; background-color: navy; border: 0; vertical-align: middle; }
|
||||
.icon { width: 18px; height: 18px; background: navy center no-repeat; border: 0; padding: 0; vertical-align: middle; }
|
||||
.icon span { display: none; }
|
||||
.icon:hover { background-color: red; }
|
||||
.size { width: 7ex; }
|
||||
.help { cursor: help; }
|
||||
.footer { position: sticky; bottom: 0; margin-right: -20px; border-top: 20px solid rgb(from var(--bg) r g b / .7); border-image: linear-gradient(rgb(from var(--bg) r g b / .2), var(--bg)) 100% 0; }
|
||||
.footer { position: sticky; bottom: 0; margin: 23px -20px .5em 0; box-shadow: 0 -5px 10px 10px var(--bg); }
|
||||
.footer > div { background: var(--bg); padding: 0 0 .5em; }
|
||||
.footer fieldset { margin-top: 0; }
|
||||
.links a { white-space: nowrap; margin-right: 20px; }
|
||||
.logout { margin-top: .5em; position: absolute; top: 0; right: 0; }
|
||||
.logout { margin-top: .5em; position: absolute; top: 0; right: 0; background-color: var(--bg); box-shadow: 0 0 5px 5px var(--bg); }
|
||||
.loadmore { margin-left: 1ex; }
|
||||
/* .edit used in designs */
|
||||
#menu { position: absolute; margin: 10px 0 0; top: 2em; left: 0; width: 19em; }
|
||||
@@ -87,13 +90,15 @@ input.wayoff { left: -1000px; position: absolute; }
|
||||
#content { margin: 2em 0 0 21em; padding: 10px 20px 20px 0; }
|
||||
#lang { position: absolute; top: -2.6em; left: 0; padding: .3em 1em; }
|
||||
#menuopen { display: none; }
|
||||
#breadcrumb { white-space: nowrap; position: absolute; top: 0; left: 21em; background: #eee; height: 2em; line-height: 1.8em; padding: 0 1em; margin: 0 0 0 -18px; }
|
||||
#breadcrumb { white-space: nowrap; position: absolute; top: 0; left: 21em; background: var(--dim); height: 2em; line-height: 1.8em; padding: 0 1em; margin: 0 0 0 -18px; }
|
||||
#logo { vertical-align: baseline; margin-bottom: -3px; }
|
||||
#h1 { color: #777; text-decoration: none; font-style: italic; }
|
||||
#version { color: red; }
|
||||
#schema { margin-left: 60px; position: relative; user-select: none; -webkit-user-select: none; }
|
||||
#schema .table { border: 1px solid silver; padding: 0 2px; cursor: move; position: absolute; }
|
||||
#schema .references { position: absolute; }
|
||||
#help { position: absolute; border: 1px solid #999; background: #eee; padding: 5px; font-family: monospace; z-index: 1; }
|
||||
#help { position: absolute; border: 1px solid #999; background: var(--dim); padding: 5px; font-family: monospace; z-index: 1; }
|
||||
:target { background: var(--lit); }
|
||||
|
||||
/* inlined here and not in compile.php because otherwise the development version flickers a little bit when loading the images */
|
||||
.icon-up { background-image: url(data:image/gif;base64,R0lGODlhEgASAIEAMe7u7gAAgJmZmQAAACH5BAEAAAEALAAAAAASABIAAQIghI+py+0PTQhRTgrvfRP0nmEVOIoReZphxbauAMfyHBcAOw==); }
|
||||
@@ -113,24 +118,29 @@ input.wayoff { left: -1000px; position: absolute; }
|
||||
.rtl #lang, .rtl #menu { left: auto; right: 0; }
|
||||
.rtl pre, .rtl code { direction: ltr; }
|
||||
|
||||
@media all and (max-width: 880px) {
|
||||
@media all and (max-width: 800px) {
|
||||
.pages { left: auto; }
|
||||
.logout { padding: 1em; top: 3em; }
|
||||
#menu { width: auto; background: var(--bg); border: 1px solid var(--fg); }
|
||||
#content { margin-left: 10px; }
|
||||
.js .logout { top: 1.667em; background-color: var(--dim); box-shadow: 0 0 5px 5px var(--dim); }
|
||||
#menu { position: static; width: auto; min-width: 23em; background: var(--bg); border: 1px solid var(--fg); margin-top: 9px; box-shadow: 0 0 20px -3px var(--fg); }
|
||||
#content { margin-left: 10px !important; }
|
||||
#lang { position: static; }
|
||||
#breadcrumb { left: 48px; }
|
||||
#breadcrumb { left: 48px !important; }
|
||||
.js #foot { position: absolute; top: 2em; left: 0; }
|
||||
.js .foot { display: none; }
|
||||
.js #menuopen { display: block; position: absolute; top: 3px; left: 6px; }
|
||||
.nojs .logout, .nojs #menu { position: static; }
|
||||
.nojs #menu { position: static; }
|
||||
.rtl.js #foot { left: auto; right: 0; }
|
||||
.rtl .pages { right: auto; }
|
||||
.rtl #content { margin-right: 10px; }
|
||||
.rtl #breadcrumb { right: auto; }
|
||||
.rtl.js #menuopen { left: auto; right: 6px; }
|
||||
.rtl #content { margin-left: 0 !important; margin-right: 10px; }
|
||||
.rtl #breadcrumb { left: auto !important; right: 48px; }
|
||||
}
|
||||
|
||||
@media print {
|
||||
#lang, #menu { display: none; }
|
||||
#lang, #menu, .logout { display: none; }
|
||||
#content { margin-left: 1em; }
|
||||
#breadcrumb { left: 1em; }
|
||||
.rtl #content { margin-left: auto; margin-right: 1em; }
|
||||
.rtl #breadcrumb { left: auto; right: 1em; }
|
||||
.nowrap td, .nowrap th, td.nowrap { white-space: normal; }
|
||||
}
|
||||
|
||||
@@ -1,60 +1,64 @@
|
||||
'use strict'; // Adminer specific functions
|
||||
|
||||
let autocompleter; // set in adminer.inc.php
|
||||
|
||||
/** Load syntax highlighting
|
||||
* @param string first three characters of database system version
|
||||
* @param [string]
|
||||
*/
|
||||
function syntaxHighlighting(version, vendor) {
|
||||
if (window.jush) {
|
||||
jush.create_links = 'target="_blank" rel="noreferrer noopener"';
|
||||
if (version) {
|
||||
for (let key in jush.urls) {
|
||||
let obj = jush.urls;
|
||||
if (typeof obj[key] != 'string') {
|
||||
obj = obj[key];
|
||||
key = 0;
|
||||
if (vendor == 'maria') {
|
||||
for (let i = 1; i < obj.length; i++) {
|
||||
obj[i] = obj[i]
|
||||
.replace('.html', '/')
|
||||
.replace('-type-syntax', '-data-types')
|
||||
.replace(/numeric-(data-types)/, '$1-$&')
|
||||
.replace(/replication-options-(master|binary-log)\//, 'replication-and-binary-log-system-variables/')
|
||||
.replace('server-options/', 'server-system-variables/')
|
||||
.replace('innodb-parameters/', 'innodb-system-variables/')
|
||||
.replace(/#(statvar|sysvar|option_mysqld)_(.*)/, '#$2')
|
||||
.replace(/#sysvar_(.*)/, '#$1')
|
||||
;
|
||||
addEventListener('DOMContentLoaded', () => {
|
||||
if (window.jush) {
|
||||
jush.create_links = 'target="_blank" rel="noreferrer noopener"';
|
||||
if (version) {
|
||||
for (let key in jush.urls) {
|
||||
let obj = jush.urls;
|
||||
if (typeof obj[key] != 'string') {
|
||||
obj = obj[key];
|
||||
key = 0;
|
||||
if (vendor == 'maria') {
|
||||
for (let i = 1; i < obj.length; i++) {
|
||||
obj[i] = obj[i]
|
||||
.replace('.html', '/')
|
||||
.replace('-type-syntax', '-data-types')
|
||||
.replace(/numeric-(data-types)/, '$1-$&')
|
||||
.replace(/replication-options-(master|binary-log)\//, 'replication-and-binary-log-system-variables/')
|
||||
.replace('server-options/', 'server-system-variables/')
|
||||
.replace('innodb-parameters/', 'innodb-system-variables/')
|
||||
.replace(/#(statvar|sysvar|option_mysqld)_(.*)/, '#$2')
|
||||
.replace(/#sysvar_(.*)/, '#$1')
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
obj[key] = (vendor == 'maria' ? obj[key].replace('dev.mysql.com/doc/mysql', 'mariadb.com/kb') : obj[key]) // MariaDB
|
||||
.replace('/doc/mysql', '/doc/refman/' + version) // MySQL
|
||||
;
|
||||
if (vendor != 'cockroach') {
|
||||
obj[key] = obj[key].replace('/docs/current', '/docs/' + version); // PostgreSQL
|
||||
obj[key] = (vendor == 'maria' ? obj[key].replace('dev.mysql.com/doc/mysql', 'mariadb.com/kb') : obj[key]) // MariaDB
|
||||
.replace('/doc/mysql', '/doc/refman/' + version) // MySQL
|
||||
;
|
||||
if (vendor != 'cockroach') {
|
||||
obj[key] = obj[key].replace('/docs/current', '/docs/' + version); // PostgreSQL
|
||||
}
|
||||
}
|
||||
}
|
||||
if (window.jushLinks) {
|
||||
jush.custom_links = jushLinks;
|
||||
}
|
||||
jush.highlight_tag('code', 0);
|
||||
adminerHighlighter = els => jush.highlight_tag(els, 0);
|
||||
for (const tag of qsa('textarea')) {
|
||||
if (/(^|\s)jush-/.test(tag.className)) {
|
||||
const pre = jush.textarea(tag, autocompleter);
|
||||
if (pre) {
|
||||
setupSubmitHighlightInput(pre);
|
||||
tag.onchange = () => {
|
||||
pre.textContent = tag.value;
|
||||
pre.oninput();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (window.jushLinks) {
|
||||
jush.custom_links = jushLinks;
|
||||
}
|
||||
jush.highlight_tag('code', 0);
|
||||
adminerHighlighter = els => jush.highlight_tag(els, 0);
|
||||
for (const tag of qsa('textarea')) {
|
||||
if (/(^|\s)jush-/.test(tag.className)) {
|
||||
const pre = jush.textarea(tag);
|
||||
if (pre) {
|
||||
setupSubmitHighlightInput(pre);
|
||||
tag.onchange = () => {
|
||||
pre.textContent = tag.value;
|
||||
pre.oninput();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** Get value of dynamically created form field
|
||||
@@ -89,6 +93,13 @@ function messagesPrint(parent) {
|
||||
for (const el of qsa('.toggle', parent)) {
|
||||
el.onclick = partial(toggle, el.getAttribute('href').substr(1));
|
||||
}
|
||||
for (const el of qsa('.copy', parent)) {
|
||||
el.onclick = () => {
|
||||
navigator.clipboard.writeText(qs('code', el.parentElement).innerText).then(() => el.textContent = '✓');
|
||||
setTimeout(() => el.textContent = '🗐', 1000);
|
||||
return false;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -380,7 +391,7 @@ function editingAddRow(focus) {
|
||||
*/
|
||||
function editingRemoveRow(name) {
|
||||
const field = formField(this.form, this.name.replace(/[^[]+(.+)/, name));
|
||||
field.parentNode.removeChild(field);
|
||||
field.remove();
|
||||
parentTag(this, 'tr').style.display = 'none';
|
||||
return false;
|
||||
}
|
||||
@@ -452,7 +463,7 @@ function editingLengthChange() {
|
||||
*/
|
||||
function editingLengthFocus() {
|
||||
const td = this.parentNode;
|
||||
if (/(enum|set)$/.test(selectValue(td.previousSibling.firstChild))) {
|
||||
if (/^(enum|set)$/.test(selectValue(td.previousSibling.firstChild))) {
|
||||
const edit = qs('#enum-edit');
|
||||
edit.value = enumValues(this.value);
|
||||
td.appendChild(edit);
|
||||
@@ -651,13 +662,29 @@ function indexesAddColumn(prefix) {
|
||||
* @param string
|
||||
*/
|
||||
function sqlSubmit(form, root) {
|
||||
if (encodeURIComponent(form['query'].value).length < 500) {
|
||||
form.action = root
|
||||
+ '&sql=' + encodeURIComponent(form['query'].value)
|
||||
+ (form['limit'].value ? '&limit=' + +form['limit'].value : '')
|
||||
+ (form['error_stops'].checked ? '&error_stops=1' : '')
|
||||
+ (form['only_errors'].checked ? '&only_errors=1' : '')
|
||||
;
|
||||
const action = root
|
||||
+ '&sql=' + encodeURIComponent(form['query'].value)
|
||||
+ (form['limit'].value ? '&limit=' + +form['limit'].value : '')
|
||||
+ (form['error_stops'].checked ? '&error_stops=1' : '')
|
||||
+ (form['only_errors'].checked ? '&only_errors=1' : '')
|
||||
;
|
||||
if ((document.location.origin + document.location.pathname + action).length < 2000) { // reasonable minimum is 2048
|
||||
form.action = action;
|
||||
}
|
||||
}
|
||||
|
||||
/** Check if PHP can handle the uploaded files
|
||||
* @param Event
|
||||
* @param number
|
||||
* @param string
|
||||
* @param number
|
||||
* @param string
|
||||
*/
|
||||
function fileChange(event, count, countMessage, size, sizeMessage) {
|
||||
if (event.target.files.length > count) {
|
||||
alert(countMessage);
|
||||
} else if (Array.from(event.target.files).reduce((sum, file) => sum + file.size, 0) > size) {
|
||||
alert(sizeMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 318 B |
@@ -96,29 +96,15 @@ function cookie(assign, days) {
|
||||
|
||||
/** Verify current Adminer version
|
||||
* @param string
|
||||
* @param string own URL base
|
||||
* @param string
|
||||
*/
|
||||
function verifyVersion(current, url, token) {
|
||||
function verifyVersion(current) {
|
||||
cookie('adminer_version=0', 1);
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.src = 'https://www.adminer.org/version/?current=' + current;
|
||||
iframe.frameBorder = 0;
|
||||
iframe.marginHeight = 0;
|
||||
iframe.scrolling = 'no';
|
||||
iframe.style.width = '7ex';
|
||||
iframe.style.height = '1.25em';
|
||||
iframe.style.display = 'none';
|
||||
addEventListener('message', event => {
|
||||
if (event.origin == 'https://www.adminer.org') {
|
||||
const match = /version=(.+)/.exec(event.data);
|
||||
if (match) {
|
||||
cookie('adminer_version=' + match[1], 1);
|
||||
ajax(url + 'script=version', () => { }, event.data + '&token=' + token);
|
||||
}
|
||||
}
|
||||
}, false);
|
||||
qs('#version').appendChild(iframe);
|
||||
// do not send X-Requested-With to avoid preflight
|
||||
fetch('https://www.adminer.org/version/?current=' + current).then(async response => {
|
||||
const json = await response.json();
|
||||
cookie('adminer_version=' + (json.version || current), 7); // empty if there's no newer version
|
||||
qs('#version').textContent = json.version;
|
||||
});
|
||||
}
|
||||
|
||||
/** Get value of select
|
||||
@@ -235,8 +221,8 @@ function formChecked(input, name) {
|
||||
function tableClick(event, click) {
|
||||
const td = parentTag(event.target, 'td');
|
||||
let text;
|
||||
if (td && (text = td.getAttribute('data-text'))) {
|
||||
if (selectClick.call(td, event, +text, td.getAttribute('data-warning'))) {
|
||||
if (td && (text = td.dataset.text)) {
|
||||
if (selectClick.call(td, event, +text, td.dataset.warning)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -525,14 +511,14 @@ function functionChange() {
|
||||
if (selectValue(this)) {
|
||||
if (input.origType === undefined) {
|
||||
input.origType = input.type;
|
||||
input.origMaxLength = input.getAttribute('data-maxlength');
|
||||
input.origMaxLength = input.dataset.maxlength;
|
||||
}
|
||||
input.removeAttribute('data-maxlength');
|
||||
delete input.dataset.maxlength;
|
||||
input.type = 'text';
|
||||
} else if (input.origType) {
|
||||
input.type = input.origType;
|
||||
if (input.origMaxLength >= 0) {
|
||||
input.setAttribute('data-maxlength', input.origMaxLength);
|
||||
input.dataset.maxlength = input.origMaxLength;
|
||||
}
|
||||
}
|
||||
oninput({target: input});
|
||||
@@ -736,9 +722,10 @@ function selectLoadMore(limit, loading) {
|
||||
return !ajax(href, request => {
|
||||
const tbody = document.createElement('tbody');
|
||||
tbody.innerHTML = request.responseText;
|
||||
adminerHighlighter(qsa('code', tbody));
|
||||
qs('#table').appendChild(tbody);
|
||||
if (tbody.children.length < limit) {
|
||||
a.parentNode.removeChild(a);
|
||||
a.remove();
|
||||
} else {
|
||||
a.href = href.replace(/\d+$/, page => +page + 1);
|
||||
a.innerHTML = title;
|
||||
@@ -843,7 +830,7 @@ function cloneNode(el) {
|
||||
|
||||
oninput = event => {
|
||||
const target = event.target;
|
||||
const maxLength = target.getAttribute('data-maxlength');
|
||||
const maxLength = target.dataset.maxlength;
|
||||
alterClass(target, 'maxlength', target.value && maxLength != null && target.value.length > maxLength); // maxLength could be 0
|
||||
};
|
||||
|
||||
|
||||
BIN
adminer/static/logo.png
Normal file
BIN
adminer/static/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 587 B |
@@ -26,11 +26,29 @@ if ($fields) {
|
||||
adminer()->tableStructurePrint($fields, $table_status);
|
||||
}
|
||||
|
||||
/** Print links to tables
|
||||
* @param list<array{table: string, ns: string}> $tables
|
||||
*/
|
||||
function tables_links(array $tables): void {
|
||||
echo "<ul>\n";
|
||||
foreach ($tables as $row) {
|
||||
$link = preg_replace('~ns=[^&]*~', "ns=" . urlencode($row["ns"]), ME);
|
||||
echo "<li><a href='" . h($link . "table=" . urlencode($row["table"])) . "'>" . ($row["ns"] != $_GET["ns"] ? "<b>" . h($row["ns"]) . "</b>." : "") . h($row["table"]) . "</a>";
|
||||
}
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
$inherits = driver()->inheritsFrom($TABLE);
|
||||
if ($inherits) {
|
||||
echo "<h3>" . lang('Inherits from') . "</h3>\n";
|
||||
tables_links($inherits);
|
||||
}
|
||||
|
||||
if (support("indexes") && driver()->supportsIndex($table_status)) {
|
||||
echo "<h3 id='indexes'>" . lang('Indexes') . "</h3>\n";
|
||||
$indexes = indexes($TABLE);
|
||||
if ($indexes) {
|
||||
adminer()->tableIndexesPrint($indexes);
|
||||
adminer()->tableIndexesPrint($indexes, $table_status);
|
||||
}
|
||||
echo '<p class="links"><a href="' . h(ME) . 'indexes=' . urlencode($TABLE) . '">' . lang('Alter indexes') . "</a>\n";
|
||||
}
|
||||
@@ -95,3 +113,13 @@ if (support(is_view($table_status) ? "view_trigger" : "trigger")) {
|
||||
}
|
||||
echo '<p class="links"><a href="' . h(ME) . 'trigger=' . urlencode($TABLE) . '">' . lang('Add trigger') . "</a>\n";
|
||||
}
|
||||
|
||||
$inherited = driver()->inheritedTables($TABLE);
|
||||
if ($inherited) {
|
||||
echo "<h3 id='partitions'>" . lang('Inherited by') . "</h3>\n";
|
||||
$partition = driver()->partitionsInfo($TABLE);
|
||||
if ($partition) {
|
||||
echo "<p><code class='jush-" . JUSH . "'>BY " . h("$partition[partition_by]($partition[partition])") . "</code>\n";
|
||||
}
|
||||
tables_links($inherited);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Adminer;
|
||||
$status = isset($_GET["status"]);
|
||||
page_header($status ? lang('Status') : lang('Variables'));
|
||||
|
||||
$variables = ($status ? show_status() : show_variables());
|
||||
$variables = ($status ? adminer()->showStatus() : adminer()->showVariables());
|
||||
if (!$variables) {
|
||||
echo "<p class='message'>" . lang('No rows.') . "\n";
|
||||
} else {
|
||||
|
||||
67
compile.php
67
compile.php
@@ -21,7 +21,7 @@ function remove_lang($match) {
|
||||
$idf = strtr($match[2], array("\\'" => "'", "\\\\" => "\\"));
|
||||
$s = (Adminer\Lang::$translations[$idf] ?: $idf);
|
||||
if ($match[3] == ",") { // lang() has parameters
|
||||
return $match[1] . (is_array($s) ? "lang(array('" . implode("', '", array_map('add_apo_slashes', $s)) . "')," : "sprintf('" . add_apo_slashes($s) . "',");
|
||||
return $match[1] . (is_array($s) ? "lang_format(array('" . implode("', '", array_map('add_apo_slashes', $s)) . "')," : "sprintf('" . add_apo_slashes($s) . "',");
|
||||
}
|
||||
return ($match[1] && $match[4] ? $s : "$match[1]'" . add_apo_slashes($s) . "'$match[4]");
|
||||
}
|
||||
@@ -47,7 +47,7 @@ function put_file($match) {
|
||||
// check function definition in drivers
|
||||
if ($vendor != "mysql") {
|
||||
preg_match_all(
|
||||
'~\bfunction ([^(]+)~',
|
||||
'~\bfunction (?!alter_table|drop_tables|truncate_tables)([^(]+)~', // used for feature detection
|
||||
preg_replace('~class Driver.*\n\t}~sU', '', file_get_contents(__DIR__ . "/adminer/drivers/mysql.inc.php")),
|
||||
$matches
|
||||
); //! respect context (extension, class)
|
||||
@@ -84,8 +84,8 @@ function put_file($match) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (basename($match[2]) != "lang.inc.php" || !$_SESSION["lang"]) {
|
||||
if (basename($match[2]) == "lang.inc.php") {
|
||||
if (basename($match[2]) == "lang.inc.php") {
|
||||
if (!$_SESSION["lang"]) {
|
||||
$return = str_replace('function lang(string $idf, $number = null): string {', 'function lang($idf, $number = null) {
|
||||
if (is_string($idf)) { // compiled version uses numbers, string comes from a plugin
|
||||
// English translation is closest to the original identifiers //! pluralized translations are not found
|
||||
@@ -97,29 +97,17 @@ function put_file($match) {
|
||||
if (!$count) {
|
||||
echo "lang() not found\n";
|
||||
}
|
||||
} else {
|
||||
$return = preg_replace('~// not used in a single language version from here.*~s', '', $return);
|
||||
$return = preg_replace_callback('~(\$pos = (.+\n).+;)~sU', function ($match) {
|
||||
return "\$pos = $match[2]\t\t\t: " . (preg_match("~'$_SESSION[lang]'.* \\? (.+)\n~U", $match[1], $match2) ? $match2[1] : "1") . "\n\t\t);";
|
||||
}, $return);
|
||||
$return = str_replace('Lang::$translations[$idf] ?: $idf', '$idf', $return); // lang() is used only by old plugins
|
||||
$return .= "define('Adminer\\LANG', '$_SESSION[lang]');\n";
|
||||
}
|
||||
$tokens = token_get_all($return); // to find out the last token
|
||||
return "?>\n$return" . (in_array($tokens[count($tokens) - 1][0], array(T_CLOSE_TAG, T_INLINE_HTML), true) ? "<?php" : "");
|
||||
} elseif (preg_match('~\s*(\$pos = (.+\n).+;)~sU', $return, $match2)) {
|
||||
// single language lang() is used for plural
|
||||
return "function get_lang() {
|
||||
return '$_SESSION[lang]';
|
||||
}
|
||||
|
||||
function lang(\$translation, \$number = null) {
|
||||
if (is_array(\$translation)) {
|
||||
\$pos = $match2[2]\t\t\t: " . (preg_match("~'$_SESSION[lang]'.* \\? (.+)\n~U", $match2[1], $match3) ? $match3[1] : "1") . '
|
||||
);
|
||||
$translation = $translation[$pos];
|
||||
}
|
||||
$translation = str_replace("%d", "%s", $translation);
|
||||
$number = format_number($number);
|
||||
return sprintf($translation, $number);
|
||||
}
|
||||
';
|
||||
} else {
|
||||
echo "lang() \$pos not found\n";
|
||||
}
|
||||
$tokens = token_get_all($return); // to find out the last token
|
||||
return "?>\n$return" . (in_array($tokens[count($tokens) - 1][0], array(T_CLOSE_TAG, T_INLINE_HTML), true) ? "<?php" : "");
|
||||
}
|
||||
|
||||
function lzw_compress($string) {
|
||||
@@ -177,7 +165,7 @@ function put_file_lang($match) {
|
||||
case "' . $lang . '": $compressed = "' . add_quo_slashes(lzw_compress(implode("\n", $translation_ids))) . '"; break;';
|
||||
}
|
||||
$translations_version = crc32($return);
|
||||
return 'Lang::$translations = $_SESSION["translations"];
|
||||
return 'Lang::$translations = (array) $_SESSION["translations"];
|
||||
if ($_SESSION["translations_version"] != LANG . ' . $translations_version . ') {
|
||||
Lang::$translations = array();
|
||||
$_SESSION["translations_version"] = LANG . ' . $translations_version . ';
|
||||
@@ -202,16 +190,19 @@ function get_translations($lang) {
|
||||
function minify_css($file) {
|
||||
global $project;
|
||||
if ($project == "editor") {
|
||||
$file = preg_replace('~.*\.url\(.*~', '', $file);
|
||||
$file = preg_replace('~\.icon-(up|down|plus|cross).*~', '', $file);
|
||||
}
|
||||
$file = preg_replace_callback('~url\((\w+\.(gif|png|jpg))\)~', function ($match) {
|
||||
return "url(data:image/$match[2];base64," . base64_encode(file_get_contents(__DIR__ . "/adminer/static/$match[1]")) . ")"; // we don't have ME in *.css so we can only inline images
|
||||
}, $file);
|
||||
return lzw_compress(preg_replace('~\s*([:;{},])\s*~', '\1', preg_replace('~/\*.*?\*/\s*~s', '', $file)));
|
||||
}
|
||||
|
||||
function minify_js($file) {
|
||||
$file = preg_replace_callback("~'use strict';~", function ($match) { // keep only the first one
|
||||
$file = preg_replace_callback("~'use strict';~", function ($match) {
|
||||
static $count = 0;
|
||||
$count++;
|
||||
return ($count == 1 ? $match[0] : '');
|
||||
return ($count == 1 ? $match[0] : ''); // keep only the first one
|
||||
}, $file);
|
||||
if (function_exists('jsShrink')) {
|
||||
$file = jsShrink($file);
|
||||
@@ -219,7 +210,8 @@ function minify_js($file) {
|
||||
return lzw_compress($file);
|
||||
}
|
||||
|
||||
function compile_file($match, $callback = '') { // $callback only to match signature
|
||||
// $callback only to match signature
|
||||
function compile_file($match, $callback = '') {
|
||||
global $project;
|
||||
$file = "";
|
||||
list(, $filenames, $callback) = $match;
|
||||
@@ -312,7 +304,12 @@ if ($vendor) {
|
||||
}
|
||||
}
|
||||
if ($project != "editor" && count(Adminer\SqlDriver::$drivers) == 1) {
|
||||
$file = str_replace('html_select("auth[driver]", SqlDriver::$drivers, DRIVER, "loginDriver(this);")', 'input_hidden("auth[driver]", "' . ($vendor == "mysql" ? "server" : $vendor) . '") . "' . reset(Adminer\SqlDriver::$drivers) . '"', $file, $count);
|
||||
$file = str_replace(
|
||||
'html_select("auth[driver]", SqlDriver::$drivers, DRIVER, "loginDriver(this);")',
|
||||
'input_hidden("auth[driver]", "' . ($vendor == "mysql" ? "server" : $vendor) . '") . "' . reset(Adminer\SqlDriver::$drivers) . '"',
|
||||
$file,
|
||||
$count
|
||||
);
|
||||
if (!$count) {
|
||||
echo "auth[driver] form field not found\n";
|
||||
}
|
||||
@@ -321,7 +318,7 @@ if ($vendor) {
|
||||
$file = str_replace(");\n\t\techo \$this->loginFormField('server', '<tr><th>' . lang('Server') . '<td>', '<input name=\"auth[server]", ' . \'<input type="hidden" name="auth[server]"', $file);
|
||||
}
|
||||
}
|
||||
$file = preg_replace('(;\s*../externals/jush/modules/jush-(?!textarea\.|txt\.|js\.|' . preg_quote($vendor == "mysql" ? "sql" : $vendor) . '\.)[^.]+.js)', '', $file);
|
||||
$file = preg_replace('(;\s*../externals/jush/modules/jush-(?!autocomplete-sql\.|textarea\.|txt\.|js\.|' . preg_quote($vendor == "mysql" ? "sql" : $vendor) . '\.)[^.]+.js)', '', $file);
|
||||
$file = preg_replace_callback('~doc_link\(array\((.*)\)\)~sU', function ($match) use ($vendor) {
|
||||
list(, $links) = $match;
|
||||
$links = preg_replace("~'(?!(" . ($vendor == "mysql" ? "sql|mariadb" : $vendor) . ")')[^']*' => [^,]*,?~", '', $links);
|
||||
@@ -333,17 +330,17 @@ if ($project == "editor") {
|
||||
$file = preg_replace('~;.\.\/externals/jush/jush(-dark)?\.css~', '', $file);
|
||||
$file = preg_replace('~compile_file\(\'\.\./(externals/jush/modules/jush\.js)[^)]+\)~', "''", $file);
|
||||
}
|
||||
$file = preg_replace_callback("~lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])~s", 'lang_ids', $file);
|
||||
$file = preg_replace_callback("~(?<!>)lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])~s", 'lang_ids', $file);
|
||||
$file = preg_replace_callback('~\b(include|require) "([^"]*" . LANG . ".inc.php)";~', 'put_file_lang', $file);
|
||||
$file = str_replace("\r", "", $file);
|
||||
if ($_SESSION["lang"]) {
|
||||
// single language version
|
||||
$file = preg_replace_callback("~(<\\?php\\s*echo )?lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])(;\\s*\\?>)?~s", 'remove_lang', $file);
|
||||
$file = preg_replace_callback("~(<\\?php\\s*echo )?(?<!>)lang\\('((?:[^\\\\']+|\\\\.)*)'([,)])(;\\s*\\?>)?~s", 'remove_lang', $file);
|
||||
$file = str_replace("switch_lang();", "", $file);
|
||||
$file = str_replace('<?php echo LANG; ?>', $_SESSION["lang"], $file);
|
||||
}
|
||||
$file = str_replace('echo script_src("static/editing.js");' . "\n", "", $file); // merged into functions.js
|
||||
$file = preg_replace('~\s+echo script_src\("\.\./externals/jush/modules/jush-(textarea|txt|js|" \. JUSH \. ")\.js"\);~', '', $file); // merged into jush.js
|
||||
$file = preg_replace('~\s+echo script_src\("\.\./externals/jush/modules/jush-(autocomplete-sql|textarea|txt|js|" \. JUSH \. ")\.js", true\);~', '', $file); // merged into jush.js
|
||||
$file = preg_replace('~echo .*/jush(-dark)?.css\'>.*~', '', $file); // merged into default.css or dark.css
|
||||
if (function_exists('stripTypes')) {
|
||||
$file = stripTypes($file);
|
||||
|
||||
@@ -33,7 +33,11 @@
|
||||
"php": ">=7.4"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rm -f adminer*.php editor*.php",
|
||||
"compile": "@php compile.php"
|
||||
"check": [
|
||||
"phpcs",
|
||||
"phpstan analyse -c phpstan.neon"
|
||||
],
|
||||
"compile": "@php compile.php",
|
||||
"clean": "rm -f adminer*.php editor*.php"
|
||||
}
|
||||
}
|
||||
|
||||
2
designs/adminer-dark/README.md
Normal file
2
designs/adminer-dark/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
## Screenshot
|
||||

|
||||
1
designs/adminer-dark/adminer-dark.css
Normal file
1
designs/adminer-dark/adminer-dark.css
Normal file
@@ -0,0 +1 @@
|
||||
/* Empty file named adminer-dark.css causes Adminer to switch to default dark mode. */
|
||||
@@ -64,7 +64,7 @@ outline:0;background:url(//www.bradezone.com/random/adminer_logo.gif) no-repeat;
|
||||
* html #lang{padding-top:10px;height:30px}
|
||||
* html form#form{height:100%}
|
||||
#logins a,#tables a{background: none}
|
||||
.logout{color:#fff}
|
||||
.logout{color:#fff;background-color:#333;box-shadow:0 0 5px 5px #333;z-index:1}
|
||||
#logout{color:#333;text-decoration:none;border-bottom:1px dotted}
|
||||
#logout:hover{border-color:#333;background:#333;color:#fff}
|
||||
.js .column{background:#ddd}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user