In #935036: File exists in FileTransferFTPExtension->createDirectoryJailed(), we subclassed RecursiveDirectoryIterator to provide an iterator which skips '.' and '..' files. This was necessary since there was no built-in mechanism in PHP 5.2 to accomplish this. In PHP 5.3 RecursiveDirectoryIterator's parent was changed to FilesystemIterator which provides a convenient SKIP_DOTS flag.

This means we can remove the SkipDotsRecursiveDirectoryIterator compatibility layer and replace all calls like
new SkipDotsRecursiveDirectoryIterator($path) with new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS).

Since this requires PHP 5.3, this is for Drupal 8 only. I'm filing under update.module, but the relevant code all lies under includes/filetransfer/....

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bfroehle’s picture

Status: Active » Needs review
FileSize
3.39 KB

Patch attached.

xjm’s picture

Status: Needs review » Needs work
Issue tags: +Novice

Tagging as novice for the task of rerolling the Drupal 8.x patch on account of #22336: Move all core Drupal files under a /core folder to improve usability and upgrades.

If you need help rerolling this patch, you can come to core office hours or ask in #drupal-gitsupport on IRC.

bfroehle’s picture

Status: Needs work » Needs review
Issue tags: -Novice
FileSize
3.43 KB
PedroKTFC’s picture

Is there a version of this for Drupal 7?

Bump!

areke’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

It looks like this needs a re-roll.

falc0’s picture

Assigned: Unassigned » falc0
Issue tags: +SprintWeekend2014
falc0’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.73 KB
falc0’s picture

Added new patch, accidentally removed backslashes in previous one.

Status: Needs review » Needs work

The last submitted patch, 8: remove-skipdotsrecursivedirectoryiterator.patch, failed testing.

falc0’s picture

Status: Needs work » Needs review
tstoeckler’s picture

The patch no longer removes the actual class. Also, since we're already changing it, we should always prefix the native PHP classes with a backlash.

The last submitted patch, 7: remove-skipdotsrecursivedirectoryiterator.patch, failed testing.

alansaviolobo’s picture

Status: Needs review » Closed (won't fix)

since the class doesn't exist anymore, this can be closed.