[Debug] Replaced logic for detecting filesystem case sensitivity

This commit is contained in:
Dan Blows 2016-03-12 15:40:45 +00:00 committed by Nicolas Grekas
parent b228378d1f
commit 2e81b0a944
1 changed files with 10 additions and 1 deletions

View File

@ -51,7 +51,16 @@ class DebugClassLoader
}
if (!isset(self::$caseCheck)) {
self::$caseCheck = false !== stripos(PHP_OS, 'win') ? (false !== stripos(PHP_OS, 'darwin') ? 2 : 1) : 0;
if(!file_exists(strtolower(__FILE__))) {
// filesystem is case sensitive
self::$caseCheck = 0;
} elseif(realpath(strtolower(__FILE__)) === __FILE__) {
// filesystem is not case sensitive
self::$caseCheck = 1;
} else {
// filesystem is not case sensitive AND realpath() fails to normalize case
self::$caseCheck = 2;
}
}
}