8000 [Debug] Replaced logic for detecting filesystem case sensitivity by blowski · Pull Request #18126 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Debug] Replaced logic for detecting filesystem case sensitivity #18126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
[Debug] Replaced logic for detecting filesystem case sensitivity
When I cloned the master branch onto a Virtualbox Vagrant OSX El Capitan host, Ubuntu Wily guest, the `Symfony\Component\Debug\Tests\DebugClassLoaderTest::testFileCaseMismatch` failed because 'Failed asserting that exception of type "\RuntimeException" is thrown'.

@wouterj confirmed he got the same problem, and it's because Virtualbox shared folders aren't case sensitive, even when the guest is using a case sensitive filesystem. So I've replaced the logic that looked at the name of the operating system.

I ran the tests in the following environments:
* Virtualbox/Vagrant - OSX Host, Ubuntu guest
* Virtualbox/Vagrant - OSX Host, Windows guest
* OSX native
* Ubuntu native

NB - I _didn't_ run it on native Windows (because I don't have easy access to one).
  • Loading branch information
Dan Blows committed Mar 12, 2016
commit dc2a045c8b9d83c8e5dc4ee64a7bb85021c83846
6 changes: 3 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 @@ -61,7 +62,6 @@ public function __construct($classLoader)
self::$caseCheck = 1;
} else {
// filesystem is not case sensitive AND realpath() fails to normalize case
// this is _probably_ OX
self::$caseCheck = 2;
}
}
Expand All @@ -81,7 +81,7 @@ public function getClassLoader()
}

/**
* Wraps all autoloaders
* Wraps all autoloaders.
*/
public static function enable()
{
Expand Down Expand Up @@ -128,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
0