bug #34396 [Finder] Allow ssh2 stream wrapper for sftp (damienalexandre)
bug #34396 [Finder] Allow ssh2 stream wrapper for sftp (damienalexandre)

This PR was merged into the 3.4 branch.

Discussion
----------

[Finder] Allow ssh2 stream wrapper for sftp

Same fix as #28604 but for the ssh2.sftp wrapper.

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #28604 maybe
| License       | MIT
| Doc PR        |

Without this patch, we can't use the finder with ssh2.sftp connections.

```php
$connection = \ssh2_connect('host', 22);
\ssh2_auth_password($connection, 'user', 'pass');

$sftp = \ssh2_sftp($connection);
$path = "ssh2.sftp://".intval($sftp)."/";

$finder = new Finder();

foreach ($finder->in($path)->files() as $directory) {
    dump(file_get_contents($directory));
}
```

Without the patch:

>   RecursiveDirectoryIterator::__construct(ssh2.sftp://838): failed to open dir: operation failed

Commits
-------

e6c9d77b63 [Finder] Allow ssh2 stream wrapper for sftp

mnapoli/symfony,Deamon/symfony,maidmaid/symfony,smatyas/symfony,maidmaid/symfony,OskarStark/symfony,Nyholm/symfony,fabpot/symfony,kbond/symfony,localheinz/symfony,mpdude/symfony,jderusse/symfony,1ed/symfony,zorn-v/symfony,shieldo/symfony,phramz/symfony,mpdude/symfony,stof/symfony,jderusse/symfony,shieldo/symfony,OskarStark/symfony,Koc/symfony,Taluu/symfony,pierredup/symfony,ragboyjr/symfony,Simperfit/symfony,Slamdunk/symfony,mweimerskirch/symfony,garak/symfony,paradajozsef/symfony,ragboyjr/symfony,mnapoli/symfony,smatyas/symfony,d-ph/symfony,paradajozsef/symfony,jakzal/symfony,chalasr/symfony,1ed/symfony,phramz/symfony,jakzal/symfony,oleg-andreyev/symfony,mpdude/symfony,Simperfit/symfony,garak/symfony,bendavies/symfony,alekitto/symfony,symfony/symfony,alekitto/symfony,pierredup/symfony,nicolas-grekas/symfony,HeahDude/symfony,jvasseur/symfony,localheinz/symfony,dmaicher/symfony,nicolas-grekas/symfony,tucksaun/symfony,tgalopin/symfony,jderusse/symfony,phramz/symfony,smatyas/symfony,derrabus/symfony,lstrojny/symfony,HeahDude/symfony,Koc/symfony,MatTheCat/symfony,MatTheCat/symfony,alekitto/symfony,curry684/symfony,d-ph/symfony,gonzalovilaseca/symfony,pyrech/symfony,jvasseur/symfony,chalasr/symfony,MatTheCat/symfony,oleg-andreyev/symfony,d-ph/symfony,bendavies/symfony,OskarStark/symfony,alekitto/symfony,localheinz/symfony,kbond/symfony,mweimerskirch/symfony,shieldo/symfony,Tobion/symfony,jakzal/symfony,mnapoli/symfony,smatyas/symfony,Koc/symfony,jderusse/symfony,lstrojny/symfony,fabpot/symfony,mweimerskirch/symfony,mpdude/symfony,tgalopin/symfony,OskarStark/symfony,maidmaid/symfony,ogizanagi/symfony,damienalexandre/symfony,voronkovich/symfony,Tobion/symfony,damienalexandre/symfony,MatTheCat/symfony,hhamon/symfony,Nyholm/symfony,bendavies/symfony,dmaicher/symfony,zerkms/symfony,Slamdunk/symfony,hhamon/symfony,jakzal/symfony,ro0NL/symfony,stof/symfony,zerkms/symfony,dmaicher/symfony,Simperfit/symfony,gonzalovilaseca/symfony,Tobion/symfony,1ed/symfony,maidmaid/symfony,pierredup/symfony,ro0NL/symfony,damienalexandre/symfony,tucksaun/symfony,symfony/symfony,mweimerskirch/symfony,ogizanagi/symfony,ogizanagi/symfony,symfony/symfony,sgehrig/symfony,xabbuh/symfony,xabbuh/symfony,dmaicher/symfony,lyrixx/symfony,Slamdunk/symfony,mweimerskirch/symfony,ogizanagi/symfony,Tobion/symfony,Deamon/symfony,zerkms/symfony,pyrech/symfony,zerkms/symfony,HeahDude/symfony,derrabus/symfony,smatyas/symfony,xabbuh/symfony,Simperfit/symfony,paradajozsef/symfony,oleg-andreyev/symfony,ragboyjr/symfony,stof/symfony,hhamon/symfony,xabbuh/symfony,Nyholm/symfony,derrabus/symfony,tucksaun/symfony,gonzalovilaseca/symfony,zorn-v/symfony,curry684/symfony,paradajozsef/symfony,kbond/symfony,gonzalovilaseca/symfony,curry684/symfony,voronkovich/symfony,shieldo/symfony,mnapoli/symfony,damienalexandre/symfony,Deamon/symfony,localheinz/symfony,sgehrig/symfony,ro0NL/symfony,tgalopin/symfony,Taluu/symfony,voronkovich/symfony,1ed/symfony,HeahDude/symfony,Deamon/symfony,tucksaun/symfony,symfony/symfony,lyrixx/symfony,lstrojny/symfony,Simperfit/symfony,fabpot/symfony,chalasr/symfony,curry684/symfony,lyrixx/symfony,oleg-andreyev/symfony,sgehrig/symfony,nicolas-grekas/symfony,phramz/symfony,nicolas-grekas/symfony,jvasseur/symfony,pierredup/symfony,mnapoli/symfony,zorn-v/symfony,Deamon/symfony,chalasr/symfony,d-ph/symfony,ragboyjr/symfony,voronkovich/symfony,stof/symfony,zorn-v/symfony,ro0NL/symfony,derrabus/symfony,bendavies/symfony,tgalopin/symfony,Koc/symfony,lyrixx/symfony,Nyholm/symfony,sgehrig/symfony,pyrech/symfony,kbond/symfony,garak/symfony,Taluu/symfony,jvasseur/symfony,garak/symfony,hhamon/symfony,fabpot/symfony,pyrech/symfony,Taluu/symfony,Slamdunk/symfony