]> git.joonet.de Git - adminer.git/commitdiff
Plugins: Autoload plugins in adminer-plugins/
authorJakub Vrana <jakub@vrana.cz>
Mon, 17 Mar 2025 18:25:57 +0000 (19:25 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 18 Mar 2025 21:30:49 +0000 (22:30 +0100)
.gitignore
CHANGELOG.md
README.md
adminer/include/bootstrap.inc.php
adminer/include/plugins.inc.php [new file with mode: 0644]
adminer/include/version.inc.php
adminer/plugin.php [deleted file]
plugins/plugin.php [deleted file]
plugins/readme.txt [deleted file]
todo.txt

index 2afb1ac59bc27f246683440d8ead8604ff90c1ad..946395f2b30632e7c46d3f167bee252f9a972ac2 100644 (file)
@@ -1,4 +1,8 @@
 /adminer/adminer.css
+/adminer/adminer-dark.css
+/editor/adminer.css
+/editor/adminer-dark.css
 /adminer*.php
 /editor*.php
 /vendor/
+adminer-plugins/
index 306273a1022f1e82de993e98aa22fc7559fa4612..56a77204ddda66d3b923536153b2b4f4d3c3ee48 100644 (file)
@@ -5,6 +5,8 @@
 - CSS: Sticky table headers (bug #918)
 - CSS: Allow more custom styles with dark mode (bug #925)
 - IMAP: New plugin driver created for fun
+- Plugins: autoload plugins from adminer-plugins/
+- Plugins: configure plugins with adminer-plugins/config.php
 
 ## Adminer 5.0.6 (released 2025-03-17)
 - Align numbers right (bug #912)
index 62f31c6bbf463bd3ad3e12f7149d5c3f42208a1c..b70f40d097c365754cce1652c04b9c5637f59ebb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,7 +1,8 @@
 # Adminer
 
-**Adminer** is a full-featured database management tool written in PHP. It consists of a single file ready to deploy
-to the target server. **Adminer Editor** offers data manipulation for end-users.
+**Adminer** is a full-featured database management tool written in PHP.
+It consists of a single file ready to deploy to the target server.
+**Adminer Editor** offers data manipulation for end-users.
 
 https://www.adminer.org/
 
@@ -18,11 +19,32 @@ 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
-- `plugins/readme.txt` - Plugins for Adminer and Adminer Editor
-- `adminer/plugin.php` - Plugin demo
 - `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
+
+## Plugins
+There are [several plugins](plugins/) distributed with Adminer and there are also many user-contributed plugins linked from https://www.adminer.org/plugins/.
+To use a plugin, simply upload it to `adminer-plugins/` next to `adminer.php`.
+
+```
+- adminer.php
+- adminer-plugins
+    - config.php
+    - dump-xml.php
+    - login-password-less.php
+```
+
+Some plugins require configuration. To use them, you need to create another file in `adminer-plugins/`:
+
+```php
+<?php // config.php
+require_once __DIR__ . "/login-password-less.php";
+
+return array(
+    new AdminerLoginPasswordLess('$2y$07$Czp9G/aLi3AnaUqpvkF05OHO1LMizrAgMLvnaOdvQovHaRv28XDhG'),
+);
+```
index 16fece751b560e1acb6bc106a476986f705ed875..bc19b7ec0bcc8973765a2b76e24104b245839f2f 100644 (file)
@@ -77,7 +77,16 @@ include "../adminer/drivers/pgsql.inc.php";
 include "../adminer/drivers/oracle.inc.php";
 include "../adminer/drivers/mssql.inc.php";
 include "./include/adminer.inc.php";
-$adminer = (function_exists('adminer_object') ? adminer_object() : new Adminer);
+
+if (function_exists('adminer_object')) {
+       $adminer = adminer_object();
+} elseif (file_exists("adminer-plugins/")) {
+       include "./include/plugins.inc.php";
+       $adminer = new Plugins(null);
+} else {
+       $adminer = new Adminer;
+}
+
 // this is matched by compile.php
 include "../adminer/drivers/mysql.inc.php"; // must be included as last driver
 
diff --git a/adminer/include/plugins.inc.php b/adminer/include/plugins.inc.php
new file mode 100644 (file)
index 0000000..d1be082
--- /dev/null
@@ -0,0 +1,426 @@
+<?php
+namespace Adminer;
+
+class Plugins extends Adminer {
+       protected $plugins;
+
+       /** Register plugins
+       * @param array object instances or null to autoload plugins from adminer-plugins/
+       */
+       function __construct($plugins) {
+               if ($plugins === null) {
+                       $plugins = array();
+                       foreach (glob("adminer-plugins/*.php") as $filename) {
+                               $include = include_once "./$filename";
+                               if (is_array($include)) { // example: return array(new AdminerLoginOtp($secret))
+                                       foreach ($include as $plugin) {
+                                               $plugins[get_class($plugin)] = $plugin;
+                                       }
+                               }
+                       }
+                       foreach (get_declared_classes() as $class) {
+                               if (!$plugins[$class] && preg_match('~^Adminer\w~i', $class)) {
+                                       $plugins[$class] = new $class; // if the constructor have some required parameters then PHP triggers an error here
+                               }
+                       }
+               }
+               $this->plugins = $plugins;
+       }
+
+       private function callParent($function, $args) {
+               return call_user_func_array(array('parent', $function), $args);
+       }
+
+       private function applyPlugin($function, $args) {
+               foreach ($this->plugins as $plugin) {
+                       if (method_exists($plugin, $function)) {
+                               switch (count($args)) { // call_user_func_array() doesn't work well with references
+                                       case 0:
+                                               $return = $plugin->$function();
+                                               break;
+                                       case 1:
+                                               $return = $plugin->$function($args[0]);
+                                               break;
+                                       case 2:
+                                               $return = $plugin->$function($args[0], $args[1]);
+                                               break;
+                                       case 3:
+                                               $return = $plugin->$function($args[0], $args[1], $args[2]);
+                                               break;
+                                       case 4:
+                                               $return = $plugin->$function($args[0], $args[1], $args[2], $args[3]);
+                                               break;
+                                       case 5:
+                                               $return = $plugin->$function($args[0], $args[1], $args[2], $args[3], $args[4]);
+                                               break;
+                                       case 6:
+                                               $return = $plugin->$function($args[0], $args[1], $args[2], $args[3], $args[4], $args[5]);
+                                               break;
+                                       default:
+                                               trigger_error('Too many parameters.', E_USER_WARNING);
+                               }
+                               if ($return !== null) {
+                                       return $return;
+                               }
+                       }
+               }
+               return $this->callParent($function, $args);
+       }
+
+       private function appendPlugin($function, $args) {
+               $return = $this->callParent($function, $args);
+               foreach ($this->plugins as $plugin) {
+                       if (method_exists($plugin, $function)) {
+                               $value = call_user_func_array(array($plugin, $function), $args);
+                               if ($value) {
+                                       $return += $value;
+                               }
+                       }
+               }
+               return $return;
+       }
+
+       // appendPlugin
+
+       function dumpFormat() {
+               $args = func_get_args();
+               return $this->appendPlugin(__FUNCTION__, $args);
+       }
+
+       function dumpOutput() {
+               $args = func_get_args();
+               return $this->appendPlugin(__FUNCTION__, $args);
+       }
+
+       function editRowPrint($table, $fields, $row, $update) {
+               $args = func_get_args();
+               return $this->appendPlugin(__FUNCTION__, $args);
+       }
+
+       function editFunctions($field) {
+               $args = func_get_args();
+               return $this->appendPlugin(__FUNCTION__, $args);
+       }
+
+       // applyPlugin
+
+       function name() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function credentials() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function connectSsl() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function permanentLogin($create = false) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function bruteForceKey() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function serverName($server) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function database() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function schemas() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function databases($flush = true) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function queryTimeout() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function headers() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function csp() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function head($dark = null) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function css() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function loginForm() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function loginFormField($name, $heading, $value) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function login($login, $password) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function tableName($tableStatus) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function fieldName($field, $order = 0) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectLinks($tableStatus, $set = "") {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function foreignKeys($table) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function backwardKeys($table, $tableName) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function backwardKeysPrint($backwardKeys, $row) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectQuery($query, $start, $failed = false) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function sqlCommandQuery($query) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function rowDescription($table) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function rowDescriptions($rows, $foreignKeys) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectLink($val, $field) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectVal($val, $link, $field, $original) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function editVal($val, $field) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function tableStructurePrint($fields) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function tableIndexesPrint($indexes) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectColumnsPrint($select, $columns) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectSearchPrint($where, $columns, $indexes) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectOrderPrint($order, $columns, $indexes) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectLimitPrint($limit) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectLengthPrint($text_length) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectActionPrint($indexes) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectCommandPrint() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectImportPrint() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectEmailPrint($emailFields, $columns) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectColumnsProcess($columns, $indexes) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectSearchProcess($fields, $indexes) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectOrderProcess($fields, $indexes) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectLimitProcess() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectLengthProcess() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectEmailProcess($where, $foreignKeys) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function selectQueryBuild($select, $where, $group, $order, $limit, $page) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function messageQuery($query, $time, $failed = false) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function editInput($table, $field, $attrs, $value) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function editHint($table, $field, $value) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function processInput($field, $value, $function = "") {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function dumpDatabase($db) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function dumpTable($table, $style, $is_view = 0) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function dumpData($table, $style, $query) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function dumpFilename($identifier) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function dumpHeaders($identifier, $multi_table = false) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function dumpFooter() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function importServerPath() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function homepage() {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function navigation($missing) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function syntaxHighlighting($tables) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function databasesPrint($missing) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+
+       function tablesPrint($tables) {
+               $args = func_get_args();
+               return $this->applyPlugin(__FUNCTION__, $args);
+       }
+}
index 06e2b335f1848511a719c69cab127486c549b1d5..8f8811d6271d0b934036c74031a96acfb11c2edb 100644 (file)
@@ -1,4 +1,4 @@
 <?php
 namespace Adminer;
 
-$VERSION = "5.0.7-dev";
+$VERSION = "5.1.0-dev";
diff --git a/adminer/plugin.php b/adminer/plugin.php
deleted file mode 100644 (file)
index d95a2f0..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-function adminer_object() {
-       // required to run any plugin
-       include_once "../plugins/plugin.php";
-
-       // autoloader
-       foreach (glob("../plugins/*.php") as $filename) {
-               include_once $filename;
-       }
-
-       // enable extra drivers just by including them
-       //~ include "../plugins/drivers/simpledb.php";
-
-       $plugins = array(
-               // specify enabled plugins here
-               new AdminerDatabaseHide(array('information_schema')),
-               new AdminerDumpJson,
-               new AdminerDumpBz2,
-               new AdminerDumpZip,
-               new AdminerDumpXml,
-               new AdminerDumpAlter,
-               //~ new AdminerSqlLog("past-" . rtrim(`git describe --tags --abbrev=0`) . ".sql"),
-               //~ new AdminerTinymce("../externals/tinymce/jscripts/tiny_mce/tiny_mce_dev.js"),
-               new AdminerFileUpload(""),
-               new AdminerJsonColumn,
-               new AdminerSlugify,
-               new AdminerTranslation,
-               new AdminerForeignSystem,
-               new AdminerEnumOption,
-               new AdminerTablesFilter,
-               new AdminerEditForeign,
-       );
-
-       /* It is possible to combine customization and plugins:
-       class AdminerCustomization extends AdminerPlugin {
-       }
-       return new AdminerCustomization($plugins);
-       */
-
-       return new AdminerPlugin($plugins);
-}
-
-// include original Adminer or Adminer Editor (usually named adminer.php)
-include "./index.php";
diff --git a/plugins/plugin.php b/plugins/plugin.php
deleted file mode 100644 (file)
index dbb13a4..0000000
+++ /dev/null
@@ -1,415 +0,0 @@
-<?php
-
-/** Adminer customization allowing usage of plugins
-* @link https://www.adminer.org/plugins/#use
-* @author Jakub Vrana, https://www.vrana.cz/
-* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
-* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
-*/
-class AdminerPlugin extends Adminer\Adminer {
-       protected $plugins;
-
-       /** Register plugins
-       * @param array object instances
-       */
-       function __construct($plugins) {
-               $this->plugins = $plugins;
-       }
-
-       private function callParent($function, $args) {
-               return call_user_func_array(array('parent', $function), $args);
-       }
-
-       private function applyPlugin($function, $args) {
-               foreach ($this->plugins as $plugin) {
-                       if (method_exists($plugin, $function)) {
-                               switch (count($args)) { // call_user_func_array() doesn't work well with references
-                                       case 0:
-                                               $return = $plugin->$function();
-                                               break;
-                                       case 1:
-                                               $return = $plugin->$function($args[0]);
-                                               break;
-                                       case 2:
-                                               $return = $plugin->$function($args[0], $args[1]);
-                                               break;
-                                       case 3:
-                                               $return = $plugin->$function($args[0], $args[1], $args[2]);
-                                               break;
-                                       case 4:
-                                               $return = $plugin->$function($args[0], $args[1], $args[2], $args[3]);
-                                               break;
-                                       case 5:
-                                               $return = $plugin->$function($args[0], $args[1], $args[2], $args[3], $args[4]);
-                                               break;
-                                       case 6:
-                                               $return = $plugin->$function($args[0], $args[1], $args[2], $args[3], $args[4], $args[5]);
-                                               break;
-                                       default:
-                                               trigger_error('Too many parameters.', E_USER_WARNING);
-                               }
-                               if ($return !== null) {
-                                       return $return;
-                               }
-                       }
-               }
-               return $this->callParent($function, $args);
-       }
-
-       private function appendPlugin($function, $args) {
-               $return = $this->callParent($function, $args);
-               foreach ($this->plugins as $plugin) {
-                       if (method_exists($plugin, $function)) {
-                               $value = call_user_func_array(array($plugin, $function), $args);
-                               if ($value) {
-                                       $return += $value;
-                               }
-                       }
-               }
-               return $return;
-       }
-
-       // appendPlugin
-
-       function dumpFormat() {
-               $args = func_get_args();
-               return $this->appendPlugin(__FUNCTION__, $args);
-       }
-
-       function dumpOutput() {
-               $args = func_get_args();
-               return $this->appendPlugin(__FUNCTION__, $args);
-       }
-
-       function editRowPrint($table, $fields, $row, $update) {
-               $args = func_get_args();
-               return $this->appendPlugin(__FUNCTION__, $args);
-       }
-
-       function editFunctions($field) {
-               $args = func_get_args();
-               return $this->appendPlugin(__FUNCTION__, $args);
-       }
-
-       // applyPlugin
-
-       function name() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function credentials() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function connectSsl() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function permanentLogin($create = false) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function bruteForceKey() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function serverName($server) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function database() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function schemas() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function databases($flush = true) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function queryTimeout() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function headers() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function csp() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function head($dark = null) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function css() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function loginForm() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function loginFormField($name, $heading, $value) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function login($login, $password) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function tableName($tableStatus) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function fieldName($field, $order = 0) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectLinks($tableStatus, $set = "") {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function foreignKeys($table) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function backwardKeys($table, $tableName) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function backwardKeysPrint($backwardKeys, $row) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectQuery($query, $start, $failed = false) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function sqlCommandQuery($query) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function rowDescription($table) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function rowDescriptions($rows, $foreignKeys) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectLink($val, $field) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectVal($val, $link, $field, $original) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function editVal($val, $field) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function tableStructurePrint($fields) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function tableIndexesPrint($indexes) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectColumnsPrint($select, $columns) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectSearchPrint($where, $columns, $indexes) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectOrderPrint($order, $columns, $indexes) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectLimitPrint($limit) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectLengthPrint($text_length) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectActionPrint($indexes) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectCommandPrint() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectImportPrint() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectEmailPrint($emailFields, $columns) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectColumnsProcess($columns, $indexes) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectSearchProcess($fields, $indexes) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectOrderProcess($fields, $indexes) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectLimitProcess() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectLengthProcess() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectEmailProcess($where, $foreignKeys) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function selectQueryBuild($select, $where, $group, $order, $limit, $page) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function messageQuery($query, $time, $failed = false) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function editInput($table, $field, $attrs, $value) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function editHint($table, $field, $value) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function processInput($field, $value, $function = "") {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function dumpDatabase($db) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function dumpTable($table, $style, $is_view = 0) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function dumpData($table, $style, $query) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function dumpFilename($identifier) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function dumpHeaders($identifier, $multi_table = false) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function dumpFooter() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function importServerPath() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function homepage() {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function navigation($missing) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function syntaxHighlighting($tables) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function databasesPrint($missing) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-
-       function tablesPrint($tables) {
-               $args = func_get_args();
-               return $this->applyPlugin(__FUNCTION__, $args);
-       }
-}
diff --git a/plugins/readme.txt b/plugins/readme.txt
deleted file mode 100644 (file)
index 0f690b6..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-../adminer/plugin.php - demo usage
-https://www.adminer.org/plugins/ - documentation
index d8419c72ee588b7d86d05b33f7631c893ec9796e..4f6850037dd9894d07b841bae8116af496eeee6c 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -8,7 +8,6 @@ Draggable columns in alter table (thanks to Michal Manak)
 <option class> for system databases and schemas - information_schema and driver-specific (thanks to Vaclav Novotny)
 Define foreign keys name - http://forum.zdrojak.root.cz/index.php?topic=185.msg1255#msg1255
 Skinnable plus.gif and other images - http://typo3.org/extensions/repository/view/t3adminer/current/
-Plugins autoloader: branch autoload; are there security risks?
 ? Filter by value in row under <thead> in select
 ? Column and table names auto-completion in SQL textarea - http://blog.quplo.com/2010/06/css-code-completion-in-your-browser/
 ? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, aliasing of $connection->query can save 24 B, JS Closure compiler can save 2 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB