mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
FileSystem.php isRelativePath() compatibility for windows
This commit is contained in:
parent
24156884e4
commit
db2b22c822
@ -70,6 +70,10 @@ class FileSystem
|
||||
*/
|
||||
public static function isRelativePath(string $path): bool
|
||||
{
|
||||
// 适配 Windows 的多盘符目录形式
|
||||
if (DIRECTORY_SEPARATOR === '\\') {
|
||||
return strlen($path) > 2 && ctype_alpha($path[0]) && $path[1] === ':';
|
||||
}
|
||||
return strlen($path) > 0 && $path[0] !== '/';
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user