-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
49 lines (43 loc) · 1.3 KB
/
config.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
<?php
namespace Weline\ElfinderFileManager;
use Weline\Framework\Http\Url;
use Weline\Framework\Manager\ObjectManager;
use Weline\Framework\View\Template;
$app_boostrap_file = __DIR__ . '/../../../bootstrap.php';
$included = false;
if (file_exists($app_boostrap_file)) {
require_once $app_boostrap_file;
$included = true;
}
if (!$included) {
$app_boostrap_file = __DIR__ . '/../../../app/bootstrap.php';
if (file_exists($app_boostrap_file)) {
require_once $app_boostrap_file;
$included = true;
}
}
if (!$included) {
# 文件找不到
die('Bootstrap文件找不到!请确保你是在WelineFramework框架中使用此拓展!');
}
# 软件资源
if (!function_exists('exec')) {
die('exec 方法找不到!请确保PHP没有禁用exec!');
}
//dd(ini_get_all());
$ds = DS;
$vendor_path = VENDOR_PATH . "studio-42{$ds}elfinder";
$target_static_path = __DIR__ . DS . "view{$ds}statics{$ds}";
if (!is_dir($target_static_path)) {
mkdir($target_static_path, 0755, true);
}
# 搬迁文件
$target_static_dir = __DIR__ . DS . "view{$ds}statics{$ds}";
if (!is_dir($target_static_dir)) {
mkdir($target_static_dir, 0755, true);
}
if (IS_WIN) {
exec("xcopy {$vendor_path} {$target_static_path} /E /I /Y /F");
} else {
exec("cp -r {$vendor_path} {$target_static_path} -f");
}