ForeignAPIRepo now overwrite files when creating them.
authorAntoine Musso <hashar@free.fr>
Mon, 25 Jun 2012 19:00:05 +0000 (21:00 +0200)
committerAaron <aschulz@wikimedia.org>
Mon, 25 Jun 2012 19:27:34 +0000 (12:27 -0700)
* Use quickCreate() since it can be slightly faster for some backends.

Change-Id: Ic7b136f376b13fa84972c1a5eb66864d390ed1d1

includes/filerepo/ForeignAPIRepo.php

index 77b9d04..13de9e6 100644 (file)
@@ -320,11 +320,11 @@ class ForeignAPIRepo extends FileRepo {
                        return false;
                }
 
+
                # @todo FIXME: Delete old thumbs that aren't being used. Maintenance script?
                $backend->prepare( array( 'dir' => dirname( $localFilename ) ) );
-               $op = array( 'op' => 'create', 'dst' => $localFilename, 'content' => $thumb );
-               if( !$backend->doOperation( $op )->isOK() ) {
-                       wfRestoreWarnings();
+               $params = array( 'dst' => $localFilename, 'content' => $thumb );
+               if( !$backend->quickCreate( $params )->isOK() ) {
                        wfDebug( __METHOD__ . " could not write to thumb path '$localFilename'\n" );
                        return $foreignUrl;
                }