]> git.joonet.de Git - adminer.git/commitdiff
Add example for using SQLite with Editor
authorJakub Vrana <jakub@vrana.cz>
Thu, 30 Jan 2020 17:02:06 +0000 (18:02 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 30 Jan 2020 17:03:21 +0000 (18:03 +0100)
editor/sqlite.php [new file with mode: 0644]

diff --git a/editor/sqlite.php b/editor/sqlite.php
new file mode 100644 (file)
index 0000000..71d747d
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+function adminer_object() {
+       include_once "../plugins/plugin.php";
+       include_once "../plugins/login-password-less.php";
+       
+       class AdminerCustomization extends AdminerPlugin {
+               function loginFormField($name, $heading, $value) {
+                       return parent::loginFormField($name, $heading, str_replace('value="server"', 'value="sqlite"', $value));
+               }
+               function database() {
+                       return "PATH_TO_YOUR_SQLITE_HERE";
+               }
+       }
+       
+       return new AdminerCustomization(array(
+               // TODO: inline the result of password_hash() so that the password is not visible in source codes
+               new AdminerLoginPasswordLess(password_hash("YOUR_PASSWORD_HERE", PASSWORD_DEFAULT)),
+       ));
+}
+
+include "./index.php";