-
Notifications
You must be signed in to change notification settings - Fork 13
/
ProcessTracyAdminerRenderer.module.php
64 lines (51 loc) · 2.32 KB
/
ProcessTracyAdminerRenderer.module.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
class ProcessTracyAdminerRenderer extends Process implements Module {
public static function getModuleInfo() {
return array(
'title' => __('Process Tracy Adminer Renderer', __FILE__),
'summary' => __('Adminer renderer for TracyDebugger.', __FILE__),
'author' => 'Adrian Jones',
'href' => 'https://processwire.com/talk/topic/12208-tracy-debugger/',
'version' => '2.0.2',
'autoload' => false,
'singular' => true,
'icon' => 'database',
'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4, TracyDebugger',
'page' => array(
'name' => 'adminer-renderer',
'parent' => 'setup',
'title' => 'Adminer Renderer',
'status' => 'hidden'
)
);
}
public function ___execute() {
$_GET['db'] = $this->wire('config')->dbName;
function adminer_object() {
require_once './panels/Adminer/plugins/plugin.php';
foreach (glob(__DIR__.'/panels/Adminer/plugins/*.php') as $filename) {
require_once $filename/*NoCompile*/;
}
$data = wire('modules')->getModuleConfigData('TracyDebugger');
$port = wire('config')->dbPort ? ':' . wire('config')->dbPort : '';
$plugins = [
new AdminerFrames,
new AdminerProcessWireLogin(wire('config')->urls->admin, wire('config')->dbHost . $port, wire('config')->dbName, wire('config')->dbUser, wire('config')->dbPass, wire('config')->dbName),
new AdminerTablesFilter(),
new AdminerSimpleMenu(),
new AdminerCollations(),
new AdminerJsonPreview($data['adminerJsonMaxLevel'], $data['adminerJsonInTable'], $data['adminerJsonInEdit'], $data['adminerJsonMaxTextLength']),
new AdminerDumpJson,
new AdminerDumpBz2,
new AdminerDumpZip,
new AdminerDumpAlter,
new AdminerTableHeaderScroll(),
new AdminerTheme("default-".$data['adminerThemeColor'])
];
return new AdminerPlugin($plugins);
}
$_GET['username'] = '';
require_once __DIR__ . '/panels/Adminer/adminer-mysql.php'/*NoCompile*/;
exit;
}
}