r88629 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88628‎ | r88629 | r88630 >
Date:01:18, 23 May 2011
Author:nelson
Status:resolved (Comments)
Tags:
Comment:
Swift needs to rewrite entire files. We need this call to prevent N**2 operations while appending
Modified paths:
  • /trunk/phase3/includes/filerepo/FileRepo.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadBase.php
@@ -216,6 +216,19 @@
217217 }
218218
219219 /**
 220+ * Finish appending to the Repo file
 221+ *
 222+ * @param $toAppendPath String: path to the Repo file that will be appended to.
 223+ * @return Status Status
 224+ */
 225+ protected function appendFinish( $toAppendPath ) {
 226+ $repo = RepoGroup::singleton()->getLocalRepo();
 227+ $status = $repo->appendFinish( $toAppendPath );
 228+ return $status;
 229+ }
 230+
 231+
 232+ /**
220233 * @param $srcPath String: the source path
221234 * @return the real path if it was a virtual URL
222235 */
Index: trunk/phase3/includes/filerepo/FileRepo.php
@@ -429,7 +429,8 @@
430430
431431
432432 /**
433 - * Append the contents of the source path to the given file.
 433+ * Append the contents of the source path to the given file, OR queue
 434+ * the appending operation in anticipation of a later appendFinish() call.
434435 * @param $srcPath String: location of the source file
435436 * @param $toAppendPath String: path to append to.
436437 * @param $flags Integer: bitfield, may be FileRepo::DELETE_SOURCE to indicate
@@ -439,6 +440,13 @@
440441 abstract function append( $srcPath, $toAppendPath, $flags = 0 );
441442
442443 /**
 444+ * Finish the append operation.
 445+ * @param $toAppendPath String: path to append to.
 446+ * @return mixed Status or false
 447+ */
 448+ abstract function appendFinish( $toAppendPath );
 449+
 450+ /**
443451 * Remove a temporary file or mark it for garbage collection
444452 * @param $virtualUrl String: the virtual URL returned by storeTemp
445453 * @return Boolean: true on success, false on failure

Follow-up revisions

RevisionCommit summaryAuthorDate
r88631Fill-in missing implementations of abstract function appendFinish()nelson02:30, 23 May 2011

Comments

#Comment by RussNelson (talk | contribs)   03:58, 23 May 2011

Fixed already.

#Comment by Aaron Schulz (talk | contribs)   04:30, 23 May 2011

Status & tagging log