Skip to content
This repository was archived by the owner on Dec 9, 2023. It is now read-only.

Commit ef78aaa

Browse files
Dan Blowsnicolas-grekas
authored andcommitted
[Debug] Replaced logic for detecting filesystem case sensitivity
1 parent 8dc1218 commit ef78aaa

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

DebugClassLoader.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,16 @@ public function __construct($classLoader)
5151
}
5252

5353
if (!isset(self::$caseCheck)) {
54-
self::$caseCheck = false !== stripos(PHP_OS, 'win') ? (false !== stripos(PHP_OS, 'darwin') ? 2 : 1) : 0;
54+
if(!file_exists(strtolower(__FILE__))) {
55+
// filesystem is case sensitive
56+
self::$caseCheck = 0;
57+
} elseif(realpath(strtolower(__FILE__)) === __FILE__) {
58+
// filesystem is not case sensitive
59+
self::$caseCheck = 1;
60+
} else {
61+
// filesystem is not case sensitive AND realpath() fails to normalize case
62+
self::$caseCheck = 2;
63+
}
5564
}
5665
}
5766

0 commit comments

Comments
 (0)