10000 [Debug] Replaced logic for detecting filesystem case sensitivity · symfony/symfony@2e81b0a · GitHub
[go: up one dir, main page]

Skip to content

Commit 2e81b0a

Browse files
Dan Blowsnicolas-grekas
Dan Blows
authored andcommitted
[Debug] Replaced logic for detecting filesystem case sensitivity
1 parent b228378 commit 2e81b0a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Symfony/Component/Debug/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)
0