From: Antoine Musso Date: Mon, 25 Jun 2012 19:00:05 +0000 (+0200) Subject: ForeignAPIRepo now overwrite files when creating them. X-Git-Tag: 1.31.0-rc.0~23235^2 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=3d07eb27de2b6ee58ffa921ddbf029de9d3cbe21;p=lhc%2Fweb%2Fwiklou.git ForeignAPIRepo now overwrite files when creating them. * Use quickCreate() since it can be slightly faster for some backends. Change-Id: Ic7b136f376b13fa84972c1a5eb66864d390ed1d1 --- diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 77b9d04dce..13de9e6b71 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -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; }