http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88629

Revision: 88629
Author:   nelson
Date:     2011-05-23 01:18:06 +0000 (Mon, 23 May 2011)
Log Message:
-----------
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
    trunk/phase3/includes/upload/UploadBase.php

Modified: trunk/phase3/includes/filerepo/FileRepo.php
===================================================================
--- trunk/phase3/includes/filerepo/FileRepo.php 2011-05-23 00:06:35 UTC (rev 
88628)
+++ trunk/phase3/includes/filerepo/FileRepo.php 2011-05-23 01:18:06 UTC (rev 
88629)
@@ -429,7 +429,8 @@
 
 
        /**
-        * Append the contents of the source path to the given file.
+        * Append the contents of the source path to the given file, OR queue
+        * the appending operation in anticipation of a later appendFinish() 
call.
         * @param $srcPath String: location of the source file
         * @param $toAppendPath String: path to append to.
         * @param $flags Integer: bitfield, may be FileRepo::DELETE_SOURCE to 
indicate
@@ -439,6 +440,13 @@
        abstract function append( $srcPath, $toAppendPath, $flags = 0 );
 
        /**
+        * Finish the append operation.
+        * @param $toAppendPath String: path to append to.
+        * @return mixed Status or false
+        */
+       abstract function appendFinish( $toAppendPath );
+
+       /**
         * Remove a temporary file or mark it for garbage collection
         * @param $virtualUrl String: the virtual URL returned by storeTemp
         * @return Boolean: true on success, false on failure

Modified: trunk/phase3/includes/upload/UploadBase.php
===================================================================
--- trunk/phase3/includes/upload/UploadBase.php 2011-05-23 00:06:35 UTC (rev 
88628)
+++ trunk/phase3/includes/upload/UploadBase.php 2011-05-23 01:18:06 UTC (rev 
88629)
@@ -216,6 +216,19 @@
        }
 
        /**
+        * Finish appending to the Repo file
+        *
+        * @param $toAppendPath String: path to the Repo file that will be 
appended to.
+        * @return Status Status
+        */
+       protected function appendFinish( $toAppendPath ) {
+               $repo = RepoGroup::singleton()->getLocalRepo();
+               $status = $repo->appendFinish( $toAppendPath );
+               return $status;
+       }
+
+
+       /**
         * @param $srcPath String: the source path
         * @return the real path if it was a virtual URL
         */


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to