-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathProcessTracyAdminerRenderer.module.php
More file actions
75 lines (64 loc) · 2.87 KB
/
ProcessTracyAdminerRenderer.module.php
File metadata and controls
75 lines (64 loc) · 2.87 KB
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
65
66
67
68
69
70
71
72
73
74
75
<?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.3',
'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() {
function adminneo_instance() {
foreach (glob(__DIR__.'/panels/Adminer/plugins/*.php') as $filename) {
require_once $filename/*NoCompile*/;
}
$tracyConfig = wire('modules')->getModuleConfigData('TracyDebugger');
$plugins = [
new \AdminNeo\ExternalLoginPlugin(true),
new \AdminNeo\FrameSupportPlugin(["self"]),
new \AdminNeo\ProcessWirePlugin(),
new \AdminNeo\JsonDumpPlugin,
new \AdminNeo\JsonPreviewPlugin($tracyConfig['adminerJsonMaxLevel'], $tracyConfig['adminerJsonInTable'], $tracyConfig['adminerJsonInEdit'], $tracyConfig['adminerJsonMaxTextLength']),
new \AdminNeo\XmlDumpPlugin,
new \AdminNeo\Bz2OutputPlugin,
new \AdminNeo\ZipOutputPlugin
];
$config = [
"servers" => [
[
"driver" => "mysql",
"server" => wire('config')->dbHost . (wire('config')->dbPort ? ':' . wire('config')->dbPort : ''),
"database" => wire('config')->dbName,
"username" => wire('config')->dbUser,
"password" => wire('config')->dbPass
]
],
"jsonValuesDetection" => true,
"jsonValuesAutoFormat" => true,
"preferSelection" => true,
"colorVariant" => $tracyConfig['adminerThemeColor'],
"cssUrls" => [
wire('config')->urls->root . 'site/modules/TracyDebugger/panels/Adminer/css/tweaks.css'
],
"jsUrls" => [
wire('config')->urls->root . 'site/modules/TracyDebugger/panels/Adminer/scripts/tweaks.js'
]
];
return \AdminNeo\Admin::create($config, $plugins);
}
require_once __DIR__ . '/panels/Adminer/adminneo.php'/*NoCompile*/;
exit;
}
}