Error stacktrace with --dev enabled while conversion is in progress

Also shorter constants.
This commit is contained in:
2023-10-03 09:01:37 +08:00
parent 771fe4931a
commit 5666702ccc
10 changed files with 44 additions and 29 deletions

View File

@@ -25,7 +25,7 @@ class FileSystem
public static function normalizePath(string $path): string
{
$path = str_replace('~', $_SERVER['HOME'], $path);
return rtrim($path, DIRECTORY_SEPARATOR);
return rtrim($path, DS);
}
/**
@@ -101,7 +101,7 @@ class FileSystem
$path = static::normalizePath($path);
$records = array_diff(@scandir($path) ?: [], ['.', '..']);
foreach ($records as &$record) {
$record = sprintf('%s%s%s', $path, DIRECTORY_SEPARATOR, $record);
$record = sprintf('%s%s%s', $path, DS, $record);
}
return $records;
}