*
* @file
* @ingroup FileBackend
- * @author Aaron Schulz
*/
/**
protected function doPrecheck( array &$predicates ) {
$status = StatusValue::newGood();
- // Check if the source file exists
- if ( !$this->fileExists( $this->params['src'], $predicates ) ) {
+
+ // Check source file existence
+ $srcExists = $this->fileExists( $this->params['src'], $predicates );
+ if ( $srcExists === false ) {
$status->fatal( 'backend-fail-notexists', $this->params['src'] );
return $status;
- // Check if a file can be placed/changed at the source
- } elseif ( !$this->backend->isPathUsableInternal( $this->params['src'] ) ) {
- $status->fatal( 'backend-fail-usable', $this->params['src'] );
- $status->fatal( 'backend-fail-describe', $this->params['src'] );
+ } elseif ( $srcExists === FileBackend::EXISTENCE_ERROR ) {
+ $status->fatal( 'backend-fail-stat', $this->params['src'] );
return $status;
}
// Update file existence predicates
- $predicates['exists'][$this->params['src']] =
- $this->fileExists( $this->params['src'], $predicates );
+ $predicates['exists'][$this->params['src']] = $srcExists;
$predicates['sha1'][$this->params['src']] =
$this->fileSha1( $this->params['src'], $predicates );