mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-22 15:24:09 +00:00
feat:模块禁用时恢复安装备份的文件
This commit is contained in:
parent
c489a6c489
commit
a4e05dc802
@ -234,6 +234,25 @@ class Manage
|
|||||||
del_empty_dir(dirname($file));
|
del_empty_dir(dirname($file));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 恢复备份文件
|
||||||
|
if ($zipDir) {
|
||||||
|
foreach (
|
||||||
|
$iterator = new RecursiveIteratorIterator(
|
||||||
|
new RecursiveDirectoryIterator($zipDir, FilesystemIterator::SKIP_DOTS),
|
||||||
|
RecursiveIteratorIterator::SELF_FIRST
|
||||||
|
) as $item
|
||||||
|
) {
|
||||||
|
$ebakFile = path_transform(root_path() . $iterator->getSubPathName());
|
||||||
|
if ($item->isDir()) {
|
||||||
|
if (!is_dir($ebakFile)) {
|
||||||
|
mkdir($ebakFile, 0755, true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
copy($item, $ebakFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
deldir($zipDir);
|
deldir($zipDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user