I want to use the 'light' version of Adminer called Adminer Editor to access a SQLite3 database file in the same directory.
The documentation on the official website doesn't seem to be too extensive and I am still trying it took me a long time to find a working solution.
I was able to overcome the None of the supported PHP extensions (SQLite3, PDO_SQLite) are available.
error.
Later I was stuck at the Database does not support password.
error.
After this I was confronted with the attempt to write a readonly database
error.
I hope my experience will help other people using adminer editor.
My system is Manjaro based on Archlinux, some of the commands might be different for your system.
sudo pacman -S php-sqlite
/etc/php/php.ini
:;extension=sqlite3
by removing the ;
.sudo systemctl restart httpd.service
.<?php phpinfo();
into a php file and open it in your browser.adminer-editor.php
.plugin.php
and login-password-less.php
from the Plugins page and put them into the plugins
subfolder.sqlite3 database.db
in terminal.sqlite.php
file from the adminer github repository and save it as index.php
. adminer-editor.php
database.db
index.php
plugins/
|__ login-password-less.php
|__ plugin.php
index.php
file. The content of my file is this:<?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 "database.db";
}
}
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("password", PASSWORD_DEFAULT)),
));
}
include 'adminer-editor.php';
index.php
.edit: Some things to note:
micro
did break them, nano
didn't.Some questions that are left on my side:
// TODO
line mean; Is there a way that I don't have to store the password in plain text in my index.php
file?