-
Notifications
You must be signed in to change notification settings - Fork 46
/
index.php
44 lines (35 loc) · 1.12 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
function adminer_object()
{
// Required to run any plugin.
include_once "./plugins/plugin.php";
// Plugins auto-loader.
foreach (glob("plugins/*.php") as $filename) {
include_once "./$filename";
}
$serverHost = filter_input(INPUT_SERVER, 'HTTP_HOST');
$serverName = filter_input(INPUT_SERVER, 'SERVER_NAME');
$config = [
"servers" => [
"mysql://$serverHost" => $serverName,
"elastic://$serverHost:9200" => $serverName,
],
"theme" => "default-orange",
];
if (file_exists("config.php")) {
include_once "config.php";
}
// Specify enabled plugins here.
$plugins = [
new AdminerDatabaseHide(["mysql", "information_schema", "performance_schema"]),
new AdminerLoginServers($config["servers"]),
new AdminerSimpleMenu(),
new AdminerCollations(),
new AdminerJsonPreview(),
// AdminerTheme has to be the last one.
new AdminerTheme($config["theme"]),
];
return new AdminerPlugin($plugins);
}
// Include original Adminer or Adminer Editor.
include "./adminer.php";