Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/Symfony/Component/Debug/DebugClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class DebugClassLoader
* @param callable|object $classLoader
*
* @api
*
* @deprecated since 2.5, passing an object is deprecated and support for it will be removed in 3.0
*/
public function __construct($classLoader)
Expand All @@ -52,7 +53,18 @@ public function __construct($classLoader)
}

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

Expand All @@ -69,7 +81,7 @@ public function getClassLoader()
}

/**
* Wraps all autoloaders
* Wraps all autoloaders.
*/
public static function enable()
{
Expand Down Expand Up @@ -116,7 +128,7 @@ public static function disable()
}

/**
* Finds a file by class name
* Finds a file by class name.
*
* @param string $class A class name to resolve to file
*
Expand Down