* @author Russ Nelson
*/
+use Wikimedia\AtEase\AtEase;
+
/**
* @brief Class for an OpenStack Swift (or Ceph RGW) based file backend.
*
$method = __METHOD__;
$handler = function ( array $request, StatusValue $status ) use ( $method, $params ) {
list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $request['response'];
- if ( $rcode === 201 ) {
+ if ( $rcode === 201 || $rcode === 202 ) {
// good
} elseif ( $rcode === 412 ) {
$status->fatal( 'backend-fail-contenttype', $params['dst'] );
return $status;
}
- Wikimedia\suppressWarnings();
+ AtEase::suppressWarnings();
$sha1Hash = sha1_file( $params['src'] );
- Wikimedia\restoreWarnings();
+ AtEase::restoreWarnings();
if ( $sha1Hash === false ) { // source doesn't exist?
$status->fatal( 'backend-fail-store', $params['src'], $params['dst'] );
$method = __METHOD__;
$handler = function ( array $request, StatusValue $status ) use ( $method, $params ) {
list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $request['response'];
- if ( $rcode === 201 ) {
+ if ( $rcode === 201 || $rcode === 202 ) {
// good
} elseif ( $rcode === 412 ) {
$status->fatal( 'backend-fail-contenttype', $params['dst'] );
// Get source file extension
$ext = FileBackend::extensionFromPath( $path );
// Create a new temporary file...
- $tmpFile = TempFSFile::factory( 'localcopy_', $ext, $this->tmpDirectory );
+ $tmpFile = $this->tmpFileFactory->newTempFSFile( 'localcopy_', $ext );
if ( $tmpFile ) {
$handle = fopen( $tmpFile->getPath(), 'wb' );
if ( $handle ) {