Removed useless begin()/commit() calls as DBO_TRX is not on in cli mode.
[lhc/web/wiklou.git] / includes / upload / UploadStash.php
index bbee0f5..bbd9c44 100644 (file)
@@ -239,7 +239,8 @@ class UploadStash {
                                }
                        }
                        // at this point, $error should contain the single "most important" error, plus any parameters.
-                       throw new UploadStashFileException( "Error storing file in '$path': " . wfMessage( $error )->text() );
+                       $errorMsg = array_shift( $error );
+                       throw new UploadStashFileException( "Error storing file in '$path': " . wfMessage( $errorMsg, $error )->text() );
                }
                $stashPath = $storeStatus->value;
 
@@ -360,14 +361,11 @@ class UploadStash {
 
                $dbw = $this->repo->getMasterDb();
 
-               // this gets its own transaction since it's called serially by the cleanupUploadStash maintenance script
-               $dbw->begin( __METHOD__ );
                $dbw->delete(
                        'uploadstash',
                        array( 'us_key' => $key ),
                        __METHOD__
                );
-               $dbw->commit( __METHOD__ );
 
                // TODO: look into UnregisteredLocalFile and find out why the rv here is sometimes wrong (false when file was removed)
                // for now, ignore.
@@ -571,9 +569,10 @@ class UploadStashFile extends UnregisteredLocalFile {
         * ugly file name.
         *
         * @param $params Array: handler-specific parameters
+        * @param $flags integer Bitfield that supports THUMB_* constants
         * @return String: base name for URL, like '120px-12345.jpg', or null if there is no handler
         */
-       function thumbName( $params ) {
+       function thumbName( $params, $flags = 0 ) {
                return $this->generateThumbName( $this->getUrlName(), $params );
        }