8000 [Finder] Unable to scan root in unix like systems. · Issue #35683 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Finder] Unable to scan root in unix like systems. #35683

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
xandros15 opened this issue Feb 12, 2020 · 1 comment
Closed

[Finder] Unable to scan root in unix like systems. #35683

xandros15 opened this issue Feb 12, 2020 · 1 comment

Comments

@xandros15
Copy link

Symfony version(s) affected: 5.0.4 and 4.4.4 and maybe others.

Description
When i use '/' or ['/'] as parametr in method Finder::in, got exception during iteration: Directory name must not be empty. In line 48 /vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php.

How to reproduce
(code should works of unix like systems)

use Symfony\Component\Finder\Finder;

$finder = new Finder();
$finder->in('/');
foreach($finder as $item){
}
@dompie
Copy link
Contributor
dompie commented Feb 12, 2020

I can confirm the behaviour for Symfony 5.0.4 (did not try other version).
A single / is normalized away in this function. Therefore the native PHP \RecursiveDirectorySeparator gets an empty string passed in Symfony\Component\Finder\Iterator\RecursiveDirectorySeparator

Maybe you can workaround it by using something like /home/../ for now ?

@fabpot fabpot closed this as completed Feb 14, 2020
fabpot added a commit that referenced this issue Feb 14, 2020
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead.

Discussion
----------

[Finder] Fix unix root dir issue

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35683
| License       | MIT

not quite sure about this one 🤔

Commits
-------

9e43103 fix unix root dir issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
0