From 96191587ccfaf921b792dd2076da4bd4f28ba8de Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 3 Apr 2025 15:45:37 +0200 Subject: [PATCH] New plugin: Set up driver, server and database in Adminer Editor --- CHANGELOG.md | 1 + README.md | 3 --- editor/sqlite.php | 2 ++ plugins/editor-setup.php | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 plugins/editor-setup.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 70b49498..3ef269e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - PostgreSQL: Support COPY FROM stdin in SQL query (bug #942) - MySQL: Display number of found rows in group queries (regression from 5.1.1) - non-MySQL: Parse '--' without trailing space as comment in SQL command (bug SF-842) +- 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) diff --git a/README.md b/README.md index 23b60749..856aab01 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/editor/sqlite.php b/editor/sqlite.php index e6854cb3..c9e58891 100644 --- a/editor/sqlite.php +++ b/editor/sqlite.php @@ -1,4 +1,6 @@ driver = $driver; + $this->server = $server; + $this->database = $database; + } + + function loginFormField($name, $heading, $value) { + if ($name == 'username') { + return $heading . str_replace("value='server'", "value='$this->driver'", $value) . "\n"; + } + } + + function credentials() { + return array($this->server, $_GET["username"], Adminer\get_password()); + } + + function database() { + if ($this->database) { + return $this->database; + } + } +}