r108194 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108193‎ | r108194 | r108195 >
Date:06:35, 6 January 2012
Author:aaron
Status:reverted (Comments)
Tags:
Comment:
r108192: Explicitly set flags for RecursiveDirectoryIterator constructor
Modified paths:
  • /trunk/phase3/includes/filerepo/backend/FSFileBackend.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/backend/FSFileBackend.php
@@ -456,7 +456,9 @@
457457 public function __construct( $dir ) {
458458 $this->suffixStart = strlen( realpath( $dir ) ) + 1; // size of "path/to/dir/"
459459 try {
460 - $this->iter = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $dir ) );
 460+ $flags = FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS;
 461+ $this->iter = new RecursiveIteratorIterator(
 462+ new RecursiveDirectoryIterator( $dir, $flags ) );
461463 } catch ( UnexpectedValueException $e ) {
462464 $this->iter = null; // bad permissions? deleted?
463465 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r110159* Reverted r108194 to support PHP < 5.3. These should already be the default ...aaron20:12, 27 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108192Fixes for r106752:...aaron05:15, 6 January 2012

Comments

#Comment by 😂 (talk | contribs)   14:41, 27 January 2012

This breaks 5.2 support.

#Comment by Dantman (talk | contribs)   15:40, 27 January 2012

;) of course 5.2 was EOLed some time ago, 5.4 is almost out, and there are other parts of core we would love to use 5.3isms in. Sounds about time to drop 5.2.

#Comment by Arseny1992 (talk | contribs)   15:55, 27 January 2012

Yes. I still running 5.2.10. When I updated to a rev containing this revision (also, if 5.2 support broken, why the installer passed?), I tried to test it. Brief repro of my steps: Have a file uploaded on wiki. Try to rename it. It threw an error related to FSFile stuff here on line 551, I hit back in browser and found out that the file wikipage did moved to the new name, but without registering to the move log, and the old page was still there. So I deleted the target pagename wikipages, did moved the first page to the target, suppressing redirect, and now I try to undelete the file page with that historymerge, but keeping receiving

Fatal error: Class 'FilesystemIterator' not found in .....\includes\filerepo\backend\FSFileBackend.php on line 551

and the page still remains in the deleted state, so I can't undelete it...

#Comment by 😂 (talk | contribs)   15:57, 27 January 2012

>also, if 5.2 support broken, why the installer passed?

The installer wasn't updated because support wasn't intentionally broken for 5.2. We only update the installer when we explicitly bump the minimum version. That's not what happened here--it was an accident.

Status & tagging log