|
@@ -98,14 +98,14 @@ class AppearanceImPortForm extends Form implements LazyRenderable
|
|
|
}
|
|
|
// 获取文件夹名称
|
|
|
$folderName = reset($items);
|
|
|
- $folderPath = $extractPath . '\\' . $folderName;
|
|
|
+ $folderPath = $extractPath . '/' . $folderName;
|
|
|
// 获取文件夹下的所有文件和文件夹
|
|
|
$folderContents = scandir($folderPath);
|
|
|
$folderContents = array_diff($folderContents, ['.', '..']);
|
|
|
// 将文件夹中的所有内容移动到 $trulyPath
|
|
|
foreach ($folderContents as $fileOrDir) {
|
|
|
- $sourcePath = $folderPath . '\\' . $fileOrDir;
|
|
|
- $destinationPath = $trulyPath . '\\' . $fileOrDir;
|
|
|
+ $sourcePath = $folderPath . '/' . $fileOrDir;
|
|
|
+ $destinationPath = $trulyPath . '/' . $fileOrDir;
|
|
|
// 如果是文件,移动文件
|
|
|
if (is_file($sourcePath)) {
|
|
|
if (!rename($sourcePath, $destinationPath)) {
|
|
@@ -122,8 +122,8 @@ class AppearanceImPortForm extends Form implements LazyRenderable
|
|
|
$folderFiles = scandir($sourcePath);
|
|
|
$folderFiles = array_diff($folderFiles, ['.', '..']);
|
|
|
foreach ($folderFiles as $subFile) {
|
|
|
- $subSourcePath = $sourcePath . '\\' . $subFile;
|
|
|
- $subDestinationPath = $destinationPath . '\\' . $subFile;
|
|
|
+ $subSourcePath = $sourcePath . '/' . $subFile;
|
|
|
+ $subDestinationPath = $destinationPath . '/' . $subFile;
|
|
|
if (!rename($subSourcePath, $subDestinationPath)) {
|
|
|
return ['status' => false, 'error' => "Error: Failed to move subfolder file $subFile\n"];
|
|
|
}
|
|
@@ -146,7 +146,7 @@ class AppearanceImPortForm extends Form implements LazyRenderable
|
|
|
|
|
|
// 循环遍历目录下的每一项
|
|
|
foreach ($items as $item) {
|
|
|
- $itemPath = $dir . '\\' . $item;
|
|
|
+ $itemPath = $dir . '/' . $item;
|
|
|
|
|
|
// 如果是文件,删除文件
|
|
|
if (is_file($itemPath)) {
|