Index: trunk/phase3/includes/filerepo/file/File.php |
— | — | @@ -806,10 +806,11 @@ |
807 | 807 | $thumb = $this->handler->getTransform( $this, $tmpThumbPath, $thumbUrl, $params ); |
808 | 808 | } |
809 | 809 | } elseif ( $thumb->hasFile() && !$thumb->fileIsSource() ) { |
810 | | - // Copy the thumbnail from the file system into storage |
811 | | - // We don't use FileRepo::store() because of hacky suclasses |
812 | | - // overriding File::getThumbPath() to use a different zone (e.g. 'temp'). |
813 | | - $status = $this->repo->getBackend()->store( |
| 810 | + $backend = $this->repo->getBackend(); |
| 811 | + // Copy the thumbnail from the file system into storage. This avoids using |
| 812 | + // FileRepo::store(); getThumbPath() uses a different zone in some subclasses. |
| 813 | + $backend->prepare( array( 'dir' => dirname( $thumbPath ) ) ); |
| 814 | + $status = $backend->store( |
814 | 815 | array( 'src' => $tmpThumbPath, 'dst' => $thumbPath ), |
815 | 816 | array( 'force' => 1, 'nonLocking' => 1, 'allowStale' => 1 ) |
816 | 817 | ); |
Index: trunk/phase3/includes/filerepo/backend/FileOp.php |
— | — | @@ -76,6 +76,13 @@ |
77 | 77 | * Attempt a series of file operations. |
78 | 78 | * Callers are responsible for handling file locking. |
79 | 79 | * |
| 80 | + * $opts is an array of options, including: |
| 81 | + * 'force' : Errors that would normally cause a rollback do not. |
| 82 | + * The remaining operations are still attempted if any fail. |
| 83 | + * 'allowStale' : Don't require the latest available data. |
| 84 | + * This can increase performance for non-critical writes. |
| 85 | + * This has no effect unless the 'force' flag is set. |
| 86 | + * |
80 | 87 | * @param $performOps Array List of FileOp operations |
81 | 88 | * @param $opts Array Batch operation options |
82 | 89 | * @return Status |
— | — | @@ -129,6 +136,7 @@ |
130 | 137 | } |
131 | 138 | } |
132 | 139 | |
| 140 | + $wasOk = $status->isOK(); |
133 | 141 | // Finish each operation... |
134 | 142 | foreach ( $performOps as $index => $fileOp ) { |
135 | 143 | if ( $fileOp->failed() ) { |
— | — | @@ -146,7 +154,7 @@ |
147 | 155 | } |
148 | 156 | |
149 | 157 | // Make sure status is OK, despite any finish() fatals |
150 | | - $status->setResult( true, $status->value ); |
| 158 | + $status->setResult( $wasOk, $status->value ); |
151 | 159 | |
152 | 160 | return $status; |
153 | 161 | } |