Merge "Use Linker::link() instead of Linker::linkKnown() when having options"
[lhc/web/wiklou.git] / includes / upload / UploadStash.php
index aa65ffe..733c686 100644 (file)
@@ -152,7 +152,7 @@ class UploadStash {
        /**
         * Getter for file metadata.
         *
-        * @param key String: key under which file information is stored
+        * @param $key String: key under which file information is stored
         * @return Array
         */
        public function getMetadata ( $key ) {
@@ -163,7 +163,7 @@ class UploadStash {
        /**
         * Getter for fileProps
         *
-        * @param key String: key under which file information is stored
+        * @param $key String: key under which file information is stored
         * @return Array
         */
        public function getFileProps ( $key ) {
@@ -319,8 +319,8 @@ class UploadStash {
        /**
         * Remove a particular file from the stash.  Also removes it from the repo.
         *
-        * @throws UploadStashNotLoggedInException
-        * @throws UploadStashWrongOwnerException
+        * @param $key
+        * @throws UploadStashNoSuchKeyException|UploadStashNotLoggedInException|UploadStashWrongOwnerException
         * @return boolean: success
         */
        public function removeFile( $key ) {
@@ -361,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.
@@ -419,6 +416,8 @@ class UploadStash {
         * with an extension.
         * XXX this is somewhat redundant with the checks that ApiUpload.php does with incoming
         * uploads versus the desired filename. Maybe we can get that passed to us...
+        * @param $path
+        * @throws UploadStashFileException
         * @return string
         */
        public static function getExtensionForPath( $path ) {
@@ -572,9 +571,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 );
        }