-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathinit.php
44 lines (27 loc) · 1020 Bytes
/
init.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
<?php
use Flm\Helper;
use Flm\WebController;
$pluginDir = dirname(__FILE__);
require_once($pluginDir . "/boot.php");
$pluginConfig = Helper::getConfig();
if (function_exists('findRemoteEXE'))
{
//bootstrap
$confBins = array_map(function ($v) {
return $v['bin'];
}, $pluginConfig['archive']['type']);
foreach (array_unique($confBins) as $bin)
{
findRemoteEXE($bin, "thePlugins.get('filemanager').showError(\"theUILang.fErrMsg[24] +'" . $bin . "' \");", $remoteRequests);
$info = $remoteRequests[$bin];
$file = $info["path"] . $bin . ".found";
if (!is_file($file) && isset($pluginConfig['archive']['type'][$bin]))
{
unset($pluginConfig['archive']['type'][$bin]);
}
}
$theSettings->registerEventHook($plugin["name"], "TaskSuccess", 10, true);
$theSettings->registerPlugin("filemanager");
$c = new WebController($pluginConfig);
$jResult .= 'plugin.config = ' . json_encode($c->getConfig()) . ';';
}