* @return Status
*/
final public function create( array $params, array $opts = array() ) {
- $params['op'] = 'create';
- return $this->doOperation( $params, $opts );
+ return $this->doOperation( array( 'op' => 'create' ) + $params, $opts );
}
/**
* @return Status
*/
final public function store( array $params, array $opts = array() ) {
- $params['op'] = 'store';
- return $this->doOperation( $params, $opts );
+ return $this->doOperation( array( 'op' => 'store' ) + $params, $opts );
}
/**
* @return Status
*/
final public function copy( array $params, array $opts = array() ) {
- $params['op'] = 'copy';
- return $this->doOperation( $params, $opts );
+ return $this->doOperation( array( 'op' => 'copy' ) + $params, $opts );
}
/**
* @return Status
*/
final public function move( array $params, array $opts = array() ) {
- $params['op'] = 'move';
- return $this->doOperation( $params, $opts );
+ return $this->doOperation( array( 'op' => 'move' ) + $params, $opts );
}
/**
* @return Status
*/
final public function delete( array $params, array $opts = array() ) {
- $params['op'] = 'delete';
- return $this->doOperation( $params, $opts );
+ return $this->doOperation( array( 'op' => 'delete' ) + $params, $opts );
}
/**
wfProfileIn( __METHOD__ );
wfProfileIn( __METHOD__ . '-' . $this->name );
if ( filesize( $params['src'] ) > $this->maxFileSizeInternal() ) {
- $status = Status::newFatal( 'backend-fail-store', $params['dst'] );
+ $status = Status::newFatal( 'backend-fail-maxsize',
+ $params['dst'], $this->maxFileSizeInternal() );
} else {
$status = $this->doStoreInternal( $params );
$this->clearCache( array( $params['dst'] ) );
return $status;
// Check if the source file is too big
} elseif ( filesize( $this->params['src'] ) > $this->backend->maxFileSizeInternal() ) {
+ $status->fatal( 'backend-fail-maxsize',
+ $this->params['dst'], $this->backend->maxFileSizeInternal() );
$status->fatal( 'backend-fail-store', $this->params['src'], $this->params['dst'] );
return $status;
// Check if a file can be placed at the destination
} elseif ( !$this->backend->isPathUsableInternal( $this->params['dst'] ) ) {
+ $status->fatal( 'backend-fail-usable', $this->params['dst'] );
$status->fatal( 'backend-fail-store', $this->params['src'], $this->params['dst'] );
return $status;
}
$status = Status::newGood();
// Check if the source data is too big
if ( strlen( $this->getParam( 'content' ) ) > $this->backend->maxFileSizeInternal() ) {
+ $status->fatal( 'backend-fail-maxsize',
+ $this->params['dst'], $this->backend->maxFileSizeInternal() );
$status->fatal( 'backend-fail-create', $this->params['dst'] );
return $status;
// Check if a file can be placed at the destination
} elseif ( !$this->backend->isPathUsableInternal( $this->params['dst'] ) ) {
+ $status->fatal( 'backend-fail-usable', $this->params['dst'] );
$status->fatal( 'backend-fail-create', $this->params['dst'] );
return $status;
}
return $status;
// Check if a file can be placed at the destination
} elseif ( !$this->backend->isPathUsableInternal( $this->params['dst'] ) ) {
+ $status->fatal( 'backend-fail-usable', $this->params['dst'] );
$status->fatal( 'backend-fail-copy', $this->params['src'], $this->params['dst'] );
return $status;
}
return $status;
// Check if a file can be placed at the destination
} elseif ( !$this->backend->isPathUsableInternal( $this->params['dst'] ) ) {
+ $status->fatal( 'backend-fail-usable', $this->params['dst'] );
$status->fatal( 'backend-fail-move', $this->params['src'], $this->params['dst'] );
return $status;
}
'backend-fail-writetemp' => 'Could not write to temporary file.',
'backend-fail-closetemp' => 'Could not close temporary file.',
'backend-fail-read' => 'Could not read file $1.',
-'backend-fail-create' => 'Could not create file $1.',
-'backend-fail-maxsize' => 'Could not create file $1 because it is larger than {{PLURAL:$2|one byte|$2 bytes}}.',
+'backend-fail-create' => 'Could not write file $1.',
+'backend-fail-maxsize' => 'Could not write file $1 because it is larger than {{PLURAL:$2|one byte|$2 bytes}}.',
+'backend-fail-usable' => 'Could not write file $1 due to insufficient permissions or missing directories/containers.',
'backend-fail-readonly' => 'The storage backend "$1" is currently read-only. The reason given is: "\'\'$2\'\'"',
'backend-fail-synced' => 'The file "$1" is in an inconsistent state within the internal storage backends',
'backend-fail-connect' => 'Could not connect to storage backend "$1".',
Parameters:
* $1 is the number of operations attempted at once in this case.
* $2 is the maximum number of operations that can be attempted at once.',
+'backend-fail-usable' => 'Parameters:
+* $1 is a file path',
# File journal errors
'filejournal-fail-dbconnect' => 'Parameters:
'backend-fail-connect',
'backend-fail-internal',
'backend-fail-contenttype',
- 'backend-fail-batchsize'
+ 'backend-fail-batchsize',
+ 'backend-fail-usable'
),
'filejournal-errors' => array(