|
@@ -91,8 +91,11 @@ class AppearanceImPortForm extends Form implements LazyRenderable
|
|
|
|
|
|
// 获取 $extractPath 下的所有文件和文件夹
|
|
|
$items = scandir($extractPath);
|
|
|
+ var_dump($items);exit;
|
|
|
// 过滤掉 '.' 和 '..'
|
|
|
$items = array_diff($items, ['.', '..']);
|
|
|
+
|
|
|
+
|
|
|
// 判断 $extractPath 是否只有一个文件夹
|
|
|
if (count($items) != 1 || !is_dir($extractPath . '\\' . reset($items))) {
|
|
|
return ['status' => false, 'error' => "Error: unzip file does not contain exactly one folder."];
|