Index: branches/FileBackend/phase3/includes/upload/UploadFromChunks.php |
— | — | @@ -95,8 +95,8 @@ |
96 | 96 | $fileList[] = $this->getVirtualChunkLocation( $i ); |
97 | 97 | } |
98 | 98 | |
99 | | - // Concatinate into the mVirtualTempPath location; |
100 | | - $status = $this->repo->concatenate( $fileList, $this->mVirtualTempPath, FileRepo::DELETE_SOURCE ); |
| 99 | + // Concatenate into the mVirtualTempPath location; |
| 100 | + $status = $this->repo->concatenate( $fileList, $this->mVirtualTempPath, FileRepo::DELETE_SOURCE ); |
101 | 101 | if( !$status->isOk() ){ |
102 | 102 | return $status; |
103 | 103 | } |
— | — | @@ -104,7 +104,22 @@ |
105 | 105 | $this->mTempPath = $this->getRealPath( $this->mVirtualTempPath ); |
106 | 106 | return $status; |
107 | 107 | } |
| 108 | + |
108 | 109 | /** |
| 110 | + * Perform the upload, then remove the temp copy afterward |
| 111 | + * @param $comment string |
| 112 | + * @param $pageText string |
| 113 | + * @param $watch bool |
| 114 | + * @param $user User |
| 115 | + * @return Status |
| 116 | + */ |
| 117 | + public function performUpload( $comment, $pageText, $watch, $user ) { |
| 118 | + $rv = parent::performUpload( $comment, $pageText, $watch, $user ); |
| 119 | + $this->repo->freeTemp( $this->mVirtualTempPath ); |
| 120 | + return $rv; |
| 121 | + } |
| 122 | + |
| 123 | + /** |
109 | 124 | * Returns the virtual chunk location: |
110 | 125 | * @param unknown_type $index |
111 | 126 | */ |
Index: branches/FileBackend/phase3/includes/filerepo/backend/FileBackendMultiWrite.php |
— | — | @@ -35,8 +35,8 @@ |
36 | 36 | * 'backends' : Array of backend config and multi-backend settings. |
37 | 37 | * Each value is the config used in the constructor of a |
38 | 38 | * FileBackend class, but with these additional settings: |
39 | | - * 'class' : The name of the backend class |
40 | | - * 'isMultiMaster': This must be set for one non-persistent backend. |
| 39 | + * 'class' : The name of the backend class |
| 40 | + * 'isMultiMaster' : This must be set for one backend. |
41 | 41 | * @param $config Array |
42 | 42 | */ |
43 | 43 | public function __construct( array $config ) { |
— | — | @@ -180,7 +180,7 @@ |
181 | 181 | return $this->backends[$this->masterIndex]->getFileTimestamp( $realParams ); |
182 | 182 | } |
183 | 183 | |
184 | | - function getFileSha1Base36(array $params) { |
| 184 | + function getFileSha1Base36( array $params ) { |
185 | 185 | # Hit all backends in case of failed operations (out of sync) |
186 | 186 | foreach ( $this->backends as $backend ) { |
187 | 187 | $realParams = $this->substOpPaths( $params, $backend ); |
Index: branches/FileBackend/phase3/includes/filerepo/backend/LockManager.php |
— | — | @@ -759,7 +759,7 @@ |
760 | 760 | $data[] = array( 'fls_key' => $key, 'fls_session' => $this->session ); |
761 | 761 | } |
762 | 762 | # Block new writers... |
763 | | - $db->insert( 'filelocks_shared', $data, __METHOD__ ); |
| 763 | + $db->insert( 'filelocks_shared', $data, __METHOD__, array( 'IGNORE' ) ); |
764 | 764 | # Actually do the locking queries... |
765 | 765 | if ( $type == self::LOCK_SH ) { // reader locks |
766 | 766 | # Bail if there are any existing writers... |