Skip to content

[Debug] Fix case sensitivity checks #18352

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

Merged
merged 1 commit into from
Mar 30, 2016
Merged

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? yes
Deprecations? no
Tests pass? yes
Fixed tickets #18344
License MIT
Doc PR -

@stof
Copy link
Member

stof commented Mar 29, 2016

Looks like deps=high needs some fixing.

regarding this PR, this looks good to me. 👍

@alexchip64
Copy link

With this fix, in Windows system, $caseCheck is set to "0", whereas it should be set to "1" (filesystem is NOT case sensitive) as in previous versions.

@nicolas-grekas
Copy link
Member Author

@alexchip64 can you detail why it ends up being set to zero in your case?

@alexchip64
Copy link

Because, in my case, the situation of the checking is as follow:

$file = C:\Users\cipriano\Documents\NetBeansProjects\zoe\vendor\symfony\symfony\src\Symfony\Component\Debug\DebugClassLoader.php

$fileTest = C:\USERS\CIPRIANO\DOCUMENTS\NETBEANSPROJECTS\ZOE\VENDOR\SYMFONY\SYMFONY\SRC\SYMFONY\COMPONENT\DEBUG\DEBUGCLASSLOADER.PHP

but

realpath($fileTest) = C:\Users\cipriano\DOCUMENTS\NETBEANSPROJECTS\zoe\vendor\symfony\symfony\src\Symfony\Component\Debug\DebugClassLoader.php

so the check realpath($fileTest) === $file fails.

@nicolas-grekas
Copy link
Member Author

does it work better if you use strtolower instead of strtoupper?

@alexchip64
Copy link

I've done it, it but final result does not change:

$fileTest = 'c:\users\cipriano\documents\netbeansprojects\zoe\vendor\symfony\symfony\src\symfony\component\debug\debugclassloader.php'

but

realpath($fileTest) = 'C:\Users\cipriano\documents\netbeansprojects\zoe\vendor\symfony\symfony\src\Symfony\Component\Debug\DebugClassLoader.php'

@nicolas-grekas
Copy link
Member Author

strange... this means it couldn't work previously and caseCheck ended up being 2, not 1, isn't it?

@alexchip64
Copy link

Version 2.8.4 does not work in Windows as I indicated in my #18344, because final value is 2 and Symfony hangs.
Previous versions used different way for checking:

self::$caseCheck = false !== stripos(PHP_OS, 'win') ? (false !== stripos(PHP_OS, 'darwin') ? 2 : 1) : 0;

@nicolas-grekas
Copy link
Member Author

@alexchip64 PR updated, can you please check the new patch?

@alexchip64
Copy link

Nothing changes.

$test = 'C:\Users\cipriano\Documents\NetBeansProjects\zoe\vendor\symfony\symfony\src\Symfony\Component\Debug\DebugClassLoader.php'

and

$file = 'DebugClassLoader.php'

so the checking:
elseif (substr($test, -strlen($file)) !== $file)

returns false

@nicolas-grekas
Copy link
Member Author

My bad, it should be === instead of !==. Fixed.

@alexchip64
Copy link

Now it is ok. At least it appears ok for Windows systems.
I've understood what you have done: you ignore the path and focus on the filename only.

@fabpot
Copy link
Member

fabpot commented Mar 30, 2016

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 7336177 into symfony:2.7 Mar 30, 2016
fabpot added a commit that referenced this pull request Mar 30, 2016
This PR was merged into the 2.7 branch.

Discussion
----------

[Debug] Fix case sensitivity checks

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18344
| License       | MIT
| Doc PR        | -

Commits
-------

7336177 [Debug] Fix case sensitivity checks
@fabpot fabpot mentioned this pull request Mar 30, 2016
@nicolas-grekas nicolas-grekas deleted the debug-case branch April 3, 2016 15:40
This was referenced Apr 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants